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

2015-05-27 Thread Vitaly Kuznetsov
Use letter 'S' to indicate a domain in such state. Signed-off-by: Vitaly Kuznetsov --- Changes in v7: - Remove LIBXL_HAVE_SHUTDWON_REASON_SOFT_RESET, the functionality will be advertised with LIBXL_HAVE_SOFT_RESET with the implementation [Wei Liu] --- tools/libxl/libxl_types.idl

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

2015-05-27 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 v7 07/10] libxc: introduce soft reset for HVM domains

2015-05-27 Thread Vitaly Kuznetsov
MCTL_soft_reset; - Restore HVM context, HVM params, seed grant table for the new domain. When the operation succeeds the source domain is being destroyed and the destination domain is ready to proceed from where the source was stopped. Signed-off-by: Vitaly Kuznetsov --- Changes in v7: - check that xc

[Xen-devel] [PATCH v7 04/10] xen: Introduce XEN_DOMCTL_soft_reset

2015-05-27 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 --- Changes in v7: - is_soft_reset flag added to struct domain to preserve

[Xen-devel] [PATCH v7 06/10] libxc: support XEN_DOMCTL_soft_reset operation

2015-05-27 Thread Vitaly Kuznetsov
Introduce xc_domain_soft_reset() function supporting XEN_DOMCTL_soft_reset. Signed-off-by: Vitaly Kuznetsov --- Changes in v7: - XENMEM_soft_reset -> XEN_DOMCTL_soft_reset. - xc_memory_soft_reset -> xc_domain_soft_reset --- tools/libxc/include/xenctrl.h | 4 tools/libxc/xc_do

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

2015-05-27 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 v7 05/10] xsm: add XEN_DOMCTL_soft_reset support

2015-05-27 Thread Vitaly Kuznetsov
sible to trasfer memory from source domain to destination domain. The default policy requires their contexts to match. Signed-off-by: Vitaly Kuznetsov --- Changes in v7: - Add reset_transfer vector to FLASK [Daniel De Graaf] - XENMEM_soft_reset -> XEN_DOMCTL_soft_reset - Add a comment on why we

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

2015-05-27 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 v7 10/10] (lib)xl: soft reset support

2015-05-27 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 --- Changes in v7: - Save toolstack earlier. - Introduce LIBXL_HAVE_SOFT_RESET [Wei Liu] --- docs/man/xl.cfg.pod.5| 12

Re: [Xen-devel] [PATCH v7 04/10] xen: Introduce XEN_DOMCTL_soft_reset

2015-05-28 Thread Vitaly Kuznetsov
Tim Deegan writes: > Hi, > > At 17:25 +0200 on 27 May (1432747540), Vitaly Kuznetsov wrote: >> 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 >>

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

2015-05-28 Thread Vitaly Kuznetsov
"Jan Beulich" writes: On 27.05.15 at 17:25, wrote: >> This patch series provides x86 PVHVM domains with an ability to perform >> kexec/kdump-style operations. > > Before I get to look at this latest version, may I go a step back and > ask for clarification whether all of these (seemingly fr

Re: [Xen-devel] [PATCH v7 04/10] xen: Introduce XEN_DOMCTL_soft_reset

2015-05-28 Thread Vitaly Kuznetsov
Tim Deegan writes: > At 13:56 +0200 on 28 May (1432821360), Vitaly Kuznetsov wrote: >> Tim Deegan writes: >> >> +last_gmfn = domain_get_maximum_gpfn(source_d); >> >> +gmfn = *gmfn_start; >> >> +while ( gmfn <= last_gmfn ) >> >

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

2015-05-28 Thread Vitaly Kuznetsov
"Jan Beulich" writes: On 28.05.15 at 14:27, wrote: >> "Jan Beulich" writes: >> >> On 27.05.15 at 17:25, wrote: This patch series provides x86 PVHVM domains with an ability to perform kexec/kdump-style operations. >>> >>> Before I get to look at this latest version, may I go

Re: [Xen-devel] [PATCH v7 04/10] xen: Introduce XEN_DOMCTL_soft_reset

2015-05-28 Thread Vitaly Kuznetsov
Tim Deegan writes: > At 15:11 +0200 on 28 May (1432825919), Vitaly Kuznetsov wrote: >> Tim Deegan writes: >> > At 13:56 +0200 on 28 May (1432821360), Vitaly Kuznetsov wrote: >> >> Tim Deegan writes: >> >> >> +

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

2015-06-02 Thread Vitaly Kuznetsov
Ian Campbell writes: > On Thu, 2015-05-28 at 15:41 +0200, Vitaly Kuznetsov wrote: >> > I.e. what you currently implement is David's model without Konrad's >> > later alternative really having been explored? Iiuc David's main >> > reservation (which I

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

2015-06-03 Thread Vitaly Kuznetsov
blish it. Signed-off-by: Vitaly Kuznetsov --- xen/common/event_channel.c | 52 +++--- xen/include/xen/event.h| 3 +++ xen/include/xen/sched.h| 1 + 3 files changed, 35 insertions(+), 21 deletions(-) diff --git a/xen/common/event_channel.c b/xen/c

[Xen-devel] [PATCH RFC 0/4] 'reset everything' approach to PVHVM guest kexec

2015-06-03 Thread Vitaly Kuznetsov
el/2015-05/, there are no messages in May after May, 26 and this series was sent on May, 27) Vitaly Kuznetsov (4): xen: evtchn: make evtchn_reset() ready for soft reset xen: grant_table: implement grant_table_soft_reset() xen: implement SCHEDOP_soft_reset xen: arch-specific hooks for domain

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

2015-06-03 Thread Vitaly Kuznetsov
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. ARM-specific hook is a noop for now. Signed-off-by: Vitaly Kuznetsov --- xen/arch/arm/domain.c| 5 xen/arch/x86/domain.c

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

2015-06-03 Thread Vitaly Kuznetsov
need to belong to someone and we don't want to implement possible DoS by reassigning them to the grantee/anonymous domain/xen/.. (the malicious guest will be able to consume all host's memory). Signed-off-by: Vitaly Kuznetsov --- xen/common/grant

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

2015-06-03 Thread Vitaly Kuznetsov
Reset event channels, replace grant pages with empty ones, unmount previously mounted vcpu_info. Signed-off-by: Vitaly Kuznetsov --- xen/common/domain.c| 37 + xen/common/schedule.c | 4 xen/include/public/sched.h | 7 +++ xen/include

[Xen-devel] [PATCH linux 0/8] xen: pvhvm: support bootup on secondary vCPUs

2016-06-28 Thread Vitaly Kuznetsov
obably won't) support kdump so I always assume Xen's vCPU id == Linux's vCPU id. ARM guests will probably need to get proper mapping once we start supporting kexec/kdump there. Vitaly Kuznetsov (8): x86/xen: update cpuid.h from Xen-4.7 xen: introduce xen_vcpu_id m

[Xen-devel] [PATCH linux 3/8] x86/xen: use xen_vcpu_id mapping for HYPERVISOR_vcpu_op

2016-06-28 Thread Vitaly Kuznetsov
don't have perpu areas initialized. While it could be solved with switching to early_percpu for xen_vcpu_id I think it's not worth it: PV guests will probably never get to the point where their idea of vCPU id diverges from Xen's. Signed-off-by: Vitaly Kuznetsov --- arch/x86/include

[Xen-devel] [PATCH linux 1/8] x86/xen: update cpuid.h from Xen-4.7

2016-06-28 Thread Vitaly Kuznetsov
Update cpuid.h header from xen hypervisor tree to get XEN_HVM_CPUID_VCPU_ID_PRESENT definition. Signed-off-by: Vitaly Kuznetsov --- arch/x86/include/asm/xen/cpuid.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/xen/cpuid.h b/arch/x86/include/asm

[Xen-devel] [PATCH linux 2/8] xen: introduce xen_vcpu_id mapping

2016-06-28 Thread Vitaly Kuznetsov
en's and Linux's ideas of vCPU id diverged. Signed-off-by: Vitaly Kuznetsov --- arch/arm/xen/enlighten.c | 10 ++ arch/x86/xen/enlighten.c | 18 +- include/xen/xen-ops.h| 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/arch/arm/xen/enlighten

[Xen-devel] [PATCH linux 5/8] xen/events: use xen_vcpu_id mapping in events_base

2016-06-28 Thread Vitaly Kuznetsov
EVTCHNOP_bind_ipi and EVTCHNOP_bind_virq pass vCPU id as a parameter and Xen's idea of vCPU id should be used. Use the newly introduced xen_vcpu_id mapping to convert it from Linux's id. Signed-off-by: Vitaly Kuznetsov --- drivers/xen/events/events_base.c | 10 +- 1 file

[Xen-devel] [PATCH linux 6/8] xen/events: fifo: use xen_vcpu_id mapping

2016-06-28 Thread Vitaly Kuznetsov
EVTCHNOP_init_control has vCPU id as a parameter and Xen's idea of vCPU id should be used. Use the newly introduced xen_vcpu_id mapping to convert it from Linux's id. Signed-off-by: Vitaly Kuznetsov --- drivers/xen/events/events_fifo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[Xen-devel] [PATCH linux 7/8] xen/evtchn: use xen_vcpu_id mapping

2016-06-28 Thread Vitaly Kuznetsov
Use the newly introduced xen_vcpu_id mapping to get Xen's idea of vCPU id for CPU0. Signed-off-by: Vitaly Kuznetsov --- drivers/xen/evtchn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c index f4edd6df..0fc6be4 100644

[Xen-devel] [PATCH linux 8/8] xen/pvhvm: run xen_vcpu_setup() for the boot CPU

2016-06-28 Thread Vitaly Kuznetsov
shing on this CPU) we're not able to boot. Switch to always doing VCPUOP_register_vcpu_info for the boot CPU. Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/enlighten.c | 2 +- arch/x86/xen/smp.c | 7 +++ arch/x86/xen/xen-ops.h | 1 + 3 files changed, 9 insertions(+), 1 deletio

[Xen-devel] [PATCH linux 4/8] x86/xen: use xen_vcpu_id mapping when pointing vcpu_info to the shared_info page

2016-06-28 Thread Vitaly Kuznetsov
shared_info page has space for 32 vcpu info slots for first 32 vCPUs but these are the first 32 vCPUs from Xen's perspective and we should map them accordingly with the newly introduced xen_vcpu_id mapping. Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/enlighten.c | 15 ++---

Re: [Xen-devel] [PATCH linux 0/8] xen: pvhvm: support bootup on secondary vCPUs

2016-06-29 Thread Vitaly Kuznetsov
David Vrabel writes: > On 28/06/16 17:47, Vitaly Kuznetsov wrote: >> It may happen that Xen's and Linux's ideas of vCPU id diverge. In >> particular, when we crash on a secondary vCPU we may want to do kdump >> and unlike plain kexec where we do migrate_to_reboot

Re: [Xen-devel] [PATCH linux 2/8] xen: introduce xen_vcpu_id mapping

2016-06-29 Thread Vitaly Kuznetsov
Andrew Cooper writes: > On 28/06/16 17:47, Vitaly Kuznetsov wrote: >> @@ -1808,6 +1822,8 @@ static int xen_hvm_cpu_notify(struct notifier_block >> *self, unsigned long action, >> int cpu = (long)hcpu; >> switch (action) { >> case CPU_UP_PREP

Re: [Xen-devel] [PATCH linux 2/8] xen: introduce xen_vcpu_id mapping

2016-06-29 Thread Vitaly Kuznetsov
Andrew Cooper writes: > On 29/06/16 13:16, Vitaly Kuznetsov wrote: >> Andrew Cooper writes: >> >>> On 28/06/16 17:47, Vitaly Kuznetsov wrote: >>>> @@ -1808,6 +1822,8 @@ static int xen_hvm_cpu_notify(struct notifier_block >>>> *self, un

Re: [Xen-devel] [PATCH linux 2/8] xen: introduce xen_vcpu_id mapping

2016-06-29 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Andrew Cooper writes: > >> On 29/06/16 13:16, Vitaly Kuznetsov wrote: >>> Andrew Cooper writes: >>> >>>> On 28/06/16 17:47, Vitaly Kuznetsov wrote: >>>>> @@ -1808,6 +1822,8 @@ static int xen_hvm_cpu_notify

[Xen-devel] [PATCH linux v2 5/9] x86/xen: use xen_vcpu_id mapping when pointing vcpu_info to the shared_info page

2016-06-30 Thread Vitaly Kuznetsov
shared_info page has space for 32 vcpu info slots for first 32 vCPUs but these are the first 32 vCPUs from Xen's perspective and we should map them accordingly with the newly introduced xen_vcpu_id mapping. Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - Use xen_vcpu_nr() helper [

[Xen-devel] [PATCH linux v2 7/9] xen/events: fifo: use xen_vcpu_id mapping

2016-06-30 Thread Vitaly Kuznetsov
EVTCHNOP_init_control has vCPU id as a parameter and Xen's idea of vCPU id should be used. Use the newly introduced xen_vcpu_id mapping to convert it from Linux's id. Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - Use xen_vcpu_nr() helper [David Vrabel] --- drivers/

[Xen-devel] [PATCH linux v2 6/9] xen/events: use xen_vcpu_id mapping in events_base

2016-06-30 Thread Vitaly Kuznetsov
EVTCHNOP_bind_ipi and EVTCHNOP_bind_virq pass vCPU id as a parameter and Xen's idea of vCPU id should be used. Use the newly introduced xen_vcpu_id mapping to convert it from Linux's id. Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - Use xen_vcpu_nr() helper [David Vrabel] --

[Xen-devel] [PATCH linux v2 4/9] x86/xen: use xen_vcpu_id mapping for HYPERVISOR_vcpu_op

2016-06-30 Thread Vitaly Kuznetsov
as they're only being called by PV guests before perpu areas are initialized. While the issue could be solved by switching to early_percpu for xen_vcpu_id I think it's not worth it: PV guests will probably never get to the point where their idea of vCPU id diverges from Xen's. Signed

[Xen-devel] [PATCH linux v2 2/9] x86/acpi: store ACPI ids from MADT for future usage

2016-06-30 Thread Vitaly Kuznetsov
these ids diverge from Linux's cpu ids. Signed-off-by: Vitaly Kuznetsov --- arch/x86/include/asm/cpu.h | 1 + arch/x86/include/asm/smp.h | 2 ++ arch/x86/kernel/acpi/boot.c| 16 arch/x86/kernel/apic/apic.c| 2 ++ arch/x86/kernel/setup_percpu.c | 3 +++ 5 fi

[Xen-devel] [PATCH linux v2 3/9] xen: introduce xen_vcpu_id mapping

2016-06-30 Thread Vitaly Kuznetsov
PUs it is a bit more trickier. Currently, we initialize IPI vectors before these CPUs boot so we can't use CPUID. Use ACPI ids from MADT instead. Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - Introduce xen_vcpu_nr() helper [David Vrabel] - Use ACPI ids instead of vLAPIC ids /2 [Andrew

[Xen-devel] [PATCH linux v2 0/9] xen: pvhvm: support bootup on secondary vCPUs

2016-06-30 Thread Vitaly Kuznetsov
ids instead of vLAPIC ids/2 [Andrew Cooper, Jan Beulich] - Introduce xen_vcpu_nr() helper [David Vrabel]. - Modify all callers of HYPERVISOR_vcpu_op() instead of modifying HYPERVISOR_vcpu_op() [David Vrabel] Vitaly Kuznetsov (9): x86/xen: update cpuid.h from Xen-4.7 x86/acpi: store ACPI ids

[Xen-devel] [PATCH linux v2 1/9] x86/xen: update cpuid.h from Xen-4.7

2016-06-30 Thread Vitaly Kuznetsov
Update cpuid.h header from xen hypervisor tree to get XEN_HVM_CPUID_VCPU_ID_PRESENT definition. Signed-off-by: Vitaly Kuznetsov --- arch/x86/include/asm/xen/cpuid.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/xen/cpuid.h b/arch/x86/include/asm

[Xen-devel] [PATCH linux v2 9/9] xen/pvhvm: run xen_vcpu_setup() for the boot CPU

2016-06-30 Thread Vitaly Kuznetsov
shing on this CPU) we're not able to boot. Switch to always doing VCPUOP_register_vcpu_info for the boot CPU. Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/enlighten.c | 2 +- arch/x86/xen/smp.c | 7 +++ arch/x86/xen/xen-ops.h | 1 + 3 files changed, 9 insertions(+), 1 deletio

[Xen-devel] [PATCH linux v2 8/9] xen/evtchn: use xen_vcpu_id mapping

2016-06-30 Thread Vitaly Kuznetsov
Use the newly introduced xen_vcpu_id mapping to get Xen's idea of vCPU id for CPU0. Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - Use xen_vcpu_nr() helper [David Vrabel] --- drivers/xen/evtchn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/xen/evt

Re: [Xen-devel] [PATCH linux 0/8] xen: pvhvm: support bootup on secondary vCPUs

2016-07-01 Thread Vitaly Kuznetsov
David Vrabel writes: > On 29/06/16 10:16, Vitaly Kuznetsov wrote: >> David Vrabel writes: >> >>> On 28/06/16 17:47, Vitaly Kuznetsov wrote: >>>> It may happen that Xen's and Linux's ideas of vCPU id diverge. In >>>> particular, when we

Re: [Xen-devel] [PATCH linux 2/8] xen: introduce xen_vcpu_id mapping

2016-07-01 Thread Vitaly Kuznetsov
"Jan Beulich" writes: >>>> On 29.06.16 at 18:27, wrote: >> On 29/06/16 17:19, Vitaly Kuznetsov wrote: >>> To explain better what I'm trying to suggest here please take a look at >>> the attached patch. If we can guarantee long term that ACPI id

[Xen-devel] [PATCH] x86, hvm: document the de facto policy for vCPU ids

2016-07-12 Thread Vitaly Kuznetsov
PVHVM guests may need to know Xen's idea of vCPU ids they have and the only way they can figure them out is to use ACPI ids from MADT table. Document the de facto policy. Signed-off-by: Vitaly Kuznetsov --- xen/include/public/hvm/hvm_info_table.h | 8 1 file changed, 8 inser

Re: [Xen-devel] [PATCHv1] x86: rtc_cmos platform device requires legacy irqs

2015-12-03 Thread Vitaly Kuznetsov
David Vrabel writes: > Adding the rtc platform device when there are no legacy irqs (no > legacy PIC) No PIC != No legacy IRQs, Hyper-V Gen2 represents such a platform (and it has RTC on irq8). I've tested this patch against it and it appears to work because the device is present in ACPI and we

Re: [Xen-devel] [PATCHv1] x86: rtc_cmos platform device requires legacy irqs

2015-12-04 Thread Vitaly Kuznetsov
Boris Ostrovsky writes: > On 12/04/2015 10:24 AM, David Vrabel wrote: >> On 04/12/15 14:06, David Vrabel wrote: >>> On 03/12/15 10:43, David Vrabel wrote: Adding the rtc platform device when there are no legacy irqs (no legacy PIC) causes a conflict with other devices that end up using

Re: [Xen-devel] Patch "x86/irq: Probe for PIC presence before allocating descs for legacy IRQs" has been added to the 4.3-stable tree

2015-12-07 Thread Vitaly Kuznetsov
ts I suggest we include this commit as well. Same for 4.2-stable tree. > > From 8c058b0b9c34d8c8d7912880956543769323e2d8 Mon Sep 17 00:00:00 2001 > From: Vitaly Kuznetsov > Date: Tue, 3 Nov 2015 10:40:14 +0100 > Subject: x86/irq: Probe for PIC presence before allocatin

Re: [Xen-devel] [PATCH] x86: Xen PV guests don't have the rtc_cmos platform device

2015-12-09 Thread Vitaly Kuznetsov
Sander Eikelenboom writes: > On 2015-12-09 15:42, Jan Beulich wrote: > On 09.12.15 at 15:32, wrote: >>> --- a/arch/x86/kernel/rtc.c >>> +++ b/arch/x86/kernel/rtc.c >>> @@ -200,6 +200,9 @@ static __init int add_rtc_cmos(void) >>> } >>> #endif >>> >>> + if (paravirt_enabled()) >>> +

[Xen-devel] [PATCH v2] memory-hotplug: add automatic onlining policy for the newly added memory

2015-12-22 Thread Vitaly Kuznetsov
hi Cc: Xishi Qiu Cc: Mel Gorman Cc: "K. Y. Srinivasan" Cc: Igor Mammedov Cc: Kay Sievers Cc: Konrad Rzeszutek Wilk Cc: Boris Ostrovsky Signed-off-by: Vitaly Kuznetsov --- - Changes since 'v1': Add 'online' parameter to add_memory_resource() as it is being used by

Re: [Xen-devel] [PATCH v2] memory-hotplug: add automatic onlining policy for the newly added memory

2016-01-04 Thread Vitaly Kuznetsov
Andrew Morton writes: > On Tue, 22 Dec 2015 17:32:30 +0100 Vitaly Kuznetsov > wrote: > >> Currently, all newly added memory blocks remain in 'offline' state unless >> someone onlines them, some linux distributions carry special udev rules >> like: >

Re: [Xen-devel] [PATCH v2] memory-hotplug: add automatic onlining policy for the newly added memory

2016-01-04 Thread Vitaly Kuznetsov
David Vrabel writes: > On 22/12/15 16:32, Vitaly Kuznetsov wrote: >> @@ -1292,6 +1304,11 @@ int __ref add_memory_resource(int nid, struct >> resource *res) >> /* create new memmap entry */ >> firmware_map_add_hotplug(start, start + size, "System RAM&qu

[Xen-devel] [PATCH v4 0/2] memory-hotplug: add automatic onlining policy for the newly added memory

2016-01-12 Thread Vitaly Kuznetsov
ne" which preserves the current behavior and "online" which causes all newly added memory blocks to go online as soon as they're added. The default is "offline". Vitaly Kuznetsov (2): memory-hotplug: add automatic onlining policy for the newly added

[Xen-devel] [PATCH v4 2/2] xen_balloon: support memory auto onlining policy

2016-01-12 Thread Vitaly Kuznetsov
Add support for the newly added kernel memory auto onlining policy to Xen ballon driver. Suggested-by: Daniel Kiper Signed-off-by: Vitaly Kuznetsov --- drivers/xen/Kconfig | 20 +--- drivers/xen/balloon.c | 30 +++--- 2 files changed, 32 insertions

[Xen-devel] [PATCH v4 1/2] memory-hotplug: add automatic onlining policy for the newly added memory

2016-01-12 Thread Vitaly Kuznetsov
ate some memory. Introduce default policy for the newly added memory blocks in /sys/devices/system/memory/auto_online_blocks file with two possible values: "offline" which preserves the current behavior and "online" which causes all newly added memory blocks to go online as s

Re: [Xen-devel] [PATCH v4 2/2] xen_balloon: support memory auto onlining policy

2016-01-13 Thread Vitaly Kuznetsov
David Vrabel writes: > On 12/01/16 16:56, Vitaly Kuznetsov wrote: >> Add support for the newly added kernel memory auto onlining policy to Xen >> ballon driver. > [...] >> --- a/drivers/xen/Kconfig >> +++ b/drivers/xen/Kconfig >> @@ -37,23 +37,29

Re: [Xen-devel] [PATCH v4 1/2] memory-hotplug: add automatic onlining policy for the newly added memory

2016-01-13 Thread Vitaly Kuznetsov
David Rientjes writes: > On Tue, 12 Jan 2016, Vitaly Kuznetsov wrote: > >> diff --git a/Documentation/memory-hotplug.txt >> b/Documentation/memory-hotplug.txt >> index ce2cfcf..ceaf40c 100644 >> --- a/Documentation/memory-hotplug.txt >> +++ b/Documentat

[Xen-devel] [PATCH v5 2/2] xen_balloon: support memory auto onlining policy

2016-01-13 Thread Vitaly Kuznetsov
Add support for the newly added kernel memory auto onlining policy to Xen ballon driver. Suggested-by: Daniel Kiper Signed-off-by: Vitaly Kuznetsov --- Changes since v4: - 'dom0' -> 'control domain', 'domU' -> 'target domain' in Kconfig [David Vr

[Xen-devel] [PATCH v5 0/2] memory-hotplug: add automatic onlining policy for the newly added memory

2016-01-13 Thread Vitaly Kuznetsov
ewly added memory blocks in /sys/devices/system/memory/auto_online_blocks file with two possible values: "offline" which preserves the current behavior and "online" which causes all newly added memory blocks to go online as soon as they're added. The default is "

[Xen-devel] [PATCH v5 1/2] memory-hotplug: add automatic onlining policy for the newly added memory

2016-01-13 Thread Vitaly Kuznetsov
ate some memory. Introduce default policy for the newly added memory blocks in /sys/devices/system/memory/auto_online_blocks file with two possible values: "offline" which preserves the current behavior and "online" which causes all newly added memory blocks to go online as s

Re: [Xen-devel] [PATCH v4 1/2] memory-hotplug: add automatic onlining policy for the newly added memory

2016-01-14 Thread Vitaly Kuznetsov
David Rientjes writes: > On Wed, 13 Jan 2016, Vitaly Kuznetsov wrote: > >> >> diff --git a/Documentation/memory-hotplug.txt >> >> b/Documentation/memory-hotplug.txt >> >> index ce2cfcf..ceaf40c 100644 >> >> --- a/Documentation/memory-ho

Re: [Xen-devel] [PATCH v4 1/2] memory-hotplug: add automatic onlining policy for the newly added memory

2016-01-15 Thread Vitaly Kuznetsov
David Rientjes writes: > On Thu, 14 Jan 2016, Vitaly Kuznetsov wrote: > >> > My suggestion is to just simply document that auto-onlining can add the >> > memory but fail to online it and the failure is silent to userspace. If >> > userspace cares, it can che

[Xen-devel] [PATCH v6 0/2] memory-hotplug: add automatic onlining policy for the newly added memory

2016-01-15 Thread Vitaly Kuznetsov
t; which causes all newly added memory blocks to go online as soon as they're added. The default is "offline". Vitaly Kuznetsov (2): memory-hotplug: add automatic onlining policy for the newly added memory xen_balloon: support memory auto onlining policy Documentation/memory-hotp

[Xen-devel] [PATCH v6 2/2] xen_balloon: support memory auto onlining policy

2016-01-15 Thread Vitaly Kuznetsov
Add support for the newly added kernel memory auto onlining policy to Xen ballon driver. Suggested-by: Daniel Kiper Reviewed-by: Daniel Kiper Acked-by: David Vrabel Signed-off-by: Vitaly Kuznetsov --- Changes since v5: - Change the last 'domU' -> 'target domain' i

[Xen-devel] [PATCH v6 1/2] memory-hotplug: add automatic onlining policy for the newly added memory

2016-01-15 Thread Vitaly Kuznetsov
soon as they're added. The default is "offline". Reviewed-by: Daniel Kiper Signed-off-by: Vitaly Kuznetsov --- Changes since v5: - Mention possible failures during automatic onlining in memory-hotplug.txt [David Rientjes] --- Documentation/m

[Xen-devel] [PATCH] Reset runstate_guest handles on soft reset

2016-01-28 Thread Vitaly Kuznetsov
runstate_guest handles need to be reset to prevent update_runstate_area() corrupting guest's memory after we resume the guest. Signed-off-by: Vitaly Kuznetsov --- xen/common/domain.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/common/domain.c b/xen/common/domain.c index 29

[Xen-devel] [PATCH] xl: don't free additional memory on soft reset

2016-01-28 Thread Vitaly Kuznetsov
We don't need to free anything extra from Dom0 in order to perform soft reset. It can also fail soft reset if it happens that we don't have this memory (which we don't need) available. Signed-off-by: Vitaly Kuznetsov --- tools/libxl/xl_cmdimpl.c | 12 +++- 1 file change

[Xen-devel] [PATCH v2] Reset runstate_guest handles on soft reset

2016-01-28 Thread Vitaly Kuznetsov
runstate_guest handles need to be reset to prevent update_runstate_area() corrupting guest's memory after we resume the guest. Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - use set_xen_guest_handle() instead of raw memset() [Jan Beulich] --- xen/common/domain.c | 3 +++ 1 file ch

Re: [Xen-devel] Using kexec-crashdump with recent Xen and Linux HVM

2015-03-11 Thread Vitaly Kuznetsov
Stefan Bader writes: > After being asked about this I started to play around with Xen-4.4.1/4.5 > together with HVM Linux guest running 3.13/3.16/3.19. With mixed success. > Usually rather failing. > > From a bit of research most activity to enable things were back in 2011. There > was a bit of a

Re: [Xen-devel] Redhat 6 VM crash on Xen when cpu number reaches 64

2015-03-26 Thread Vitaly Kuznetsov
"Ouyang Zhaowei (Charles)" writes: > Hi all: > > Now a days, we tested Redhat 6.2(6.4) on Xen(version 4.1.2). > If we config the cpu number more than 32, it'll show 32 in > the VM, and if we config it 64 cpus, the VM will crash and > the log is list below. > > Can someone tell us why is this happ

Re: [Xen-devel] Xen 4.6 Development Update

2015-02-16 Thread Vitaly Kuznetsov
writes: > Hi all > > We are now one month into 4.6 development window. This is an email to keep > track of all the patch series I gathered. It is by no means complete and / or > acurate. Feel free to reply this email with new projects or correct my > misunderstanding. Hi Wei, I have my "[PATCH

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

2015-09-14 Thread Vitaly Kuznetsov
Wei Liu writes: > Sorry for the delay. > > FYI all other patches of this series were applied by Jan. You only need > to resend this one. Cool, I will. > > See below for a few comments. > > On Fri, Sep 04, 2015 at 03:39:51PM +0200, Vitaly Kuznetsov wrote: >> Use e

[Xen-devel] [PATCH v12 1/1] (lib)xl: soft reset support

2015-09-21 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 v11: - Minor descri

[Xen-devel] [PATCH v12 0/1] toolstack-assisted approach to PVHVM guest kexec

2015-09-21 Thread Vitaly Kuznetsov
v11 of the 'toolstack-assisted approach to pvhvm guest kexec' is available here: http://lists.xenproject.org/archives/html/xen-devel/2015-09/msg00547.html Vitaly Kuznetsov (1): (lib)xl: soft reset support docs/man/xl.cfg.pod.5| 8 +- tools/libxl/libxl.c

[Xen-devel] [PATCH] xen/pvhvm: add soft reset on kexec/kdump support

2015-09-25 Thread Vitaly Kuznetsov
obably OK as by default all unknown shutdown reasons cause domain destroy with a message in toolstack log: 'Unknown shutdown reason code 5. Destroying domain.' which gives a clue to what the problem is and eliminates false expectations. Signed-off-by: Vitaly Kuznetsov --- arch/x86/

Re: [Xen-devel] [PATCH] xen/pvhvm: add soft reset on kexec/kdump support

2015-09-25 Thread Vitaly Kuznetsov
Boris Ostrovsky writes: > On 09/25/2015 09:59 AM, Konrad Rzeszutek Wilk wrote: >> On Fri, Sep 25, 2015 at 11:59:52AM +0200, Vitaly Kuznetsov wrote: >>> Currently there is a number of issues preventing PVHVM Xen guests from >>> doing successful kexec/kdump:

Re: [Xen-devel] [PATCH] xen/pvhvm: add soft reset on kexec/kdump support

2015-09-29 Thread Vitaly Kuznetsov
wrote: >>>>> On 09/25/2015 12:07 PM, Vitaly Kuznetsov wrote: >>>>>>> Also, I am not sure I see how this new op will be used in the >>>>>>> hypervisor --- currently AFAICS it is only processed under >>>>>>> is_hard

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

2015-08-12 Thread Vitaly Kuznetsov
"Jan Beulich" writes: >>>> On 11.08.15 at 21:57, wrote: >> On Tue, Jul 28, 2015 at 03:28:11PM +0200, Vitaly Kuznetsov wrote: >>> @@ -1038,6 +1045,32 @@ void domain_unpause_except_self(struct domain *d) >>> domain_unpause(d); >>&g

Re: [Xen-devel] Failure to boot HVM guest with more than 32 VCPUS

2015-08-12 Thread Vitaly Kuznetsov
"Hao, Xudong" writes: > Hi, > > In X86_64 platform, we noticed an issue that Xen boot a RHEL6u6 or > Fedora22 guest, when configure the VCPU more than 32, the guest will > fail to boot up. The issue is well-known for RHEL6.6 (and is fixed in 6.7 and in 6.6.z) but Fedora22 should boot. The log b

Re: [Xen-devel] Failure to boot HVM guest with more than 32 VCPUS

2015-08-13 Thread Vitaly Kuznetsov
"Hao, Xudong" writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Wednesday, August 12, 2015 5:40 PM >> To: Hao, Xudong >> Cc: xen-devel@lists.xen.org >> Subject: Re: [Xen-devel] Failure to boot HV

Re: [Xen-devel] Failure to boot HVM guest with more than 32 VCPUS

2015-08-13 Thread Vitaly Kuznetsov
"Hao, Xudong" writes: > > Attach the Fedora22 log, a different issue. > Here is the crash: [ 6399.814801] xen_netfront: Initialising Xen virtual ethernet driver [ 6399.814838] [drm] Initialized drm 1.1.0 20060810 [ 6399.838500] xen_netfront: can't alloc rx grant refs [ 6399.838504] net eth0: on

Re: [Xen-devel] Failure to boot HVM guest with more than 32 VCPUS

2015-08-13 Thread Vitaly Kuznetsov
Konrad Rzeszutek Wilk writes: > On August 13, 2015 4:20:11 AM EDT, Vitaly Kuznetsov > wrote: >>"Hao, Xudong" writes: >> >>>> -Original Message- >>>> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >>>> Sent: Wedn

Re: [Xen-devel] Redhat 6 VM crash on Xen when cpu number reaches 64

2015-08-14 Thread Vitaly Kuznetsov
"Ouyangzhaowei (Charles)" writes: >>> Hi all: >>> >>> Now a days, we tested Redhat 6.2(6.4) on Xen(version 4.1.2). >>> If we config the cpu number more than 32, it'll show 32 in >>> the VM, and if we config it 64 cpus, the VM will crash and >>> the log is list below. >>> >>> Can someone tell us w

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

2015-09-01 Thread Vitaly Kuznetsov
Wei Liu writes: [skip] >> >> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c >> index ff0d616..5f5559b 100644 >> --- a/tools/libxl/libxl.c >> +++ b/tools/libxl/libxl.c >> @@ -1478,6 +1478,7 @@ void libxl__domain_destroy(libxl__egc *egc, >> libxl__domain_destroy_state *dds) >>

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

2015-09-01 Thread Vitaly Kuznetsov
Wei Liu writes: > [...] >> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl >> index 9f6ec00..87d8255 100644 >> --- a/tools/libxl/libxl_types.idl >> +++ b/tools/libxl/libxl_types.idl >> @@ -138,6 +138,8 @@ libxl_action_on_shutdown = >> Enumeration("action_on_shutdown", [ >>

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

2015-09-04 Thread Vitaly Kuznetsov
aware of this special page. grant_table_warn_active_grants() is required to find possible misbehaving backends in future. v10 of the 'toolstack-assisted approach to pvhvm guest kexec' is available here: http://lists.xen.org/archives/html/xen-devel/2015-07/msg05054.html Vitaly

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

2015-09-04 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 Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Jan Beulich --- Changes since v10: - None. --- xen/common/event_channel.c | 43

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

2015-09-04 Thread Vitaly Kuznetsov
Use letter 'S' to indicate a domain in such state. Introduce new 'on_soft_reset' action and default it to 'restart' for now. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Wei Liu --- Changes since v10: - Add Acked-by: Wei Liu - Add

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

2015-09-04 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 -ENOSYS for now. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Konrad Rzeszutek Wilk

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

2015-09-04 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 v10: - Adapt to 'm

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

2015-09-04 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 Acked-by: Jan Beulich Reviewed-by: Konrad Rzeszutek Wilk --- Changes since v10: - None --- xen/common/shutdown.c | 6 ++ xen

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

2015-09-04 Thread Vitaly Kuznetsov
ckends can cause a domain to crash right after the soft reset operation and 'g' option won't be available in this case. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Jan Beulich --- Changes since v10: - None. --- xen/commo

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

2015-09-04 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 Acked-by: Daniel De Graaf --- Changes since v10: - None. --- tools/flask/policy/policy/modules/xen/xen.if | 2 +- xen/xsm/flask/hooks.c| 3 +++ xen

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

2015-09-04 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 Acked-by: Jan Beulich --- Changes since v10: - r

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

2015-09-04 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 Reviewed-by: Konrad Rzeszutek Wilk --- Changes since v10: - None. --- tools/libxl/xl.h | 6 ++ tools/libxl/xl_cmdimpl.c | 23

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

2015-09-04 Thread Vitaly Kuznetsov
Introduce xc_domain_soft_reset() function supporting XEN_DOMCTL_soft_reset. Signed-off-by: Vitaly Kuznetsov Acked-by: Wei Liu Reviewed-by: Konrad Rzeszutek Wilk Acked-by: Ian Jackson --- Changes since v10: - None. --- tools/libxc/include/xenctrl.h | 3 +++ tools/libxc/xc_domain.c | 9

[Xen-devel] [PATCH v11 10/11] libxl: add LIBXL_DEVICE_MODEL_SAVE_FILE

2015-09-04 Thread Vitaly Kuznetsov
Use this in libxl_dm instead of hard-coding. Signed-off-by: Vitaly Kuznetsov Acked-by: Ian Campbell --- Changes since v10: - s,XC,LIBXL,g to meet the XC_DEVICE_MODEL_RESTORE_FILE -> LIBXL_DEVICE_MODEL_RESTORE_FILE change. --- tools/libxl/libxl_dm.c | 2 +- tools/libxl/libxl_interna

Re: [Xen-devel] [PATCH v4 0/9] toolstack-based approach to pvhvm guest kexec

2014-12-04 Thread Vitaly Kuznetsov
Olaf Hering writes: > On Wed, Dec 03, Vitaly Kuznetsov wrote: > >> Original description: >> >> When a PVHVM linux guest performs kexec there are lots of things which >> require taking care of: >> - shared info, vcpu_info >> - grants >> - event ch

Re: [Xen-devel] [PATCH v4 0/9] toolstack-based approach to pvhvm guest kexec

2014-12-04 Thread Vitaly Kuznetsov
Wei Liu writes: > On Wed, Dec 03, 2014 at 06:16:12PM +0100, Vitaly Kuznetsov wrote: >> Changes from RFCv3: >> This is the first non-RFC series as no major concerns were expressed. I'm >> trying >> to address Jan's comments. Changes are: >&

<    1   2   3   4   >