Skip to content

Commit 18eb3b6

Browse files
committed
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
2 parents 6a46676 + fb9b7b4 commit 18eb3b6

11 files changed

Lines changed: 77 additions & 23 deletions

File tree

arch/x86/kernel/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,6 @@ static void __init early_reserve_memory(void)
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)
10321031
if (efi_enabled(EFI_BOOT))
10331032
efi_init();
10341033

1034+
reserve_ibft_region();
10351035
dmi_setup();
10361036

10371037
/*

arch/x86/xen/efi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,22 @@
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

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
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)
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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ static DEFINE_PER_CPU(struct xen_common_irq, xen_irq_work) = { .irq = -1 };
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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ void xen_restore_time_memory_area(void);
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),
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

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ static const struct {
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 {
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,23 +68,33 @@ void __init reserve_ibft_region(void)
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. */
8388
if (pos + len <= (IBFT_END-1)) {
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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,20 @@
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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,7 @@ int xen_test_irq_shared(int irq);
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 */

0 commit comments

Comments
 (0)