diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-09-22 13:46:57 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-09-22 13:46:57 +0100 |
commit | a0c61c0f77d2e0926bf728623e474fe9126648ae (patch) | |
tree | 1ed061a7b59d162a5b33b11ea9dfc38e95fe28f3 /xen/include/asm-x86/ldt.h | |
parent | 27e019d758f4aa3cdbae469fb9c2fada5a021cfa (diff) | |
download | xen-a0c61c0f77d2e0926bf728623e474fe9126648ae.tar.gz xen-a0c61c0f77d2e0926bf728623e474fe9126648ae.tar.bz2 xen-a0c61c0f77d2e0926bf728623e474fe9126648ae.zip |
x86: make GDT per-CPU
The major issue with supporting a significantly larger number of
physical CPUs appears to be the use of per-CPU GDT entries - at
present, x86-64 could support only up to 126 CPUs (with code changes
to also use the top-most GDT page, that would be 254). Instead of
trying to go with incremental steps here, by converting the GDT itself
to be per-CPU, limitations in that respect go away entirely.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/include/asm-x86/ldt.h')
-rw-r--r-- | xen/include/asm-x86/ldt.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/xen/include/asm-x86/ldt.h b/xen/include/asm-x86/ldt.h index b9a769f534..c7f3f06d58 100644 --- a/xen/include/asm-x86/ldt.h +++ b/xen/include/asm-x86/ldt.h @@ -6,7 +6,6 @@ static inline void load_LDT(struct vcpu *v) { - unsigned int cpu; struct desc_struct *desc; unsigned long ents; @@ -16,11 +15,11 @@ static inline void load_LDT(struct vcpu *v) } else { - cpu = smp_processor_id(); - desc = (!is_pv_32on64_vcpu(v) ? gdt_table : compat_gdt_table) - + __LDT(cpu) - FIRST_RESERVED_GDT_ENTRY; + desc = (!is_pv_32on64_vcpu(v) + ? this_cpu(gdt_table) : this_cpu(compat_gdt_table)) + + LDT_ENTRY - FIRST_RESERVED_GDT_ENTRY; _set_tssldt_desc(desc, LDT_VIRT_START(v), ents*8-1, 2); - __asm__ __volatile__ ( "lldt %%ax" : : "a" (__LDT(cpu)<<3) ); + __asm__ __volatile__ ( "lldt %%ax" : : "a" (LDT_ENTRY << 3) ); } } |