[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-ia64-devel] [PATCH] define VHPT_ENABLED in Rules.mk instead of the header file, vhpt.h.



# HG changeset patch
# User Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
# Date 1210148132 -32400
# Node ID 350c8198eab0293f92a197738c23f09d4ed175af
# Parent  f2457c7aff8d45949bc2c83876a7d26d0588663f
[IA64] define VHPT_ENABLED in Rules.mk instead of the header file, vhpt.h.

VHPT_ENABLED is defined in vhpt.h, but it is intended for compile time
option. Defining in the header file caused that VHPT_ENABLED
is undefined in some files resulting in unintentional compilation.
Define the macro in Rules.mk resolves it. And minor modifications to
remove compilation error/warning.
PATCHNAME: ia64_vhpt_enabled

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff --git a/xen/arch/ia64/Rules.mk b/xen/arch/ia64/Rules.mk
--- a/xen/arch/ia64/Rules.mk
+++ b/xen/arch/ia64/Rules.mk
@@ -8,6 +8,7 @@
 no_warns ?= n
 vti_debug ?= n
 vmx_panic ?= n
+vhpt_disable ?= n
 xen_ia64_expose_p2m    ?= y
 xen_ia64_pervcpu_vhpt  ?= y
 xen_ia64_tlb_track     ?= y
@@ -45,6 +46,9 @@
 endif
 ifeq ($(xen_ia64_pervcpu_vhpt),y)
 CFLAGS += -DCONFIG_XEN_IA64_PERVCPU_VHPT
+ifeq ($(vhpt_disable),y)
+$(error "both xen_ia64_pervcpu_vhpt=y and vhpt_disable=y are enabled. they 
can't be enabled simultaneously. disable one of them.")
+endif
 endif
 ifeq ($(xen_ia64_tlb_track),y)
 CFLAGS += -DCONFIG_XEN_IA64_TLB_TRACK
@@ -57,6 +61,11 @@
 endif
 ifeq ($(no_warns),y)
 CFLAGS += -Wa,--fatal-warnings -Werror -Wno-uninitialized
+endif
+ifneq ($(vhpt_disable),y)
+CFLAGS += -DVHPT_ENABLED=1
+else
+CFLAGS += -DVHPT_ENABLED=0
 endif
 
 LDFLAGS := -g
diff --git a/xen/arch/ia64/asm-offsets.c b/xen/arch/ia64/asm-offsets.c
--- a/xen/arch/ia64/asm-offsets.c
+++ b/xen/arch/ia64/asm-offsets.c
@@ -254,10 +254,12 @@
        DEFINE(IA64_MCA_CPU_RBSTORE_OFFSET,
               offsetof(struct ia64_mca_cpu, rbstore));
 
+#if VHPT_ENABLED
        DEFINE(IA64_VCPU_VHPT_PAGE_OFFSET,
               offsetof(struct vcpu, arch.vhpt_page));
        DEFINE(IA64_VCPU_VHPT_MADDR_OFFSET,
               offsetof(struct vcpu, arch.vhpt_maddr));
+#endif
 
        BLANK();
        DEFINE(IA64_MCA_TLB_INFO_SIZE, sizeof(struct ia64_mca_tlb_info));
diff --git a/xen/arch/ia64/xen/domain.c b/xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c
+++ b/xen/arch/ia64/xen/domain.c
@@ -499,10 +499,9 @@
 
 int vcpu_late_initialise(struct vcpu *v)
 {
-       struct domain *d = v->domain;
        int rc, order;
 
-       if (HAS_PERVCPU_VHPT(d)) {
+       if (HAS_PERVCPU_VHPT(v->domain)) {
                rc = pervcpu_vhpt_alloc(v);
                if (rc != 0)
                        return rc;
diff --git a/xen/include/asm-ia64/vhpt.h b/xen/include/asm-ia64/vhpt.h
--- a/xen/include/asm-ia64/vhpt.h
+++ b/xen/include/asm-ia64/vhpt.h
@@ -1,7 +1,5 @@
 #ifndef ASM_VHPT_H
 #define ASM_VHPT_H
-
-#define VHPT_ENABLED 1
 
 /* Size of the VHPT.  */
 // XXX work around to avoid trigerring xenLinux software lock up detection.


-- 
yamahata

Attachment: 17527_350c8198eab0_ia64_vhpt_enabled.patch
Description: Text Data

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.