[Xen-devel] [PATCH for-4.7] libxl/save: set domain_suspend_state->domid in do_domain_soft_reset()

2016-04-11 Thread Vitaly Kuznetsov
c/s d5c693d "libxl/save: Refactor libxl__domain_suspend_state" broke soft reset as libxl__domain_suspend_device_model() now fails when domid in not set in libxl__domain_suspend_state. Signed-off-by: Vitaly Kuznetsov --- tools/libxl/libxl_create.c | 2 +- 1 file changed, 1 inser

Re: [Xen-devel] [PATCH for-4.7] libxl/save: set domain_suspend_state->domid in do_domain_soft_reset()

2016-04-11 Thread Vitaly Kuznetsov
Wei Liu writes: > Sorry for breaking it! > Np! > On Mon, Apr 11, 2016 at 02:20:04PM +0200, Vitaly Kuznetsov wrote: >> c/s d5c693d "libxl/save: Refactor libxl__domain_suspend_state" broke soft >> reset as libxl__domain_suspend_device_model() now fa

Re: [Xen-devel] Xen 4.7 Headline Features (for PR)

2016-04-22 Thread Vitaly Kuznetsov
George Dunlap writes: > > soft reset for pv guests > For HVM guests I guess. -- Vitaly ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel

[Xen-devel] [PATCH RFC] x86/smpboot: Set safer __max_logical_packages limit

2017-04-20 Thread Vitaly Kuznetsov
logical package management more robust") Signed-off-by: Vitaly Kuznetsov --- arch/x86/kernel/smpboot.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index bd1f1ad..85f41cd 100644 --- a/arch/x86/kerne

Re: [Xen-devel] [PATCH RFC] x86/smpboot: Set safer __max_logical_packages limit

2017-04-20 Thread Vitaly Kuznetsov
Peter Zijlstra writes: > On Thu, Apr 20, 2017 at 03:24:53PM +0200, Vitaly Kuznetsov wrote: >> In this patch I suggest we set __max_logical_packages based on the >> max_physical_pkg_id and total_cpus, > > So my 4 socket 144 CPU system will then get max_physical_pkg_i

Re: [Xen-devel] [PATCH RFC] x86/smpboot: Set safer __max_logical_packages limit

2017-04-20 Thread Vitaly Kuznetsov
Boris Ostrovsky writes: > On 04/20/2017 11:40 AM, Vitaly Kuznetsov wrote: >> Peter Zijlstra writes: >> >>> On Thu, Apr 20, 2017 at 03:24:53PM +0200, Vitaly Kuznetsov wrote: >>>> In this patch I suggest we set __max_logical_packages based on the >>>&g

[Xen-devel] [PATCH] xen-netfront: avoid crashing on resume after a failure in talk_to_netback()

2017-05-04 Thread Vitaly Kuznetsov
again after resume. Reset drvdata in netback_changed() the same way we reset it in netfront_probe() and check for NULL in both netfront_resume() and netback_changed() to properly handle the situation. Signed-off-by: Vitaly Kuznetsov --- I apologize for sending this during the merge window, I'

Re: [Xen-devel] [PATCH] xen-netfront: avoid crashing on resume after a failure in talk_to_netback()

2017-05-05 Thread Vitaly Kuznetsov
David Miller writes: > From: Vitaly Kuznetsov > Date: Thu, 4 May 2017 14:23:04 +0200 > >> Unavoidable crashes in netfront_resume() and netback_changed() after a >> previous fail in talk_to_netback() (e.g. when we fail to read MAC from >> xenstore) were disc

[Xen-devel] [PATCH v2] xen-netfront: avoid crashing on resume after a failure in talk_to_netback()

2017-05-11 Thread Vitaly Kuznetsov
after resume. Fix the bug by removing the whole xen device completely with device_unregister(), this guarantees we won't have any calls into netfront after a failure. Signed-off-by: Vitaly Kuznetsov --- Changes since v1: instead of cleaning drvdata and checking for it in netfront_re

Re: [Xen-devel] Support of lguest?

2017-05-15 Thread Vitaly Kuznetsov
Juergen Gross writes: > Lguest and Xen pv-guests are the only users of pv_mmu_ops (with the > one exception of the .exit_mmap member, which is being used by Xen > HVM-guests, too). > > As it is possible now to build a kernel without Xen pv-guest support > while keeping PVH and PVHVM support, I th

[Xen-devel] [PATCH RFC] x86: enable RCU based table free when PARAVIRT

2017-08-17 Thread Vitaly Kuznetsov
ggested-by: Peter Zijlstra Signed-off-by: Vitaly Kuznetsov --- arch/x86/Kconfig | 1 + arch/x86/include/asm/tlb.h | 7 +++ arch/x86/mm/pgtable.c | 15 +++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 78

Re: [Xen-devel] [PATCH RFC] x86: enable RCU based table free when PARAVIRT

2017-08-18 Thread Vitaly Kuznetsov
Juergen Gross writes: > On 17/08/17 11:20, Vitaly Kuznetsov wrote: >> On x86 software page-table walkers depend on the fact that remote TLB flush >> does an IPI: walk is performed lockless but with interrupts disabled and in >> case the pagetable is freed the freeing CP

[Xen-devel] [PATCH] x86: enable RCU based table free when PARAVIRT

2017-08-23 Thread Vitaly Kuznetsov
ggested-by: Peter Zijlstra Signed-off-by: Vitaly Kuznetsov Acked-by: Juergen Gross --- Changes since RFC: - Added Juergen's Acked-by. Fixed a typo in the description. I didn't get any other feedback on my RFC, assuming there are no objections, dropping RFC. --- arch/x86/Kconfig

Re: [Xen-devel] [PATCH] x86: enable RCU based table free when PARAVIRT

2017-08-24 Thread Vitaly Kuznetsov
Linus Torvalds writes: > On Wed, Aug 23, 2017 at 3:36 PM, Kirill A. Shutemov > wrote: >> >> Below is test cases that allocates a lot of page tables and measuare >> fork/exit time. (I'm not entirely sure it's the best way to stress the >> codepath.) > > Looks ok to me. Doing a profile (without th

[Xen-devel] [PATCH v2] x86: enable RCU based table free

2017-08-24 Thread Vitaly Kuznetsov
x27;t show any notable performance impact. Suggested-by: Peter Zijlstra Signed-off-by: Vitaly Kuznetsov Acked-by: Juergen Gross --- Changes since v1: - Enable HAVE_RCU_TABLE_FREE unconditionally to avoid different code pathes for no reason [Linus Torvalds] --- arch/x86/Kconfig | 1 +

Re: [Xen-devel] [PATCH v2] x86: enable RCU based table free

2017-08-24 Thread Vitaly Kuznetsov
Peter Zijlstra writes: > On Thu, Aug 24, 2017 at 11:22:58AM +0200, Vitaly Kuznetsov wrote: > >> diff --git a/arch/x86/include/asm/tlb.h b/arch/x86/include/asm/tlb.h >> index c7797307fc2b..d43a7fcafee9 100644 >> --- a/arch/x86/include/asm/tlb.h >> +++ b/arch/x86

Re: [Xen-devel] [PATCH v2] x86: enable RCU based table free

2017-08-25 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Peter Zijlstra writes: > >> On Thu, Aug 24, 2017 at 11:22:58AM +0200, Vitaly Kuznetsov wrote: >> >>> diff --git a/arch/x86/include/asm/tlb.h b/arch/x86/include/asm/tlb.h >>> index c7797307fc2b..d43a7fcafee9 100644 >>> --

[Xen-devel] [PATCH v3] x86: enable RCU based table free

2017-08-28 Thread Vitaly Kuznetsov
x27;t show any notable performance impact. Suggested-by: Peter Zijlstra Signed-off-by: Vitaly Kuznetsov Acked-by: Juergen Gross Acked-by: Kirill A. Shutemov --- Changes since v2: - Add Kirill's Acked-by. - Add a comment to __tlb_remove_table [Peter Zijlstra] --- arch/x86/Kconfig |

[Xen-devel] [PATCH] xen: reset creation_finished flag on soft reset

2017-09-01 Thread Vitaly Kuznetsov
to 'true' when toolstack unpauses the domain, just like after normal creation. Signed-off-by: Vitaly Kuznetsov --- xen/common/domain.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/common/domain.c b/xen/common/domain.c index b22aacc57e..b529c5d7ad 100644 --- a/xen/common/

Re: [Xen-devel] [PATCH] xen: reset creation_finished flag on soft reset

2017-09-01 Thread Vitaly Kuznetsov
Andrew Cooper writes: > On 01/09/2017 10:11, Vitaly Kuznetsov wrote: >> C/s e7dabe5 ("x86/hvm: don't unconditionally create a default ioreq >> server") broke soft reset when QEMU traditional is being used. During >> soft reset QEMU is relaunched and default io

Re: [Xen-devel] [PATCH] xen: reset creation_finished flag on soft reset

2017-09-01 Thread Vitaly Kuznetsov
Paul Durrant writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: 01 September 2017 10:27 >> To: Andrew Cooper ; Paul Durrant >> >> Cc: xen-devel@lists.xen.org; George Dunlap ; >> Ian Jackson ; Jan Be

Re: [Xen-devel] [PATCH] xen: reset creation_finished flag on soft reset

2017-09-05 Thread Vitaly Kuznetsov
ncluding pci pass-through seems to work. However, I'm not anywhere close to '20-30 lines' -- it's an order of magnitude more :-) Anyway, here is the patch (attached). If everyone agrees the change is appropriate for qemu-traditional I can sent it out. No additional changes to the

[Xen-devel] [PATCH qemu-traditional] switch to the new ioreq server API

2017-09-06 Thread Vitaly Kuznetsov
I_CONFIG handling code is stolen as-is from qemu-upstream. Signed-off-by: Vitaly Kuznetsov --- hw/pci.c| 5 ++ hw/xen_common.h | 163 hw/xen_machine_fv.c | 31 -- i386-dm/exec-dm.c | 7 +++ i386-dm/helper2.c

Re: [Xen-devel] [PATCH 00/13] x86/paravirt: Make pv ops code generation more closely match reality

2017-10-06 Thread Vitaly Kuznetsov
Josh Poimboeuf writes: > - For the most common runtime cases (everything except Xen and vSMP), > vmlinux disassembly now matches what the actual runtime code looks > like. This improves debuggability and kernel developer sanity (a > precious resource). > > ... > > - It's hopefully a first

Re: [Xen-devel] [PATCH][tip] x86/paravirt: Make the virt_spin_lock_key setup after jump_label_init()

2017-10-27 Thread Vitaly Kuznetsov
Boris Petkov writes: > On October 27, 2017 6:02:00 PM GMT+02:00, Dou Liyang > wrote: >>Commit: >> >> 9043442b43b1 ("locking/paravirt: Use new static key for controlling >> call of virt_spin_lock()") >> >>set the static virt_spin_lock_key to a value before jump_label_init() >>has been called,

[Xen-devel] [PATCH] xen/x86: Don't BUG on CPU0 offlining

2017-06-26 Thread Vitaly Kuznetsov
CONFIG_BOOTPARAM_HOTPLUG_CPU0 allows to offline CPU0 but Xen HVM guests BUG() in xen_teardown_timer(). Remove the BUG_ON(), this is probably a leftover from ancient times when CPU0 hotplug was impossible, it works just fine for HVM. Signed-off-by: Vitaly Kuznetsov --- - CPU0 hotplug is currently

Re: [Xen-devel] [PATCH] xen/x86: Don't BUG on CPU0 offlining

2017-06-28 Thread Vitaly Kuznetsov
Konrad Rzeszutek Wilk writes: > On Mon, Jun 26, 2017 at 06:39:30PM +0200, Vitaly Kuznetsov wrote: >> CONFIG_BOOTPARAM_HOTPLUG_CPU0 allows to offline CPU0 but Xen HVM guests >> BUG() in xen_teardown_timer(). Remove the BUG_ON(), this is probably a >> leftover from ancient ti

Re: [Xen-devel] [PATCH qemu-traditional] switch to the new ioreq server API

2017-09-21 Thread Vitaly Kuznetsov
Paul Durrant writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: 06 September 2017 10:29 >> To: xen-devel@lists.xen.org >> Cc: Paul Durrant ; Ian Jackson >> >> Subject: [PATCH qemu-traditional] switch

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

2017-03-28 Thread Vitaly Kuznetsov
Juergen Gross writes: > On 14/03/17 18:35, Vitaly Kuznetsov wrote: >> Changes since v2: ... > > Series pushed to kernel/git/xen/tip.git for-linus-4.12 with one fixup > patch added: smp_pv.c had a duplicate xen_call_function_interrupt() > defined but not used. I remo

Re: [Xen-devel] linux-next: manual merge of the xen-tip tree with the tip tree

2017-03-29 Thread Vitaly Kuznetsov
Juergen Gross writes: > On 29/03/17 10:59, Ingo Molnar wrote: >> >> * Juergen Gross wrote: >> >>> On 29/03/17 05:35, Stephen Rothwell wrote: Hi all, Today's linux-next merge of the xen-tip tree got a conflict in: arch/x86/xen/enlighten.c between commits: >>

Re: [Xen-devel] linux-next: manual merge of the xen-tip tree with the tip tree

2017-04-04 Thread Vitaly Kuznetsov
Juergen Gross writes: > On 29/03/17 12:06, Vitaly Kuznetsov wrote: >> Juergen Gross writes: >>> I'll create another branch for-linus-4.12 based on the tip tree next >>> week which will be subject to the pull request for Linus. As soon as >>> for-linus-4.

Re: [Xen-devel] [PATCH net-next] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-08-29 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > David Vrabel writes: > >> On 22/08/16 16:42, Vitaly Kuznetsov wrote: >>> >>> I see two ways to fix the issue: >>> - Change the 'wire' protocol between netfront and netback to start keeping >>> the original S

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

2016-09-05 Thread Vitaly Kuznetsov
Julien Grall writes: > Hi Vitaly, > > On 26/07/16 13:30, 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

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

2016-09-06 Thread Vitaly Kuznetsov
Stefano Stabellini writes: > On Mon, 5 Sep 2016, Vitaly Kuznetsov wrote: >> Julien Grall writes: >> >> > Hi Vitaly, >> > >> > On 26/07/16 13:30, Vitaly Kuznetsov wrote: >> >> It may happen that Xen's and Linux's ideas of vCPU id

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

2016-09-07 Thread Vitaly Kuznetsov
Stefano Stabellini writes: > On Tue, 6 Sep 2016, Vitaly Kuznetsov wrote: >> Stefano Stabellini writes: >> >> > On Mon, 5 Sep 2016, Vitaly Kuznetsov wrote: >> >> Julien Grall writes: >> >> >> >> > Hi Vitaly, >> >>

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

2016-09-07 Thread Vitaly Kuznetsov
Julien Grall writes: > Hi Vitaly, > > On 07/09/2016 10:07, Vitaly Kuznetsov wrote: >> Stefano Stabellini writes: >>> I don't know that much about cpuid, but the virtual MPIDR is constructed >>> from the vcpu id right now: >>> >>> v-&

[Xen-devel] [PATCH] arm/xen: fix SMP guests boot

2016-09-08 Thread Vitaly Kuznetsov
M and use it to initialize xen_vcpu_id mapping. This is the same trick we currently do on x86. Reported-by: Julien Grall Tested-by: Wei Chen Signed-off-by: Vitaly Kuznetsov --- It would be nice if this patch could still make it to 4.8 as all SMP ARM/Xen guests are currently broken. --- ar

Re: [Xen-devel] [PATCH net-next] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-09 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Vitaly Kuznetsov writes: > >> David Vrabel writes: >> >>> On 22/08/16 16:42, Vitaly Kuznetsov wrote: >>>> >>>> I see two ways to fix the issue: >>>> - Change the 'wire' protocol between netfr

Re: [Xen-devel] [PATCH net-next] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-12 Thread Vitaly Kuznetsov
David Vrabel writes: > On 22/08/16 16:42, Vitaly Kuznetsov wrote: >> Small packet loss is reported on complex multi host network configurations >> including tunnels, NAT, ... My investigation led me to the following check >> in netback which drops packets: >> >>

[Xen-devel] [PATCH net-next RESEND] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-16 Thread Vitaly Kuznetsov
erable short-term and shouldn't bring significant performance degradation as such packets are rare. That's what this patch is trying to achieve with skb_copy(). Signed-off-by: Vitaly Kuznetsov Acked-by: David Vrabel --- - This is just a RESEND with David's ACK added. ---

Re: [Xen-devel] [PATCH net-next RESEND] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-19 Thread Vitaly Kuznetsov
David Miller writes: > From: Vitaly Kuznetsov > Date: Fri, 16 Sep 2016 12:59:14 +0200 > >> @@ -595,6 +596,19 @@ static int xennet_start_xmit(struct sk_buff *skb, >> struct net_device *dev) >> offset = offset_in_page(skb->data); >> len = skb_headlen

[Xen-devel] [PATCH net-next v2] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-19 Thread Vitaly Kuznetsov
erable short-term and shouldn't bring significant performance degradation as such packets are rare. That's what this patch is trying to achieve with skb_copy(). Signed-off-by: Vitaly Kuznetsov Acked-by: David Vrabel --- - Changes since 'v1': Recalculate 'len' a

Re: [Xen-devel] [PATCH net-next RESEND] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-19 Thread Vitaly Kuznetsov
David Vrabel writes: > On 19/09/16 11:22, Vitaly Kuznetsov wrote: >> David Miller writes: >> >>> From: Vitaly Kuznetsov >>> Date: Fri, 16 Sep 2016 12:59:14 +0200 >>> >>>> @@ -595,6 +596,19 @@ static int xennet_start_xmit(struct sk_b

[Xen-devel] [PATCH net-next v3] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-09-19 Thread Vitaly Kuznetsov
erable short-term and shouldn't bring significant performance degradation as such packets are rare. That's what this patch is trying to achieve with skb_copy(). Signed-off-by: Vitaly Kuznetsov Acked-by: David Vrabel --- - Changes since 'v2': Move 'len' calculat

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

2017-02-24 Thread Vitaly Kuznetsov
Get read of #ifdefs in suspend.c by splitting the code into suspend_pv.c and suspend_hvm.c. Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/Makefile | 4 ++-- arch/x86/xen/suspend.c | 58 -- arch/x86/xen/suspend_hvm.c | 22

[Xen-devel] [PATCH 1/5] x86/xen: start untangling PV and PVHVM guest support code

2017-02-24 Thread Vitaly Kuznetsov
-off-by: Vitaly Kuznetsov --- arch/x86/include/asm/hypervisor.h |3 +- arch/x86/kernel/cpu/hypervisor.c |7 +- arch/x86/kernel/process_64.c |2 +- arch/x86/xen/Kconfig | 23 +- arch/x86/xen/Makefile | 10 +- arch/x86/xen/enlighten.c | 1904

[Xen-devel] [PATCH 0/5] x86/xen: untangle PV and PVHVM guest support code

2017-02-24 Thread Vitaly Kuznetsov
-only and PVHVM-only builds, booted and did save/restore test. I also tried the newly introduced PVHv2 guest, it even worked! Vitaly Kuznetsov (5): x86/xen: start untangling PV and PVHVM guest support code x86/xen: split smp.c for PV and PVHVM guests x86/xen: put setup.c, mmu.c and p2m.c

[Xen-devel] [PATCH 2/5] x86/xen: split smp.c for PV and PVHVM guests

2017-02-24 Thread Vitaly Kuznetsov
More or less mechanically split smp.c into 3 files. XEN_PV_SMP and XEN_PVHVM_SMP config options added to support the change. Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/Kconfig| 8 + arch/x86/xen/Makefile | 3 + arch/x86/xen/enlighten_pv.c | 9 + arch/x86/xen/smp.c

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

2017-02-24 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 --- arch/x86/xen/Kconfig | 2 +- arch/x86/xen/Makefile | 5 +++-- arch/x86/xen/pmu.h| 5 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/x86

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

2017-02-27 Thread Vitaly Kuznetsov
Michal Hocko writes: > From: Michal Hocko > > This knob has been added by 31bc3858ea3e ("memory-hotplug: add automatic > onlining policy for the newly added memory") mainly to cover memory > hotplug based balooning solutions currently implemented for HyperV > and Xen. Both of them want to online

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

2017-02-27 Thread Vitaly Kuznetsov
Michal Hocko writes: > On Mon 27-02-17 11:02:09, Vitaly Kuznetsov wrote: > [...] >> I don't have anything new to add to the discussion happened last week >> but I'd like to summarize my arguments against this change: >> >> 1) This patch doesn't so

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

2017-02-27 Thread Vitaly Kuznetsov
Heiko Carstens writes: > On Mon, Feb 27, 2017 at 11:02:09AM +0100, Vitaly Kuznetsov wrote: >> A couple of other thoughts: >> 1) Having all newly added memory online ASAP is probably what people >> want for all virtual machines. Sorry, obviously missed 'x86' in th

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

2017-02-27 Thread Vitaly Kuznetsov
Michal Hocko writes: > On Mon 27-02-17 11:49:43, Vitaly Kuznetsov wrote: >> Michal Hocko writes: >> >> > On Mon 27-02-17 11:02:09, Vitaly Kuznetsov wrote: >> > [...] >> >> I don't have anything new to add to the discussion happened last week &g

Re: [Xen-devel] [PATCH 1/5] x86/xen: start untangling PV and PVHVM guest support code

2017-03-01 Thread Vitaly Kuznetsov
Juergen Gross writes: > On 24/02/17 17:14, Vitaly Kuznetsov wrote: >> Introduce CONFIG_XEN_PV config option and split enlighten.c into >> 4 files. Temporary add #ifdef CONFIG_XEN_PV to smp.c and mmu.c to >> not break the build and not make the patch even bigger. >

[Xen-devel] [RFC PATCH KERNEL 3/4] x86/xen: put setup.c, mmu.c and p2m.c under CONFIG_XEN_PV

2016-11-14 Thread Vitaly Kuznetsov
HVM-only builds. Signed-off-by: Vitaly Kuznetsov --- arch/x86/include/asm/xen/page.h | 44 ++- arch/x86/xen/Makefile | 10 +- arch/x86/xen/mmu.c | 284 arch/x86/xen/mmu_common.c | 219 +++ arch/x8

[Xen-devel] [RFC PATCH KERNEL 0/4] x86/xen: untangle PV and PVHVM guest support code

2016-11-14 Thread Vitaly Kuznetsov
her such refactoring will be welcomed. 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. Vitaly Kuznetsov (4): x86/xen: start untangling PV and PVHVM guest support code x86/xen: split smp.

[Xen-devel] [RFC PATCH KERNEL 1/4] x86/xen: start untangling PV and PVHVM guest support code

2016-11-14 Thread Vitaly Kuznetsov
-off-by: Vitaly Kuznetsov --- arch/x86/include/asm/hypervisor.h | 3 +- arch/x86/kernel/cpu/hypervisor.c | 7 +- arch/x86/kernel/process_64.c | 2 +- arch/x86/xen/Kconfig | 25 ++- arch/x86/xen/Makefile | 7 +- arch/x86/xen/enlighten.c | 388

[Xen-devel] [RFC PATCH KERNEL 4/4] x86/xen: put setup.c, pmu.c and apic.c under CONFIG_XEN_PV

2016-11-14 Thread Vitaly Kuznetsov
xen_pmu_init/finish() functions are used in suspend.c and enlighten_common.c, add stubs for now. Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/Kconfig | 2 +- arch/x86/xen/Makefile | 4 ++-- arch/x86/xen/pmu.h| 5 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch

[Xen-devel] [RFC PATCH KERNEL 2/4] x86/xen: split smp.c for PV and PVHVM guests

2016-11-14 Thread Vitaly Kuznetsov
More or less mechanically split smp.c into 3 files. XEN_PV_SMP and XEN_PVHVM_SMP config options added to support the change. Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/Kconfig | 8 ++ arch/x86/xen/Makefile | 5 +- arch/x86/xen/enlighten.c | 8 ++ arch/x86/xen/smp.c

Re: [Xen-devel] [RFC PATCH KERNEL 0/4] x86/xen: untangle PV and PVHVM guest support code

2016-11-15 Thread Vitaly Kuznetsov
Boris Ostrovsky writes: > On 11/14/2016 01:21 PM, David Vrabel wrote: >> On 14/11/16 17:17, Vitaly Kuznetsov wrote: >>> Hi, >>> >>> I have a long-standing idea to separate PV and PVHVM code in kernel and >>> introduce Kconfig options to make it p

Re: [Xen-devel] [RFC PATCH KERNEL 1/4] x86/xen: start untangling PV and PVHVM guest support code

2016-11-15 Thread Vitaly Kuznetsov
David Vrabel writes: > On 14/11/16 17:17, Vitaly Kuznetsov wrote: >> Introduce CONFIG_XEN_PV config option and split enlighten.c into >> 3 files. Temporary add #ifdef CONFIG_XEN_PV to smp.c and mmu.c to >> not break the build and not make the patch even bigger. >

[Xen-devel] [PATCH KERNEL] xen/events: use xen_vcpu_id mapping for EVTCHNOP_status

2016-11-23 Thread Vitaly Kuznetsov
EVTCHNOP_status hypercall returns Xen's idea of vcpu id so we need to compare it against xen_vcpu_id mapping, not the Linux cpu id. Suggested-by: Radim Krcmar Signed-off-by: Vitaly Kuznetsov --- drivers/xen/events/events_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

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

2016-07-25 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > 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_cpu() we try booting > on the vCPU which crashed.

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

2016-07-25 Thread Vitaly Kuznetsov
Julien Grall writes: > Hi David, > > On 25/07/16 13:38, David Vrabel wrote: >> On 30/06/16 16:56, 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

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

2016-07-25 Thread Vitaly Kuznetsov
Julien Grall writes: > Hello, > > On 25/07/16 14:39, Vitaly Kuznetsov wrote: >> Julien Grall writes: >> >>> Hi David, >>> >>> On 25/07/16 13:38, David Vrabel wrote: >>>> On 30/06/16 16:56, Vitaly Kuznetsov wrote: >>>

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

2016-07-26 Thread Vitaly Kuznetsov
Stefano Stabellini writes: > On Mon, 25 Jul 2016, Vitaly Kuznetsov wrote: >> >> While we're not obliged to have the same type for xen_vcpu_id on all >> arches I see no point in diverging without a reason. I can do v3 making >> the mapping uint32 > > I

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

2016-07-26 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 v2: - Use uint32_t for xen_vcpu_id mapping [Julien Grall] Changes since v1: - Introduce xen_vcp

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

2016-07-26 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 v3 0/9] xen: pvhvm: support bootup on secondary vCPUs

2016-07-26 Thread Vitaly Kuznetsov
Changes since v1: - "x86/acpi: store ACPI ids from MADT for future usage" patch added. - Use ACPI 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_

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

2016-07-26 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 v3 7/9] xen/events: fifo: use xen_vcpu_id mapping

2016-07-26 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 v3 8/9] xen/evtchn: use xen_vcpu_id mapping

2016-07-26 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

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

2016-07-26 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 v3 9/9] xen/pvhvm: run xen_vcpu_setup() for the boot CPU

2016-07-26 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 v3 5/9] x86/xen: use xen_vcpu_id mapping when pointing vcpu_info to the shared_info page

2016-07-26 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 v3 4/9] x86/xen: use xen_vcpu_id mapping for HYPERVISOR_vcpu_op

2016-07-26 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

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

2016-07-26 Thread Vitaly Kuznetsov
David Vrabel writes: > On 26/07/16 13:30, 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 v3 0/9] xen: pvhvm: support bootup on secondary vCPUs

2016-07-27 Thread Vitaly Kuznetsov
Stefano Stabellini writes: > On Tue, 26 Jul 2016, Vitaly Kuznetsov wrote: >> David Vrabel writes: >> >> > On 26/07/16 13:30, Vitaly Kuznetsov wrote: >> >> It may happen that Xen's and Linux's ideas of vCPU id diverge. In >> >> parti

Re: [Xen-devel] Xen 4.7.0 boot PANIC on kernel 4.7.0-4 + UEFI ?

2016-07-28 Thread Vitaly Kuznetsov
; > for_each_efi_memory_desc(md) { > unsigned long long start = md->phys_addr; > 123 unsigned long long size = md->num_pages << > EFI_PAGE_SHIFT; > While I see that you're running linux-4.7 could you please double-check that it has the following: commit 55f1ea15216a5a14c96738bd5284100a00ffa9dc Author: Vitaly Kuznetsov Date: Tue May 31 11:23:43 2016 +0100 efi: Fix for_each_efi_memory_desc_in_map() for empty memmaps ? -- Vitaly ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

[Xen-devel] [PATCH linux] xen: change the type of xen_vcpu_id to uint32_t

2016-07-28 Thread Vitaly Kuznetsov
We pass xen_vcpu_id mapping information to hypercalls which require uint32_t type so it would be cleaner to have it as uint32_t. The initializer to -1 can be dropped as we always do the mapping before using it and we never check the 'not set' value anyway. Signed-off-by: Vitaly

Re: [Xen-devel] [PATCH linux] xen: change the type of xen_vcpu_id to uint32_t

2016-07-29 Thread Vitaly Kuznetsov
David Vrabel writes: > On 28/07/16 17:24, Vitaly Kuznetsov wrote: >> We pass xen_vcpu_id mapping information to hypercalls which require >> uint32_t type so it would be cleaner to have it as uint32_t. The >> initializer to -1 can be dropped as we always do the mapping befo

[Xen-devel] [PATCH linux v2] xen: change the type of xen_vcpu_id to uint32_t

2016-07-29 Thread Vitaly Kuznetsov
We pass xen_vcpu_id mapping information to hypercalls which require uint32_t type so it would be cleaner to have it as uint32_t. The initializer to -1 can be dropped as we always do the mapping before using it and we never check the 'not set' value anyway. Signed-off-by: Vitaly

[Xen-devel] [PATCH net-next] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-08-22 Thread Vitaly Kuznetsov
erable short-term and shouldn't bring significant performance degradation as such packets are rare. That's what this patch is trying to achieve with skb_copy(). Signed-off-by: Vitaly Kuznetsov --- drivers/net/xen-netfront.c | 14 ++ 1 file changed, 14 insertions(+) d

Re: [Xen-devel] [PATCH net-next] xen-netfront: avoid packet loss when ethernet header crosses page boundary

2016-08-23 Thread Vitaly Kuznetsov
David Vrabel writes: > On 22/08/16 16:42, Vitaly Kuznetsov wrote: >> >> I see two ways to fix the issue: >> - Change the 'wire' protocol between netfront and netback to start keeping >> the original SKB structure. We'll have to add a flag indicating

[Xen-devel] [PATCH RFC] xen: make it possible to disable XEN_TMEM

2016-10-03 Thread Vitaly Kuznetsov
too. In theory, both these options could be unified under the XEN_SELFBALLOONING but other (out-of-tree) users of the tmem interface may exist and someone may want to keep them supported without enabling XEN_SELFBALLOONING. Signed-off-by: Vitaly Kuznetsov --- - I don't know much about tmem an

Re: [Xen-devel] [PATCH RFC] xen: make it possible to disable XEN_TMEM

2016-10-03 Thread Vitaly Kuznetsov
Konrad Rzeszutek Wilk writes: > On Mon, Oct 03, 2016 at 04:02:48PM +0200, Vitaly Kuznetsov wrote: >> XEN_TMEM config option has no prompt and it is enabled as module by >> default if CLEANCACHE or FRONTSWAP options are set with no way to disable >> it. The only in-tree user

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

2017-03-02 Thread Vitaly Kuznetsov
ible 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 Kuzne

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

2017-03-02 Thread Vitaly Kuznetsov
All code to supprot Xen PV will get under this new option. For the beginning, check for it in the common code. Signed-off-by: Vitaly Kuznetsov --- arch/x86/kernel/cpu/hypervisor.c | 4 +++- arch/x86/kernel/process_64.c | 2 +- arch/x86/xen/Kconfig | 23

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

2017-03-02 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 --- arch/x86/xen/smp.c | 49 ++--- 1 file changed, 30 insertions(+), 19

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

2017-03-02 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 --- ar

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

2017-03-02 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 --- arch/x86/include/asm/hypervisor.h | 3

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

2017-03-02 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 --- arch/x86/xen/Makefile

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

2017-03-02 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 --- arch/x86/xen/Makefile| 2 + arch/x86/xen/enlighten.c | 110 - arch/x86/xen/enlighten_pvh.c | 114

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

2017-03-02 Thread Vitaly Kuznetsov
xen_pmu_init/finish() functions are used in suspend.c and enlighten.c, add stubs for now. Reviewed-by: Juergen Gross Signed-off-by: Vitaly Kuznetsov --- 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 v2 07/21] x86/xen: split xen_smp_intr_init()/xen_smp_intr_free()

2017-03-02 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 --- arch/x86/xen/enlighten_pv.c | 9 + arch/x86/xen

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

2017-03-02 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 --- arch/x86/xen/smp.c | 26 -- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c

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

2017-03-02 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 --- arch/x86/xen/enlighten.c | 12 ++-- arch/x86/xen/xen-ops.h | 2 ++ 2 files chang

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

2017-03-02 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 --- include/xen/xen-ops.h | 14 ++ 1 file changed, 14 insertions(+) diff

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

2017-03-02 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 --- 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-head.S index 37794e4

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

2017-03-02 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. Signed-off-by: Vitaly Kuznetsov --- arch/x86/xen/Makefile | 2 +- arch/x86/xen/smp.c| 487 +--- arch/x86/xen

  1   2   3   4   >