diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-12 06:35:23 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-12 06:37:32 -0400 |
commit | 365d46dc9be9b3c833990a06f3994b1987eda578 (patch) | |
tree | 9397d1304144a288411f2118707f44ff5e862fa6 /arch/x86/xen/enlighten.c | |
parent | 5dc64a3442b98eaa0e3730c35fcf00cf962a93e7 (diff) | |
parent | fd048088306656824958e7783ffcee27e241b361 (diff) |
Merge branch 'linus' into x86/xen
Conflicts:
arch/x86/kernel/cpu/common.c
arch/x86/kernel/process_64.c
arch/x86/xen/enlighten.c
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r-- | arch/x86/xen/enlighten.c | 65 |
1 files changed, 51 insertions, 14 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 977a54255fb4..0013a729b41d 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <xen/hvc-console.h> | 35 | #include <xen/hvc-console.h> |
36 | 36 | ||
37 | #include <asm/paravirt.h> | 37 | #include <asm/paravirt.h> |
38 | #include <asm/apic.h> | ||
38 | #include <asm/page.h> | 39 | #include <asm/page.h> |
39 | #include <asm/xen/hypercall.h> | 40 | #include <asm/xen/hypercall.h> |
40 | #include <asm/xen/hypervisor.h> | 41 | #include <asm/xen/hypervisor.h> |
@@ -553,16 +554,47 @@ static void xen_io_delay(void) | |||
553 | } | 554 | } |
554 | 555 | ||
555 | #ifdef CONFIG_X86_LOCAL_APIC | 556 | #ifdef CONFIG_X86_LOCAL_APIC |
556 | static u32 xen_apic_read(unsigned long reg) | 557 | static u32 xen_apic_read(u32 reg) |
557 | { | 558 | { |
558 | return 0; | 559 | return 0; |
559 | } | 560 | } |
560 | 561 | ||
561 | static void xen_apic_write(unsigned long reg, u32 val) | 562 | static void xen_apic_write(u32 reg, u32 val) |
562 | { | 563 | { |
563 | /* Warn to see if there's any stray references */ | 564 | /* Warn to see if there's any stray references */ |
564 | WARN_ON(1); | 565 | WARN_ON(1); |
565 | } | 566 | } |
567 | |||
568 | static u64 xen_apic_icr_read(void) | ||
569 | { | ||
570 | return 0; | ||
571 | } | ||
572 | |||
573 | static void xen_apic_icr_write(u32 low, u32 id) | ||
574 | { | ||
575 | /* Warn to see if there's any stray references */ | ||
576 | WARN_ON(1); | ||
577 | } | ||
578 | |||
579 | static void xen_apic_wait_icr_idle(void) | ||
580 | { | ||
581 | return; | ||
582 | } | ||
583 | |||
584 | static u32 xen_safe_apic_wait_icr_idle(void) | ||
585 | { | ||
586 | return 0; | ||
587 | } | ||
588 | |||
589 | static struct apic_ops xen_basic_apic_ops = { | ||
590 | .read = xen_apic_read, | ||
591 | .write = xen_apic_write, | ||
592 | .icr_read = xen_apic_icr_read, | ||
593 | .icr_write = xen_apic_icr_write, | ||
594 | .wait_icr_idle = xen_apic_wait_icr_idle, | ||
595 | .safe_wait_icr_idle = xen_safe_apic_wait_icr_idle, | ||
596 | }; | ||
597 | |||
566 | #endif | 598 | #endif |
567 | 599 | ||
568 | static void xen_flush_tlb(void) | 600 | static void xen_flush_tlb(void) |
@@ -798,7 +830,7 @@ static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high) | |||
798 | 830 | ||
799 | /* Early in boot, while setting up the initial pagetable, assume | 831 | /* Early in boot, while setting up the initial pagetable, assume |
800 | everything is pinned. */ | 832 | everything is pinned. */ |
801 | static __init void xen_alloc_pte_init(struct mm_struct *mm, u32 pfn) | 833 | static __init void xen_alloc_pte_init(struct mm_struct *mm, unsigned long pfn) |
802 | { | 834 | { |
803 | #ifdef CONFIG_FLATMEM | 835 | #ifdef CONFIG_FLATMEM |
804 | BUG_ON(mem_map); /* should only be used early */ | 836 | BUG_ON(mem_map); /* should only be used early */ |
@@ -808,7 +840,7 @@ static __init void xen_alloc_pte_init(struct mm_struct *mm, u32 pfn) | |||
808 | 840 | ||
809 | /* Early release_pte assumes that all pts are pinned, since there's | 841 | /* Early release_pte assumes that all pts are pinned, since there's |
810 | only init_mm and anything attached to that is pinned. */ | 842 | only init_mm and anything attached to that is pinned. */ |
811 | static void xen_release_pte_init(u32 pfn) | 843 | static void xen_release_pte_init(unsigned long pfn) |
812 | { | 844 | { |
813 | make_lowmem_page_readwrite(__va(PFN_PHYS(pfn))); | 845 | make_lowmem_page_readwrite(__va(PFN_PHYS(pfn))); |
814 | } | 846 | } |
@@ -824,7 +856,7 @@ static void pin_pagetable_pfn(unsigned cmd, unsigned long pfn) | |||
824 | 856 | ||
825 | /* This needs to make sure the new pte page is pinned iff its being | 857 | /* This needs to make sure the new pte page is pinned iff its being |
826 | attached to a pinned pagetable. */ | 858 | attached to a pinned pagetable. */ |
827 | static void xen_alloc_ptpage(struct mm_struct *mm, u32 pfn, unsigned level) | 859 | static void xen_alloc_ptpage(struct mm_struct *mm, unsigned long pfn, unsigned level) |
828 | { | 860 | { |
829 | struct page *page = pfn_to_page(pfn); | 861 | struct page *page = pfn_to_page(pfn); |
830 | 862 | ||
@@ -842,12 +874,12 @@ static void xen_alloc_ptpage(struct mm_struct *mm, u32 pfn, unsigned level) | |||
842 | } | 874 | } |
843 | } | 875 | } |
844 | 876 | ||
845 | static void xen_alloc_pte(struct mm_struct *mm, u32 pfn) | 877 | static void xen_alloc_pte(struct mm_struct *mm, unsigned long pfn) |
846 | { | 878 | { |
847 | xen_alloc_ptpage(mm, pfn, PT_PTE); | 879 | xen_alloc_ptpage(mm, pfn, PT_PTE); |
848 | } | 880 | } |
849 | 881 | ||
850 | static void xen_alloc_pmd(struct mm_struct *mm, u32 pfn) | 882 | static void xen_alloc_pmd(struct mm_struct *mm, unsigned long pfn) |
851 | { | 883 | { |
852 | xen_alloc_ptpage(mm, pfn, PT_PMD); | 884 | xen_alloc_ptpage(mm, pfn, PT_PMD); |
853 | } | 885 | } |
@@ -895,7 +927,7 @@ static void xen_pgd_free(struct mm_struct *mm, pgd_t *pgd) | |||
895 | } | 927 | } |
896 | 928 | ||
897 | /* This should never happen until we're OK to use struct page */ | 929 | /* This should never happen until we're OK to use struct page */ |
898 | static void xen_release_ptpage(u32 pfn, unsigned level) | 930 | static void xen_release_ptpage(unsigned long pfn, unsigned level) |
899 | { | 931 | { |
900 | struct page *page = pfn_to_page(pfn); | 932 | struct page *page = pfn_to_page(pfn); |
901 | 933 | ||
@@ -909,23 +941,23 @@ static void xen_release_ptpage(u32 pfn, unsigned level) | |||
909 | } | 941 | } |
910 | } | 942 | } |
911 | 943 | ||
912 | static void xen_release_pte(u32 pfn) | 944 | static void xen_release_pte(unsigned long pfn) |
913 | { | 945 | { |
914 | xen_release_ptpage(pfn, PT_PTE); | 946 | xen_release_ptpage(pfn, PT_PTE); |
915 | } | 947 | } |
916 | 948 | ||
917 | static void xen_release_pmd(u32 pfn) | 949 | static void xen_release_pmd(unsigned long pfn) |
918 | { | 950 | { |
919 | xen_release_ptpage(pfn, PT_PMD); | 951 | xen_release_ptpage(pfn, PT_PMD); |
920 | } | 952 | } |
921 | 953 | ||
922 | #if PAGETABLE_LEVELS == 4 | 954 | #if PAGETABLE_LEVELS == 4 |
923 | static void xen_alloc_pud(struct mm_struct *mm, u32 pfn) | 955 | static void xen_alloc_pud(struct mm_struct *mm, unsigned long pfn) |
924 | { | 956 | { |
925 | xen_alloc_ptpage(mm, pfn, PT_PUD); | 957 | xen_alloc_ptpage(mm, pfn, PT_PUD); |
926 | } | 958 | } |
927 | 959 | ||
928 | static void xen_release_pud(u32 pfn) | 960 | static void xen_release_pud(unsigned long pfn) |
929 | { | 961 | { |
930 | xen_release_ptpage(pfn, PT_PUD); | 962 | xen_release_ptpage(pfn, PT_PUD); |
931 | } | 963 | } |
@@ -1230,8 +1262,6 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = { | |||
1230 | 1262 | ||
1231 | static const struct pv_apic_ops xen_apic_ops __initdata = { | 1263 | static const struct pv_apic_ops xen_apic_ops __initdata = { |
1232 | #ifdef CONFIG_X86_LOCAL_APIC | 1264 | #ifdef CONFIG_X86_LOCAL_APIC |
1233 | .apic_write = xen_apic_write, | ||
1234 | .apic_read = xen_apic_read, | ||
1235 | .setup_boot_clock = paravirt_nop, | 1265 | .setup_boot_clock = paravirt_nop, |
1236 | .setup_secondary_clock = paravirt_nop, | 1266 | .setup_secondary_clock = paravirt_nop, |
1237 | .startup_ipi_hook = paravirt_nop, | 1267 | .startup_ipi_hook = paravirt_nop, |
@@ -1600,6 +1630,13 @@ asmlinkage void __init xen_start_kernel(void) | |||
1600 | 1630 | ||
1601 | xen_init_irq_ops(); | 1631 | xen_init_irq_ops(); |
1602 | 1632 | ||
1633 | #ifdef CONFIG_X86_LOCAL_APIC | ||
1634 | /* | ||
1635 | * set up the basic apic ops. | ||
1636 | */ | ||
1637 | apic_ops = &xen_basic_apic_ops; | ||
1638 | #endif | ||
1639 | |||
1603 | if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) { | 1640 | if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) { |
1604 | pv_mmu_ops.ptep_modify_prot_start = xen_ptep_modify_prot_start; | 1641 | pv_mmu_ops.ptep_modify_prot_start = xen_ptep_modify_prot_start; |
1605 | pv_mmu_ops.ptep_modify_prot_commit = xen_ptep_modify_prot_commit; | 1642 | pv_mmu_ops.ptep_modify_prot_commit = xen_ptep_modify_prot_commit; |