ia64/xen-unstable

annotate xen/include/asm-x86/fixmap.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 2b43fb3afb3e
children ca495837a722
rev   line source
kaf24@1452 1 /*
kaf24@1452 2 * fixmap.h: compile-time virtual memory allocation
kaf24@1452 3 *
kaf24@1452 4 * This file is subject to the terms and conditions of the GNU General Public
kaf24@1452 5 * License. See the file "COPYING" in the main directory of this archive
kaf24@1452 6 * for more details.
kaf24@1452 7 *
kaf24@1452 8 * Copyright (C) 1998 Ingo Molnar
kaf24@1508 9 * Modifications for Xen are copyright (c) 2002-2004, K A Fraser
kaf24@1452 10 */
kaf24@1452 11
kaf24@1452 12 #ifndef _ASM_FIXMAP_H
kaf24@1452 13 #define _ASM_FIXMAP_H
kaf24@1452 14
kaf24@1452 15 #include <xen/config.h>
kaf24@5157 16 #include <asm/apicdef.h>
kaf24@1452 17 #include <asm/acpi.h>
kaf24@1452 18 #include <asm/page.h>
ian@12677 19 #include <xen/kexec.h>
kaf24@1452 20
kaf24@1452 21 /*
kaf24@1452 22 * Here we define all the compile-time 'special' virtual
kaf24@1452 23 * addresses. The point is to have a constant address at
kaf24@1452 24 * compile time, but to set the physical address only
kaf24@1508 25 * in the boot process. We allocate these special addresses
kaf24@1508 26 * from the end of virtual memory backwards.
kaf24@1452 27 */
kaf24@1452 28 enum fixed_addresses {
kaf24@10209 29 #ifdef CONFIG_X86_PAE
kaf24@10209 30 FIX_PAE_HIGHMEM_0,
kaf24@10209 31 FIX_PAE_HIGHMEM_END = FIX_PAE_HIGHMEM_0 + NR_CPUS-1,
kaf24@10209 32 #endif
kaf24@5157 33 FIX_APIC_BASE,
kaf24@1508 34 FIX_IO_APIC_BASE_0,
kaf24@1508 35 FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS-1,
kaf24@1508 36 FIX_ACPI_BEGIN,
kaf24@1508 37 FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
kaf24@5901 38 FIX_HPET_BASE,
kaf24@5902 39 FIX_CYCLONE_TIMER,
ian@12677 40 FIX_KEXEC_BASE_0,
ian@12677 41 FIX_KEXEC_BASE_END = FIX_KEXEC_BASE_0 \
ian@12677 42 + ((KEXEC_XEN_NO_PAGES >> 1) * KEXEC_IMAGE_NR) - 1,
kaf24@1508 43 __end_of_fixed_addresses
kaf24@1452 44 };
kaf24@1452 45
kaf24@3594 46 #define FIXADDR_TOP (IOREMAP_VIRT_END - PAGE_SIZE)
kaf24@1508 47 #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
kaf24@1508 48 #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
kaf24@1508 49
kaf24@3594 50 extern void __set_fixmap(
kaf24@10209 51 enum fixed_addresses idx, unsigned long mfn, unsigned long flags);
kaf24@1452 52
kaf24@1452 53 #define set_fixmap(idx, phys) \
kaf24@10209 54 __set_fixmap(idx, (phys)>>PAGE_SHIFT, PAGE_HYPERVISOR)
kaf24@1452 55
kaf24@1508 56 #define set_fixmap_nocache(idx, phys) \
kaf24@10209 57 __set_fixmap(idx, (phys)>>PAGE_SHIFT, PAGE_HYPERVISOR_NOCACHE)
kaf24@1452 58
kaf24@4804 59 #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
kaf24@4804 60 #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
kaf24@4804 61
kaf24@4817 62 #define fix_to_virt(x) (__fix_to_virt(x))
kaf24@4804 63
kaf24@4804 64 static inline unsigned long virt_to_fix(const unsigned long vaddr)
kaf24@4804 65 {
kaf24@4804 66 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
kaf24@4804 67 return __virt_to_fix(vaddr);
kaf24@4804 68 }
kaf24@1452 69
kaf24@1452 70 #endif