[Xen-devel] [PATCH v2 14/21] x86/xen: split suspend.c for PV and PVHVM guests

2017-03-02 Thread Vitaly Kuznetsov
Slit the code in suspend.c into suspend_pv.c and suspend_hvm.c. Reviewed-by: Juergen Gross Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/Makefile | 3 ++- arch/x86/xen/suspend.c | 54 -- arch/x86/xen/suspend_hvm.c | 22

[Xen-devel] [PATCH v2 12/21] x86/xen: split off mmu_hvm.c

2017-03-02 Thread Vitaly Kuznetsov
Move PVHVM related code to mmu_hvm.c. Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/Makefile | 2 +- arch/x86/xen/mmu.c | 74 -- arch/x86/xen/mmu_hvm.c | 79 ++ 3 files changed, 80 insertions

[Xen-devel] [PATCH v2 18/21] xen/balloon: decorate PV-only parts with #ifdef CONFIG_XEN_PV

2017-03-02 Thread 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 --- drivers/xen/balloon.c | 30 -- 1 file changed

[Xen-devel] [PATCH v2 21/21] x86/xen: rename some PV-only functions in smp_pv.c

2017-03-02 Thread Vitaly Kuznetsov
After 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. Signed-off-by: Vitaly Kuznetsov --- - This patch i

[Xen-devel] [PATCH v2 06/21] x86/xen: split off enlighten_pv.c

2017-03-02 Thread Vitaly Kuznetsov
Basically, enlighten.c is renamed to enlighten_pv.c and some code moved out to common enlighten.c. Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/Makefile |4 +- arch/x86/xen/enlighten.c| 1626 ++- arch/x86/xen/enlighten_pv.c | 1552

[Xen-devel] [PATCH v2 17/21] x86/xen: create stubs for HVM-only builds in page.h

2017-03-02 Thread Vitaly Kuznetsov
-table.c but only if !xen_feature(XENFEAT_auto_translated_physmap). Signed-off-by: Vitaly Kuznetsov --- arch/x86/include/asm/xen/page.h | 25 + 1 file changed, 25 insertions(+) diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h index 33cbd3d

[Xen-devel] [PATCH v2 20/21] x86/xen: enable PVHVM-only builds

2017-03-02 Thread Vitaly Kuznetsov
Now 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. Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/Kconfig | 4 arch/x86/xen/Makefile | 9 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git

Re: [Xen-devel] [RFC PATCH] mm, hotplug: get rid of auto_online_blocks

2017-03-13 Thread Vitaly Kuznetsov
Michal Hocko writes: > On Mon 13-03-17 11:55:54, Igor Mammedov wrote: >> > > >> > >- suggested RFC is not acceptable from virt point of view >> > > as it regresses guests on top of x86 kvm/vmware which >> > > both use ACPI based memory hotplug. >> > > >> > >- u

Re: [Xen-devel] [PATCH v2 00/21] x86/xen: untangle PV and PVHVM guest support code

2017-03-13 Thread Vitaly Kuznetsov
Boris Ostrovsky writes: > On 03/02/2017 12:53 PM, Vitaly Kuznetsov wrote: >> 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 (patc

Re: [Xen-devel] [RFC PATCH] mm, hotplug: get rid of auto_online_blocks

2017-03-13 Thread Vitaly Kuznetsov
Michal Hocko writes: > On Mon 13-03-17 13:54:59, Vitaly Kuznetsov wrote: >> Michal Hocko writes: >> >> > On Mon 13-03-17 11:55:54, Igor Mammedov wrote: >> >> > > >> >> > >- suggested RFC is not acceptable from virt point of

Re: [Xen-devel] [RFC PATCH] mm, hotplug: get rid of auto_online_blocks

2017-03-13 Thread Vitaly Kuznetsov
Michal Hocko writes: > On Mon 13-03-17 14:42:37, Vitaly Kuznetsov wrote: >> > >> > What is the API those guests ask for the memory? And who is actually >> > responsible to ask for that memory? Is it a kernel or userspace >> > solution? >> >>

[Xen-devel] [PATCH v3 08/21] x86/xen: split xen_smp_prepare_boot_cpu()

2017-03-14 Thread Vitaly Kuznetsov
Split 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. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Juergen Gross --- arch/x86/xen/smp.c | 49 ++--- 1 file changed

[Xen-devel] [PATCH v3 05/21] x86/xen: split off enlighten_hvm.c

2017-03-14 Thread 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 from enlighten.c. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Juergen Gross

[Xen-devel] [PATCH v3 02/21] x86/xen: globalize have_vcpu_info_placement

2017-03-14 Thread Vitaly Kuznetsov
have_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. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Juergen Gross --- arch/x86/xen/enlighten.c | 12 ++-- arch/x86/xen/xen-ops.h

[Xen-devel] [PATCH v3 09/21] x86/xen: split xen_cpu_die()

2017-03-14 Thread Vitaly Kuznetsov
Split xen_cpu_die() into xen_pv_cpu_die() and xen_hvm_cpu_die() to support further splitting of smp.c. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Juergen Gross --- arch/x86/xen/smp.c | 26 -- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/arch/x86/xen

[Xen-devel] [PATCH v3 07/21] x86/xen: split xen_smp_intr_init()/xen_smp_intr_free()

2017-03-14 Thread Vitaly Kuznetsov
xen_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(). Signed-off-by: Vitaly Kuznetsov Reviewed-by: Juergen Gross --- Changes since v2: 'e

[Xen-devel] [PATCH v3 01/21] x86/xen: separate PV and HVM hypervisors

2017-03-14 Thread Vitaly Kuznetsov
ead_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. Signed-off-by: Vitaly Kuznetsov --- Changes since v2: .pin_vcpu kept for x86_h

[Xen-devel] [PATCH v3 03/21] x86/xen: add CONFIG_XEN_PV to Kconfig

2017-03-14 Thread Vitaly Kuznetsov
All code to support Xen PV will get under this new option. For the beginning, check for it in the common code. Signed-off-by: Vitaly Kuznetsov --- Changes since v2: select XEN_HAVE_PVMMU moved to config XEN_PV [Juergen Gross] --- arch/x86/kernel/cpu/hypervisor.c | 4 +++- arch/x86/kernel

[Xen-devel] [PATCH v3 04/21] x86/xen: split off enlighten_pvh.c

2017-03-14 Thread Vitaly Kuznetsov
Create enlighten_pvh.c by splitting off PVH related code from enlighten.c, put it under CONFIG_XEN_PVH. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Juergen Gross --- Changes since v2: #include added [kbuild test robot] --- arch/x86/xen/Makefile| 2 + arch/x86/xen/enlighten.c

[Xen-devel] [PATCH v3 00/21] x86/xen: untangle PV and PVHVM guest support code

2017-03-14 Thread Vitaly Kuznetsov
sable 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

[Xen-devel] [PATCH v3 12/21] x86/xen: split off mmu_hvm.c

2017-03-14 Thread Vitaly Kuznetsov
Move PVHVM related code to mmu_hvm.c. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Juergen Gross --- arch/x86/xen/Makefile | 2 +- arch/x86/xen/mmu.c | 74 -- arch/x86/xen/mmu_hvm.c | 79 ++ 3

[Xen-devel] [PATCH v3 06/21] x86/xen: split off enlighten_pv.c

2017-03-14 Thread Vitaly Kuznetsov
Basically, enlighten.c is renamed to enlighten_pv.c and some code moved out to common enlighten.c. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Juergen Gross --- Changes since v2: xen_pin_vcpu() left in enlighten.c --- arch/x86/xen/Makefile |4 +- arch/x86/xen/enlighten.c

[Xen-devel] [PATCH v3 11/21] x86/xen: split off smp_pv.c

2017-03-14 Thread Vitaly Kuznetsov
Basically, 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. Reviewed-by: Juergen Gross Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/Makefile | 2 +- arch/x86/xen/smp.c| 488

[Xen-devel] [PATCH v3 17/21] x86/xen: create stubs for HVM-only builds in page.h

2017-03-14 Thread Vitaly Kuznetsov
-table.c but only if !xen_feature(XENFEAT_auto_translated_physmap). Signed-off-by: Vitaly Kuznetsov Reviewed-by: Juergen Gross --- arch/x86/include/asm/xen/page.h | 25 + 1 file changed, 25 insertions(+) diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm

[Xen-devel] [PATCH v3 20/21] x86/xen: enable PVHVM-only builds

2017-03-14 Thread Vitaly Kuznetsov
Now 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. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Juergen Gross --- arch/x86/xen/Kconfig | 4 arch/x86/xen/Makefile | 9 + 2 files changed, 9 insertions

[Xen-devel] [PATCH v3 16/21] x86/xen: define startup_xen for XEN PV only

2017-03-14 Thread Vitaly Kuznetsov
startup_xen references PV-only code, decorate it with #ifdef CONFIG_XEN_PV to make PV-free builds possible. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Juergen Gross --- arch/x86/xen/xen-head.S | 4 1 file changed, 4 insertions(+) diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen

[Xen-devel] [PATCH v3 18/21] xen/balloon: decorate PV-only parts with #ifdef CONFIG_XEN_PV

2017-03-14 Thread 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 Reviewed-by: Juergen Gross --- drivers/xen/balloon.c | 30

[Xen-devel] [PATCH v3 21/21] x86/xen: rename some PV-only functions in smp_pv.c

2017-03-14 Thread Vitaly Kuznetsov
After 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. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Jue

[Xen-devel] [PATCH v3 15/21] x86/xen: put setup.c, pmu.c and apic.c under CONFIG_XEN_PV

2017-03-14 Thread Vitaly Kuznetsov
xen_pmu_init/finish() functions are used in suspend.c and enlighten.c, add stubs for now. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Juergen Gross --- arch/x86/xen/Kconfig | 2 +- arch/x86/xen/Makefile | 6 +++--- arch/x86/xen/pmu.h| 5 + 3 files changed, 9 insertions(+), 4

[Xen-devel] [PATCH v3 14/21] x86/xen: split suspend.c for PV and PVHVM guests

2017-03-14 Thread Vitaly Kuznetsov
Slit the code in suspend.c into suspend_pv.c and suspend_hvm.c. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Juergen Gross --- Changes since v2: #include added to suspend_pv.c [kbuild test robot] --- arch/x86/xen/Makefile | 3 ++- arch/x86/xen/suspend.c | 54

[Xen-devel] [PATCH v3 19/21] xen: create xen_create/destroy_contiguous_region() stubs for PVHVM only builds

2017-03-14 Thread 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 Reviewed-by: Juergen Gross --- include/xen/xen-ops.h | 14 ++ 1 file

[Xen-devel] [PATCH v3 10/21] x86/xen: split off smp_hvm.c

2017-03-14 Thread Vitaly Kuznetsov
Move 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. Signed-off-by: Vitaly Kuznetsov Reviewed-b

[Xen-devel] [PATCH 0/2] libxl: fix soft reset for PVHv2 guests

2017-03-20 Thread Vitaly Kuznetsov
init_hvm_pv_info(); + /* Detect PVH booting after kexec */ + xen_detect_pvh(); + xen_hvm_init_shared_info(); xen_panic_handler_init(); With the hack I was able to do kdump on a PVHv2 guest. I'll start a separate mail thread to discuss how we should do it right. Vitaly Kuzn

[Xen-devel] [PATCH 1/2] libxl: don't try to rename dm save file for PVH

2017-03-20 Thread Vitaly Kuznetsov
Guests with LIBXL_DEVICE_MODEL_VERSION_NONE don't have a device model running so there is no save file to rename. Signed-off-by: Vitaly Kuznetsov --- tools/libxl/libxl_create.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/libxl/libxl_creat

[Xen-devel] [PATCH 2/2] libxl: preserve console tty across soft reset

2017-03-20 Thread Vitaly Kuznetsov
uests serial console through QEMU is usually in use and for PVH we don't have it. Signed-off-by: Vitaly Kuznetsov --- tools/libxl/libxl_console.c | 5 - tools/libxl/libxl_create.c | 8 +++- tools/libxl/libxl_internal.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --g

[Xen-devel] [RFC] xen/pvh: detect PVH after kexec

2017-03-20 Thread Vitaly Kuznetsov
a CPUID leaf or something like that? Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/enlighten.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index ec1d5c4..4a30886 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/

Re: [Xen-devel] [RFC] xen/pvh: detect PVH after kexec

2017-03-21 Thread Vitaly Kuznetsov
Boris Ostrovsky writes: > On 03/20/2017 02:20 PM, Vitaly Kuznetsov wrote: >> PVH guests after kexec boot like normal HVM guests and we're not entering >> xen_prepare_pvh() > > Is it not? Aren't we going via xen_hvm_shutdown() and then > SHUTDOWN_soft_reset whi

Re: [Xen-devel] [RFC] xen/pvh: detect PVH after kexec

2017-03-21 Thread Vitaly Kuznetsov
Roger Pau Monne writes: > On Tue, Mar 21, 2017 at 10:21:52AM +0100, Vitaly Kuznetsov wrote: >> Boris Ostrovsky writes: >> >> > On 03/20/2017 02:20 PM, Vitaly Kuznetsov wrote: >> >> PVH guests after kexec boot like normal HVM guests and we're not enterin

Re: [Xen-devel] [RFC] xen/pvh: detect PVH after kexec

2017-03-21 Thread Vitaly Kuznetsov
Boris Ostrovsky writes: > On 03/21/2017 08:13 AM, Roger Pau Monne wrote: >> On Tue, Mar 21, 2017 at 12:53:07PM +0100, Vitaly Kuznetsov wrote: >>> Roger Pau Monne writes: >>> >>>> On Tue, Mar 21, 2017 at 10:21:52AM +0100, Vitaly Kuznetsov wrote: >>&g

Re: [Xen-devel] [RFC] xen/pvh: detect PVH after kexec

2017-03-21 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Roger Pau Monne writes: > >> On Tue, Mar 21, 2017 at 10:21:52AM +0100, Vitaly Kuznetsov wrote: >>> Boris Ostrovsky writes: >>> >>> > On 03/20/2017 02:20 PM, Vitaly Kuznetsov wrote: >>> >> PVH guests after

Re: [Xen-devel] [RFC] xen/pvh: detect PVH after kexec

2017-03-21 Thread Vitaly Kuznetsov
Boris Ostrovsky writes: > On 03/21/2017 10:44 AM, Vitaly Kuznetsov wrote: >> Vitaly Kuznetsov writes: >> >>> Roger Pau Monne writes: >>> >>>> On Tue, Mar 21, 2017 at 10:21:52AM +0100, Vitaly Kuznetsov wrote: >>>>> Boris Ostrovsky w

Re: [Xen-devel] [PATCH 0/2] libxl: fix soft reset for PVHv2 guests

2017-03-22 Thread Vitaly Kuznetsov
Wei Liu writes: > On Mon, Mar 20, 2017 at 07:03:09PM +0100, Vitaly Kuznetsov wrote: >> Vitaly Kuznetsov (2): >> libxl: don't try to rename dm save file for PVH > > I've pushed this patch. > >> libxl: preserve console tty across soft reset >>

[Xen-devel] [PATCH v2 1/2] libxl: preserve console tty across soft reset

2017-03-22 Thread Vitaly Kuznetsov
uests serial console through QEMU is usually in use and for PVH we don't have it. Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - Use libxl__xs_read_mandatory() instead of xs_read() [Wei Liu] Signed-off-by: Vitaly Kuznetsov --- tools/libxl/libxl_console.c | 5 - tools/libxl/libxl

[Xen-devel] [PATCH v2 0/2] libxl: fix soft reset for PVHv2 guests

2017-03-22 Thread Vitaly Kuznetsov
- Use libxl__xs_read_mandatory() instead of xs_read() [Wei Liu] - Follow-up PATCH2 added to make do_domain_soft_reset () consistent. Vitaly Kuznetsov (2): libxl: preserve console tty across soft reset libxl: use libxl__xs_read_checked() instead or raw xs_read() in do_domain_soft_reset()

[Xen-devel] [PATCH v2 2/2] libxl: use libxl__xs_read_checked() instead or raw xs_read() in do_domain_soft_reset()

2017-03-22 Thread Vitaly Kuznetsov
Replace raw xs_read() calls with libxl__xs_read_checked() and bail on error. Signed-off-by: Vitaly Kuznetsov --- tools/libxl/libxl_create.c | 26 -- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c

Re: [Xen-devel] [PATCH v11 5/5] xen/arm: account for stolen ticks

2015-11-06 Thread Vitaly Kuznetsov
David Vrabel writes: > On 06/11/15 11:39, Stefano Stabellini wrote: >> On Thu, 5 Nov 2015, Mark Rutland wrote: static void xen_percpu_init(void) { struct vcpu_register_vcpu_info info; @@ -104,6 +120,8 @@ static void xen_percpu_init(void) BUG_ON(err); per_c

Re: [Xen-devel] [PATCH v11 5/5] xen/arm: account for stolen ticks

2015-11-06 Thread Vitaly Kuznetsov
Mark Rutland writes: > On Fri, Nov 06, 2015 at 11:41:49AM +, David Vrabel wrote: >> On 06/11/15 11:39, Stefano Stabellini wrote: >> > On Thu, 5 Nov 2015, Mark Rutland wrote: >> >>> static void xen_percpu_init(void) >> >>> { >> >>> struct vcpu_register_vcpu_info info; >> >>> @@ -104

Re: [Xen-devel] [PATCH] xen/events: Always allocate legacy interrupts on PV guests

2015-11-18 Thread Vitaly Kuznetsov
Boris Ostrovsky writes: > After commit 8c058b0b9c34 ("x86/irq: Probe for PIC presence before > allocating descs for legacy IRQs") early_irq_init() will no longer > preallocate descriptors for legacy interrupts if PIT does not > exist. PIC? > > Therefore we need to allocate those descriptors for

Re: [Xen-devel] [PATCH] xen/events: Always allocate legacy interrupts on PV guests

2015-11-18 Thread Vitaly Kuznetsov
Boris Ostrovsky writes: > On 11/18/2015 06:16 AM, Vitaly Kuznetsov wrote: >> Boris Ostrovsky writes: >> >>> After commit 8c058b0b9c34 ("x86/irq: Probe for PIC presence before >>> allocating descs for legacy IRQs") early_irq_init() will no longer >&g

Re: [Xen-devel] [PATCH RFC 2/4] xen: grant_table: implement grant_table_soft_reset()

2015-06-08 Thread Vitaly Kuznetsov
"Jan Beulich" writes: On 03.06.15 at 15:35, wrote: >> When soft reset is being performed we need to replace all actively >> granted pages with empty pages to prevent possible future memory >> corruption as the newly started kernel won't be aware of these >> granted pages. >> >> We make the

Re: [Xen-devel] [PATCH RFC 1/4] xen: evtchn: make evtchn_reset() ready for soft reset

2015-06-08 Thread Vitaly Kuznetsov
"Jan Beulich" writes: On 03.06.15 at 15:35, wrote: >> --- a/xen/common/event_channel.c >> +++ b/xen/common/event_channel.c >> @@ -274,11 +274,13 @@ static long >> evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind) >> >> lchn->u.interdomain.remote_dom = rd; >> lchn->u.int

Re: [Xen-devel] [PATCH RFC 4/4] xen: arch-specific hooks for domain_soft_reset()

2015-06-08 Thread Vitaly Kuznetsov
"Jan Beulich" writes: On 03.06.15 at 15:35, wrote: >> +int arch_domain_soft_reset(struct domain *d) >> +{ >> +struct page_info *page = virt_to_page(d->shared_info), *new_page; >> +int ret = 0; >> +struct domain *owner; >> +unsigned long mfn, mfn_new, gfn; >> +p2m_type_t

Re: [Xen-devel] [PATCH RFC 4/4] xen: arch-specific hooks for domain_soft_reset()

2015-06-22 Thread Vitaly Kuznetsov
Tim Deegan writes: > At 15:35 +0200 on 03 Jun (1433345722), Vitaly Kuznetsov wrote: >> x86-specific hook cleans up the pirq-emuirq mappings and replaces the >> shared_info frame with an empty page to support subsequent >> XENMAPSPACE_shared_info call. > > That'

Re: [Xen-devel] [PATCH RFC 3/4] xen: implement SCHEDOP_soft_reset

2015-06-22 Thread Vitaly Kuznetsov
"Jan Beulich" writes: On 03.06.15 at 15:35, wrote: >> @@ -1129,8 +1129,9 @@ void unmap_vcpu_info(struct vcpu *v) >> mfn = v->vcpu_info_mfn; >> unmap_domain_page_global((void *) >> ((unsigned long)v->vcpu_info & PAGE_MASK)); >> - >> -v->vcpu_info =

Re: [Xen-devel] [PATCH RFC 3/4] xen: implement SCHEDOP_soft_reset

2015-06-22 Thread Vitaly Kuznetsov
"Jan Beulich" writes: On 22.06.15 at 18:00, wrote: >> "Jan Beulich" writes: >> >> On 03.06.15 at 15:35, wrote: @@ -1129,8 +1129,9 @@ void unmap_vcpu_info(struct vcpu *v) mfn = v->vcpu_info_mfn; unmap_domain_page_global((void *)

Re: [Xen-devel] [PATCH RFC 3/4] xen: implement SCHEDOP_soft_reset

2015-06-23 Thread Vitaly Kuznetsov
"Jan Beulich" writes: On 22.06.15 at 18:24, wrote: >> "Jan Beulich" writes: >> >> On 22.06.15 at 18:00, wrote: "Jan Beulich" writes: On 03.06.15 at 15:35, wrote: >> @@ -1129,8 +1129,9 @@ void unmap_vcpu_info(struct vcpu *v) >> mfn = v->vcpu_info_mfn

[Xen-devel] [PATCH v8 01/11] xen: introduce SHUTDOWN_soft_reset shutdown reason

2015-06-23 Thread Vitaly Kuznetsov
This special type of shutdown is supposed to be used by PVHVM guests when they want to perform some sort of kexec/kdump. Signed-off-by: Vitaly Kuznetsov --- xen/common/shutdown.c | 6 ++ xen/include/public/sched.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a

[Xen-devel] [PATCH v8 08/11] xen: arch-specific hooks for domain_soft_reset()

2015-06-23 Thread Vitaly Kuznetsov
x86-specific hook cleans up the pirq-emuirq mappings, destroys all ioreq servers and and replaces the shared_info frame with an empty page to support subsequent XENMAPSPACE_shared_info call. ARM-specific hook is a noop for now. Signed-off-by: Vitaly Kuznetsov --- Changes since 'PATCH RF

[Xen-devel] [PATCH v8 02/11] libxl: support SHUTDOWN_soft_reset shutdown reason

2015-06-23 Thread Vitaly Kuznetsov
Use letter 'S' to indicate a domain in such state. Signed-off-by: Vitaly Kuznetsov Acked-by: Ian Campbell --- tools/libxl/libxl_types.idl | 1 + tools/libxl/xl_cmdimpl.c | 2 +- tools/python/xen/lowlevel/xl/xl.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)

[Xen-devel] [PATCH v8 06/11] xen: Introduce XEN_DOMCTL_soft_reset

2015-06-23 Thread Vitaly Kuznetsov
New domctl resets state for a domain allowing it to 'start over': register vcpu_info, switch to FIFO ABI for event channels. Still active grants are being logged to help debugging misbehaving backends. Signed-off-by: Vitaly Kuznetsov --- xen/common/domain.c

[Xen-devel] [PATCH v8 00/11] toolstack-assisted approach to PVHVM guest kexec

2015-06-23 Thread Vitaly Kuznetsov
This patch series provides x86 PVHVM domains with an ability to perform kexec/kdump-style operations. The list of currently known issues blocking kexec (and why the series is required) is: - Bound event channels. - Registered vcpu_info. - PIRQ/emuirq mappings. - shared_info frame after XENMAPSPACE

[Xen-devel] [PATCH v8 07/11] flask: DOMCTL_soft_reset support

2015-06-23 Thread Vitaly Kuznetsov
Add new soft_reset vector to domain2 class, add it to create_domain in the default policy. Signed-off-by: Vitaly Kuznetsov --- tools/flask/policy/policy/modules/xen/xen.if | 2 +- xen/xsm/flask/hooks.c| 3 +++ xen/xsm/flask/policy/access_vectors | 2 ++ 3 files

[Xen-devel] [PATCH v8 10/11] libxc: add XC_DEVICE_MODEL_SAVE_FILE

2015-06-23 Thread Vitaly Kuznetsov
Use this in libxl_dm instead of hard-coding. Signed-off-by: Vitaly Kuznetsov Acked-by: Ian Campbell --- tools/libxc/include/xenguest.h | 2 ++ tools/libxl/libxl_dm.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/libxc/include/xenguest.h b/tools/libxc

[Xen-devel] [PATCH v8 11/11] (lib)xl: soft reset support

2015-06-23 Thread Vitaly Kuznetsov
Use existing create/restore path to perform 'soft reset' for HVM domains. Tear everything down, e.g. destroy domain's device model, remove the domain from xenstore, save toolstack record and start over. Signed-off-by: Vitaly Kuznetsov --- Changes since 'v7' - &

[Xen-devel] [PATCH v8 04/11] xen: evtchn: make evtchn_reset() ready for soft reset

2015-06-23 Thread Vitaly Kuznetsov
We need to close all event channel so the domain performing soft reset will be able to open them back. Signed-off-by: Vitaly Kuznetsov --- xen/common/event_channel.c | 38 +++--- xen/include/xen/event.h| 3 +++ 2 files changed, 22 insertions(+), 19 deletions

[Xen-devel] [PATCH v8 09/11] libxc: support XEN_DOMCTL_soft_reset operation

2015-06-23 Thread Vitaly Kuznetsov
Introduce xc_domain_soft_reset() function supporting XEN_DOMCTL_soft_reset. Signed-off-by: Vitaly Kuznetsov --- tools/libxc/include/xenctrl.h | 3 +++ tools/libxc/xc_domain.c | 9 + 2 files changed, 12 insertions(+) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include

[Xen-devel] [PATCH v8 05/11] xen: grant_table: implement grant_table_warn_active_grants()

2015-06-23 Thread Vitaly Kuznetsov
Log first 10 active grants of a domain. This function is going to be used for soft reset, active grants on this path usually mean misbehaving backends refusing to release their mappings on shutdown. Signed-off-by: Vitaly Kuznetsov --- xen/common/grant_table.c | 31

[Xen-devel] [PATCH v8 03/11] xl: introduce enum domain_restart_type

2015-06-23 Thread Vitaly Kuznetsov
As a preparation before adding new restart type (soft reset) put all restart types into an enum. Signed-off-by: Vitaly Kuznetsov Acked-by: Ian Campbell --- Changes since v7: - s,restarter,restarted, [Ian Campbell] --- tools/libxl/xl.h | 6 ++ tools/libxl/xl_cmdimpl.c | 23

Re: [Xen-devel] [PATCH] x86/arm/mm: use gfn instead of pfn in p2m_get_mem_access/p2m_set_mem_access

2015-06-23 Thread Vitaly Kuznetsov
"Jan Beulich" writes: On 26.05.15 at 15:32, wrote: >> --- a/xen/arch/arm/p2m.c >> +++ b/xen/arch/arm/p2m.c >> @@ -1709,9 +1709,9 @@ bool_t p2m_mem_access_check(paddr_t gpa, vaddr_t gla, >> const struct npfec npfec) >> >> /* >> * Set access type for a region of pfns. >> - * If start_pf

Re: [Xen-devel] [PATCH for-4.7] libxl: keep PoD target adjustment by memory fudge after reload_domain_config()

2016-06-01 Thread Vitaly Kuznetsov
George Dunlap writes: > On Tue, May 31, 2016 at 6:42 PM, Wei Liu wrote: >> From: Vitaly Kuznetsov >> >> Commit 56fb5fd623 ("libxl: adjust PoD target by memory fudge, too") >> introduced target_memkb adjustment for HVM PoD domains on create. The &g

Re: [Xen-devel] Xen 4.6 Development Update (2 WEEKS TO FREEZE, important information in preamble)

2015-06-26 Thread Vitaly Kuznetsov
writes: > * toolstack-based approach to pvhvm guest kexec (fair) >also contains hypervisor side change, v6 > - Vitaly Kuznetsov it is already "[PATCH v8 00/11] toolstack-assisted approach to PVHVM guest kexec" waiting for reviews and (IMHO) 'ok' (as I

[Xen-devel] [PATCH v3] x86/arm/mm: use gfn instead of pfn in p2m_get_mem_access/p2m_set_mem_access

2015-06-26 Thread Vitaly Kuznetsov
n' parameter passed to gfn_lock/gfn_unlock is not defined. This code compiles only because of a coincidence: gfn_lock/gfn_unlock are currently macros which don't use their second argument. Signed-off-by: Vitaly Kuznetsov --- Changes since v2: - Instead of adding start_ prefix on ARM remov

Re: [Xen-devel] [PATCH v3] x86/arm/mm: use gfn instead of pfn in p2m_get_mem_access/p2m_set_mem_access

2015-06-29 Thread Vitaly Kuznetsov
Andrew Cooper writes: > On 26/06/15 16:17, Vitaly Kuznetsov wrote: >> 'pfn' and 'start_pfn' are ambiguous, both these functions expect GFNs as >> input. >> >> On x86 the interface of p2m_set_mem_access() in p2m.c doesn't match the >> dec

[Xen-devel] [PATCH v4] x86/arm/mm: use gfn instead of pfn in p2m_get_mem_access/p2m_set_mem_access

2015-06-29 Thread Vitaly Kuznetsov
mem_access on ARM) interfaces to using gft_t instead of unsigned long and update all users of these functions. There is also an issue in p2m_get_mem_access on x86: 'gfn' parameter passed to gfn_lock/gfn_unlock is not defined. This code compiles only because of a coincidence: gfn_lock/gfn

Re: [Xen-devel] [PATCH v4] x86/arm/mm: use gfn instead of pfn in p2m_get_mem_access/p2m_set_mem_access

2015-07-02 Thread Vitaly Kuznetsov
George Dunlap writes: > On 07/02/2015 12:25 PM, Tim Deegan wrote: >> At 12:09 +0100 on 02 Jul (1435838956), Andrew Cooper wrote: >>> On 02/07/15 11:48, George Dunlap wrote: Now in p2m_set_mem_access(), rather than just using an unsigned long in the loop iterating over gfns, you do this

[Xen-devel] [PATCH v5] x86/arm/mm: use gfn instead of pfn in p2m_get_mem_access/p2m_set_mem_access

2015-07-02 Thread Vitaly Kuznetsov
mem_access on ARM) interfaces to using gft_t instead of unsigned long and update all users of these functions. There is also an issue in p2m_get_mem_access on x86: 'gfn' parameter passed to gfn_lock/gfn_unlock is not defined. This code compiles only because of a coincidence: gfn_lock/gfn

[Xen-devel] [PATCH v6 00/10] toolstack-based approach to pvhvm guest kexec

2015-05-13 Thread Vitaly Kuznetsov
e v5. I'd like to apologize for all that. v5 and all the history of the series is available here: http://lists.xenproject.org/archives/html/xen-devel/2014-12/msg01312.html Vitaly Kuznetsov (10): xen: introduce SHUTDOWN_soft_reset shutdown reason libxl: support SHUTDOWN_soft_reset shutdown reason xe

[Xen-devel] [PATCH v6 05/10] xsm: add XENMEM_soft_reset support

2015-05-13 Thread Vitaly Kuznetsov
Dummy policy just checks that the current domain is privileged, in flask policy soft_reset is added to create_domain. Signed-off-by: Vitaly Kuznetsov --- tools/flask/policy/policy/modules/xen/xen.if | 2 +- xen/common/memory.c | 4 xen/include/xsm/dummy.h

[Xen-devel] [PATCH v6 09/10] libxc: add XC_DEVICE_MODEL_SAVE_FILE

2015-05-13 Thread Vitaly Kuznetsov
Use this in libxl_dm instead of hard-coding. Signed-off-by: Vitaly Kuznetsov --- tools/libxc/include/xenguest.h | 1 + tools/libxl/libxl_dm.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h index

[Xen-devel] [PATCH v6 03/10] xen: introduce DOMDYING_locked state

2015-05-13 Thread Vitaly Kuznetsov
domain is dying (so its mappings are locked and do not change) but the cleanup procedure has not being started yet. It will be set from outside of the domain_kill() function. Signed-off-by: Vitaly Kuznetsov --- xen/common/domain.c | 1 + xen/include/xen/sched.h | 3 ++- 2 files changed, 3

[Xen-devel] [PATCH v6 04/10] xen: Introduce XENMEM_soft_reset operation

2015-05-13 Thread Vitaly Kuznetsov
New operation reassigns all memory pages from source domain to the destination domain mapping them at exactly the same GFNs. Pages mapped more than once (e.g. grants) are being copied. Signed-off-by: Vitaly Kuznetsov --- xen/common/memory.c | 232

[Xen-devel] [PATCH v6 01/10] xen: introduce SHUTDOWN_soft_reset shutdown reason

2015-05-13 Thread Vitaly Kuznetsov
. This operation is not supported for PV domains including the hardware domain. Signed-off-by: Vitaly Kuznetsov --- xen/common/shutdown.c | 6 ++ xen/include/public/sched.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/common/shutdown.c b/xen/common/shutdown.c

[Xen-devel] [PATCH v6 02/10] libxl: support SHUTDOWN_soft_reset shutdown reason

2015-05-13 Thread Vitaly Kuznetsov
Use letter 'S' to indicate a domain in such state. Signed-off-by: Vitaly Kuznetsov --- tools/libxl/libxl.h | 7 +++ tools/libxl/libxl_types.idl | 1 + tools/libxl/xl_cmdimpl.c | 2 +- tools/python/xen/lowlevel/xl/xl.c | 1 + 4 files changed, 10 insert

[Xen-devel] [PATCH v6 07/10] libxc: introduce soft reset for HVM domains

2015-05-13 Thread Vitaly Kuznetsov
eset; - Destroy the original domain; - Restore HVM context, HVM params, seed grant table for the new domain. After that the new domain resumes execution from where SHUTDOWN_soft_reset was called by the original domain. Signed-off-by: Vitaly Kuznetsov --- tools/libxc/Makefile | 1

[Xen-devel] [PATCH v6 08/10] xl: introduce enum domain_restart_type

2015-05-13 Thread Vitaly Kuznetsov
As a preparation before adding new restart type (soft reset) put all restart types into an enum. Signed-off-by: Vitaly Kuznetsov --- tools/libxl/xl.h | 6 ++ tools/libxl/xl_cmdimpl.c | 23 ++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a

[Xen-devel] [PATCH v6 06/10] libxc: support XENMEM_soft_reset operation

2015-05-13 Thread Vitaly Kuznetsov
Introduce xc_domain_memory_soft_reset() function supporting XENMEM_soft_reset. Signed-off-by: Vitaly Kuznetsov --- tools/libxc/include/xenctrl.h | 5 + tools/libxc/xc_domain.c | 18 ++ 2 files changed, 23 insertions(+) diff --git a/tools/libxc/include/xenctrl.h b

[Xen-devel] [PATCH v6 10/10] (lib)xl: soft reset support

2015-05-13 Thread Vitaly Kuznetsov
Perform soft reset when a domain did SHUTDOWN_soft_reset. Migrate the content with xc_domain_soft_reset(), reload dm and toolstack. Signed-off-by: Vitaly Kuznetsov --- docs/man/xl.cfg.pod.5| 12 + tools/libxl/libxl.c | 4 ++ tools/libxl/libxl.h | 6 +++ tools

[Xen-devel] Status of soft reset for PVHVM (Was: Xen 4.6 Development Update (four months reminder))

2015-05-13 Thread Vitaly Kuznetsov
writes: > * toolstack-based approach to pvhvm guest kexec (fair) >also contains hypervisor side change > - Vitaly Kuznetsov > > * Toolstack-based approach to pvhvm guest kexec (ok) > v4 posted > - Vitaly Kuznetsov v6 was jus

Re: [Xen-devel] [PATCH v6 07/10] libxc: introduce soft reset for HVM domains

2015-05-20 Thread Vitaly Kuznetsov
Julien Grall writes: > Hi Vitaly, > > On 13/05/15 10:49, Vitaly Kuznetsov wrote: >> +int xc_domain_soft_reset(xc_interface *xch, uint32_t source_dom, >> + uint32_t dest_dom, domid_t console_domid, >> + unsigned

Re: [Xen-devel] [PATCH v6 05/10] xsm: add XENMEM_soft_reset support

2015-05-21 Thread Vitaly Kuznetsov
Daniel De Graaf writes: > On 05/13/2015 05:49 AM, Vitaly Kuznetsov wrote: >> Dummy policy just checks that the current domain is privileged, >> in flask policy soft_reset is added to create_domain. >> >> Signed-off-by: Vitaly Kuznetsov > > I think the FLASK pol

Re: [Xen-devel] [PATCH v6 10/10] (lib)xl: soft reset support

2015-05-22 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Perform soft reset when a domain did SHUTDOWN_soft_reset. Migrate the > content with xc_domain_soft_reset(), reload dm and toolstack. > ..skip.. > +void libxl__xc_domain_soft_reset(libxl__egc *egc, > + libxl__domain_cr

Re: [Xen-devel] [PATCH v6 05/10] xsm: add XENMEM_soft_reset support

2015-05-22 Thread Vitaly Kuznetsov
"Jan Beulich" writes: On 13.05.15 at 11:49, wrote: >> --- a/xen/include/xsm/dummy.h >> +++ b/xen/include/xsm/dummy.h >> @@ -193,6 +193,13 @@ static XSM_INLINE int >> xsm_memory_exchange(XSM_DEFAULT_ARG struct domain *d) >> return xsm_default_action(action, current->domain, d); >> } >

Re: [Xen-devel] [PATCH v6 04/10] xen: Introduce XENMEM_soft_reset operation

2015-05-22 Thread Vitaly Kuznetsov
"Jan Beulich" writes: On 13.05.15 at 11:49, wrote: >> --- a/xen/common/memory.c >> +++ b/xen/common/memory.c >> @@ -580,6 +580,234 @@ static long >> memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg) >> return rc; >> } >> >> +static long >> memory_soft_reset(XEN_GU

Re: [Xen-devel] [PATCH v6 04/10] xen: Introduce XENMEM_soft_reset operation

2015-05-25 Thread Vitaly Kuznetsov
Tim Deegan writes: > At 17:26 +0100 on 22 May (1432315574), Jan Beulich wrote: >> >>> On 22.05.15 at 17:36, wrote: >> > On 13.05.15 at 11:49, wrote: >> >>> +if ( !source_d->is_dying ) >> >>> +{ >> >>> +/* >> >>> + * Make sure no allocation/remapping for the source do

[Xen-devel] [PATCH] xen: fix xen_domctl_monitor_op_t definition

2015-05-25 Thread Vitaly Kuznetsov
It seems xen_domctl_monitor_op_t was supposed to be a typedef for struct xen_domctl_monitor_op and not the non-existent xen_domctl__op. Signed-off-by: Vitaly Kuznetsov --- xen/include/public/domctl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/public/domctl.h

[Xen-devel] [PATCH] x86/mm: use existing 'pfn' in p2m_get_mem_access

2015-05-26 Thread Vitaly Kuznetsov
'gfn' is not defined in p2m_get_mem_access() and this code compiles only because of a coincidence: gfn_lock/gfn_unlock are currently macros which don't use their second argument. Signed-off-by: Vitaly Kuznetsov --- xen/arch/x86/mm/p2m.c | 4 ++-- 1 file changed, 2 insertions(

Re: [Xen-devel] [PATCH v6 04/10] xen: Introduce XENMEM_soft_reset operation

2015-05-26 Thread Vitaly Kuznetsov
Tim Deegan writes: > At 12:06 +0200 on 25 May (143265), Vitaly Kuznetsov wrote: >> Tim Deegan writes: >> >> > At 17:26 +0100 on 22 May (1432315574), Jan Beulich wrote: >> >> >>> On 22.05.15 at 17:36, wrote: >> >> >>>>&g

[Xen-devel] [PATCH] x86/arm/mm: use gfn instead of pfn in p2m_get_mem_access/p2m_set_mem_access

2015-05-26 Thread Vitaly Kuznetsov
n' parameter passed to gfn_lock/gfn_unlock is not defined. This code compiles only because of a coincidence: gfn_lock/gfn_unlock are currently macros which don't use their second argument. Signed-off-by: Vitaly Kuznetsov --- - This patch is a successor of '[PATCH] x86/mm: use existin

[Xen-devel] [PATCH v7 03/10] xen: introduce DOMDYING_locked state

2015-05-27 Thread Vitaly Kuznetsov
domain is dying (so its mappings are locked and do not change) but the cleanup procedure has not being started yet. It will be set from outside of the domain_kill() function. Signed-off-by: Vitaly Kuznetsov --- xen/common/domain.c | 1 + xen/include/xen/sched.h | 3 ++- 2 files changed, 3

[Xen-devel] [PATCH v7 00/10] toolstack-based approach to pvhvm guest kexec

2015-05-27 Thread Vitaly Kuznetsov
org/archives/html/xen-devel/2015-05/msg01613.html v5 and all the history of the series is available here: http://lists.xenproject.org/archives/html/xen-devel/2014-12/msg01312.html Vitaly Kuznetsov (10): xen: introduce SHUTDOWN_soft_reset shutdown reason libxl: support SHUTDOWN_soft_reset shutd

<    1   2   3   4   >