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