Skip to content

Commit 90c9e95

Browse files
committed
Merge tag 'for-linus-5.17a-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen fixes from Juergen Gross: - documentation fixes related to Xen - enable x2apic mode when available when running as hardware virtualized guest under Xen - cleanup and fix a corner case of vcpu enumeration when running a paravirtualized Xen guest * tag 'for-linus-5.17a-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: x86/Xen: streamline (and fix) PV CPU enumeration xen: update missing ioctl magic numers documentation Improve docs for IOCTL_GNTDEV_MAP_GRANT_REF xen: xenbus_dev.h: delete incorrect file name xen/x2apic: enable x2apic mode when supported for HVM
2 parents 5fdb262 + e25a8d9 commit 90c9e95

File tree

7 files changed

+20
-50
lines changed

7 files changed

+20
-50
lines changed

Documentation/userspace-api/ioctl/ioctl-number.rst

+3
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ Code Seq# Include File Comments
115115
'B' 00-1F linux/cciss_ioctl.h conflict!
116116
'B' 00-0F include/linux/pmu.h conflict!
117117
'B' C0-FF advanced bbus <mailto:[email protected]>
118+
'B' 00-0F xen/xenbus_dev.h conflict!
118119
'C' all linux/soundcard.h conflict!
119120
'C' 01-2F linux/capi.h conflict!
120121
'C' F0-FF drivers/net/wan/cosa.h conflict!
@@ -134,6 +135,7 @@ Code Seq# Include File Comments
134135
'F' 80-8F linux/arcfb.h conflict!
135136
'F' DD video/sstfb.h conflict!
136137
'G' 00-3F drivers/misc/sgi-gru/grulib.h conflict!
138+
'G' 00-0F xen/gntalloc.h, xen/gntdev.h conflict!
137139
'H' 00-7F linux/hiddev.h conflict!
138140
'H' 00-0F linux/hidraw.h conflict!
139141
'H' 01 linux/mei.h conflict!
@@ -176,6 +178,7 @@ Code Seq# Include File Comments
176178
'P' 60-6F sound/sscape_ioctl.h conflict!
177179
'P' 00-0F drivers/usb/class/usblp.c conflict!
178180
'P' 01-09 drivers/misc/pci_endpoint_test.c conflict!
181+
'P' 00-0F xen/privcmd.h conflict!
179182
'Q' all linux/soundcard.h
180183
'R' 00-1F linux/random.h conflict!
181184
'R' 01 linux/rfkill.h conflict!

arch/x86/include/asm/xen/hypervisor.h

-14
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,6 @@ static inline uint32_t xen_cpuid_base(void)
4343
return hypervisor_cpuid_base("XenVMMXenVMM", 2);
4444
}
4545

46-
#ifdef CONFIG_XEN
47-
extern bool __init xen_hvm_need_lapic(void);
48-
49-
static inline bool __init xen_x2apic_para_available(void)
50-
{
51-
return xen_hvm_need_lapic();
52-
}
53-
#else
54-
static inline bool __init xen_x2apic_para_available(void)
55-
{
56-
return (xen_cpuid_base() != 0);
57-
}
58-
#endif
59-
6046
struct pci_dev;
6147

6248
#ifdef CONFIG_XEN_PV_DOM0

arch/x86/xen/enlighten_hvm.c

+4-9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <xen/events.h>
1010
#include <xen/interface/memory.h>
1111

12+
#include <asm/apic.h>
1213
#include <asm/cpu.h>
1314
#include <asm/smp.h>
1415
#include <asm/io_apic.h>
@@ -242,15 +243,9 @@ static __init int xen_parse_no_vector_callback(char *arg)
242243
}
243244
early_param("xen_no_vector_callback", xen_parse_no_vector_callback);
244245

245-
bool __init xen_hvm_need_lapic(void)
246+
static __init bool xen_x2apic_available(void)
246247
{
247-
if (xen_pv_domain())
248-
return false;
249-
if (!xen_hvm_domain())
250-
return false;
251-
if (xen_feature(XENFEAT_hvm_pirqs) && xen_have_vector_callback)
252-
return false;
253-
return true;
248+
return x2apic_supported();
254249
}
255250

256251
static __init void xen_hvm_guest_late_init(void)
@@ -312,7 +307,7 @@ struct hypervisor_x86 x86_hyper_xen_hvm __initdata = {
312307
.detect = xen_platform_hvm,
313308
.type = X86_HYPER_XEN_HVM,
314309
.init.init_platform = xen_hvm_guest_init,
315-
.init.x2apic_available = xen_x2apic_para_available,
310+
.init.x2apic_available = xen_x2apic_available,
316311
.init.init_mem_mapping = xen_hvm_init_mem_mapping,
317312
.init.guest_late_init = xen_hvm_guest_late_init,
318313
.runtime.pin_vcpu = xen_pin_vcpu,

arch/x86/xen/enlighten_pv.c

-4
Original file line numberDiff line numberDiff line change
@@ -1341,10 +1341,6 @@ asmlinkage __visible void __init xen_start_kernel(void)
13411341

13421342
xen_acpi_sleep_register();
13431343

1344-
/* Avoid searching for BIOS MP tables */
1345-
x86_init.mpparse.find_smp_config = x86_init_noop;
1346-
x86_init.mpparse.get_smp_config = x86_init_uint_noop;
1347-
13481344
xen_boot_params_init_edd();
13491345

13501346
#ifdef CONFIG_ACPI

arch/x86/xen/smp_pv.c

+6-20
Original file line numberDiff line numberDiff line change
@@ -148,28 +148,12 @@ int xen_smp_intr_init_pv(unsigned int cpu)
148148
return rc;
149149
}
150150

151-
static void __init xen_fill_possible_map(void)
152-
{
153-
int i, rc;
154-
155-
if (xen_initial_domain())
156-
return;
157-
158-
for (i = 0; i < nr_cpu_ids; i++) {
159-
rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL);
160-
if (rc >= 0) {
161-
num_processors++;
162-
set_cpu_possible(i, true);
163-
}
164-
}
165-
}
166-
167-
static void __init xen_filter_cpu_maps(void)
151+
static void __init _get_smp_config(unsigned int early)
168152
{
169153
int i, rc;
170154
unsigned int subtract = 0;
171155

172-
if (!xen_initial_domain())
156+
if (early)
173157
return;
174158

175159
num_processors = 0;
@@ -210,7 +194,6 @@ static void __init xen_pv_smp_prepare_boot_cpu(void)
210194
* sure the old memory can be recycled. */
211195
make_lowmem_page_readwrite(xen_initial_gdt);
212196

213-
xen_filter_cpu_maps();
214197
xen_setup_vcpu_info_placement();
215198

216199
/*
@@ -476,5 +459,8 @@ static const struct smp_ops xen_smp_ops __initconst = {
476459
void __init xen_smp_init(void)
477460
{
478461
smp_ops = xen_smp_ops;
479-
xen_fill_possible_map();
462+
463+
/* Avoid searching for BIOS MP tables */
464+
x86_init.mpparse.find_smp_config = x86_init_noop;
465+
x86_init.mpparse.get_smp_config = _get_smp_config;
480466
}

include/uapi/xen/gntdev.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ struct ioctl_gntdev_grant_ref {
4747
/*
4848
* Inserts the grant references into the mapping table of an instance
4949
* of gntdev. N.B. This does not perform the mapping, which is deferred
50-
* until mmap() is called with @index as the offset.
50+
* until mmap() is called with @index as the offset. @index should be
51+
* considered opaque to userspace, with one exception: if no grant
52+
* references have ever been inserted into the mapping table of this
53+
* instance, @index will be set to 0. This is necessary to use gntdev
54+
* with userspace APIs that expect a file descriptor that can be
55+
* mmap()'d at offset 0, such as Wayland. If @count is set to 0, this
56+
* ioctl will fail.
5157
*/
5258
#define IOCTL_GNTDEV_MAP_GRANT_REF \
5359
_IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref))

include/xen/xenbus_dev.h

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/******************************************************************************
2-
* evtchn.h
3-
*
42
* Interface to /dev/xen/xenbus_backend.
53
*
64
* Copyright (c) 2011 Bastian Blank <[email protected]>

0 commit comments

Comments
 (0)