ia64/xen-unstable

view xen/include/asm-x86/percpu.h @ 15812:86a154e1ef5d

[HVM] Shadow: don't shadow the p2m table.
For HVM vcpus with paging disabled, we used to shadow the p2m table,
and skip the p2m lookup to go from gfn to mfn. Instead, we now
provide a simple pagetable that gives a one-to-one mapping of 4GB, and
shadow that, making the translations from gfn to mfn via the p2m.
This removes the paging-disabled special-case code from the shadow
fault handler, and allows us to expand the p2m interface, since all HVM
translations now go through the same p2m lookups.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Fri Aug 31 11:06:22 2007 +0100 (2007-08-31)
parents 9b1c9d4133f8
children ebbd0e8c3e72
line source
1 #ifndef __X86_PERCPU_H__
2 #define __X86_PERCPU_H__
4 #define PERCPU_SHIFT 12
5 #define PERCPU_SIZE (1UL << PERCPU_SHIFT)
7 /* Separate out the type, so (int[3], foo) works. */
8 #define DEFINE_PER_CPU(type, name) \
9 __attribute__((__section__(".data.percpu"))) \
10 __typeof__(type) per_cpu__##name
12 /* var is in discarded region: offset to particular copy we want */
13 #define per_cpu(var, cpu) \
14 (*RELOC_HIDE(&per_cpu__##var, ((unsigned int)(cpu))<<PERCPU_SHIFT))
15 #define __get_cpu_var(var) \
16 (per_cpu(var, smp_processor_id()))
18 #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
20 #endif /* __X86_PERCPU_H__ */