Pull xen updates from Juergen Gross: - three patches adding missing prototypes - a fix for finding the iBFT in a Xen dom0 for supporting diskless iSCSI boot * tag 'for-linus-6.5-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: x86: xen: add missing prototypes x86/xen: add prototypes for paravirt mmu functions iscsi_ibft: Fix finding the iBFT under Xen Dom 0 xen: xen_debug_interrupt prototype to global header
Unified · Split
| @@ -796,7 +796,6 @@ static void __init early_reserve_memory(void) · 795 unmodified lines | ||
| 796 | 796 | |
| 797 | 797 | memblock_x86_reserve_range_setup_data(); |
| 798 | 798 | |
| 799 | − reserve_ibft_region(); | |
| 800 | 799 | reserve_bios_regions(); |
| 801 | 800 | trim_snb_memory(); |
| 802 | 801 | } |
| @@ -1032,6 +1031,7 @@ void __init setup_arch(char **cmdline_p) · 229 unmodified lines | ||
| 1032 | 1031 | if (efi_enabled(EFI_BOOT)) |
| 1033 | 1032 | efi_init(); |
| 1034 | 1033 | |
| 1034 | + reserve_ibft_region(); | |
| 1035 | 1035 | dmi_setup(); |
| 1036 | 1036 | |
| 1037 | 1037 | /* |
| @@ -16,6 +16,8 @@ · 15 unmodified lines | ||
| 16 | 16 | #include <asm/setup.h> |
| 17 | 17 | #include <asm/xen/hypercall.h> |
| 18 | 18 | |
| 19 | +#include "xen-ops.h" | |
| 20 | + | |
| 19 | 21 | static efi_char16_t vendor[100] __initdata; |
| 20 | 22 | |
| 21 | 23 | static efi_system_table_t efi_systab_xen __initdata = { |
| @@ -86,6 +86,22 @@ · 85 unmodified lines | ||
| 86 | 86 | #include "mmu.h" |
| 87 | 87 | #include "debugfs.h" |
| 88 | 88 | |
| 89 | +/* | |
| 90 | + * Prototypes for functions called via PV_CALLEE_SAVE_REGS_THUNK() in order | |
| 91 | + * to avoid warnings with "-Wmissing-prototypes". | |
| 92 | + */ | |
| 93 | +pteval_t xen_pte_val(pte_t pte); | |
| 94 | +pgdval_t xen_pgd_val(pgd_t pgd); | |
| 95 | +pmdval_t xen_pmd_val(pmd_t pmd); | |
| 96 | +pudval_t xen_pud_val(pud_t pud); | |
| 97 | +p4dval_t xen_p4d_val(p4d_t p4d); | |
| 98 | +pte_t xen_make_pte(pteval_t pte); | |
| 99 | +pgd_t xen_make_pgd(pgdval_t pgd); | |
| 100 | +pmd_t xen_make_pmd(pmdval_t pmd); | |
| 101 | +pud_t xen_make_pud(pudval_t pud); | |
| 102 | +p4d_t xen_make_p4d(p4dval_t p4d); | |
| 103 | +pte_t xen_make_pte_init(pteval_t pte); | |
| 104 | + | |
| 89 | 105 | #ifdef CONFIG_X86_VSYSCALL_EMULATION |
| 90 | 106 | /* l3 pud for userspace vsyscall mapping */ |
| 91 | 107 | static pud_t level3_user_vsyscall[PTRS_PER_PUD] __page_aligned_bss; |
| @@ -6,6 +6,7 @@ · 5 unmodified lines | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | #include <linux/init.h> |
| 9 | +#include <linux/iscsi_ibft.h> | |
| 9 | 10 | #include <linux/sched.h> |
| 10 | 11 | #include <linux/kstrtox.h> |
| 11 | 12 | #include <linux/mm.h> |
| @@ -764,17 +765,26 @@ char * __init xen_memory_setup(void) · 752 unmodified lines | ||
| 764 | 765 | BUG_ON(memmap.nr_entries == 0); |
| 765 | 766 | xen_e820_table.nr_entries = memmap.nr_entries; |
| 766 | 767 | |
| 767 | − /* | |
| 768 | − * Xen won't allow a 1:1 mapping to be created to UNUSABLE | |
| 769 | − * regions, so if we're using the machine memory map leave the | |
| 770 | − * region as RAM as it is in the pseudo-physical map. | |
| 771 | − * | |
| 772 | − * UNUSABLE regions in domUs are not handled and will need | |
| 773 | − * a patch in the future. | |
| 774 | − */ | |
| 775 | − if (xen_initial_domain()) | |
| 768 | + if (xen_initial_domain()) { | |
| 769 | + /* | |
| 770 | + * Xen won't allow a 1:1 mapping to be created to UNUSABLE | |
| 771 | + * regions, so if we're using the machine memory map leave the | |
| 772 | + * region as RAM as it is in the pseudo-physical map. | |
| 773 | + * | |
| 774 | + * UNUSABLE regions in domUs are not handled and will need | |
| 775 | + * a patch in the future. | |
| 776 | + */ | |
| 776 | 777 | xen_ignore_unusable(); |
| 777 | 778 | |
| 779 | +#ifdef CONFIG_ISCSI_IBFT_FIND | |
| 780 | + /* Reserve 0.5 MiB to 1 MiB region so iBFT can be found */ | |
| 781 | + xen_e820_table.entries[xen_e820_table.nr_entries].addr = IBFT_START; | |
| 782 | + xen_e820_table.entries[xen_e820_table.nr_entries].size = IBFT_END - IBFT_START; | |
| 783 | + xen_e820_table.entries[xen_e820_table.nr_entries].type = E820_TYPE_RESERVED; | |
| 784 | + xen_e820_table.nr_entries++; | |
| 785 | +#endif | |
| 786 | + } | |
| 787 | + | |
| 778 | 788 | /* Make sure the Xen-supplied memory map is well-ordered. */ |
| 779 | 789 | e820__update_table(&xen_e820_table); |
| 780 | 790 | |
| @@ -2,6 +2,10 @@ · 1 unmodified line | ||
| 2 | 2 | #ifndef _XEN_SMP_H |
| 3 | 3 | |
| 4 | 4 | #ifdef CONFIG_SMP |
| 5 | + | |
| 6 | +void asm_cpu_bringup_and_idle(void); | |
| 7 | +asmlinkage void cpu_bringup_and_idle(void); | |
| 8 | + | |
| 5 | 9 | extern void xen_send_IPI_mask(const struct cpumask *mask, |
| 6 | 10 | int vector); |
| 7 | 11 | extern void xen_send_IPI_mask_allbutself(const struct cpumask *mask, |
| @@ -55,7 +55,6 @@ static DEFINE_PER_CPU(struct xen_common_irq, xen_irq_work) = { .irq = -1 }; · 54 unmodified lines | ||
| 55 | 55 | static DEFINE_PER_CPU(struct xen_common_irq, xen_pmu_irq) = { .irq = -1 }; |
| 56 | 56 | |
| 57 | 57 | static irqreturn_t xen_irq_work_interrupt(int irq, void *dev_id); |
| 58 | −void asm_cpu_bringup_and_idle(void); | |
| 59 | 58 | |
| 60 | 59 | static void cpu_bringup(void) |
| 61 | 60 | { |
| @@ -72,8 +72,6 @@ void xen_restore_time_memory_area(void); · 71 unmodified lines | ||
| 72 | 72 | void xen_init_time_ops(void); |
| 73 | 73 | void xen_hvm_init_time_ops(void); |
| 74 | 74 | |
| 75 | −irqreturn_t xen_debug_interrupt(int irq, void *dev_id); | |
| 76 | − | |
| 77 | 75 | bool xen_vcpu_stolen(int vcpu); |
| 78 | 76 | |
| 79 | 77 | void xen_vcpu_setup(int cpu); |
| @@ -148,9 +146,12 @@ int xen_cpuhp_setup(int (*cpu_up_prepare_cb)(unsigned int), · 68 unmodified lines | ||
| 148 | 146 | void xen_pin_vcpu(int cpu); |
| 149 | 147 | |
| 150 | 148 | void xen_emergency_restart(void); |
| 149 | +void xen_force_evtchn_callback(void); | |
| 150 | + | |
| 151 | 151 | #ifdef CONFIG_XEN_PV |
| 152 | 152 | void xen_pv_pre_suspend(void); |
| 153 | 153 | void xen_pv_post_suspend(int suspend_cancelled); |
| 154 | +void xen_start_kernel(struct start_info *si); | |
| 154 | 155 | #else |
| 155 | 156 | static inline void xen_pv_pre_suspend(void) {} |
| 156 | 157 | static inline void xen_pv_post_suspend(int suspend_cancelled) {} |
| @@ -42,8 +42,6 @@ static const struct { · 41 unmodified lines | ||
| 42 | 42 | }; |
| 43 | 43 | |
| 44 | 44 | #define IBFT_SIGN_LEN 4 |
| 45 | −#define IBFT_START 0x80000 /* 512kB */ | |
| 46 | −#define IBFT_END 0x100000 /* 1MB */ | |
| 47 | 45 | #define VGA_MEM 0xA0000 /* VGA buffer */ |
| 48 | 46 | #define VGA_SIZE 0x20000 /* 128kB */ |
| 49 | 47 | |
| @@ -52,9 +50,9 @@ static const struct { · 2 unmodified lines | ||
| 52 | 50 | */ |
| 53 | 51 | void __init reserve_ibft_region(void) |
| 54 | 52 | { |
| 55 | − unsigned long pos; | |
| 53 | + unsigned long pos, virt_pos = 0; | |
| 56 | 54 | unsigned int len = 0; |
| 57 | − void *virt; | |
| 55 | + void *virt = NULL; | |
| 58 | 56 | int i; |
| 59 | 57 | |
| 60 | 58 | ibft_phys_addr = 0; |
| @@ -70,13 +68,20 @@ void __init reserve_ibft_region(void) · 9 unmodified lines | ||
| 70 | 68 | * so skip that area */ |
| 71 | 69 | if (pos == VGA_MEM) |
| 72 | 70 | pos += VGA_SIZE; |
| 73 | − virt = isa_bus_to_virt(pos); | |
| 71 | + | |
| 72 | + /* Map page by page */ | |
| 73 | + if (offset_in_page(pos) == 0) { | |
| 74 | + if (virt) | |
| 75 | + early_memunmap(virt, PAGE_SIZE); | |
| 76 | + virt = early_memremap_ro(pos, PAGE_SIZE); | |
| 77 | + virt_pos = pos; | |
| 78 | + } | |
| 74 | 79 | |
| 75 | 80 | for (i = 0; i < ARRAY_SIZE(ibft_signs); i++) { |
| 76 | − if (memcmp(virt, ibft_signs[i].sign, IBFT_SIGN_LEN) == | |
| 77 | − 0) { | |
| 81 | + if (memcmp(virt + (pos - virt_pos), ibft_signs[i].sign, | |
| 82 | + IBFT_SIGN_LEN) == 0) { | |
| 78 | 83 | unsigned long *addr = |
| 79 | − (unsigned long *)isa_bus_to_virt(pos + 4); | |
| 84 | + (unsigned long *)(virt + pos - virt_pos + 4); | |
| 80 | 85 | len = *addr; |
| 81 | 86 | /* if the length of the table extends past 1M, |
| 82 | 87 | * the table cannot be valid. */ |
| @@ -84,9 +89,12 @@ void __init reserve_ibft_region(void) · 1 unmodified line | ||
| 84 | 89 | ibft_phys_addr = pos; |
| 85 | 90 | memblock_reserve(ibft_phys_addr, PAGE_ALIGN(len)); |
| 86 | 91 | pr_info("iBFT found at %pa.\n", &ibft_phys_addr); |
| 87 | − return; | |
| 92 | + goto out; | |
| 88 | 93 | } |
| 89 | 94 | } |
| 90 | 95 | } |
| 91 | 96 | } |
| 97 | + | |
| 98 | +out: | |
| 99 | + early_memunmap(virt, PAGE_SIZE); | |
| 92 | 100 | } |
| @@ -21,12 +21,20 @@ · 20 unmodified lines | ||
| 21 | 21 | */ |
| 22 | 22 | extern phys_addr_t ibft_phys_addr; |
| 23 | 23 | |
| 24 | +#ifdef CONFIG_ISCSI_IBFT_FIND | |
| 25 | + | |
| 24 | 26 | /* |
| 25 | 27 | * Routine used to find and reserve the iSCSI Boot Format Table. The |
| 26 | 28 | * physical address is set in the ibft_phys_addr variable. |
| 27 | 29 | */ |
| 28 | −#ifdef CONFIG_ISCSI_IBFT_FIND | |
| 29 | 30 | void reserve_ibft_region(void); |
| 31 | + | |
| 32 | +/* | |
| 33 | + * Physical bounds to search for the iSCSI Boot Format Table. | |
| 34 | + */ | |
| 35 | +#define IBFT_START 0x80000 /* 512kB */ | |
| 36 | +#define IBFT_END 0x100000 /* 1MB */ | |
| 37 | + | |
| 30 | 38 | #else |
| 31 | 39 | static inline void reserve_ibft_region(void) {} |
| 32 | 40 | #endif |
| @@ -138,4 +138,7 @@ int xen_test_irq_shared(int irq); · 137 unmodified lines | ||
| 138 | 138 | |
| 139 | 139 | /* initialize Xen IRQ subsystem */ |
| 140 | 140 | void xen_init_IRQ(void); |
| 141 | + | |
| 142 | +irqreturn_t xen_debug_interrupt(int irq, void *dev_id); | |
| 143 | + | |
| 141 | 144 | #endif /* _XEN_EVENTS_H */ |
| @@ -31,6 +31,9 @@ extern uint32_t xen_start_flags; · 30 unmodified lines | ||
| 31 | 31 | |
| 32 | 32 | #include <xen/interface/hvm/start_info.h> |
| 33 | 33 | extern struct hvm_start_info pvh_start_info; |
| 34 | +void xen_prepare_pvh(void); | |
| 35 | +struct pt_regs; | |
| 36 | +void xen_pv_evtchn_do_upcall(struct pt_regs *regs); | |
| 34 | 37 | |
| 35 | 38 | #ifdef CONFIG_XEN_DOM0 |
| 36 | 39 | #include <xen/interface/xen.h> |