Skip to content

Commit 0f912c8

Browse files
committed
Merge tag 'for-linus-7.0-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen fixes from Juergen Gross: - a cleanup of arch/x86/kernel/head_64.S removing the pre-built page tables for Xen guests - a small comment update - another cleanup for Xen PVH guests mode - fix an issue with Xen PV-devices backed by driver domains * tag 'for-linus-7.0-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/xenbus: better handle backend crash xenbus: add xenbus_device parameter to xenbus_read_driver_state() x86/PVH: Use boot params to pass RSDP address in start_info page x86/xen: update outdated comment xen/acpi-processor: fix _CST detection using undersized evaluation buffer x86/xen: Build identity mapping page tables dynamically for XENPV
2 parents 4ae12d8 + e2dcf90 commit 0f912c8

14 files changed

Lines changed: 97 additions & 77 deletions

File tree

arch/x86/include/asm/pgtable_64.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
extern p4d_t level4_kernel_pgt[512];
2020
extern p4d_t level4_ident_pgt[512];
2121
extern pud_t level3_kernel_pgt[512];
22-
extern pud_t level3_ident_pgt[512];
2322
extern pmd_t level2_kernel_pgt[512];
2423
extern pmd_t level2_fixmap_pgt[512];
25-
extern pmd_t level2_ident_pgt[512];
2624
extern pte_t level1_fixmap_pgt[512 * FIXMAP_PMD_NUM];
2725
extern pgd_t init_top_pgt[];
2826

arch/x86/kernel/head_64.S

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -616,38 +616,10 @@ SYM_DATA(early_recursion_flag, .long 0)
616616

617617
.data
618618

619-
#if defined(CONFIG_XEN_PV) || defined(CONFIG_PVH)
620-
SYM_DATA_START_PTI_ALIGNED(init_top_pgt)
621-
.quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
622-
.org init_top_pgt + L4_PAGE_OFFSET*8, 0
623-
.quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
624-
.org init_top_pgt + L4_START_KERNEL*8, 0
625-
/* (2^48-(2*1024*1024*1024))/(2^39) = 511 */
626-
.quad level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE_NOENC
627-
.fill PTI_USER_PGD_FILL,8,0
628-
SYM_DATA_END(init_top_pgt)
629-
630-
SYM_DATA_START_PAGE_ALIGNED(level3_ident_pgt)
631-
.quad level2_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
632-
.fill 511, 8, 0
633-
SYM_DATA_END(level3_ident_pgt)
634-
SYM_DATA_START_PAGE_ALIGNED(level2_ident_pgt)
635-
/*
636-
* Since I easily can, map the first 1G.
637-
* Don't set NX because code runs from these pages.
638-
*
639-
* Note: This sets _PAGE_GLOBAL despite whether
640-
* the CPU supports it or it is enabled. But,
641-
* the CPU should ignore the bit.
642-
*/
643-
PMDS(0, __PAGE_KERNEL_IDENT_LARGE_EXEC, PTRS_PER_PMD)
644-
SYM_DATA_END(level2_ident_pgt)
645-
#else
646619
SYM_DATA_START_PTI_ALIGNED(init_top_pgt)
647620
.fill 512,8,0
648621
.fill PTI_USER_PGD_FILL,8,0
649622
SYM_DATA_END(init_top_pgt)
650-
#endif
651623

652624
SYM_DATA_START_PAGE_ALIGNED(level4_kernel_pgt)
653625
.fill 511,8,0

arch/x86/platform/pvh/enlighten.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ struct hvm_start_info __initdata pvh_start_info;
2525

2626
const unsigned int __initconst pvh_start_info_sz = sizeof(pvh_start_info);
2727

28-
static u64 __init pvh_get_root_pointer(void)
29-
{
30-
return pvh_start_info.rsdp_paddr;
31-
}
32-
3328
/*
3429
* Xen guests are able to obtain the memory map from the hypervisor via the
3530
* HYPERVISOR_memory_op hypercall.
@@ -95,7 +90,7 @@ static void __init init_pvh_bootparams(bool xen_guest)
9590
pvh_bootparams.hdr.version = (2 << 8) | 12;
9691
pvh_bootparams.hdr.type_of_loader = ((xen_guest ? 0x9 : 0xb) << 4) | 0;
9792

98-
x86_init.acpi.get_root_pointer = pvh_get_root_pointer;
93+
pvh_bootparams.acpi_rsdp_addr = pvh_start_info.rsdp_paddr;
9994
}
10095

10196
/*

arch/x86/xen/enlighten_pv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ static void __init xen_init_capabilities(void)
392392

393393
/*
394394
* Xen PV would need some work to support PCID: CR3 handling as well
395-
* as xen_flush_tlb_others() would need updating.
395+
* as xen_flush_tlb_multi() would need updating.
396396
*/
397397
setup_clear_cpu_cap(X86_FEATURE_PCID);
398398

arch/x86/xen/mmu_pv.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ pte_t xen_make_pte_init(pteval_t pte);
105105
static pud_t level3_user_vsyscall[PTRS_PER_PUD] __page_aligned_bss;
106106
#endif
107107

108+
static pud_t level3_ident_pgt[PTRS_PER_PUD] __page_aligned_bss;
109+
static pmd_t level2_ident_pgt[PTRS_PER_PMD] __page_aligned_bss;
110+
108111
/*
109112
* Protects atomic reservation decrease/increase against concurrent increases.
110113
* Also protects non-atomic updates of current_pages and balloon lists.
@@ -1777,6 +1780,12 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
17771780
/* Zap identity mapping */
17781781
init_top_pgt[0] = __pgd(0);
17791782

1783+
init_top_pgt[pgd_index(__PAGE_OFFSET_BASE_L4)].pgd =
1784+
__pa_symbol(level3_ident_pgt) + _KERNPG_TABLE_NOENC;
1785+
init_top_pgt[pgd_index(__START_KERNEL_map)].pgd =
1786+
__pa_symbol(level3_kernel_pgt) + _PAGE_TABLE_NOENC;
1787+
level3_ident_pgt[0].pud = __pa_symbol(level2_ident_pgt) + _KERNPG_TABLE_NOENC;
1788+
17801789
/* Pre-constructed entries are in pfn, so convert to mfn */
17811790
/* L4[273] -> level3_ident_pgt */
17821791
/* L4[511] -> level3_kernel_pgt */

drivers/net/xen-netfront.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,7 @@ static int xennet_xdp_set(struct net_device *dev, struct bpf_prog *prog,
16461646

16471647
/* avoid the race with XDP headroom adjustment */
16481648
wait_event(module_wq,
1649-
xenbus_read_driver_state(np->xbdev->otherend) ==
1649+
xenbus_read_driver_state(np->xbdev, np->xbdev->otherend) ==
16501650
XenbusStateReconfigured);
16511651
np->netfront_xdp_enabled = true;
16521652

@@ -1764,9 +1764,9 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)
17641764
do {
17651765
xenbus_switch_state(dev, XenbusStateInitialising);
17661766
err = wait_event_timeout(module_wq,
1767-
xenbus_read_driver_state(dev->otherend) !=
1767+
xenbus_read_driver_state(dev, dev->otherend) !=
17681768
XenbusStateClosed &&
1769-
xenbus_read_driver_state(dev->otherend) !=
1769+
xenbus_read_driver_state(dev, dev->otherend) !=
17701770
XenbusStateUnknown, XENNET_TIMEOUT);
17711771
} while (!err);
17721772

@@ -2626,31 +2626,31 @@ static void xennet_bus_close(struct xenbus_device *dev)
26262626
{
26272627
int ret;
26282628

2629-
if (xenbus_read_driver_state(dev->otherend) == XenbusStateClosed)
2629+
if (xenbus_read_driver_state(dev, dev->otherend) == XenbusStateClosed)
26302630
return;
26312631
do {
26322632
xenbus_switch_state(dev, XenbusStateClosing);
26332633
ret = wait_event_timeout(module_wq,
2634-
xenbus_read_driver_state(dev->otherend) ==
2635-
XenbusStateClosing ||
2636-
xenbus_read_driver_state(dev->otherend) ==
2637-
XenbusStateClosed ||
2638-
xenbus_read_driver_state(dev->otherend) ==
2639-
XenbusStateUnknown,
2640-
XENNET_TIMEOUT);
2634+
xenbus_read_driver_state(dev, dev->otherend) ==
2635+
XenbusStateClosing ||
2636+
xenbus_read_driver_state(dev, dev->otherend) ==
2637+
XenbusStateClosed ||
2638+
xenbus_read_driver_state(dev, dev->otherend) ==
2639+
XenbusStateUnknown,
2640+
XENNET_TIMEOUT);
26412641
} while (!ret);
26422642

2643-
if (xenbus_read_driver_state(dev->otherend) == XenbusStateClosed)
2643+
if (xenbus_read_driver_state(dev, dev->otherend) == XenbusStateClosed)
26442644
return;
26452645

26462646
do {
26472647
xenbus_switch_state(dev, XenbusStateClosed);
26482648
ret = wait_event_timeout(module_wq,
2649-
xenbus_read_driver_state(dev->otherend) ==
2650-
XenbusStateClosed ||
2651-
xenbus_read_driver_state(dev->otherend) ==
2652-
XenbusStateUnknown,
2653-
XENNET_TIMEOUT);
2649+
xenbus_read_driver_state(dev, dev->otherend) ==
2650+
XenbusStateClosed ||
2651+
xenbus_read_driver_state(dev, dev->otherend) ==
2652+
XenbusStateUnknown,
2653+
XENNET_TIMEOUT);
26542654
} while (!ret);
26552655
}
26562656

drivers/pci/xen-pcifront.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ static void pcifront_try_connect(struct pcifront_device *pdev)
856856
int err;
857857

858858
/* Only connect once */
859-
if (xenbus_read_driver_state(pdev->xdev->nodename) !=
859+
if (xenbus_read_driver_state(pdev->xdev, pdev->xdev->nodename) !=
860860
XenbusStateInitialised)
861861
return;
862862

@@ -876,7 +876,7 @@ static int pcifront_try_disconnect(struct pcifront_device *pdev)
876876
enum xenbus_state prev_state;
877877

878878

879-
prev_state = xenbus_read_driver_state(pdev->xdev->nodename);
879+
prev_state = xenbus_read_driver_state(pdev->xdev, pdev->xdev->nodename);
880880

881881
if (prev_state >= XenbusStateClosing)
882882
goto out;
@@ -895,7 +895,7 @@ static int pcifront_try_disconnect(struct pcifront_device *pdev)
895895

896896
static void pcifront_attach_devices(struct pcifront_device *pdev)
897897
{
898-
if (xenbus_read_driver_state(pdev->xdev->nodename) ==
898+
if (xenbus_read_driver_state(pdev->xdev, pdev->xdev->nodename) ==
899899
XenbusStateReconfiguring)
900900
pcifront_connect(pdev);
901901
}
@@ -909,7 +909,7 @@ static int pcifront_detach_devices(struct pcifront_device *pdev)
909909
struct pci_dev *pci_dev;
910910
char str[64];
911911

912-
state = xenbus_read_driver_state(pdev->xdev->nodename);
912+
state = xenbus_read_driver_state(pdev->xdev, pdev->xdev->nodename);
913913
if (state == XenbusStateInitialised) {
914914
dev_dbg(&pdev->xdev->dev, "Handle skipped connect.\n");
915915
/* We missed Connected and need to initialize. */

drivers/scsi/xen-scsifront.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ static void scsifront_backend_changed(struct xenbus_device *dev,
11751175
return;
11761176
}
11771177

1178-
if (xenbus_read_driver_state(dev->nodename) ==
1178+
if (xenbus_read_driver_state(dev, dev->nodename) ==
11791179
XenbusStateInitialised)
11801180
scsifront_do_lun_hotplug(info, VSCSIFRONT_OP_ADD_LUN);
11811181

drivers/xen/xen-acpi-processor.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,8 @@ read_acpi_id(acpi_handle handle, u32 lvl, void *context, void **rv)
378378
acpi_psd[acpi_id].domain);
379379
}
380380

381-
status = acpi_evaluate_object(handle, "_CST", NULL, &buffer);
382-
if (ACPI_FAILURE(status)) {
383-
if (!pblk)
384-
return AE_OK;
385-
}
381+
if (!pblk && !acpi_has_method(handle, "_CST"))
382+
return AE_OK;
386383
/* .. and it has a C-state */
387384
__set_bit(acpi_id, acpi_id_cst_present);
388385

drivers/xen/xen-pciback/xenbus.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ static int xen_pcibk_attach(struct xen_pcibk_device *pdev)
149149

150150
mutex_lock(&pdev->dev_lock);
151151
/* Make sure we only do this setup once */
152-
if (xenbus_read_driver_state(pdev->xdev->nodename) !=
152+
if (xenbus_read_driver_state(pdev->xdev, pdev->xdev->nodename) !=
153153
XenbusStateInitialised)
154154
goto out;
155155

156156
/* Wait for frontend to state that it has published the configuration */
157-
if (xenbus_read_driver_state(pdev->xdev->otherend) !=
157+
if (xenbus_read_driver_state(pdev->xdev, pdev->xdev->otherend) !=
158158
XenbusStateInitialised)
159159
goto out;
160160

@@ -374,7 +374,7 @@ static int xen_pcibk_reconfigure(struct xen_pcibk_device *pdev,
374374
dev_dbg(&pdev->xdev->dev, "Reconfiguring device ...\n");
375375

376376
mutex_lock(&pdev->dev_lock);
377-
if (xenbus_read_driver_state(pdev->xdev->nodename) != state)
377+
if (xenbus_read_driver_state(pdev->xdev, pdev->xdev->nodename) != state)
378378
goto out;
379379

380380
err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, "num_devs", "%d",
@@ -572,7 +572,7 @@ static int xen_pcibk_setup_backend(struct xen_pcibk_device *pdev)
572572
/* It's possible we could get the call to setup twice, so make sure
573573
* we're not already connected.
574574
*/
575-
if (xenbus_read_driver_state(pdev->xdev->nodename) !=
575+
if (xenbus_read_driver_state(pdev->xdev, pdev->xdev->nodename) !=
576576
XenbusStateInitWait)
577577
goto out;
578578

@@ -662,7 +662,7 @@ static void xen_pcibk_be_watch(struct xenbus_watch *watch,
662662
struct xen_pcibk_device *pdev =
663663
container_of(watch, struct xen_pcibk_device, be_watch);
664664

665-
switch (xenbus_read_driver_state(pdev->xdev->nodename)) {
665+
switch (xenbus_read_driver_state(pdev->xdev, pdev->xdev->nodename)) {
666666
case XenbusStateInitWait:
667667
xen_pcibk_setup_backend(pdev);
668668
break;

0 commit comments

Comments
 (0)