commit f45d74f37a7d5cfc9a5fb8356802b41615a8ec56 Author: Sergey Tovpeko Date: Thu May 12 15:00:09 2011 +0400 [kdb] Fixed GET_PROCESSOR_ID macros diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S index 31efe63..b54e039 100644 --- a/xen/arch/x86/x86_64/entry.S +++ b/xen/arch/x86/x86_64/entry.S @@ -12,17 +12,6 @@ #include #include -#ifdef XEN_KDB_CONFIG -/* return (int) smp_processor_id in reg. the upper 32bits should already be - * * zeroed(?), but we clear anyways by shifting left and right */ -#define GET_PROCESSOR_ID(reg) \ - movq $~(STACK_SIZE-1),reg; \ - andq %rsp,reg; \ - orq $(STACK_SIZE-16),reg; \ - movq (reg),reg; \ - shl $32,reg; \ - shr $32,reg; -#endif ALIGN /* %rbx: struct vcpu */ switch_to_kernel: diff --git a/xen/include/asm-x86/x86_64/asm_defns.h b/xen/include/asm-x86/x86_64/asm_defns.h index 5c7159a..1fb154f 100644 --- a/xen/include/asm-x86/x86_64/asm_defns.h +++ b/xen/include/asm-x86/x86_64/asm_defns.h @@ -130,6 +130,12 @@ STR(IRQ) #nr "_interrupt:\n\t" \ GET_CPUINFO_FIELD(CPUINFO_current_vcpu,reg) \ movq (reg),reg; +#define GET_PROCESSOR_ID(reg) \ + GET_CPUINFO_FIELD(CPUINFO_processor_id,reg) \ + movq (reg), reg; \ + shl $32,reg; \ + shr $32,reg; + #ifdef __ASSEMBLY__ # define _ASM_EX(p) p-. #else