ia64/xen-unstable

view xen/include/asm-x86/io.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 3e75d9b1d556
children cab326925ea6
line source
1 #ifndef _ASM_IO_H
2 #define _ASM_IO_H
4 #include <xen/config.h>
5 #include <xen/types.h>
6 #include <asm/page.h>
8 /* We don't need real ioremap() on Xen/x86. */
9 #define ioremap(x,l) (__va(x))
10 #define iounmap(p) ((void)0)
12 #define readb(x) (*(volatile char *)(x))
13 #define readw(x) (*(volatile short *)(x))
14 #define readl(x) (*(volatile int *)(x))
15 #define writeb(d,x) (*(volatile char *)(x) = (d))
16 #define writew(d,x) (*(volatile short *)(x) = (d))
17 #define writel(d,x) (*(volatile int *)(x) = (d))
19 #define __OUT1(s,x) \
20 static inline void out##s(unsigned x value, unsigned short port) {
22 #define __OUT2(s,s1,s2) \
23 __asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
25 #define __OUT(s,s1,x) \
26 __OUT1(s,x) __OUT2(s,s1,"w") : : "a" (value), "Nd" (port)); } \
27 __OUT1(s##_p,x) __OUT2(s,s1,"w") : : "a" (value), "Nd" (port));}
29 #define __IN1(s) \
30 static inline RETURN_TYPE in##s(unsigned short port) { RETURN_TYPE _v;
32 #define __IN2(s,s1,s2) \
33 __asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"
35 #define __IN(s,s1,i...) \
36 __IN1(s) __IN2(s,s1,"w") : "=a" (_v) : "Nd" (port) ,##i ); return _v; } \
37 __IN1(s##_p) __IN2(s,s1,"w") : "=a" (_v) : "Nd" (port) ,##i ); return _v; }
39 #define RETURN_TYPE unsigned char
40 __IN(b,"")
41 #undef RETURN_TYPE
42 #define RETURN_TYPE unsigned short
43 __IN(w,"")
44 #undef RETURN_TYPE
45 #define RETURN_TYPE unsigned int
46 __IN(l,"")
47 #undef RETURN_TYPE
49 __OUT(b,"b",char)
50 __OUT(w,"w",short)
51 __OUT(l,,int)
53 #endif