|
@@ -17,6 +17,7 @@
|
|
#include <asm/processor-flags.h>
|
|
#include <asm/processor-flags.h>
|
|
#include <asm/errno.h>
|
|
#include <asm/errno.h>
|
|
#include <asm/segment.h>
|
|
#include <asm/segment.h>
|
|
|
|
+#include <asm/percpu.h>
|
|
|
|
|
|
#include <xen/interface/xen.h>
|
|
#include <xen/interface/xen.h>
|
|
|
|
|
|
@@ -28,12 +29,10 @@
|
|
|
|
|
|
#if 1
|
|
#if 1
|
|
/*
|
|
/*
|
|
- x86-64 does not yet support direct access to percpu variables
|
|
|
|
- via a segment override, so we just need to make sure this code
|
|
|
|
- never gets used
|
|
|
|
|
|
+ FIXME: x86_64 now can support direct access to percpu variables
|
|
|
|
+ via a segment override. Update xen accordingly.
|
|
*/
|
|
*/
|
|
#define BUG ud2a
|
|
#define BUG ud2a
|
|
-#define PER_CPU_VAR(var, off) 0xdeadbeef
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -45,14 +44,14 @@ ENTRY(xen_irq_enable_direct)
|
|
BUG
|
|
BUG
|
|
|
|
|
|
/* Unmask events */
|
|
/* Unmask events */
|
|
- movb $0, PER_CPU_VAR(xen_vcpu_info, XEN_vcpu_info_mask)
|
|
|
|
|
|
+ movb $0, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_mask
|
|
|
|
|
|
/* Preempt here doesn't matter because that will deal with
|
|
/* Preempt here doesn't matter because that will deal with
|
|
any pending interrupts. The pending check may end up being
|
|
any pending interrupts. The pending check may end up being
|
|
run on the wrong CPU, but that doesn't hurt. */
|
|
run on the wrong CPU, but that doesn't hurt. */
|
|
|
|
|
|
/* Test for pending */
|
|
/* Test for pending */
|
|
- testb $0xff, PER_CPU_VAR(xen_vcpu_info, XEN_vcpu_info_pending)
|
|
|
|
|
|
+ testb $0xff, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_pending
|
|
jz 1f
|
|
jz 1f
|
|
|
|
|
|
2: call check_events
|
|
2: call check_events
|
|
@@ -69,7 +68,7 @@ ENDPATCH(xen_irq_enable_direct)
|
|
ENTRY(xen_irq_disable_direct)
|
|
ENTRY(xen_irq_disable_direct)
|
|
BUG
|
|
BUG
|
|
|
|
|
|
- movb $1, PER_CPU_VAR(xen_vcpu_info, XEN_vcpu_info_mask)
|
|
|
|
|
|
+ movb $1, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_mask
|
|
ENDPATCH(xen_irq_disable_direct)
|
|
ENDPATCH(xen_irq_disable_direct)
|
|
ret
|
|
ret
|
|
ENDPROC(xen_irq_disable_direct)
|
|
ENDPROC(xen_irq_disable_direct)
|
|
@@ -87,7 +86,7 @@ ENDPATCH(xen_irq_disable_direct)
|
|
ENTRY(xen_save_fl_direct)
|
|
ENTRY(xen_save_fl_direct)
|
|
BUG
|
|
BUG
|
|
|
|
|
|
- testb $0xff, PER_CPU_VAR(xen_vcpu_info, XEN_vcpu_info_mask)
|
|
|
|
|
|
+ testb $0xff, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_mask
|
|
setz %ah
|
|
setz %ah
|
|
addb %ah,%ah
|
|
addb %ah,%ah
|
|
ENDPATCH(xen_save_fl_direct)
|
|
ENDPATCH(xen_save_fl_direct)
|
|
@@ -107,13 +106,13 @@ ENTRY(xen_restore_fl_direct)
|
|
BUG
|
|
BUG
|
|
|
|
|
|
testb $X86_EFLAGS_IF>>8, %ah
|
|
testb $X86_EFLAGS_IF>>8, %ah
|
|
- setz PER_CPU_VAR(xen_vcpu_info, XEN_vcpu_info_mask)
|
|
|
|
|
|
+ setz PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_mask
|
|
/* Preempt here doesn't matter because that will deal with
|
|
/* Preempt here doesn't matter because that will deal with
|
|
any pending interrupts. The pending check may end up being
|
|
any pending interrupts. The pending check may end up being
|
|
run on the wrong CPU, but that doesn't hurt. */
|
|
run on the wrong CPU, but that doesn't hurt. */
|
|
|
|
|
|
/* check for unmasked and pending */
|
|
/* check for unmasked and pending */
|
|
- cmpw $0x0001, PER_CPU_VAR(xen_vcpu_info, XEN_vcpu_info_pending)
|
|
|
|
|
|
+ cmpw $0x0001, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_pending
|
|
jz 1f
|
|
jz 1f
|
|
2: call check_events
|
|
2: call check_events
|
|
1:
|
|
1:
|
|
@@ -196,7 +195,7 @@ ENTRY(xen_sysret64)
|
|
/* We're already on the usermode stack at this point, but still
|
|
/* We're already on the usermode stack at this point, but still
|
|
with the kernel gs, so we can easily switch back */
|
|
with the kernel gs, so we can easily switch back */
|
|
movq %rsp, %gs:pda_oldrsp
|
|
movq %rsp, %gs:pda_oldrsp
|
|
- movq %gs:pda_kernelstack,%rsp
|
|
|
|
|
|
+ movq PER_CPU_VAR(kernel_stack),%rsp
|
|
|
|
|
|
pushq $__USER_DS
|
|
pushq $__USER_DS
|
|
pushq %gs:pda_oldrsp
|
|
pushq %gs:pda_oldrsp
|
|
@@ -213,7 +212,7 @@ ENTRY(xen_sysret32)
|
|
/* We're already on the usermode stack at this point, but still
|
|
/* We're already on the usermode stack at this point, but still
|
|
with the kernel gs, so we can easily switch back */
|
|
with the kernel gs, so we can easily switch back */
|
|
movq %rsp, %gs:pda_oldrsp
|
|
movq %rsp, %gs:pda_oldrsp
|
|
- movq %gs:pda_kernelstack, %rsp
|
|
|
|
|
|
+ movq PER_CPU_VAR(kernel_stack), %rsp
|
|
|
|
|
|
pushq $__USER32_DS
|
|
pushq $__USER32_DS
|
|
pushq %gs:pda_oldrsp
|
|
pushq %gs:pda_oldrsp
|