History

Merge tag 'for-linus-6.5-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

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

Linus Torvalds committed 3 years ago

Commit 18eb3b62 parents 6a46676 fb9b7b411 files · +77 −23Browse files

Unified · Split

11 files
  1. arch/x86/kernel/setup.c +1 −1
  2. arch/x86/xen/efi.c +2 −0
  3. arch/x86/xen/mmu_pv.c +16 −0
  4. arch/x86/xen/setup.c +19 −9
  5. arch/x86/xen/smp.h +4 −0
  6. arch/x86/xen/smp_pv.c +0 −1
  7. arch/x86/xen/xen-ops.h +3 −2
  8. drivers/firmware/iscsi_ibft_find.c +17 −9
  9. include/linux/iscsi_ibft.h +9 −1
  10. include/xen/events.h +3 −0
  11. include/xen/xen.h +3 −0
arch/x86/kernel/setup.c+1−1
@@ -796,7 +796,6 @@ static void __init early_reserve_memory(void) · 795 unmodified lines
796796
797797 memblock_x86_reserve_range_setup_data();
798798
799− reserve_ibft_region();
800799 reserve_bios_regions();
801800 trim_snb_memory();
802801 }
@@ -1032,6 +1031,7 @@ void __init setup_arch(char **cmdline_p) · 229 unmodified lines
10321031 if (efi_enabled(EFI_BOOT))
10331032 efi_init();
10341033
1034+ reserve_ibft_region();
10351035 dmi_setup();
10361036
10371037 /*
arch/x86/xen/efi.c+2−0
@@ -16,6 +16,8 @@ · 15 unmodified lines
1616 #include <asm/setup.h>
1717 #include <asm/xen/hypercall.h>
1818
19+#include "xen-ops.h"
20+
1921 static efi_char16_t vendor[100] __initdata;
2022
2123 static efi_system_table_t efi_systab_xen __initdata = {
arch/x86/xen/mmu_pv.c+16−0
@@ -86,6 +86,22 @@ · 85 unmodified lines
8686 #include "mmu.h"
8787 #include "debugfs.h"
8888
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+
89105 #ifdef CONFIG_X86_VSYSCALL_EMULATION
90106 /* l3 pud for userspace vsyscall mapping */
91107 static pud_t level3_user_vsyscall[PTRS_PER_PUD] __page_aligned_bss;
arch/x86/xen/setup.c+19−9
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 */
77
88 #include <linux/init.h>
9+#include <linux/iscsi_ibft.h>
910 #include <linux/sched.h>
1011 #include <linux/kstrtox.h>
1112 #include <linux/mm.h>
@@ -764,17 +765,26 @@ char * __init xen_memory_setup(void) · 752 unmodified lines
764765 BUG_ON(memmap.nr_entries == 0);
765766 xen_e820_table.nr_entries = memmap.nr_entries;
766767
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+ */
776777 xen_ignore_unusable();
777778
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+
778788 /* Make sure the Xen-supplied memory map is well-ordered. */
779789 e820__update_table(&xen_e820_table);
780790
arch/x86/xen/smp.h+4−0
@@ -2,6 +2,10 @@ · 1 unmodified line
22 #ifndef _XEN_SMP_H
33
44 #ifdef CONFIG_SMP
5+
6+void asm_cpu_bringup_and_idle(void);
7+asmlinkage void cpu_bringup_and_idle(void);
8+
59 extern void xen_send_IPI_mask(const struct cpumask *mask,
610 int vector);
711 extern void xen_send_IPI_mask_allbutself(const struct cpumask *mask,
arch/x86/xen/smp_pv.c+0−1
@@ -55,7 +55,6 @@ static DEFINE_PER_CPU(struct xen_common_irq, xen_irq_work) = { .irq = -1 }; · 54 unmodified lines
5555 static DEFINE_PER_CPU(struct xen_common_irq, xen_pmu_irq) = { .irq = -1 };
5656
5757 static irqreturn_t xen_irq_work_interrupt(int irq, void *dev_id);
58−void asm_cpu_bringup_and_idle(void);
5958
6059 static void cpu_bringup(void)
6160 {
arch/x86/xen/xen-ops.h+3−2
@@ -72,8 +72,6 @@ void xen_restore_time_memory_area(void); · 71 unmodified lines
7272 void xen_init_time_ops(void);
7373 void xen_hvm_init_time_ops(void);
7474
75−irqreturn_t xen_debug_interrupt(int irq, void *dev_id);
76−
7775 bool xen_vcpu_stolen(int vcpu);
7876
7977 void xen_vcpu_setup(int cpu);
@@ -148,9 +146,12 @@ int xen_cpuhp_setup(int (*cpu_up_prepare_cb)(unsigned int), · 68 unmodified lines
148146 void xen_pin_vcpu(int cpu);
149147
150148 void xen_emergency_restart(void);
149+void xen_force_evtchn_callback(void);
150+
151151 #ifdef CONFIG_XEN_PV
152152 void xen_pv_pre_suspend(void);
153153 void xen_pv_post_suspend(int suspend_cancelled);
154+void xen_start_kernel(struct start_info *si);
154155 #else
155156 static inline void xen_pv_pre_suspend(void) {}
156157 static inline void xen_pv_post_suspend(int suspend_cancelled) {}
drivers/firmware/iscsi_ibft_find.c+17−9
@@ -42,8 +42,6 @@ static const struct { · 41 unmodified lines
4242 };
4343
4444 #define IBFT_SIGN_LEN 4
45−#define IBFT_START 0x80000 /* 512kB */
46−#define IBFT_END 0x100000 /* 1MB */
4745 #define VGA_MEM 0xA0000 /* VGA buffer */
4846 #define VGA_SIZE 0x20000 /* 128kB */
4947
@@ -52,9 +50,9 @@ static const struct { · 2 unmodified lines
5250 */
5351 void __init reserve_ibft_region(void)
5452 {
55− unsigned long pos;
53+ unsigned long pos, virt_pos = 0;
5654 unsigned int len = 0;
57− void *virt;
55+ void *virt = NULL;
5856 int i;
5957
6058 ibft_phys_addr = 0;
@@ -70,13 +68,20 @@ void __init reserve_ibft_region(void) · 9 unmodified lines
7068 * so skip that area */
7169 if (pos == VGA_MEM)
7270 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+ }
7479
7580 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) {
7883 unsigned long *addr =
79− (unsigned long *)isa_bus_to_virt(pos + 4);
84+ (unsigned long *)(virt + pos - virt_pos + 4);
8085 len = *addr;
8186 /* if the length of the table extends past 1M,
8287 * the table cannot be valid. */
@@ -84,9 +89,12 @@ void __init reserve_ibft_region(void) · 1 unmodified line
8489 ibft_phys_addr = pos;
8590 memblock_reserve(ibft_phys_addr, PAGE_ALIGN(len));
8691 pr_info("iBFT found at %pa.\n", &ibft_phys_addr);
87− return;
92+ goto out;
8893 }
8994 }
9095 }
9196 }
97+
98+out:
99+ early_memunmap(virt, PAGE_SIZE);
92100 }
include/linux/iscsi_ibft.h+9−1
@@ -21,12 +21,20 @@ · 20 unmodified lines
2121 */
2222 extern phys_addr_t ibft_phys_addr;
2323
24+#ifdef CONFIG_ISCSI_IBFT_FIND
25+
2426 /*
2527 * Routine used to find and reserve the iSCSI Boot Format Table. The
2628 * physical address is set in the ibft_phys_addr variable.
2729 */
28−#ifdef CONFIG_ISCSI_IBFT_FIND
2930 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+
3038 #else
3139 static inline void reserve_ibft_region(void) {}
3240 #endif
include/xen/events.h+3−0
@@ -138,4 +138,7 @@ int xen_test_irq_shared(int irq); · 137 unmodified lines
138138
139139 /* initialize Xen IRQ subsystem */
140140 void xen_init_IRQ(void);
141+
142+irqreturn_t xen_debug_interrupt(int irq, void *dev_id);
143+
141144 #endif /* _XEN_EVENTS_H */
include/xen/xen.h+3−0
@@ -31,6 +31,9 @@ extern uint32_t xen_start_flags; · 30 unmodified lines
3131
3232 #include <xen/interface/hvm/start_info.h>
3333 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);
3437
3538 #ifdef CONFIG_XEN_DOM0
3639 #include <xen/interface/xen.h>