x86/xen: untangle PV and PVHVM guest support code
Subsystems (3)
v2 cover x86/xen: untangle PV and PVHVM guest support code
Changes since v1:
- Patches 1,2 and 3 were split and reordered to avoid adding temporary #ifdefs [Juergen Gross]
- Juergen's R-b added to what is now patches 14 and 15 (patches 4 and 5 in v1). Due to re-ordering there are some tiny diffrences but I opted for keeping the tag.
Some patches are known to produce checkpatch.pl WARNINGS and a couple of ERRORs, I fixed a few (mostly in _hvm* code I split) and I refrained from fixing the rest to make it easier to review. I think that we may leave PV code as it is as sooner or later it will go away.
Original description:
I have a long-standing idea to separate PV and PVHVM code in kernel and introduce Kconfig options to make it possible to enable the required parts only breaking the current 'all or nothing' approach.
Motivation:
- Xen related x86 code in kernel is rather big and it is unclear which parts of it are required for PV, for HVM or for both. With PVH coming into picture is becomes even more tangled. It makes it hard to understand/audit the code.
- In some case we may want to avoid bloating kernel by supporting Xen guests we don't need. In particular, 90% of the code in arch/x86/xen/ is required to support PV guests and one may require PVHVM support only.
- PV guests are supposed to go away one day and such code separation would help us to get ready.
This series adds XEN_PV Kconfig option and makes it possible to build PV-only and PVHVM-only kernels. It also makes it possible to disable Dom0 support.
Some patches are rather big but this is mostly just moving code around, no functional changes intended. I smoke tested it with PV-only and PVHVM-only builds, booted and did save/restore test. I also tried the newly introduced PVHv2 guest, it even worked!
Vitaly Kuznetsov (21):
x86/xen: separate PV and HVM hypervisors
x86/xen: globalize have_vcpu_info_placement
x86/xen: add CONFIG_XEN_PV to Kconfig
x86/xen: split off enlighten_pvh.c
x86/xen: split off enlighten_hvm.c
x86/xen: split off enlighten_pv.c
x86/xen: split xen_smp_intr_init()/xen_smp_intr_free() x86/xen: split xen_smp_prepare_boot_cpu()
x86/xen: split xen_cpu_die()
x86/xen: split off smp_hvm.c
x86/xen: split off smp_pv.c
x86/xen: split off mmu_hvm.c
x86/xen: split off mmu_pv.c
x86/xen: split suspend.c for PV and PVHVM guests x86/xen: put setup.c, pmu.c and apic.c under CONFIG_XEN_PV x86/xen: define startup_xen for XEN PV only
x86/xen: create stubs for HVM-only builds in page.h xen/balloon: decorate PV-only parts with #ifdef CONFIG_XEN_PV
xen: create xen_create/destroy_contiguous_region() stubs for PVHVM
only builds
x86/xen: enable PVHVM-only builds
x86/xen: rename some PV-only functions in smp_pv.c
arch/x86/include/asm/hypervisor.h | 3 +- arch/x86/include/asm/xen/page.h | 25 + arch/x86/kernel/cpu/hypervisor.c | 7 +- arch/x86/kernel/process_64.c | 2 +- arch/x86/xen/Kconfig | 33 +- arch/x86/xen/Makefile | 16 +- arch/x86/xen/enlighten.c | 1904 +------------------------ arch/x86/xen/enlighten_hvm.c | 210 +++ arch/x86/xen/enlighten_pv.c | 1561 +++++++++++++++++++++ arch/x86/xen/enlighten_pvh.c | 114 ++ arch/x86/xen/mmu.c | 2776 +------------------------------------ arch/x86/xen/mmu_hvm.c | 79 ++ arch/x86/xen/mmu_pv.c | 2635 +++++++++++++++++++++++++++++++++++ arch/x86/xen/pmu.h | 5 + arch/x86/xen/smp.c | 516 +------ arch/x86/xen/smp.h | 16 + arch/x86/xen/smp_hvm.c | 58 + arch/x86/xen/smp_pv.c | 499 +++++++ arch/x86/xen/suspend.c | 54 - arch/x86/xen/suspend_hvm.c | 22 + arch/x86/xen/suspend_pv.c | 44 + arch/x86/xen/xen-head.S | 4 + arch/x86/xen/xen-ops.h | 21 + drivers/xen/balloon.c | 30 +- include/xen/xen-ops.h | 14 + 25 files changed, 5461 insertions(+), 5187 deletions(-) create mode 100644 arch/x86/xen/enlighten_hvm.c create mode 100644 arch/x86/xen/enlighten_pv.c create mode 100644 arch/x86/xen/enlighten_pvh.c create mode 100644 arch/x86/xen/mmu_hvm.c create mode 100644 arch/x86/xen/mmu_pv.c create mode 100644 arch/x86/xen/smp_hvm.c create mode 100644 arch/x86/xen/smp_pv.c create mode 100644 arch/x86/xen/suspend_hvm.c create mode 100644 arch/x86/xen/suspend_pv.c
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
PATCH v2 1/21 x86/xen: separate PV and HVM hypervisors
As a preparation to splitting the code we need to untangle it:
x86_hyper_xen -> x86_hyper_xen_hvm and x86_hyper_xen_pv xen_platform() -> xen_platform_hvm() and xen_platform_pv() xen_cpu_up_prepare() -> xen_cpu_up_prepare_pv() and xen_cpu_up_prepare_hvm() xen_cpu_dead() -> xen_cpu_dead_pv() and xen_cpu_dead_pv_hvm()
Add two parameters to xen_cpuhp_setup() to pass proper cpu_up_prepare and cpu_dead hooks. xen_set_cpu_features() is now PV-only so the redundant xen_pv_domain() check can be dropped.
--- arch/x86/include/asm/hypervisor.h | 3 +- arch/x86/kernel/cpu/hypervisor.c | 3 +- arch/x86/xen/enlighten.c | 113 +++++++++++++++++++++++++------------- 3 files changed, 78 insertions(+), 41 deletions(-)
arch/x86/include/asm/hypervisor.h +2 -1
@@ -53,7 +53,8 @@ extern const struct hypervisor_x86 *x86_hyper;/* Recognized hypervisors */ extern const struct hypervisor_x86 x86_hyper_vmware;extern const struct hypervisor_x86 x86_hyper_ms_hyperv; -extern const struct hypervisor_x86 x86_hyper_xen; +extern const struct hypervisor_x86 x86_hyper_xen_pv; +extern const struct hypervisor_x86 x86_hyper_xen_hvm;extern const struct hypervisor_x86 x86_hyper_kvm;extern void init_hypervisor (struct cpuinfo_x86 *c);
arch/x86/kernel/cpu/hypervisor.c +2 -1
@@ -29,7 +29,8 @@static const __initconst struct hypervisor_x86 *const hypervisors[] = { #ifdef CONFIG_XEN - &x86_hyper_xen, + &x86_hyper_xen_pv, + &x86_hyper_xen_hvm, #endif &x86_hyper_vmware, &x86_hyper_ms_hyperv,
arch/x86/xen/enlighten.c +74 -39
190 lines not on this page · raw message
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Juergen Gross
maintainerRe: [PATCH v2 01/21] x86/xen: separate PV and HVM hypervisors
Quoted 234 lines · Vitaly Kuznetsov
As a preparation to splitting the code we need to untangle it:
x86_hyper_xen->x86_hyper_xen_hvmandx86_hyper_xen_pvxen_platform()->xen_platform_hvm()andxen_platform_pv()xen_cpu_up_prepare()->xen_cpu_up_prepare_pv()andxen_cpu_up_prepare_hvm()xen_cpu_dead()->xen_cpu_dead_pv()andxen_cpu_dead_pv_hvm()Add two parameters to
xen_cpuhp_setup()to pass propercpu_up_prepareandcpu_deadhooks.xen_set_cpu_features()is now PV-only so the redundantxen_pv_domain()check can be dropped.Signed-off-by Vitaly Kuznetsov <[email protected]>--- arch/x86/include/asm/hypervisor.h | 3 +- arch/x86/kernel/cpu/hypervisor.c | 3 +- arch/x86/xen/enlighten.c | 113 +++++++++++++++++++++++++------------- 3 files changed, 78 insertions(+), 41 deletions(-)arch/x86/include/asm/hypervisor.h +2
-1@@ -53,7 +53,8 @@ extern const struct hypervisor_x86 *x86_hyper;/* Recognized hypervisors */ extern const struct hypervisor_x86 x86_hyper_vmware;extern const struct hypervisor_x86 x86_hyper_ms_hyperv; -extern const struct hypervisor_x86 x86_hyper_xen; +extern const struct hypervisor_x86 x86_hyper_xen_pv; +extern const struct hypervisor_x86 x86_hyper_xen_hvm;extern const struct hypervisor_x86 x86_hyper_kvm;extern void init_hypervisor (struct cpuinfo_x86 *c);arch/x86/kernel/cpu/hypervisor.c +2
-1@@ -29,7 +29,8 @@static const __initconst struct hypervisor_x86 *const hypervisors[] = { #ifdef CONFIG_XEN - &x86_hyper_xen, + &x86_hyper_xen_pv, + &x86_hyper_xen_hvm, #endif &x86_hyper_vmware, &x86_hyper_ms_hyperv,arch/x86/xen/enlighten.c +65
-38@@ -139,9 +139,11 @@ void *xen_initial_gdt;RESERVE_BRK (shared_info_page_brk,PAGE_SIZE ); -static int xen_cpu_up_prepare (unsigned int cpu); +static int xen_cpu_up_prepare_pv (unsigned int cpu); +static int xen_cpu_up_prepare_hvm (unsigned int cpu);static int xen_cpu_up_online (unsigned int cpu); -static int xen_cpu_dead (unsigned int cpu); +static int xen_cpu_dead_pv (unsigned int cpu); +static int xen_cpu_dead_hvm (unsigned int cpu);/* * Point at some empty memory to start with. We map the real shared_info @@ -1447,13 +1449,14 @@ static void __init xen_dom0_set_legacy_features(void) x86_platform.legacy.rtc =1 ; } -static int xen_cpuhp_setup (void ) +static int xen_cpuhp_setup (int (*cpu_up_prepare_cb)(unsigned int ), +int (*cpu_dead_cb)(unsigned int )) {int rc; rc =cpuhp_setup_state_nocalls (CPUHP_XEN_PREPARE ,"x86/xen/hvm_guest:prepare" , - xen_cpu_up_prepare, xen_cpu_dead); + cpu_up_prepare_cb, cpu_dead_cb);if (rc >=0 ) { rc = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "x86/xen/hvm_guest:online",@@ -1559,7 +1562,7 @@ asmlinkage __visible void __init xen_start_kernel(void)possible map and a non-dummy shared_info. */ per_cpu (xen_vcpu,0 ) = &HYPERVISOR_shared_info->vcpu_info[0 ]; -WARN_ON (xen_cpuhp_setup ()); +WARN_ON (xen_cpuhp_setup (xen_cpu_up_prepare_pv, xen_cpu_dead_pv));local_irq_disable (); early_boot_irqs_disabled = true;@@ -1840,28 +1843,41 @@ static void __init init_hvm_pv_info(void) }#endif -static int xen_cpu_up_prepare (unsigned int cpu) +static int xen_cpu_up_prepare_pv (unsigned int cpu) {int rc; -if (xen_hvm_domain ()) { -/* -* This can happen if CPU was offlined earlier and -* offlining timed out in common_cpu_die(). -*/ -if (cpu_report_state (cpu) ==CPU_DEAD_FROZEN ) { -xen_smp_intr_free (cpu); -xen_uninit_lock_cpu (cpu); - } +xen_setup_timer (cpu); -if (cpu_acpi_id (cpu) !=U32_MAX ) -per_cpu (xen_vcpu_id, cpu) =cpu_acpi_id (cpu); -else -per_cpu (xen_vcpu_id, cpu) = cpu; -xen_vcpu_setup (cpu); + rc =xen_smp_intr_init (cpu); +if (rc) { +WARN (1 ,"xen_smp_intr_init() for CPU %d failed: %d\n" , + cpu, rc); +return rc; + } +return 0 ; +} + +static int xen_cpu_up_prepare_hvm (unsigned int cpu) +{ +int rc; + +/* +* This can happen if CPU was offlined earlier and +* offlining timed out in common_cpu_die(). +*/ +if (cpu_report_state (cpu) ==CPU_DEAD_FROZEN ) { +xen_smp_intr_free (cpu); +xen_uninit_lock_cpu (cpu); } -if (xen_pv_domain () ||xen_feature (XENFEAT_hvm_safe_pvclock)) +if (cpu_acpi_id (cpu) !=U32_MAX ) +per_cpu (xen_vcpu_id, cpu) =cpu_acpi_id (cpu); +else +per_cpu (xen_vcpu_id, cpu) = cpu; +xen_vcpu_setup (cpu); + +if (xen_feature (XENFEAT_hvm_safe_pvclock))xen_setup_timer (cpu); rc =xen_smp_intr_init (cpu);@@ -1873,16 +1889,25 @@ static int xen_cpu_up_prepare(unsigned int cpu)return 0 ; } -static int xen_cpu_dead (unsigned int cpu) +static int xen_cpu_dead_pv (unsigned int cpu) {xen_smp_intr_free (cpu); -if (xen_pv_domain () ||xen_feature (XENFEAT_hvm_safe_pvclock)) -xen_teardown_timer (cpu); +xen_teardown_timer (cpu);return 0 ; } +static int xen_cpu_dead_hvm (unsigned int cpu) +{ +xen_smp_intr_free (cpu); + +if (xen_feature (XENFEAT_hvm_safe_pvclock)) +xen_teardown_timer (cpu); + +return 0 ; +} +static int xen_cpu_up_online (unsigned int cpu) {xen_init_lock_cpu (cpu);@@ -1919,7 +1944,7 @@ static void __init xen_hvm_guest_init(void)BUG_ON (!xen_feature (XENFEAT_hvm_callback_vector));xen_hvm_smp_init (); -WARN_ON (xen_cpuhp_setup ()); +WARN_ON (xen_cpuhp_setup (xen_cpu_up_prepare_hvm, xen_cpu_dead_hvm));xen_unplug_emulated_devices (); x86_init.irqs.intr_init = xen_init_IRQ;xen_hvm_init_time_ops ();@@ -1942,9 +1967,17 @@ static __init int xen_parse_nopv(char *arg) }early_param ("xen_nopv" , xen_parse_nopv); -static uint32_t __init xen_platform (void ) +static uint32_t __init xen_platform_pv (void ) { -if (xen_nopv) +if (xen_pv_domain ()) +return xen_cpuid_base (); + +return 0 ; +} + +static uint32_t __init xen_platform_hvm (void ) +{ +if (xen_pv_domain () || xen_nopv)return 0 ;return xen_cpuid_base ();@@ -1966,10 +1999,8 @@ EXPORT_SYMBOL_GPL(xen_hvm_need_lapic);static void xen_set_cpu_features (struct cpuinfo_x86 *c) { -if (xen_pv_domain ()) { -clear_cpu_bug (c,X86_BUG_SYSRET_SS_ATTRS ); -set_cpu_cap (c,X86_FEATURE_XENPV ); - } +clear_cpu_bug (c,X86_BUG_SYSRET_SS_ATTRS ); +set_cpu_cap (c,X86_FEATURE_XENPV ); }static void xen_pin_vcpu (int cpu)@@ -2011,17 +2042,21 @@ static void xen_pin_vcpu(int cpu) } } -const struct hypervisor_x86 x86_hyper_xen = { - .name ="Xen" , - .detect = xen_platform, -#ifdef CONFIG_XEN_PVHVM - .init_platform = xen_hvm_guest_init, -#endif - .x2apic_available = xen_x2apic_para_available, +const struct hypervisor_x86 x86_hyper_xen_pv = { + .name ="Xen PV" , + .detect = xen_platform_pv, .set_cpu_features = xen_set_cpu_features,
arch/x86/xen/enlighten.c static void xen_pin_vcpu(int cpu) · line 2057
Quoted 10 lines
arch/x86/xen/enlighten.c +7
-1.pin_vcpu = xen_pin_vcpu, }; -EXPORT_SYMBOL (x86_hyper_xen); +EXPORT_SYMBOL (x86_hyper_xen_pv); + +const struct hypervisor_x86 x86_hyper_xen_hvm = { + .name ="Xen HVM" , + .detect = xen_platform_hvm, + .init_platform = xen_hvm_guest_init, + .x2apic_available = xen_x2apic_para_available,
Please keep the .pin_vcpu member. It will be needed for a PVH dom0.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH v2 2/21 x86/xen: globalize have_vcpu_info_placement
In reply to Vitaly Kuznetsovhave_vcpu_info_placement applies to both PV and HVM and as we're going to split the code we need to make it global.
Rename to xen_have_vcpu_info_placement.
--- arch/x86/xen/enlighten.c | 12 ++++++------ arch/x86/xen/xen-ops.h | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-)
arch/x86/xen/enlighten.c +6 -6
@@ -164,7 +164,7 @@ struct shared_info *HYPERVISOR_shared_info = &xen_dummy_shared_info;* * 0: not available, 1: available */ -static int have_vcpu_info_placement =1 ; +int xen_have_vcpu_info_placement =1 ;struct tls_descs {struct desc_struct desc[3 ];
@@ -228,7 +228,7 @@ void xen_vcpu_setup(int cpu)per_cpu (xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[xen_vcpu_nr (cpu)]; -if (!have_vcpu_info_placement) { +if (!xen_have_vcpu_info_placement) {if (cpu >=MAX_VIRT_CPUS )clamp_max_cpus ();return ;
@@ -251,7 +251,7 @@ void xen_vcpu_setup(int cpu)if (err) {printk (KERN_DEBUG "register_vcpu_info failed: err=%d\n" , err); - have_vcpu_info_placement =0 ; + xen_have_vcpu_info_placement =0 ;clamp_max_cpus (); }else {/* This cpu is using the registered vcpu info, even if
@@ -280,7 +280,7 @@ void xen_vcpu_restore(void)xen_setup_runstate_info (cpu); -if (have_vcpu_info_placement) +if (xen_have_vcpu_info_placement)xen_vcpu_setup (cpu); if (other_cpu && is_up &&
@@ -1159,7 +1159,7 @@ void xen_setup_vcpu_info_placement(void)* xen_vcpu_setup managed to place the vcpu_info within the * percpu area for all cpus, so make use of it. */ -if (have_vcpu_info_placement) { +if (xen_have_vcpu_info_placement) { pv_irq_ops.save_fl =__PV_IS_CALLEE_SAVE (xen_save_fl_direct); pv_irq_ops.restore_fl =__PV_IS_CALLEE_SAVE (xen_restore_fl_direct); pv_irq_ops.irq_disable =__PV_IS_CALLEE_SAVE (xen_irq_disable_direct);
@@ -1178,7 +1178,7 @@ static unsigned xen_patch(u8 type, u16 clobbers, void *insnbuf,#define SITE (op, x) \ case PARAVIRT_PATCH(op.x): \ - if (have_vcpu_info_placement) { \ + if (xen_have_vcpu_info_placement) { \ start = (char *)xen_##x##_direct; \ end = xen_##x##_direct_end; \ reloc = xen_##x##_direct_reloc; \
arch/x86/xen/xen-ops.h +2 -0
@@ -76,6 +76,8 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id);bool xen_vcpu_stolen (int vcpu); +extern int xen_have_vcpu_info_placement; +void xen_vcpu_setup (int cpu);void xen_setup_vcpu_info_placement (void );
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 02/21] x86/xen: globalize have_vcpu_info_placement
Quoted 6 lines · Vitaly Kuznetsov
have_vcpu_info_placementapplies to both PV and HVM and as we're going to split the code we need to make it global.Rename to
xen_have_vcpu_info_placement.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 02/21] x86/xen: globalize have_vcpu_info_placement
In reply to Vitaly KuznetsovQuoted 6 lines · Vitaly Kuznetsov
have_vcpu_info_placementapplies to both PV and HVM and as we're going to split the code we need to make it global.Rename to
xen_have_vcpu_info_placement.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
PATCH v2 3/21 x86/xen: add CONFIG_XEN_PV to Kconfig
In reply to Vitaly KuznetsovAll code to supprot Xen PV will get under this new option. For the beginning, check for it in the common code.
--- arch/x86/kernel/cpu/hypervisor.c | 4 +++- arch/x86/kernel/process_64.c | 2 +- arch/x86/xen/Kconfig | 23 ++++++++++++++++++----- 3 files changed, 22 insertions(+), 7 deletions(-)
arch/x86/kernel/cpu/hypervisor.c +3 -1
@@ -28,8 +28,10 @@static const __initconst struct hypervisor_x86 *const hypervisors[] = { -#ifdef CONFIG_XEN +#ifdef CONFIG_XEN_PV &x86_hyper_xen_pv, +#endif +#ifdef CONFIG_XEN_PVHVM &x86_hyper_xen_hvm, #endif &x86_hyper_vmware,
arch/x86/kernel/process_64.c +1 -1
@@ -438,7 +438,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) task_thread_info(prev_p)->flags & _TIF_WORK_CTXSW_PREV))__switch_to_xtra (prev_p, next_p, tss); -#ifdef CONFIG_XEN +#ifdef CONFIG_XEN_PV /* * On Xen PV, IOPL bits in pt_regs->flags have no effect, and * current_pt_regs()->flags may not match the current task's
arch/x86/xen/Kconfig +18 -5
@@ -6,7 +6,6 @@ config XEN bool "Xen guest support" depends on PARAVIRT select PARAVIRT_CLOCK - select XEN_HAVE_PVMMU select XEN_HAVE_VPMU depends on X86_64 || (X86_32 && X86_PAE) depends on X86_LOCAL_APIC && X86_TSC
@@ -15,18 +14,32 @@ config XEN kernel to boot in a paravirtualized environment under the Xen hypervisor. +config XEN_PV + bool "Xen PV guest support" + default y + depends on XEN + help + Support running as a Xen PV guest. + config XEN_DOM0 - def_bool y - depends on XEN && PCI_XEN && SWIOTLB_XEN + bool "Xen PV Dom0 support" + default y + depends on XEN_PV && PCI_XEN && SWIOTLB_XEN depends on X86_IO_APIC && ACPI && PCI + select XEN_HAVE_PVMMU + help + Support running as a Xen PV Dom0 guest. config XEN_PVHVM - def_bool y + bool "Xen PVHVM guest support" + default y depends on XEN && PCI && X86_LOCAL_APIC + help + Support running as a Xen PVHVM guest. config XEN_512GB bool "Limit Xen pv-domain memory to 512GB" - depends on XEN && X86_64 + depends on XEN_PV && X86_64 default y help Limit paravirtualized user domains to 512GB of RAM.
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Juergen Gross
maintainerRe: [PATCH v2 03/21] x86/xen: add CONFIG_XEN_PV to Kconfig
Quoted 1 line · Vitaly Kuznetsov
All code to supprot Xen PV will get under this new option. For the
s/supprot/support/
Quoted 51 lines
beginning, check for it in the common code.
Signed-off-by Vitaly Kuznetsov <[email protected]>--- arch/x86/kernel/cpu/hypervisor.c | 4 +++- arch/x86/kernel/process_64.c | 2 +- arch/x86/xen/Kconfig | 23 ++++++++++++++++++----- 3 files changed, 22 insertions(+), 7 deletions(-)arch/x86/kernel/cpu/hypervisor.c +3
-1@@ -28,8 +28,10 @@static const __initconst struct hypervisor_x86 *const hypervisors[] = { -#ifdef CONFIG_XEN +#ifdef CONFIG_XEN_PV &x86_hyper_xen_pv, +#endif +#ifdef CONFIG_XEN_PVHVM &x86_hyper_xen_hvm, #endif &x86_hyper_vmware,arch/x86/kernel/process_64.c +1
-1@@ -438,7 +438,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) task_thread_info(prev_p)->flags & _TIF_WORK_CTXSW_PREV))__switch_to_xtra (prev_p, next_p, tss); -#ifdef CONFIG_XEN +#ifdef CONFIG_XEN_PV /* * On Xen PV, IOPL bits in pt_regs->flags have no effect, and * current_pt_regs()->flags may not match the current task's arch/x86/xen/Kconfig +0
-1@@ -6,7 +6,6 @@ config XEN bool "Xen guest support" depends on PARAVIRT select PARAVIRT_CLOCK - select XEN_HAVE_PVMMU select XEN_HAVE_VPMU depends on X86_64 || (X86_32 && X86_PAE) depends on X86_LOCAL_APIC && X86_TSC
arch/x86/xen/Kconfig config XEN · line 20
Quoted 7 lines
arch/x86/xen/Kconfig +4
-0@@ -15,18 +14,32 @@ config XEN kernel to boot in a paravirtualized environment under the Xen hypervisor. +config XEN_PV + bool "Xen PV guest support" + default y + depends on XEN
select XEN_HAVE_PVMMU is missing ...
arch/x86/xen/Kconfig config XEN · line 29
Quoted 11 lines
arch/x86/xen/Kconfig +7
-2+ help + Support running as a Xen PV guest. + config XEN_DOM0 - def_bool y - depends on XEN && PCI_XEN && SWIOTLB_XEN + bool "Xen PV Dom0 support" + default y + depends on XEN_PV && PCI_XEN && SWIOTLB_XEN depends on X86_IO_APIC && ACPI && PCI + select XEN_HAVE_PVMMU
... and can be dropped here
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Juergen Gross
maintainerRe: [PATCH v2 03/21] x86/xen: add CONFIG_XEN_PV to Kconfig
In reply to Vitaly KuznetsovQuoted 1 line · Vitaly Kuznetsov
All code to supprot Xen PV will get under this new option. For the
s/supprot/support/
Quoted 51 lines
beginning, check for it in the common code.
Signed-off-by Vitaly Kuznetsov <[email protected]>--- arch/x86/kernel/cpu/hypervisor.c | 4 +++- arch/x86/kernel/process_64.c | 2 +- arch/x86/xen/Kconfig | 23 ++++++++++++++++++----- 3 files changed, 22 insertions(+), 7 deletions(-)arch/x86/kernel/cpu/hypervisor.c +3
-1@@ -28,8 +28,10 @@static const __initconst struct hypervisor_x86 *const hypervisors[] = { -#ifdef CONFIG_XEN +#ifdef CONFIG_XEN_PV &x86_hyper_xen_pv, +#endif +#ifdef CONFIG_XEN_PVHVM &x86_hyper_xen_hvm, #endif &x86_hyper_vmware,arch/x86/kernel/process_64.c +1
-1@@ -438,7 +438,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) task_thread_info(prev_p)->flags & _TIF_WORK_CTXSW_PREV))__switch_to_xtra (prev_p, next_p, tss); -#ifdef CONFIG_XEN +#ifdef CONFIG_XEN_PV /* * On Xen PV, IOPL bits in pt_regs->flags have no effect, and * current_pt_regs()->flags may not match the current task's arch/x86/xen/Kconfig +0
-1@@ -6,7 +6,6 @@ config XEN bool "Xen guest support" depends on PARAVIRT select PARAVIRT_CLOCK - select XEN_HAVE_PVMMU select XEN_HAVE_VPMU depends on X86_64 || (X86_32 && X86_PAE) depends on X86_LOCAL_APIC && X86_TSC
arch/x86/xen/Kconfig config XEN · line 20
Quoted 7 lines
arch/x86/xen/Kconfig +4
-0@@ -15,18 +14,32 @@ config XEN kernel to boot in a paravirtualized environment under the Xen hypervisor. +config XEN_PV + bool "Xen PV guest support" + default y + depends on XEN
select XEN_HAVE_PVMMU is missing ...
arch/x86/xen/Kconfig config XEN · line 29
Quoted 11 lines
arch/x86/xen/Kconfig +7
-2+ help + Support running as a Xen PV guest. + config XEN_DOM0 - def_bool y - depends on XEN && PCI_XEN && SWIOTLB_XEN + bool "Xen PV Dom0 support" + default y + depends on XEN_PV && PCI_XEN && SWIOTLB_XEN depends on X86_IO_APIC && ACPI && PCI + select XEN_HAVE_PVMMU
... and can be dropped here
Juergen
PATCH v2 4/21 x86/xen: split off enlighten_pvh.c
In reply to Vitaly KuznetsovCreate enlighten_pvh.c by splitting off PVH related code from enlighten.c, put it under CONFIG_XEN_PVH.
--- arch/x86/xen/Makefile | 2 + arch/x86/xen/enlighten.c | 110 ----------------------------------------- arch/x86/xen/enlighten_pvh.c | 114 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+), 110 deletions(-) create mode 100644 arch/x86/xen/enlighten_pvh.c
arch/x86/xen/Makefile +2 -0
@@ -15,6 +15,8 @@ obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ grant-table.o suspend.o platform-pci-unplug.o \ p2m.o apic.o pmu.o +obj-$(CONFIG_XEN_PVH) += enlighten_pvh.o + obj-$(CONFIG_EVENT_TRACING) += trace.o obj-$(CONFIG_SMP) += smp.o
arch/x86/xen/enlighten.c +0 -110
122 lines not on this page · raw message
arch/x86/xen/enlighten_pvh.c new file +114 -0
114 lines not on this page · raw message
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 04/21] x86/xen: split off enlighten_pvh.c
Quoted 4 lines · Vitaly Kuznetsov
Create
enlighten_pvh.cby splitting off PVH related code fromenlighten.c, put it underCONFIG_XEN_PVH.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 04/21] x86/xen: split off enlighten_pvh.c
In reply to Vitaly KuznetsovQuoted 4 lines · Vitaly Kuznetsov
Create
enlighten_pvh.cby splitting off PVH related code fromenlighten.c, put it underCONFIG_XEN_PVH.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
PATCH v2 5/21 x86/xen: split off enlighten_hvm.c
In reply to Vitaly KuznetsovMove PVHVM related code to enlighten_hvm.c. Three functions:xen_cpuhp_setup(), xen_reboot(), xen_emergency_restart() are shared, drop static qualifier from them. These functions will go to common code once it is split from enlighten.c.
--- arch/x86/xen/Makefile | 1 + arch/x86/xen/enlighten.c | 209 +----------------------------------------- arch/x86/xen/enlighten_hvm.c | 210 +++++++++++++++++++++++++++++++++++++++++++ arch/x86/xen/xen-ops.h | 6 ++ 4 files changed, 221 insertions(+), 205 deletions(-) create mode 100644 arch/x86/xen/enlighten_hvm.c
arch/x86/xen/Makefile +1 -0
@@ -15,6 +15,7 @@ obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ grant-table.o suspend.o platform-pci-unplug.o \ p2m.o apic.o pmu.o +obj-$(CONFIG_XEN_PVHVM) += enlighten_hvm.o obj-$(CONFIG_XEN_PVH) += enlighten_pvh.o obj-$(CONFIG_EVENT_TRACING) += trace.o
arch/x86/xen/enlighten.c +4 -205
279 lines not on this page · raw message
arch/x86/xen/enlighten_hvm.c new file +210 -0
210 lines not on this page · raw message
arch/x86/xen/xen-ops.h +6 -0
@@ -148,4 +148,10 @@ __visible void xen_adjust_exception_frame(void);extern int xen_panic_handler_init (void ); +extern int xen_cpuhp_setup (int (*cpu_up_prepare_cb)(unsigned int ), +int (*cpu_dead_cb)(unsigned int )); + +extern void xen_reboot (int reason); +extern void xen_emergency_restart (void ); +#endif /* XEN_OPS_H */
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 05/21] x86/xen: split off enlighten_hvm.c
Quoted 6 lines · Vitaly Kuznetsov
Move PVHVM related code to
enlighten_hvm.c. Three functions:xen_cpuhp_setup(),xen_reboot(),xen_emergency_restart()are shared, drop static qualifier from them. These functions will go to common code once it is split fromenlighten.c.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH v2 6/21 x86/xen: split off enlighten_pv.c
In reply to Vitaly KuznetsovBasically, enlighten.c is renamed to enlighten_pv.c and some code moved out to common enlighten.c.
--- arch/x86/xen/Makefile | 4 +- arch/x86/xen/enlighten.c | 1626 ++----------------------------------------- arch/x86/xen/enlighten_pv.c | 1552 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1596 insertions(+), 1586 deletions(-) create mode 100644 arch/x86/xen/enlighten_pv.c
arch/x86/xen/Makefile +2 -2
@@ -7,13 +7,13 @@ endif # Make sure early boot has no stackprotector nostackp := $(call cc-option, -fno-stack-protector) -CFLAGS_enlighten.o := $(nostackp) +CFLAGS_enlighten_pv.o := $(nostackp) CFLAGS_mmu.o := $(nostackp) obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ time.o xen-asm.o xen-asm_$(BITS).o \ grant-table.o suspend.o platform-pci-unplug.o \ - p2m.o apic.o pmu.o + p2m.o apic.o pmu.o enlighten_pv.o obj-$(CONFIG_XEN_PVHVM) += enlighten_hvm.o obj-$(CONFIG_XEN_PVH) += enlighten_pvh.o
arch/x86/xen/enlighten.c +42 -1584
1,677 lines not on this page · raw message
arch/x86/xen/enlighten_pv.c new file +1552 -0
1,308 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Part of the diff is not shown here. View the raw message.
Re: [PATCH v2 06/21] x86/xen: split off enlighten_pv.c
Quoted 4 lines · Vitaly Kuznetsov
Basically,
enlighten.cis renamed toenlighten_pv.cand some code moved out to commonenlighten.c.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
Re: [PATCH v2 06/21] x86/xen: split off enlighten_pv.c
In reply to Vitaly KuznetsovQuoted 4 lines · Vitaly Kuznetsov
Basically,
enlighten.cis renamed toenlighten_pv.cand some code moved out to commonenlighten.c.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH v2 7/21 x86/xen: split xen_smp_intr_init()/xen_smp_intr_free()
In reply to Vitaly Kuznetsovxen_smp_intr_init() and xen_smp_intr_free() have PV-specific code and as a praparatory change to splitting smp.c we need to split these fucntions. Create xen_smp_intr_init_pv()/xen_smp_intr_free_pv().
--- arch/x86/xen/enlighten_pv.c | 9 +++++++++ arch/x86/xen/smp.c | 29 ++++++++++++++++++----------- arch/x86/xen/smp.h | 8 ++++++++ 3 files changed, 35 insertions(+), 11 deletions(-)
arch/x86/xen/enlighten_pv.c +9 -0
@@ -1478,12 +1478,21 @@ static int xen_cpu_up_prepare_pv(unsigned int cpu) cpu, rc);return rc; } + + rc =xen_smp_intr_init_pv (cpu); +if (rc) { +WARN (1 ,"xen_smp_intr_init_pv() for CPU %d failed: %d\n" , + cpu, rc); +return rc; + } +return 0 ; }static int xen_cpu_dead_pv (unsigned int cpu) {xen_smp_intr_free (cpu); +xen_smp_intr_free_pv (cpu);xen_teardown_timer (cpu);
arch/x86/xen/smp.c +18 -11
@@ -132,9 +132,10 @@ void xen_smp_intr_free(unsigned int cpu)kfree (per_cpu (xen_callfuncsingle_irq, cpu).name);per_cpu (xen_callfuncsingle_irq, cpu).name =NULL ; } -if (xen_hvm_domain ()) -return ; +} +void xen_smp_intr_free_pv (unsigned int cpu) +{if (per_cpu (xen_irq_work, cpu).irq >=0 ) {unbind_from_irqhandler (per_cpu (xen_irq_work, cpu).irq,NULL );per_cpu (xen_irq_work, cpu).irq =-1 ;
@@ -148,11 +149,12 @@ void xen_smp_intr_free(unsigned int cpu)kfree (per_cpu (xen_pmu_irq, cpu).name);per_cpu (xen_pmu_irq, cpu).name =NULL ; } -}; +} +int xen_smp_intr_init (unsigned int cpu) {int rc; -char *resched_name, *callfunc_name, *debug_name, *pmu_name; +char *resched_name, *callfunc_name, *debug_name; resched_name =kasprintf (GFP_KERNEL ,"resched%d" , cpu); rc = bind_ipi_to_irqhandler(XEN_RESCHEDULE_VECTOR,
@@ -199,12 +201,17 @@ int xen_smp_intr_init(unsigned int cpu)per_cpu (xen_callfuncsingle_irq, cpu).irq = rc;per_cpu (xen_callfuncsingle_irq, cpu).name = callfunc_name; -/* -* The IRQ worker on PVHVM goes through the native path and uses the -* IPI mechanism. -*/ -if (xen_hvm_domain ()) -return 0 ; +return 0 ; + + fail: +xen_smp_intr_free (cpu); +return rc; +} + +int xen_smp_intr_init_pv (unsigned int cpu) +{ +int rc; +char *callfunc_name, *pmu_name; callfunc_name =kasprintf (GFP_KERNEL ,"irqwork%d" , cpu); rc = bind_ipi_to_irqhandler(XEN_IRQ_WORK_VECTOR,
@@ -233,7 +240,7 @@ int xen_smp_intr_init(unsigned int cpu)return 0 ; fail: -xen_smp_intr_free (cpu); +xen_smp_intr_free_pv (cpu);return rc; }
arch/x86/xen/smp.h +8 -0
@@ -11,6 +11,8 @@ extern void xen_send_IPI_self(int vector);extern int xen_smp_intr_init (unsigned int cpu);extern void xen_smp_intr_free (unsigned int cpu); +extern int xen_smp_intr_init_pv (unsigned int cpu); +extern void xen_smp_intr_free_pv (unsigned int cpu);#else /* CONFIG_SMP */
@@ -19,6 +21,12 @@ static inline int xen_smp_intr_init(unsigned int cpu)return 0 ; }static inline void xen_smp_intr_free (unsigned int cpu) {} + +static inline int xen_smp_intr_init_pv (unsigned int cpu) +{ +return 0 ; +} +static inline void xen_smp_intr_free_pv (unsigned int cpu) {}#endif /* CONFIG_SMP */ #endif
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 07/21] x86/xen: split xen_smp_intr_init()/xen_smp_intr_free()
Quoted 5 lines · Vitaly Kuznetsov
xen_smp_intr_init()andxen_smp_intr_free()have PV-specific code and as a praparatory change to splittingsmp.cwe need to split these fucntions. Create xen_smp_intr_init_pv()/xen_smp_intr_free_pv().Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 07/21] x86/xen: split xen_smp_intr_init()/xen_smp_intr_free()
In reply to Vitaly KuznetsovQuoted 5 lines · Vitaly Kuznetsov
xen_smp_intr_init()andxen_smp_intr_free()have PV-specific code and as a praparatory change to splittingsmp.cwe need to split these fucntions. Create xen_smp_intr_init_pv()/xen_smp_intr_free_pv().Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
PATCH v2 8/21 x86/xen: split xen_smp_prepare_boot_cpu()
In reply to Vitaly KuznetsovSplit xen_smp_prepare_boot_cpu() into xen_pv_smp_prepare_boot_cpu() and xen_hvm_smp_prepare_boot_cpu() to support further splitting of smp.c.
--- arch/x86/xen/smp.c | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-)
arch/x86/xen/smp.c +30 -19
@@ -296,35 +296,46 @@ static void __init xen_filter_cpu_maps(void) } -static void __init xen_smp_prepare_boot_cpu (void ) +static void __init xen_pv_smp_prepare_boot_cpu (void ) {BUG_ON (smp_processor_id () !=0 );native_smp_prepare_boot_cpu (); -if (xen_pv_domain ()) { -if (!xen_feature (XENFEAT_writable_page_tables)) -/* We've switched to the "real" per-cpu gdt, so make -* sure the old memory can be recycled. */ -make_lowmem_page_readwrite (xen_initial_gdt); +if (!xen_feature (XENFEAT_writable_page_tables)) +/* We've switched to the "real" per-cpu gdt, so make +* sure the old memory can be recycled. */ +make_lowmem_page_readwrite (xen_initial_gdt);#ifdef CONFIG_X86_32 -/* -* Xen starts us with XEN_FLAT_RING1_DS, but linux code -* expects __USER_DS -*/ -loadsegment (ds, __USER_DS); -loadsegment (es, __USER_DS); +/* +* Xen starts us with XEN_FLAT_RING1_DS, but linux code +* expects __USER_DS +*/ +loadsegment (ds, __USER_DS); +loadsegment (es, __USER_DS);#endif -xen_filter_cpu_maps (); -xen_setup_vcpu_info_placement (); - } +xen_filter_cpu_maps (); +xen_setup_vcpu_info_placement (); + +/* +* The alternative logic (which patches the unlock/lock) runs before +* the smp bootup up code is activated. Hence we need to set this up +* the core kernel is being patched. Otherwise we will have only +* modules patched but not core code. +*/ +xen_init_spinlocks (); +} + +static void __init xen_hvm_smp_prepare_boot_cpu (void ) +{ +BUG_ON (smp_processor_id () !=0 ); +native_smp_prepare_boot_cpu ();/* * Setup vcpu_info for boot CPU. */ -if (xen_hvm_domain ()) -xen_vcpu_setup (0 ); +xen_vcpu_setup (0 );/* * The alternative logic (which patches the unlock/lock) runs before
@@ -716,7 +727,7 @@ static irqreturn_t xen_irq_work_interrupt(int irq, void *dev_id) }static const struct smp_ops xen_smp_ops__initconst = { - .smp_prepare_boot_cpu = xen_smp_prepare_boot_cpu, + .smp_prepare_boot_cpu = xen_pv_smp_prepare_boot_cpu, .smp_prepare_cpus = xen_smp_prepare_cpus, .smp_cpus_done = xen_smp_cpus_done,
@@ -753,5 +764,5 @@ void __init xen_hvm_smp_init(void) smp_ops.cpu_die = xen_cpu_die; smp_ops.send_call_func_ipi = xen_smp_send_call_function_ipi; smp_ops.send_call_func_single_ipi = xen_smp_send_call_function_single_ipi; - smp_ops.smp_prepare_boot_cpu = xen_smp_prepare_boot_cpu; + smp_ops.smp_prepare_boot_cpu = xen_hvm_smp_prepare_boot_cpu; }
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 08/21] x86/xen: split xen_smp_prepare_boot_cpu()
Quoted 4 lines · Vitaly Kuznetsov
Split
xen_smp_prepare_boot_cpu()intoxen_pv_smp_prepare_boot_cpu()andxen_hvm_smp_prepare_boot_cpu()to support further splitting ofsmp.c.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 08/21] x86/xen: split xen_smp_prepare_boot_cpu()
In reply to Vitaly KuznetsovQuoted 4 lines · Vitaly Kuznetsov
Split
xen_smp_prepare_boot_cpu()intoxen_pv_smp_prepare_boot_cpu()andxen_hvm_smp_prepare_boot_cpu()to support further splitting ofsmp.c.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
PATCH v2 9/21 x86/xen: split xen_cpu_die()
In reply to Vitaly KuznetsovSplit xen_cpu_die() into xen_pv_cpu_die() and xen_hvm_cpu_die() to support further splitting of smp.c.
--- arch/x86/xen/smp.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-)
arch/x86/xen/smp.c +20 -6
@@ -513,10 +513,10 @@ static int xen_cpu_disable(void)return 0 ; } -static void xen_cpu_die (unsigned int cpu) +static void xen_pv_cpu_die (unsigned int cpu) { -while (xen_pv_domain () &&HYPERVISOR_vcpu_op (VCPUOP_is_up, -xen_vcpu_nr (cpu),NULL )) { +while (HYPERVISOR_vcpu_op (VCPUOP_is_up, +xen_vcpu_nr (cpu),NULL )) {__set_current_state (TASK_UNINTERRUPTIBLE );schedule_timeout (HZ /10 ); }
@@ -529,6 +529,15 @@ static void xen_cpu_die(unsigned int cpu) } } +static void xen_hvm_cpu_die (unsigned int cpu) +{ +if (common_cpu_die (cpu) ==0 ) { +xen_smp_intr_free (cpu); +xen_uninit_lock_cpu (cpu); +xen_teardown_timer (cpu); + } +} +static void xen_play_dead (void )/* used only with HOTPLUG_CPU */ {play_dead_common ();
@@ -551,7 +560,12 @@ static int xen_cpu_disable(void)return -ENOSYS ; } -static void xen_cpu_die (unsigned int cpu) +static void xen_pv_cpu_die (unsigned int cpu) +{ +BUG (); +} + +static void xen_hvm_cpu_die (unsigned int cpu) {BUG (); }
@@ -732,7 +746,7 @@ static const struct smp_ops xen_smp_ops __initconst = { .smp_cpus_done = xen_smp_cpus_done, .cpu_up = xen_cpu_up, - .cpu_die = xen_cpu_die, + .cpu_die = xen_pv_cpu_die, .cpu_disable = xen_cpu_disable, .play_dead = xen_play_dead,
@@ -761,7 +775,7 @@ void __init xen_hvm_smp_init(void) { smp_ops.smp_prepare_cpus = xen_hvm_smp_prepare_cpus; smp_ops.smp_send_reschedule = xen_smp_send_reschedule; - smp_ops.cpu_die = xen_cpu_die; + smp_ops.cpu_die = xen_hvm_cpu_die; smp_ops.send_call_func_ipi = xen_smp_send_call_function_ipi; smp_ops.send_call_func_single_ipi = xen_smp_send_call_function_single_ipi; smp_ops.smp_prepare_boot_cpu = xen_hvm_smp_prepare_boot_cpu;
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 09/21] x86/xen: split xen_cpu_die()
Quoted 4 lines · Vitaly Kuznetsov
Split
xen_cpu_die()intoxen_pv_cpu_die()andxen_hvm_cpu_die()to support further splitting ofsmp.c.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 09/21] x86/xen: split xen_cpu_die()
In reply to Vitaly KuznetsovQuoted 4 lines · Vitaly Kuznetsov
Split
xen_cpu_die()intoxen_pv_cpu_die()andxen_hvm_cpu_die()to support further splitting ofsmp.c.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
PATCH v2 10/21 x86/xen: split off smp_hvm.c
In reply to Vitaly KuznetsovMove PVHVM related code to smp_hvm.c. Drop 'static' qualifier from xen_smp_send_reschedule(), xen_smp_send_call_function_ipi(), xen_smp_send_call_function_single_ipi(), these functions will be moved to common smp code when smp_pv.c is split.
--- arch/x86/xen/Kconfig | 4 ++++ arch/x86/xen/Makefile | 1 + arch/x86/xen/smp.c | 57 +++---------------------------------------------- arch/x86/xen/smp.h | 3 +++ arch/x86/xen/smp_hvm.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 69 insertions(+), 54 deletions(-) create mode 100644 arch/x86/xen/smp_hvm.c
arch/x86/xen/Kconfig +4 -0
@@ -37,6 +37,10 @@ config XEN_PVHVM help Support running as a Xen PVHVM guest. +config XEN_PVHVM_SMP + def_bool y + depends on XEN_PVHVM && SMP + config XEN_512GB bool "Limit Xen pv-domain memory to 512GB" depends on XEN_PV && X86_64
arch/x86/xen/Makefile +1 -0
@@ -21,6 +21,7 @@ obj-$(CONFIG_XEN_PVH) += enlighten_pvh.o obj-$(CONFIG_EVENT_TRACING) += trace.o obj-$(CONFIG_SMP) += smp.o +obj-$(CONFIG_XEN_PVHVM_SMP) += smp_hvm.o obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o obj-$(CONFIG_XEN_DOM0) += vga.o
arch/x86/xen/smp.c +3 -54
96 lines not on this page · raw message
arch/x86/xen/smp.h +3 -0
@@ -14,6 +14,9 @@ extern void xen_smp_intr_free(unsigned int cpu);extern int xen_smp_intr_init_pv (unsigned int cpu);extern void xen_smp_intr_free_pv (unsigned int cpu); +extern void xen_smp_send_reschedule (int cpu); +extern void xen_smp_send_call_function_ipi (const struct cpumask *mask); +extern void xen_smp_send_call_function_single_ipi (int cpu);#else /* CONFIG_SMP */ static inline int xen_smp_intr_init (unsigned int cpu)
arch/x86/xen/smp_hvm.c new file +58 -0
58 lines not on this page · raw message
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 10/21] x86/xen: split off smp_hvm.c
Quoted 6 lines · Vitaly Kuznetsov
Move PVHVM related code to
smp_hvm.c. Drop 'static' qualifier fromxen_smp_send_reschedule(),xen_smp_send_call_function_ipi(),xen_smp_send_call_function_single_ipi(), these functions will be moved to common smp code whensmp_pv.cis split.Signed-off-by Vitaly Kuznetsov <[email protected]>
One nit below, with this addressed:
Quoted 15 lines
--- arch/x86/xen/Kconfig | 4 ++++ arch/x86/xen/Makefile | 1 + arch/x86/xen/smp.c | 57 +++---------------------------------------------- arch/x86/xen/smp.h | 3 +++ arch/x86/xen/smp_hvm.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 69 insertions(+), 54 deletions(-) create mode 100644 arch/x86/xen/smp_hvm.carch/x86/xen/smp.h +0
-0
arch/x86/xen/smp.h extern void xen_smp_intr_free(unsigned int cpu); · line 19
Quoted 6 lines
arch/x86/xen/smp.h +3
-0@@ -14,6 +14,9 @@ extern void xen_smp_intr_free(unsigned int cpu);extern int xen_smp_intr_init_pv (unsigned int cpu);extern void xen_smp_intr_free_pv (unsigned int cpu); +extern void xen_smp_send_reschedule (int cpu); +extern void xen_smp_send_call_function_ipi (const struct cpumask *mask); +extern void xen_smp_send_call_function_single_ipi (int cpu);
Could you please drop the "extern" qualifier when adding new function prototypes? I know this just follows the style of the file, but I'd prefer not to add new instances.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 10/21] x86/xen: split off smp_hvm.c
In reply to Vitaly KuznetsovQuoted 6 lines · Vitaly Kuznetsov
Move PVHVM related code to
smp_hvm.c. Drop 'static' qualifier fromxen_smp_send_reschedule(),xen_smp_send_call_function_ipi(),xen_smp_send_call_function_single_ipi(), these functions will be moved to common smp code whensmp_pv.cis split.Signed-off-by Vitaly Kuznetsov <[email protected]>
One nit below, with this addressed:
Quoted 15 lines
--- arch/x86/xen/Kconfig | 4 ++++ arch/x86/xen/Makefile | 1 + arch/x86/xen/smp.c | 57 +++---------------------------------------------- arch/x86/xen/smp.h | 3 +++ arch/x86/xen/smp_hvm.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 69 insertions(+), 54 deletions(-) create mode 100644 arch/x86/xen/smp_hvm.carch/x86/xen/smp.h +0
-0
arch/x86/xen/smp.h extern void xen_smp_intr_free(unsigned int cpu); · line 19
Quoted 6 lines
arch/x86/xen/smp.h +3
-0@@ -14,6 +14,9 @@ extern void xen_smp_intr_free(unsigned int cpu);extern int xen_smp_intr_init_pv (unsigned int cpu);extern void xen_smp_intr_free_pv (unsigned int cpu); +extern void xen_smp_send_reschedule (int cpu); +extern void xen_smp_send_call_function_ipi (const struct cpumask *mask); +extern void xen_smp_send_call_function_single_ipi (int cpu);
Could you please drop the "extern" qualifier when adding new function prototypes? I know this just follows the style of the file, but I'd prefer not to add new instances.
Juergen
PATCH v2 11/21 x86/xen: split off smp_pv.c
In reply to Vitaly KuznetsovBasically, smp.c is renamed to smp_pv.c and some code moved out to common smp.c. struct xen_common_irq delcaration ended up in smp.h.
--- arch/x86/xen/Makefile | 2 +- arch/x86/xen/smp.c | 487 +----------------------------------------------- arch/x86/xen/smp.h | 5 + arch/x86/xen/smp_pv.c | 499 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 508 insertions(+), 485 deletions(-) create mode 100644 arch/x86/xen/smp_pv.c
arch/x86/xen/Makefile +1 -1
@@ -20,7 +20,7 @@ obj-$(CONFIG_XEN_PVH) += enlighten_pvh.o obj-$(CONFIG_EVENT_TRACING) += trace.o -obj-$(CONFIG_SMP) += smp.o +obj-$(CONFIG_SMP) += smp.o smp_pv.o obj-$(CONFIG_XEN_PVHVM_SMP) += smp_hvm.o obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o
arch/x86/xen/smp.c +3 -484
526 lines not on this page · raw message
arch/x86/xen/smp.h +5 -0
@@ -17,6 +17,11 @@ extern void xen_smp_intr_free_pv(unsigned int cpu);extern void xen_smp_send_reschedule (int cpu);extern void xen_smp_send_call_function_ipi (const struct cpumask *mask);extern void xen_smp_send_call_function_single_ipi (int cpu); + +struct xen_common_irq { +int irq; +char *name; +};#else /* CONFIG_SMP */ static inline int xen_smp_intr_init (unsigned int cpu)
arch/x86/xen/smp_pv.c new file +499 -0
499 lines not on this page · raw message
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 11/21] x86/xen: split off smp_pv.c
Quoted 4 lines · Vitaly Kuznetsov
Basically,
smp.cis renamed tosmp_pv.cand some code moved out to commonsmp.c. structxen_common_irqdelcaration ended up insmp.h.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 11/21] x86/xen: split off smp_pv.c
In reply to Vitaly KuznetsovQuoted 4 lines · Vitaly Kuznetsov
Basically,
smp.cis renamed tosmp_pv.cand some code moved out to commonsmp.c. structxen_common_irqdelcaration ended up insmp.h.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
PATCH v2 12/21 x86/xen: split off mmu_hvm.c
In reply to Vitaly KuznetsovMove PVHVM related code to mmu_hvm.c.
--- arch/x86/xen/Makefile | 2 +- arch/x86/xen/mmu.c | 74 ---------------------------------------------- arch/x86/xen/mmu_hvm.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 75 deletions(-) create mode 100644 arch/x86/xen/mmu_hvm.c
arch/x86/xen/Makefile +1 -1
@@ -15,7 +15,7 @@ obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ grant-table.o suspend.o platform-pci-unplug.o \ p2m.o apic.o pmu.o enlighten_pv.o -obj-$(CONFIG_XEN_PVHVM) += enlighten_hvm.o +obj-$(CONFIG_XEN_PVHVM) += enlighten_hvm.o mmu_hvm.o obj-$(CONFIG_XEN_PVH) += enlighten_pvh.o obj-$(CONFIG_EVENT_TRACING) += trace.o
arch/x86/xen/mmu.c +0 -74
80 lines not on this page · raw message
arch/x86/xen/mmu_hvm.c new file +79 -0
79 lines not on this page · raw message
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 12/21] x86/xen: split off mmu_hvm.c
Quoted 3 lines · Vitaly Kuznetsov
Move PVHVM related code to
mmu_hvm.c.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 12/21] x86/xen: split off mmu_hvm.c
In reply to Vitaly KuznetsovQuoted 3 lines · Vitaly Kuznetsov
Move PVHVM related code to
mmu_hvm.c.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
PATCH v2 13/21 x86/xen: split off mmu_pv.c
In reply to Vitaly KuznetsovBasically, mmu.c is renamed to mmu_pv.c and some code moved out to common mmu.c.
--- arch/x86/xen/Makefile | 4 +- arch/x86/xen/mmu.c | 2702 +------------------------------------------------ arch/x86/xen/mmu_pv.c | 2635 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2674 insertions(+), 2667 deletions(-) create mode 100644 arch/x86/xen/mmu_pv.c
arch/x86/xen/Makefile +2 -2
@@ -8,12 +8,12 @@ endif # Make sure early boot has no stackprotector nostackp := $(call cc-option, -fno-stack-protector) CFLAGS_enlighten_pv.o := $(nostackp) -CFLAGS_mmu.o := $(nostackp) +CFLAGS_mmu_pv.o := $(nostackp) obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ time.o xen-asm.o xen-asm_$(BITS).o \ grant-table.o suspend.o platform-pci-unplug.o \ - p2m.o apic.o pmu.o enlighten_pv.o + p2m.o apic.o pmu.o enlighten_pv.o mmu_pv.o obj-$(CONFIG_XEN_PVHVM) += enlighten_hvm.o mmu_hvm.o obj-$(CONFIG_XEN_PVH) += enlighten_pvh.o
arch/x86/xen/mmu.c +37 -2665
2,737 lines not on this page · raw message
arch/x86/xen/mmu_pv.c new file +2635 -0
249 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Part of the diff is not shown here. View the raw message.
Re: [PATCH v2 13/21] x86/xen: split off mmu_pv.c
Quoted 4 lines · Vitaly Kuznetsov
Basically,
mmu.cis renamed tommu_pv.cand some code moved out to commonmmu.c.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 13/21] x86/xen: split off mmu_pv.c
In reply to Vitaly KuznetsovQuoted 4 lines · Vitaly Kuznetsov
Basically,
mmu.cis renamed tommu_pv.cand some code moved out to commonmmu.c.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
PATCH v2 14/21 x86/xen: split suspend.c for PV and PVHVM guests
In reply to Vitaly KuznetsovSlit the code in suspend.c into suspend_pv.c and suspend_hvm.c.
--- arch/x86/xen/Makefile | 3 ++- arch/x86/xen/suspend.c | 54 ---------------------------------------------- arch/x86/xen/suspend_hvm.c | 22 +++++++++++++++++++ arch/x86/xen/suspend_pv.c | 44 +++++++++++++++++++++++++++++++++++++ arch/x86/xen/xen-ops.h | 13 +++++++++++ 5 files changed, 81 insertions(+), 55 deletions(-) create mode 100644 arch/x86/xen/suspend_hvm.c create mode 100644 arch/x86/xen/suspend_pv.c
arch/x86/xen/Makefile +2 -1
@@ -15,7 +15,8 @@ obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ grant-table.o suspend.o platform-pci-unplug.o \ p2m.o apic.o pmu.o enlighten_pv.o mmu_pv.o -obj-$(CONFIG_XEN_PVHVM) += enlighten_hvm.o mmu_hvm.o +obj-$(CONFIG_XEN_PVHVM) += enlighten_hvm.o mmu_hvm.o suspend_hvm.o +obj-$(CONFIG_XEN_PV) += suspend_pv.o obj-$(CONFIG_XEN_PVH) += enlighten_pvh.o obj-$(CONFIG_EVENT_TRACING) += trace.o
arch/x86/xen/suspend.c +0 -54
60 lines not on this page · raw message
arch/x86/xen/suspend_hvm.c new file +22 -0
@@ -0,0 +1,22 @@ +#include <linux/types.h> + +#include <xen/xen.h> +#include <xen/features.h> +#include <xen/interface/features.h> + +#include "xen-ops.h" + +void xen_hvm_post_suspend (int suspend_cancelled) +{ +int cpu; + +if (!suspend_cancelled) +xen_hvm_init_shared_info (); +xen_callback_vector (); +xen_unplug_emulated_devices (); +if (xen_feature (XENFEAT_hvm_safe_pvclock)) { +for_each_online_cpu (cpu) { +xen_setup_runstate_info (cpu); + } + } +}
arch/x86/xen/suspend_pv.c new file +44 -0
44 lines not on this page · raw message
arch/x86/xen/xen-ops.h +13 -0
@@ -153,5 +153,18 @@ extern int xen_cpuhp_setup(int (*cpu_up_prepare_cb)(unsigned int),extern void xen_reboot (int reason);extern void xen_emergency_restart (void ); +#ifdef CONFIG_XEN_PV +extern void xen_pv_pre_suspend (void ); +extern void xen_pv_post_suspend (int suspend_cancelled); +#else +static inline void xen_pv_pre_suspend (void ) {} +static inline void xen_pv_post_suspend (int suspend_cancelled) {} +#endif + +#ifdef CONFIG_XEN_PVHVM +extern void xen_hvm_post_suspend (int suspend_cancelled); +#else +static inline void xen_hvm_post_suspend (int suspend_cancelled) {} +#endif #endif /* XEN_OPS_H */
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
kbuild test robot
build botRe: [Xen-devel] [PATCH v2 14/21] x86/xen: split suspend.c for PV and PVHVM guests
reproduce:
Hi Vitaly,
[auto build test ERROR on xen-tip/linux-next]
[also build test ERROR on next-20170303]
[cannot apply to v4.10]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Vitaly-Kuznetsov/x86-xen-untangle-PV-and-PVHVM-guest-support-code/20170305-162950 base: https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git linux-next config: x86_64-randconfig-i0-03021655 (attached as .config) compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4 reproduce: # save the attached .config to linux build tree make ARCH=x86_64
All errors (new ones prefixed by >>):
arch/x86/xen/suspend_pv.c: In function 'xen_pv_pre_suspend':
>> arch/x86/xen/suspend_pv.c:19:2: error: implicit declaration of function 'fix_to_virt' [-Werror=implicit-function-declaration]
if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
^
In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from arch/x86/xen/suspend_pv.c:1:
>> arch/x86/xen/suspend_pv.c:19:47: error: 'FIX_PARAVIRT_BOOTMAP' undeclared (first use in this function)
if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
^
include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^
arch/x86/xen/suspend_pv.c:19:2: note: in expansion of macro 'if'
if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
^
arch/x86/xen/suspend_pv.c:19:47: note: each undeclared identifier is reported only once for each function it appears in
if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
^
include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^
arch/x86/xen/suspend_pv.c:19:2: note: in expansion of macro 'if'
if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
^cc1: some warnings being treated as errors
vim +/fix_to_virt +19 arch/x86/xen/suspend_pv.c
13 xen_start_info->console.domU.mfn =
14 mfn_to_pfn(xen_start_info->console.domU.mfn);
15
16 BUG_ON(!irqs_disabled());
17
18 HYPERVISOR_shared_info = &xen_dummy_shared_info;
> 19 if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
20 __pte_ma(0), 0))
21 BUG();
22 }---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
kbuild test robot
build botRe: [PATCH v2 14/21] x86/xen: split suspend.c for PV and PVHVM guests
In reply to Vitaly Kuznetsovreproduce:
Hi Vitaly,
[auto build test ERROR on xen-tip/linux-next]
[also build test ERROR on next-20170303]
[cannot apply to v4.10]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Vitaly-Kuznetsov/x86-xen-untangle-PV-and-PVHVM-guest-support-code/20170305-162950 base: https://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git linux-next config: x86_64-randconfig-i0-03021655 (attached as .config) compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4 reproduce: # save the attached .config to linux build tree make ARCH=x86_64
All errors (new ones prefixed by >>):
arch/x86/xen/suspend_pv.c: In function 'xen_pv_pre_suspend':
>> arch/x86/xen/suspend_pv.c:19:2: error: implicit declaration of function 'fix_to_virt' [-Werror=implicit-function-declaration]
if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
^
In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from arch/x86/xen/suspend_pv.c:1:
>> arch/x86/xen/suspend_pv.c:19:47: error: 'FIX_PARAVIRT_BOOTMAP' undeclared (first use in this function)
if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
^
include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^
arch/x86/xen/suspend_pv.c:19:2: note: in expansion of macro 'if'
if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
^
arch/x86/xen/suspend_pv.c:19:47: note: each undeclared identifier is reported only once for each function it appears in
if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
^
include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^
arch/x86/xen/suspend_pv.c:19:2: note: in expansion of macro 'if'
if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
^cc1: some warnings being treated as errors
vim +/fix_to_virt +19 arch/x86/xen/suspend_pv.c
13 xen_start_info->console.domU.mfn =
14 mfn_to_pfn(xen_start_info->console.domU.mfn);
15
16 BUG_ON(!irqs_disabled());
17
18 HYPERVISOR_shared_info = &xen_dummy_shared_info;
> 19 if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
20 __pte_ma(0), 0))
21 BUG();
22 }---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH v2 15/21 x86/xen: put setup.c, pmu.c and apic.c under CONFIG_XEN_PV
In reply to Vitaly Kuznetsovxen_pmu_init/finish() functions are used in suspend.c and enlighten.c, add stubs for now.
--- arch/x86/xen/Kconfig | 2 +- arch/x86/xen/Makefile | 6 +++--- arch/x86/xen/pmu.h | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-)
arch/x86/xen/Kconfig +1 -1
@@ -6,7 +6,6 @@ config XEN bool "Xen guest support" depends on PARAVIRT select PARAVIRT_CLOCK - select XEN_HAVE_VPMU depends on X86_64 || (X86_32 && X86_PAE) depends on X86_LOCAL_APIC && X86_TSC help
@@ -18,6 +17,7 @@ config XEN_PV bool "Xen PV guest support" default y depends on XEN + select XEN_HAVE_VPMU help Support running as a Xen PV guest.
arch/x86/xen/Makefile +3 -3
@@ -10,13 +10,13 @@ nostackp := $(call cc-option, -fno-stack-protector) CFLAGS_enlighten_pv.o := $(nostackp) CFLAGS_mmu_pv.o := $(nostackp) -obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ +obj-y := enlighten.o multicalls.o mmu.o irq.o \ time.o xen-asm.o xen-asm_$(BITS).o \ grant-table.o suspend.o platform-pci-unplug.o \ - p2m.o apic.o pmu.o enlighten_pv.o mmu_pv.o + p2m.o enlighten_pv.o mmu_pv.o obj-$(CONFIG_XEN_PVHVM) += enlighten_hvm.o mmu_hvm.o suspend_hvm.o -obj-$(CONFIG_XEN_PV) += suspend_pv.o +obj-$(CONFIG_XEN_PV) += setup.o apic.o pmu.o suspend_pv.o obj-$(CONFIG_XEN_PVH) += enlighten_pvh.o obj-$(CONFIG_EVENT_TRACING) += trace.o
arch/x86/xen/pmu.h +5 -0
@@ -4,8 +4,13 @@#include <xen/interface/xenpmu.h> irqreturn_t xen_pmu_irq_handler (int irq,void *dev_id); +#ifdef CONFIG_XEN_HAVE_VPMU void xen_pmu_init (int cpu);void xen_pmu_finish (int cpu); +#else +static inline void xen_pmu_init (int cpu) {} +static inline void xen_pmu_finish (int cpu) {} +#endif bool is_xen_pmu (int cpu);bool pmu_msr_read (unsigned int msr,uint64_t *val,int *err);bool pmu_msr_write (unsigned int msr,uint32_t low,uint32_t high,int *err);
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
PATCH v2 16/21 x86/xen: define startup_xen for XEN PV only
In reply to Vitaly Kuznetsovstartup_xen references PV-only code, decorate it with #ifdef CONFIG_XEN_PV to make PV-free builds possible.
--- arch/x86/xen/xen-head.S | 4 ++++ 1 file changed, 4 insertions(+)
arch/x86/xen/xen-head.S +4 -0
@@ -16,6 +16,7 @@ #include <xen/interface/xen-mca.h> #include <asm/xen/interface.h> +#ifdef CONFIG_XEN_PV __INIT ENTRY(startup_xen) cld
@@ -34,6 +35,7 @@ ENTRY(startup_xen) jmp xen_start_kernel __FINIT +#endif .pushsection .text .balign PAGE_SIZE
@@ -58,7 +60,9 @@ ENTRY(hypercall_page) /* Map the p2m table to a 512GB-aligned user address. */ ELFNOTE(Xen, XEN_ELFNOTE_INIT_P2M, .quad PGDIR_SIZE) #endif +#ifdef CONFIG_XEN_PV ELFNOTE(Xen, XEN_ELFNOTE_ENTRY, _ASM_PTR startup_xen) +#endif ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page) ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .ascii "!writable_page_tables|pae_pgdir_above_4gb")
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 16/21] x86/xen: define startup_xen for XEN PV only
Quoted 4 lines · Vitaly Kuznetsov
startup_xenreferences PV-only code, decorate it with #ifdefCONFIG_XEN_PVto make PV-free builds possible.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 16/21] x86/xen: define startup_xen for XEN PV only
In reply to Vitaly KuznetsovQuoted 4 lines · Vitaly Kuznetsov
startup_xenreferences PV-only code, decorate it with #ifdefCONFIG_XEN_PVto make PV-free builds possible.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
PATCH v2 17/21 x86/xen: create stubs for HVM-only builds in page.h
In reply to Vitaly Kuznetsov__pfn_to_mfn() is only used from PV code (mmu_pv.c, p2m.c) and from page.h where all functions calling it check for xen_feature(XENFEAT_auto_translated_physmap) first so we can replace it with any stub to make build happy.
set_foreign_p2m_mapping()/clear_foreign_p2m_mapping() are used from grant-table.c but only if !xen_feature(XENFEAT_auto_translated_physmap).
--- arch/x86/include/asm/xen/page.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
arch/x86/include/asm/xen/page.h +25 -0
@@ -51,12 +51,30 @@ extern bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn);extern unsigned long __init set_phys_range_identity (unsigned long pfn_s,unsigned long pfn_e); +#ifdef CONFIG_XEN_PV extern int set_foreign_p2m_mapping (struct gnttab_map_grant_ref *map_ops,struct gnttab_map_grant_ref *kmap_ops,struct page **pages,unsigned int count);extern int clear_foreign_p2m_mapping (struct gnttab_unmap_grant_ref *unmap_ops,struct gnttab_unmap_grant_ref *kunmap_ops,struct page **pages,unsigned int count); +#else +static inline int +set_foreign_p2m_mapping (struct gnttab_map_grant_ref *map_ops, +struct gnttab_map_grant_ref *kmap_ops, +struct page **pages,unsigned int count) +{ +return 0 ; +} + +static inline int +clear_foreign_p2m_mapping (struct gnttab_unmap_grant_ref *unmap_ops, +struct gnttab_unmap_grant_ref *kunmap_ops, +struct page **pages,unsigned int count) +{ +return 0 ; +} +#endif /* * Helper functions to write or read unsigned long values to/from
@@ -72,6 +90,7 @@ static inline int xen_safe_read_ulong(unsigned long *addr, unsigned long *val)return __get_user (*val, (unsigned long __user *)addr); } +#ifdef CONFIG_XEN_PV /* * When to use pfn_to_mfn(), __pfn_to_mfn() or get_phys_to_machine(): * - pfn_to_mfn() returns either INVALID_P2M_ENTRY or the mfn. No indicator
@@ -98,6 +117,12 @@ static inline unsigned long __pfn_to_mfn(unsigned long pfn) return mfn; } +#else +static inline unsigned long __pfn_to_mfn (unsigned long pfn) +{ +return pfn; +} +#endif static inline unsigned long pfn_to_mfn (unsigned long pfn) {
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 17/21] x86/xen: create stubs for HVM-only builds in page.h
Quoted 9 lines · Vitaly Kuznetsov
__pfn_to_mfn()is only used from PV code (mmu_pv.c,p2m.c) and frompage.hwhere all functions calling it check forxen_feature(XENFEAT_auto_translated_physmap)first so we can replace it with any stub to make build happy.set_foreign_p2m_mapping()/clear_foreign_p2m_mapping() are used from
grant-table.cbut only if !xen_feature(XENFEAT_auto_translated_physmap).Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 17/21] x86/xen: create stubs for HVM-only builds in page.h
In reply to Vitaly KuznetsovQuoted 9 lines · Vitaly Kuznetsov
__pfn_to_mfn()is only used from PV code (mmu_pv.c,p2m.c) and frompage.hwhere all functions calling it check forxen_feature(XENFEAT_auto_translated_physmap)first so we can replace it with any stub to make build happy.set_foreign_p2m_mapping()/clear_foreign_p2m_mapping() are used from
grant-table.cbut only if !xen_feature(XENFEAT_auto_translated_physmap).Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
PATCH v2 18/21 xen/balloon: decorate PV-only parts with #ifdef CONFIG_XEN_PV
In reply to Vitaly KuznetsovBalloon driver uses several PV-only concepts (xen_start_info, xen_extra_mem,..) and it seems the simpliest solution to make HVM-only build happy is to decorate these parts with #ifdefs.
--- drivers/xen/balloon.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-)
drivers/xen/balloon.c +20 -10
@@ -708,6 +708,7 @@ void free_xenballooned_pages(int nr_pages, struct page **pages) }EXPORT_SYMBOL (free_xenballooned_pages); +#ifdef CONFIG_XEN_PV static void __init balloon_add_region (unsigned long start_pfn,unsigned long pages) {
@@ -731,19 +732,22 @@ static void __init balloon_add_region(unsigned long start_pfn, balloon_stats.total_pages += extra_pfn_end - start_pfn; } +#endif static int __init balloon_init (void ) { -int i; -if (!xen_domain ())return -ENODEV ;pr_info ("Initialising balloon driver\n" ); +#ifdef CONFIG_XEN_PV balloon_stats.current_pages =xen_pv_domain () ?min (xen_start_info->nr_pages - xen_released_pages, max_pfn) :get_num_physpages (); +#else + balloon_stats.current_pages =get_num_physpages (); +#endif balloon_stats.target_pages = balloon_stats.current_pages; balloon_stats.balloon_low =0 ; balloon_stats.balloon_high =0 ;
@@ -760,14 +764,20 @@ static int __init balloon_init(void)register_sysctl_table (xen_root);#endif -/* -* Initialize the balloon with pages from the extra memory -* regions (see arch/x86/xen/setup.c). -*/ -for (i =0 ; i <XEN_EXTRA_MEM_MAX_REGIONS ; i++) -if (xen_extra_mem[i].n_pfns) -balloon_add_region (xen_extra_mem[i].start_pfn, - xen_extra_mem[i].n_pfns); +#ifdef CONFIG_XEN_PV + { +int i; + +/* +* Initialize the balloon with pages from the extra memory +* regions (see arch/x86/xen/setup.c). +*/ +for (i =0 ; i <XEN_EXTRA_MEM_MAX_REGIONS ; i++) +if (xen_extra_mem[i].n_pfns) +balloon_add_region (xen_extra_mem[i].start_pfn, + xen_extra_mem[i].n_pfns); + } +#endif return 0 ; }
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 18/21] xen/balloon: decorate PV-only parts with #ifdef CONFIG_XEN_PV
Quoted 5 lines · Vitaly Kuznetsov
Balloon driver uses several PV-only concepts (
xen_start_info,xen_extra_mem,..) and it seems the simpliest solution to make HVM-only build happy is to decorate these parts with #ifdefs.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 18/21] xen/balloon: decorate PV-only parts with #ifdef CONFIG_XEN_PV
In reply to Vitaly KuznetsovQuoted 5 lines · Vitaly Kuznetsov
Balloon driver uses several PV-only concepts (
xen_start_info,xen_extra_mem,..) and it seems the simpliest solution to make HVM-only build happy is to decorate these parts with #ifdefs.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
PATCH v2 19/21 xen: create xen_create/destroy_contiguous_region() stubs for PVHVM only builds
In reply to Vitaly Kuznetsovxen_create_contiguous_region()/xen_create_contiguous_region() are PV-only, they both contain xen_feature(XENFEAT_auto_translated_physmap) check and bail in the very beginning.
--- include/xen/xen-ops.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
include/xen/xen-ops.h +14 -0
@@ -34,11 +34,25 @@ u64 xen_steal_clock(int cpu);int xen_setup_shutdown_event (void );extern unsigned long *xen_contiguous_bitmap; + +#ifdef CONFIG_XEN_PV int xen_create_contiguous_region (phys_addr_t pstart,unsigned int order,unsigned int address_bits,dma_addr_t *dma_handle);void xen_destroy_contiguous_region (phys_addr_t pstart,unsigned int order); +#else +static inline int xen_create_contiguous_region (phys_addr_t pstart, +unsigned int order, +unsigned int address_bits, +dma_addr_t *dma_handle) +{ +return 0 ; +} + +static inline void xen_destroy_contiguous_region (phys_addr_t pstart, +unsigned int order) { } +#endif struct vm_area_struct ;
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 19/21] xen: create xen_create/destroy_contiguous_region() stubs for PVHVM only builds
Quoted 5 lines · Vitaly Kuznetsov
xen_create_contiguous_region()/xen_create_contiguous_region() are PV-only, they both contain
xen_feature(XENFEAT_auto_translated_physmap)check and bail in the very beginning.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 19/21] xen: create xen_create/destroy_contiguous_region() stubs for PVHVM only builds
In reply to Vitaly KuznetsovQuoted 5 lines · Vitaly Kuznetsov
xen_create_contiguous_region()/xen_create_contiguous_region() are PV-only, they both contain
xen_feature(XENFEAT_auto_translated_physmap)check and bail in the very beginning.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
PATCH v2 20/21 x86/xen: enable PVHVM-only builds
In reply to Vitaly KuznetsovNow everything is in place and we can move PV-only code under CONFIG_XEN_PV. CONFIG_XEN_PV_SMP is created to support the change.
--- arch/x86/xen/Kconfig | 4 ++++ arch/x86/xen/Makefile | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-)
arch/x86/xen/Kconfig +4 -0
@@ -21,6 +21,10 @@ config XEN_PV help Support running as a Xen PV guest. +config XEN_PV_SMP + def_bool y + depends on XEN_PV && SMP + config XEN_DOM0 bool "Xen PV Dom0 support" default y
arch/x86/xen/Makefile +5 -4
@@ -12,16 +12,17 @@ CFLAGS_mmu_pv.o := $(nostackp) obj-y := enlighten.o multicalls.o mmu.o irq.o \ time.o xen-asm.o xen-asm_$(BITS).o \ - grant-table.o suspend.o platform-pci-unplug.o \ - p2m.o enlighten_pv.o mmu_pv.o + grant-table.o suspend.o platform-pci-unplug.o obj-$(CONFIG_XEN_PVHVM) += enlighten_hvm.o mmu_hvm.o suspend_hvm.o -obj-$(CONFIG_XEN_PV) += setup.o apic.o pmu.o suspend_pv.o +obj-$(CONFIG_XEN_PV) += setup.o apic.o pmu.o suspend_pv.o \ + p2m.o enlighten_pv.o mmu_pv.o obj-$(CONFIG_XEN_PVH) += enlighten_pvh.o obj-$(CONFIG_EVENT_TRACING) += trace.o -obj-$(CONFIG_SMP) += smp.o smp_pv.o +obj-$(CONFIG_SMP) += smp.o +obj-$(CONFIG_XEN_PV_SMP) += smp_pv.o obj-$(CONFIG_XEN_PVHVM_SMP) += smp_hvm.o obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 20/21] x86/xen: enable PVHVM-only builds
Quoted 4 lines · Vitaly Kuznetsov
Now everything is in place and we can move PV-only code under
CONFIG_XEN_PV.CONFIG_XEN_PV_SMPis created to support the change.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 20/21] x86/xen: enable PVHVM-only builds
In reply to Vitaly KuznetsovQuoted 4 lines · Vitaly Kuznetsov
Now everything is in place and we can move PV-only code under
CONFIG_XEN_PV.CONFIG_XEN_PV_SMPis created to support the change.Signed-off-by Vitaly Kuznetsov <[email protected]>
Juergen
PATCH v2 21/21 x86/xen: rename some PV-only functions in smp_pv.c
In reply to Vitaly KuznetsovAfter code split between PV and HVM some functions in xen_smp_ops have xen_pv_ prefix and some only xen_ which makes them look like they're common for both PV and HVM while they're not. Rename all the rest to have xen_pv_ prefix.
---
- This patch is rather a matter of taste and it makes code archeology slightly harder, we may consider dropping it from the series.
--- arch/x86/xen/smp_pv.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
arch/x86/xen/smp_pv.c +14 -14
@@ -220,7 +220,7 @@ static void __init xen_pv_smp_prepare_boot_cpu(void)xen_init_spinlocks (); } -static void __init xen_smp_prepare_cpus (unsigned int max_cpus) +static void __init xen_pv_smp_prepare_cpus (unsigned int max_cpus) {unsigned cpu;unsigned int i;
@@ -336,7 +336,7 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)return 0 ; } -static int xen_cpu_up (unsigned int cpu,struct task_struct *idle) +static int xen_pv_cpu_up (unsigned int cpu,struct task_struct *idle) {int rc;
@@ -370,12 +370,12 @@ static int xen_cpu_up(unsigned int cpu, struct task_struct *idle)return 0 ; } -static void xen_smp_cpus_done (unsigned int max_cpus) +static void xen_pv_smp_cpus_done (unsigned int max_cpus) { }#ifdef CONFIG_HOTPLUG_CPU -static int xen_cpu_disable (void ) +static int xen_pv_cpu_disable (void ) {unsigned int cpu =smp_processor_id ();if (cpu ==0 )
@@ -403,7 +403,7 @@ static void xen_pv_cpu_die(unsigned int cpu) } } -static void xen_play_dead (void )/* used only with HOTPLUG_CPU */ +static void xen_pv_play_dead (void )/* used only with HOTPLUG_CPU */ {play_dead_common ();HYPERVISOR_vcpu_op (VCPUOP_down,xen_vcpu_nr (smp_processor_id ()),NULL );
@@ -420,7 +420,7 @@ static void xen_play_dead(void) /* used only with HOTPLUG_CPU */ }#else /* !CONFIG_HOTPLUG_CPU */ -static int xen_cpu_disable (void ) +static int xen_pv_cpu_disable (void ) {return -ENOSYS ; }
@@ -430,7 +430,7 @@ static void xen_pv_cpu_die(unsigned int cpu)BUG (); } -static void xen_play_dead (void ) +static void xen_pv_play_dead (void ) {BUG (); }
@@ -450,7 +450,7 @@ static void stop_self(void *v)BUG (); } -static void xen_stop_other_cpus (int wait) +static void xen_pv_stop_other_cpus (int wait) {smp_call_function (stop_self,NULL , wait); }
@@ -477,15 +477,15 @@ static irqreturn_t xen_irq_work_interrupt(int irq, void *dev_id)static const struct smp_ops xen_smp_ops__initconst = { .smp_prepare_boot_cpu = xen_pv_smp_prepare_boot_cpu, - .smp_prepare_cpus = xen_smp_prepare_cpus, - .smp_cpus_done = xen_smp_cpus_done, + .smp_prepare_cpus = xen_pv_smp_prepare_cpus, + .smp_cpus_done = xen_pv_smp_cpus_done, - .cpu_up = xen_cpu_up, + .cpu_up = xen_pv_cpu_up, .cpu_die = xen_pv_cpu_die, - .cpu_disable = xen_cpu_disable, - .play_dead = xen_play_dead, + .cpu_disable = xen_pv_cpu_disable, + .play_dead = xen_pv_play_dead, - .stop_other_cpus = xen_stop_other_cpus, + .stop_other_cpus = xen_pv_stop_other_cpus, .smp_send_reschedule = xen_smp_send_reschedule, .send_call_func_ipi = xen_smp_send_call_function_ipi,
Signature · 7 lines
2.9.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH v2 21/21] x86/xen: rename some PV-only functions in smp_pv.c
Quoted 9 lines · Vitaly Kuznetsov
After code split between PV and HVM some functions in
xen_smp_opshavexen_pv_prefix and some onlyxen_which makes them look like they're common for both PV and HVM while they're not. Rename all the rest to havexen_pv_prefix.Signed-off-by Vitaly Kuznetsov <[email protected]>---
- This patch is rather a matter of taste and it makes code archeology slightly harder, we may consider dropping it from the series.
I'm fine with this change.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v2 21/21] x86/xen: rename some PV-only functions in smp_pv.c
In reply to Vitaly KuznetsovQuoted 9 lines · Vitaly Kuznetsov
After code split between PV and HVM some functions in
xen_smp_opshavexen_pv_prefix and some onlyxen_which makes them look like they're common for both PV and HVM while they're not. Rename all the rest to havexen_pv_prefix.Signed-off-by Vitaly Kuznetsov <[email protected]>---
- This patch is rather a matter of taste and it makes code archeology slightly harder, we may consider dropping it from the series.
I'm fine with this change.
Juergen
Boris Ostrovsky
reviewerQuoted 12 lines · Vitaly Kuznetsov
Changes since v1:
- Patches 1,2 and 3 were split and reordered to avoid adding temporary #ifdefs [Juergen Gross]
- Juergen's R-b added to what is now patches 14 and 15 (patches 4 and 5 in v1). Due to re-ordering there are some tiny diffrences but I opted for keeping the tag.Some patches are known to produce checkpatch.pl WARNINGS and a couple of ERRORs, I fixed a few (mostly in _hvm* code I split) and I refrained from fixing the rest to make it easier to review. I think that we may leave PV code as it is as sooner or later it will go away.
Quoted 5 lines
Original description:
I have a long-standing idea to separate PV and PVHVM code in kernel and introduce
Kconfigoptions to make it possible to enable the required parts only breaking the current 'all or nothing' approach.
I tried applying this to mainline and it failed at some point. Is there a branch i can pull from?
Thanks.
-boris
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Boris Ostrovsky
reviewerQuoted 12 lines · Vitaly Kuznetsov
Changes since v1:
- Patches 1,2 and 3 were split and reordered to avoid adding temporary #ifdefs [Juergen Gross]
- Juergen's R-b added to what is now patches 14 and 15 (patches 4 and 5 in v1). Due to re-ordering there are some tiny diffrences but I opted for keeping the tag.Some patches are known to produce checkpatch.pl WARNINGS and a couple of ERRORs, I fixed a few (mostly in _hvm* code I split) and I refrained from fixing the rest to make it easier to review. I think that we may leave PV code as it is as sooner or later it will go away.
Quoted 5 lines
Original description:
I have a long-standing idea to separate PV and PVHVM code in kernel and introduce
Kconfigoptions to make it possible to enable the required parts only breaking the current 'all or nothing' approach.
I tried applying this to mainline and it failed at some point. Is there a branch i can pull from?
Thanks.
-boris
Quoted 13 lines · Boris Ostrovsky
Quoted 12 lines · Vitaly Kuznetsov
Changes since v1:
- Patches 1,2 and 3 were split and reordered to avoid adding temporary #ifdefs [Juergen Gross]
- Juergen's R-b added to what is now patches 14 and 15 (patches 4 and 5 in v1). Due to re-ordering there are some tiny diffrences but I opted for keeping the tag.Some patches are known to produce checkpatch.pl WARNINGS and a couple of ERRORs, I fixed a few (mostly in _hvm* code I split) and I refrained from fixing the rest to make it easier to review. I think that we may leave PV code as it is as sooner or later it will go away.
Quoted 9 lines
Quoted 5 lines
Original description:
I have a long-standing idea to separate PV and PVHVM code in kernel and introduce
Kconfigoptions to make it possible to enable the required parts only breaking the current 'all or nothing' approach.I tried applying this to mainline and it failed at some point. Is there a branch i can pull from?
Sorry for the delayed response, I was on vacation last week.
Just pushed this series to github, you can pull it from
https://github.com/vittyvk/linux.git (xen_pv_hvm_split_v2 branch)
I'll be rebasing and addressing Juergen's and kbuild's comments this week.
Signature · 6 lines
Vitaly _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 13 lines · Boris Ostrovsky
Quoted 12 lines · Vitaly Kuznetsov
Changes since v1:
- Patches 1,2 and 3 were split and reordered to avoid adding temporary #ifdefs [Juergen Gross]
- Juergen's R-b added to what is now patches 14 and 15 (patches 4 and 5 in v1). Due to re-ordering there are some tiny diffrences but I opted for keeping the tag.Some patches are known to produce checkpatch.pl WARNINGS and a couple of ERRORs, I fixed a few (mostly in _hvm* code I split) and I refrained from fixing the rest to make it easier to review. I think that we may leave PV code as it is as sooner or later it will go away.
Quoted 9 lines
Quoted 5 lines
Original description:
I have a long-standing idea to separate PV and PVHVM code in kernel and introduce
Kconfigoptions to make it possible to enable the required parts only breaking the current 'all or nothing' approach.I tried applying this to mainline and it failed at some point. Is there a branch i can pull from?
Sorry for the delayed response, I was on vacation last week.
Just pushed this series to github, you can pull it from
https://github.com/vittyvk/linux.git (xen_pv_hvm_split_v2 branch)
I'll be rebasing and addressing Juergen's and kbuild's comments this week.
Signature · 1 line
Vitaly