aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/xen')
-rw-r--r--arch/x86/xen/enlighten.c65
-rw-r--r--arch/x86/xen/setup.c2
2 files changed, 52 insertions, 15 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index a4e201b47f64..a27d562a9744 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -36,6 +36,7 @@
36#include <xen/hvc-console.h> 36#include <xen/hvc-console.h>
37 37
38#include <asm/paravirt.h> 38#include <asm/paravirt.h>
39#include <asm/apic.h>
39#include <asm/page.h> 40#include <asm/page.h>
40#include <asm/xen/hypercall.h> 41#include <asm/xen/hypercall.h>
41#include <asm/xen/hypervisor.h> 42#include <asm/xen/hypervisor.h>
@@ -580,16 +581,47 @@ static void xen_io_delay(void)
580} 581}
581 582
582#ifdef CONFIG_X86_LOCAL_APIC 583#ifdef CONFIG_X86_LOCAL_APIC
583static u32 xen_apic_read(unsigned long reg) 584static u32 xen_apic_read(u32 reg)
584{ 585{
585 return 0; 586 return 0;
586} 587}
587 588
588static void xen_apic_write(unsigned long reg, u32 val) 589static void xen_apic_write(u32 reg, u32 val)
589{ 590{
590 /* Warn to see if there's any stray references */ 591 /* Warn to see if there's any stray references */
591 WARN_ON(1); 592 WARN_ON(1);
592} 593}
594
595static u64 xen_apic_icr_read(void)
596{
597 return 0;
598}
599
600static void xen_apic_icr_write(u32 low, u32 id)
601{
602 /* Warn to see if there's any stray references */
603 WARN_ON(1);
604}
605
606static void xen_apic_wait_icr_idle(void)
607{
608 return;
609}
610
611static u32 xen_safe_apic_wait_icr_idle(void)
612{
613 return 0;
614}
615
616static struct apic_ops xen_basic_apic_ops = {
617 .read = xen_apic_read,
618 .write = xen_apic_write,
619 .icr_read = xen_apic_icr_read,
620 .icr_write = xen_apic_icr_write,
621 .wait_icr_idle = xen_apic_wait_icr_idle,
622 .safe_wait_icr_idle = xen_safe_apic_wait_icr_idle,
623};
624
593#endif 625#endif
594 626
595static void xen_flush_tlb(void) 627static void xen_flush_tlb(void)
@@ -812,7 +844,7 @@ static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high)
812 844
813/* Early in boot, while setting up the initial pagetable, assume 845/* Early in boot, while setting up the initial pagetable, assume
814 everything is pinned. */ 846 everything is pinned. */
815static __init void xen_alloc_pte_init(struct mm_struct *mm, u32 pfn) 847static __init void xen_alloc_pte_init(struct mm_struct *mm, unsigned long pfn)
816{ 848{
817#ifdef CONFIG_FLATMEM 849#ifdef CONFIG_FLATMEM
818 BUG_ON(mem_map); /* should only be used early */ 850 BUG_ON(mem_map); /* should only be used early */
@@ -822,7 +854,7 @@ static __init void xen_alloc_pte_init(struct mm_struct *mm, u32 pfn)
822 854
823/* Early release_pte assumes that all pts are pinned, since there's 855/* Early release_pte assumes that all pts are pinned, since there's
824 only init_mm and anything attached to that is pinned. */ 856 only init_mm and anything attached to that is pinned. */
825static void xen_release_pte_init(u32 pfn) 857static void xen_release_pte_init(unsigned long pfn)
826{ 858{
827 make_lowmem_page_readwrite(__va(PFN_PHYS(pfn))); 859 make_lowmem_page_readwrite(__va(PFN_PHYS(pfn)));
828} 860}
@@ -838,7 +870,7 @@ static void pin_pagetable_pfn(unsigned cmd, unsigned long pfn)
838 870
839/* This needs to make sure the new pte page is pinned iff its being 871/* This needs to make sure the new pte page is pinned iff its being
840 attached to a pinned pagetable. */ 872 attached to a pinned pagetable. */
841static void xen_alloc_ptpage(struct mm_struct *mm, u32 pfn, unsigned level) 873static void xen_alloc_ptpage(struct mm_struct *mm, unsigned long pfn, unsigned level)
842{ 874{
843 struct page *page = pfn_to_page(pfn); 875 struct page *page = pfn_to_page(pfn);
844 876
@@ -856,12 +888,12 @@ static void xen_alloc_ptpage(struct mm_struct *mm, u32 pfn, unsigned level)
856 } 888 }
857} 889}
858 890
859static void xen_alloc_pte(struct mm_struct *mm, u32 pfn) 891static void xen_alloc_pte(struct mm_struct *mm, unsigned long pfn)
860{ 892{
861 xen_alloc_ptpage(mm, pfn, PT_PTE); 893 xen_alloc_ptpage(mm, pfn, PT_PTE);
862} 894}
863 895
864static void xen_alloc_pmd(struct mm_struct *mm, u32 pfn) 896static void xen_alloc_pmd(struct mm_struct *mm, unsigned long pfn)
865{ 897{
866 xen_alloc_ptpage(mm, pfn, PT_PMD); 898 xen_alloc_ptpage(mm, pfn, PT_PMD);
867} 899}
@@ -909,7 +941,7 @@ static void xen_pgd_free(struct mm_struct *mm, pgd_t *pgd)
909} 941}
910 942
911/* This should never happen until we're OK to use struct page */ 943/* This should never happen until we're OK to use struct page */
912static void xen_release_ptpage(u32 pfn, unsigned level) 944static void xen_release_ptpage(unsigned long pfn, unsigned level)
913{ 945{
914 struct page *page = pfn_to_page(pfn); 946 struct page *page = pfn_to_page(pfn);
915 947
@@ -923,23 +955,23 @@ static void xen_release_ptpage(u32 pfn, unsigned level)
923 } 955 }
924} 956}
925 957
926static void xen_release_pte(u32 pfn) 958static void xen_release_pte(unsigned long pfn)
927{ 959{
928 xen_release_ptpage(pfn, PT_PTE); 960 xen_release_ptpage(pfn, PT_PTE);
929} 961}
930 962
931static void xen_release_pmd(u32 pfn) 963static void xen_release_pmd(unsigned long pfn)
932{ 964{
933 xen_release_ptpage(pfn, PT_PMD); 965 xen_release_ptpage(pfn, PT_PMD);
934} 966}
935 967
936#if PAGETABLE_LEVELS == 4 968#if PAGETABLE_LEVELS == 4
937static void xen_alloc_pud(struct mm_struct *mm, u32 pfn) 969static void xen_alloc_pud(struct mm_struct *mm, unsigned long pfn)
938{ 970{
939 xen_alloc_ptpage(mm, pfn, PT_PUD); 971 xen_alloc_ptpage(mm, pfn, PT_PUD);
940} 972}
941 973
942static void xen_release_pud(u32 pfn) 974static void xen_release_pud(unsigned long pfn)
943{ 975{
944 xen_release_ptpage(pfn, PT_PUD); 976 xen_release_ptpage(pfn, PT_PUD);
945} 977}
@@ -1273,8 +1305,6 @@ static const struct pv_irq_ops xen_irq_ops __initdata = {
1273 1305
1274static const struct pv_apic_ops xen_apic_ops __initdata = { 1306static const struct pv_apic_ops xen_apic_ops __initdata = {
1275#ifdef CONFIG_X86_LOCAL_APIC 1307#ifdef CONFIG_X86_LOCAL_APIC
1276 .apic_write = xen_apic_write,
1277 .apic_read = xen_apic_read,
1278 .setup_boot_clock = paravirt_nop, 1308 .setup_boot_clock = paravirt_nop,
1279 .setup_secondary_clock = paravirt_nop, 1309 .setup_secondary_clock = paravirt_nop,
1280 .startup_ipi_hook = paravirt_nop, 1310 .startup_ipi_hook = paravirt_nop,
@@ -1677,6 +1707,13 @@ asmlinkage void __init xen_start_kernel(void)
1677 pv_apic_ops = xen_apic_ops; 1707 pv_apic_ops = xen_apic_ops;
1678 pv_mmu_ops = xen_mmu_ops; 1708 pv_mmu_ops = xen_mmu_ops;
1679 1709
1710#ifdef CONFIG_X86_LOCAL_APIC
1711 /*
1712 * set up the basic apic ops.
1713 */
1714 apic_ops = &xen_basic_apic_ops;
1715#endif
1716
1680 if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) { 1717 if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) {
1681 pv_mmu_ops.ptep_modify_prot_start = xen_ptep_modify_prot_start; 1718 pv_mmu_ops.ptep_modify_prot_start = xen_ptep_modify_prot_start;
1682 pv_mmu_ops.ptep_modify_prot_commit = xen_ptep_modify_prot_commit; 1719 pv_mmu_ops.ptep_modify_prot_commit = xen_ptep_modify_prot_commit;
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index b6acc3a0af46..d67901083888 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -42,7 +42,7 @@ char * __init xen_memory_setup(void)
42 42
43 e820.nr_map = 0; 43 e820.nr_map = 0;
44 44
45 e820_add_region(0, PFN_PHYS(max_pfn), E820_RAM); 45 e820_add_region(0, PFN_PHYS((u64)max_pfn), E820_RAM);
46 46
47 /* 47 /*
48 * Even though this is normal, usable memory under Xen, reserve 48 * Even though this is normal, usable memory under Xen, reserve