# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1176297884 21600
# Node ID 7158623a1b3dd28f86f908fce7e8e56c37a49179
# Parent 1bde28f762a66276008da38e3fb24751f83dc128
[IA64] Handle NAT bit for dom0 and domU
This fixes ia32 apps running under the IA32-EL.
Signed-off-by: Anthony Xu <anthony.xu@xxxxxxxxx>
---
linux-2.6-xen-sparse/arch/ia64/kernel/asm-offsets.c | 2
linux-2.6-xen-sparse/arch/ia64/xen/xenentry.S | 6 +
linux-2.6-xen-sparse/arch/ia64/xen/xenivt.S | 63 +++++++++++---------
linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h | 1
xen/arch/ia64/xen/hyperprivop.S | 8 ++
5 files changed, 52 insertions(+), 28 deletions(-)
diff -r 1bde28f762a6 -r 7158623a1b3d
linux-2.6-xen-sparse/arch/ia64/kernel/asm-offsets.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/asm-offsets.c Mon Apr 09
13:40:25 2007 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/asm-offsets.c Wed Apr 11
07:24:44 2007 -0600
@@ -290,5 +290,7 @@ void foo(void)
DEFINE_MAPPED_REG_OFS(XSI_BANKNUM_OFS, banknum);
DEFINE_MAPPED_REG_OFS(XSI_BANK0_R16_OFS, bank0_regs[0]);
DEFINE_MAPPED_REG_OFS(XSI_BANK1_R16_OFS, bank1_regs[0]);
+ DEFINE_MAPPED_REG_OFS(XSI_B0NATS_OFS, vbnat);
+ DEFINE_MAPPED_REG_OFS(XSI_B1NATS_OFS, vnat);
#endif /* CONFIG_XEN */
}
diff -r 1bde28f762a6 -r 7158623a1b3d
linux-2.6-xen-sparse/arch/ia64/xen/xenentry.S
--- a/linux-2.6-xen-sparse/arch/ia64/xen/xenentry.S Mon Apr 09 13:40:25
2007 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/xenentry.S Wed Apr 11 07:24:44
2007 -0600
@@ -614,6 +614,7 @@ GLOBAL_ENTRY(ia64_leave_kernel)
#ifdef CONFIG_XEN
;;
// r16-r31 all now hold bank1 values
+ mov r15=ar.unat
movl r2=XSI_BANK1_R16
movl r3=XSI_BANK1_R16+8
;;
@@ -641,6 +642,11 @@ GLOBAL_ENTRY(ia64_leave_kernel)
.mem.offset 0,0; st8.spill [r2]=r30,16
.mem.offset 8,0; st8.spill [r3]=r31,16
;;
+ mov r3=ar.unat
+ movl r2=XSI_B1NAT
+ ;;
+ st8 [r2]=r3
+ mov ar.unat=r15
movl r2=XSI_BANKNUM;;
st4 [r2]=r0;
#else
diff -r 1bde28f762a6 -r 7158623a1b3d linux-2.6-xen-sparse/arch/ia64/xen/xenivt.S
--- a/linux-2.6-xen-sparse/arch/ia64/xen/xenivt.S Mon Apr 09 13:40:25
2007 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/xenivt.S Wed Apr 11 07:24:44
2007 -0600
@@ -2013,33 +2013,6 @@ END(ia32_interrupt)
DBG_FAULT(66)
FAULT(66)
-#ifdef CONFIG_XEN
- /*
- * There is no particular reason for this code to be here, other than
that
- * there happens to be space here that would go unused otherwise. If
this
- * fault ever gets "unreserved", simply moved the following code to a
more
- * suitable spot...
- */
-
-GLOBAL_ENTRY(xen_bsw1)
- /* FIXME: THIS CODE IS NOT NaT SAFE! */
- movl r30=XSI_BANKNUM;
- mov r31=1;;
- st4 [r30]=r31;
- movl r30=XSI_BANK1_R16;
- movl r31=XSI_BANK1_R16+8;;
- ld8 r16=[r30],16; ld8 r17=[r31],16;;
- ld8 r18=[r30],16; ld8 r19=[r31],16;;
- ld8 r20=[r30],16; ld8 r21=[r31],16;;
- ld8 r22=[r30],16; ld8 r23=[r31],16;;
- ld8 r24=[r30],16; ld8 r25=[r31],16;;
- ld8 r26=[r30],16; ld8 r27=[r31],16;;
- ld8 r28=[r30],16; ld8 r29=[r31],16;;
- ld8 r30=[r30]; ld8 r31=[r31];;
- br.ret.sptk.many b0
-END(xen_bsw1)
-#endif
-
.org ia64_ivt+0x7f00
/////////////////////////////////////////////////////////////////////////////////////////
// 0x7f00 Entry 67 (size 16 bundles) Reserved
@@ -2167,4 +2140,38 @@ 1:
(p6) br.spnt.few 1b // call evtchn_do_upcall again.
br.sptk.many ia64_leave_kernel
END(xen_event_callback)
-#endif
+
+
+ /*
+ * There is no particular reason for this code to be here, other than
that
+ * there happens to be space here that would go unused otherwise. If
this
+ * fault ever gets "unreserved", simply moved the following code to a
more
+ * suitable spot...
+ */
+
+GLOBAL_ENTRY(xen_bsw1)
+ /* FIXME: THIS CODE IS NOT NaT SAFE! */
+ mov r14=ar.unat
+ movl r30=XSI_B1NAT
+ ;;
+ ld8 r30=[r30];;
+ mov ar.unat=r30
+ movl r30=XSI_BANKNUM;
+ mov r31=1;;
+ st4 [r30]=r31;
+ movl r30=XSI_BANK1_R16;
+ movl r31=XSI_BANK1_R16+8;;
+ ld8.fill r16=[r30],16; ld8.fill r17=[r31],16;;
+ ld8.fill r18=[r30],16; ld8.fill r19=[r31],16;;
+ ld8.fill r20=[r30],16; ld8.fill r21=[r31],16;;
+ ld8.fill r22=[r30],16; ld8.fill r23=[r31],16;;
+ ld8.fill r24=[r30],16; ld8.fill r25=[r31],16;;
+ ld8.fill r26=[r30],16; ld8.fill r27=[r31],16;;
+ ld8.fill r28=[r30],16; ld8.fill r29=[r31],16;;
+ ld8.fill r30=[r30]; ld8.fill r31=[r31];;
+ mov ar.unat=r14
+ br.ret.sptk.many b0
+END(xen_bsw1)
+
+
+#endif
diff -r 1bde28f762a6 -r 7158623a1b3d
linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h Mon Apr 09
13:40:25 2007 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h Wed Apr 11
07:24:44 2007 -0600
@@ -57,6 +57,7 @@
#define XSI_PSR_IC (XSI_BASE + XSI_PSR_IC_OFS)
#define XSI_IPSR (XSI_BASE + XSI_IPSR_OFS)
#define XSI_IIP (XSI_BASE + XSI_IIP_OFS)
+#define XSI_B1NAT (XSI_BASE + XSI_B1NATS_OFS)
#define XSI_BANK1_R16 (XSI_BASE + XSI_BANK1_R16_OFS)
#define XSI_BANKNUM (XSI_BASE + XSI_BANKNUM_OFS)
#define XSI_IHA (XSI_BASE + XSI_IHA_OFS)
diff -r 1bde28f762a6 -r 7158623a1b3d xen/arch/ia64/xen/hyperprivop.S
--- a/xen/arch/ia64/xen/hyperprivop.S Mon Apr 09 13:40:25 2007 -0600
+++ b/xen/arch/ia64/xen/hyperprivop.S Wed Apr 11 07:24:44 2007 -0600
@@ -304,6 +304,8 @@ ENTRY(hyper_ssm_i)
;;
adds r2=XSI_BANK1_R16_OFS-XSI_PSR_IC_OFS,r18;
adds r3=(XSI_BANK1_R16_OFS+8)-XSI_PSR_IC_OFS,r18;;
+ // temporarily save ar.unat
+ mov r28=ar.unat
bsw.1;;
// FIXME?: ar.unat is not really handled correctly,
// but may not matter if the OS is NaT-clean
@@ -324,6 +326,12 @@ ENTRY(hyper_ssm_i)
.mem.offset 0,0; st8.spill [r2]=r30,16;
.mem.offset 8,0; st8.spill [r3]=r31,16 ;;
bsw.0 ;;
+ mov r27=ar.unat
+ adds r26=XSI_B1NATS_OFS-XSI_PSR_IC_OFS,r18 ;;
+ //save bank1 ar.unat
+ st8 [r26]=r27
+ //restore ar.unat
+ mov ar.unat=r28
mov r2=r30
mov r3=r29
adds r20=XSI_BANKNUM_OFS-XSI_PSR_IC_OFS,r18 ;;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|