Skip to content

Commit b5d72dd

Browse files
committed
Merge tag 'for-linus-5.3a-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen updates from Juergen Gross: "Fixes and features: - A series to introduce a common command line parameter for disabling paravirtual extensions when running as a guest in virtualized environment - A fix for int3 handling in Xen pv guests - Removal of the Xen-specific tmem driver as support of tmem in Xen has been dropped (and it was experimental only) - A security fix for running as Xen dom0 (XSA-300) - A fix for IRQ handling when offlining cpus in Xen guests - Some small cleanups" * tag 'for-linus-5.3a-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: let alloc_xenballooned_pages() fail if not enough memory free xen/pv: Fix a boot up hang revealed by int3 self test x86/xen: Add "nopv" support for HVM guest x86/paravirt: Remove const mark from x86_hyper_xen_hvm variable xen: Map "xen_nopv" parameter to "nopv" and mark it obsolete x86: Add "nopv" parameter to disable PV extensions x86/xen: Mark xen_hvm_need_lapic() and xen_x2apic_para_available() as __init xen: remove tmem driver Revert "x86/paravirt: Set up the virt_spin_lock_key after static keys get initialized" xen/events: fix binding user event channels to cpus
2 parents 26473f8 + a1078e8 commit b5d72dd

25 files changed

Lines changed: 112 additions & 1120 deletions

‎Documentation/admin-guide/kernel-parameters.txt‎

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4698,27 +4698,6 @@
46984698
Force threading of all interrupt handlers except those
46994699
marked explicitly IRQF_NO_THREAD.
47004700

4701-
tmem [KNL,XEN]
4702-
Enable the Transcendent memory driver if built-in.
4703-
4704-
tmem.cleancache=0|1 [KNL, XEN]
4705-
Default is on (1). Disable the usage of the cleancache
4706-
API to send anonymous pages to the hypervisor.
4707-
4708-
tmem.frontswap=0|1 [KNL, XEN]
4709-
Default is on (1). Disable the usage of the frontswap
4710-
API to send swap pages to the hypervisor. If disabled
4711-
the selfballooning and selfshrinking are force disabled.
4712-
4713-
tmem.selfballooning=0|1 [KNL, XEN]
4714-
Default is on (1). Disable the driving of swap pages
4715-
to the hypervisor.
4716-
4717-
tmem.selfshrinking=0|1 [KNL, XEN]
4718-
Default is on (1). Partial swapoff that immediately
4719-
transfers pages from Xen hypervisor back to the
4720-
kernel based on different criteria.
4721-
47224701
topology= [S390]
47234702
Format: {off | on}
47244703
Specify if the kernel should make use of the cpu
@@ -5288,6 +5267,8 @@
52885267
xen_nopv [X86]
52895268
Disables the PV optimizations forcing the HVM guest to
52905269
run as generic HVM guest with no PV drivers.
5270+
This option is obsoleted by the "nopv" option, which
5271+
has equivalent effect for XEN platform.
52915272

52925273
xen_scrub_pages= [XEN]
52935274
Boolean option to control scrubbing pages before giving them back
@@ -5302,6 +5283,11 @@
53025283
improve timer resolution at the expense of processing
53035284
more timer interrupts.
53045285

5286+
nopv= [X86,XEN,KVM,HYPER_V,VMWARE]
5287+
Disables the PV optimizations forcing the guest to run
5288+
as generic guest with no PV drivers. Currently support
5289+
XEN HVM, KVM, HYPER_V and VMWARE guest.
5290+
53055291
xirc2ps_cs= [NET,PCMCIA]
53065292
Format:
53075293
<irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]

‎arch/x86/entry/entry_64.S‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,6 @@ idtentry stack_segment do_stack_segment has_error_code=1
11761176
#ifdef CONFIG_XEN_PV
11771177
idtentry xennmi do_nmi has_error_code=0
11781178
idtentry xendebug do_debug has_error_code=0
1179-
idtentry xenint3 do_int3 has_error_code=0
11801179
#endif
11811180

11821181
idtentry general_protection do_general_protection has_error_code=1

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,20 @@ struct hypervisor_x86 {
5353

5454
/* runtime callbacks */
5555
struct x86_hyper_runtime runtime;
56+
57+
/* ignore nopv parameter */
58+
bool ignore_nopv;
5659
};
5760

61+
extern const struct hypervisor_x86 x86_hyper_vmware;
62+
extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
63+
extern const struct hypervisor_x86 x86_hyper_xen_pv;
64+
extern const struct hypervisor_x86 x86_hyper_kvm;
65+
extern const struct hypervisor_x86 x86_hyper_jailhouse;
66+
extern const struct hypervisor_x86 x86_hyper_acrn;
67+
extern struct hypervisor_x86 x86_hyper_xen_hvm;
68+
69+
extern bool nopv;
5870
extern enum x86_hypervisor_type x86_hyper_type;
5971
extern void init_hypervisor_platform(void);
6072
static inline bool hypervisor_is_type(enum x86_hypervisor_type type)

‎arch/x86/include/asm/traps.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ asmlinkage void simd_coprocessor_error(void);
4040
asmlinkage void xen_divide_error(void);
4141
asmlinkage void xen_xennmi(void);
4242
asmlinkage void xen_xendebug(void);
43-
asmlinkage void xen_xenint3(void);
43+
asmlinkage void xen_int3(void);
4444
asmlinkage void xen_overflow(void);
4545
asmlinkage void xen_bounds(void);
4646
asmlinkage void xen_invalid_op(void);

‎arch/x86/include/asm/x86_init.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@ extern struct x86_apic_ops x86_apic_ops;
301301
extern void x86_early_init_platform_quirks(void);
302302
extern void x86_init_noop(void);
303303
extern void x86_init_uint_noop(unsigned int unused);
304+
extern bool bool_x86_init_noop(void);
305+
extern void x86_op_int_noop(int cpu);
304306
extern bool x86_pnpbios_disabled(void);
305307

306308
#endif

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ static inline uint32_t xen_cpuid_base(void)
4444
}
4545

4646
#ifdef CONFIG_XEN
47-
extern bool xen_hvm_need_lapic(void);
47+
extern bool __init xen_hvm_need_lapic(void);
4848

49-
static inline bool xen_x2apic_para_available(void)
49+
static inline bool __init xen_x2apic_para_available(void)
5050
{
5151
return xen_hvm_need_lapic();
5252
}
5353
#else
54-
static inline bool xen_x2apic_para_available(void)
54+
static inline bool __init xen_x2apic_para_available(void)
5555
{
5656
return (xen_cpuid_base() != 0);
5757
}

‎arch/x86/kernel/cpu/hypervisor.c‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@
2626
#include <asm/processor.h>
2727
#include <asm/hypervisor.h>
2828

29-
extern const struct hypervisor_x86 x86_hyper_vmware;
30-
extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
31-
extern const struct hypervisor_x86 x86_hyper_xen_pv;
32-
extern const struct hypervisor_x86 x86_hyper_xen_hvm;
33-
extern const struct hypervisor_x86 x86_hyper_kvm;
34-
extern const struct hypervisor_x86 x86_hyper_jailhouse;
35-
extern const struct hypervisor_x86 x86_hyper_acrn;
36-
3729
static const __initconst struct hypervisor_x86 * const hypervisors[] =
3830
{
3931
#ifdef CONFIG_XEN_PV
@@ -58,13 +50,24 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] =
5850
enum x86_hypervisor_type x86_hyper_type;
5951
EXPORT_SYMBOL(x86_hyper_type);
6052

53+
bool __initdata nopv;
54+
static __init int parse_nopv(char *arg)
55+
{
56+
nopv = true;
57+
return 0;
58+
}
59+
early_param("nopv", parse_nopv);
60+
6161
static inline const struct hypervisor_x86 * __init
6262
detect_hypervisor_vendor(void)
6363
{
6464
const struct hypervisor_x86 *h = NULL, * const *p;
6565
uint32_t pri, max_pri = 0;
6666

6767
for (p = hypervisors; p < hypervisors + ARRAY_SIZE(hypervisors); p++) {
68+
if (unlikely(nopv) && !(*p)->ignore_nopv)
69+
continue;
70+
6871
pri = (*p)->detect();
6972
if (pri > max_pri) {
7073
max_pri = pri;

‎arch/x86/kernel/jailhouse.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,5 @@ const struct hypervisor_x86 x86_hyper_jailhouse __refconst = {
217217
.detect = jailhouse_detect,
218218
.init.init_platform = jailhouse_init_platform,
219219
.init.x2apic_available = jailhouse_x2apic_available,
220+
.ignore_nopv = true,
220221
};

‎arch/x86/kernel/smpboot.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,8 +1368,6 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
13681368
pr_info("CPU0: ");
13691369
print_cpu_info(&cpu_data(0));
13701370

1371-
native_pv_lock_init();
1372-
13731371
uv_system_init();
13741372

13751373
set_mtrr_aps_delayed_init();
@@ -1399,6 +1397,7 @@ void __init native_smp_prepare_boot_cpu(void)
13991397
/* already set me in cpu_online_mask in boot_cpu_init() */
14001398
cpumask_set_cpu(me, cpu_callout_mask);
14011399
cpu_set_state_online(me);
1400+
native_pv_lock_init();
14021401
}
14031402

14041403
void __init calculate_max_logical_packages(void)

‎arch/x86/kernel/x86_init.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ void x86_init_noop(void) { }
2929
void __init x86_init_uint_noop(unsigned int unused) { }
3030
static int __init iommu_init_noop(void) { return 0; }
3131
static void iommu_shutdown_noop(void) { }
32-
static bool __init bool_x86_init_noop(void) { return false; }
33-
static void x86_op_int_noop(int cpu) { }
32+
bool __init bool_x86_init_noop(void) { return false; }
33+
void x86_op_int_noop(int cpu) { }
3434

3535
/*
3636
* The platform setup functions are preset with the default functions

0 commit comments

Comments
 (0)