[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

[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

Re: [PATCH 0/3] Drivers: hv: vmbus: Some miscellaneous fixes

2016-07-29 Thread Vitaly Kuznetsov
"K. Y. Srinivasan" writes: > Some miscellaneous fixes. > > Vitaly Kuznetsov (3): > Drivers: hv: avoid vfree() on crash > Drivers: hv: get rid of redundant messagecount in > create_gpadl_header() > Drivers: hv: don't leak memory in vmbus_establish_

Re: [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: [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-&

[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

[PATCH 4/4] Drivers: hv: balloon: replace ha_region_mutex with spinlock

2016-08-05 Thread Vitaly Kuznetsov
list_for_each -> list_for_each_entry as we actually need entries in all these cases, drop meaningless list_empty() checks. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 98 ++--- 1 file changed, 53 insertions(+), 45 deletions(-) diff --git a/drivers/

[PATCH 3/4] Drivers: hv: balloon: get rid on ol_waitevent

2016-08-05 Thread Vitaly Kuznetsov
With the recently introduced in-kernel memory onlining (MEMORY_HOTPLUG_DEFAULT_ONLINE) these it no point in waiting for pages to come online in the driver and in case the feature is disabled the 5 second wait won't help. Get rid of the waiting. Signed-off-by: Vitaly Kuznetsov --- drive

[PATCH 0/4] Drivers: hv: balloon: fix WS2012 memory hotplug issues and do some cleanup

2016-08-05 Thread Vitaly Kuznetsov
the locking fine-grained with a spinlock. Vitaly Kuznetsov (4): Drivers: hv: balloon: keep track of where ha_region starts Drivers: hv: balloon: account for gaps in hot add regions Drivers: hv: balloon: get rid on ol_waitevent Drivers: hv: balloon: replace ha_region_mutex with spinlock

[PATCH 2/4] Drivers: hv: balloon: account for gaps in hot add regions

2016-08-05 Thread Vitaly Kuznetsov
and our current logic doesn't allow that. Instead, create a list of such 'gaps' and check for them in the page online callback. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 107 +--- 1 file changed, 83 insertions

[PATCH 1/4] Drivers: hv: balloon: keep track of where ha_region starts

2016-08-05 Thread Vitaly Kuznetsov
'moving window' was wrong (as there is no guarantee that hot add requests come ordered) we should still keep track of covered_start_pfn. This is not a revert, the logic is different. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_balloon.c | 7 +-- 1 file changed, 5 insertions(+),

Re: [PATCH 2/4] Drivers: hv: balloon: account for gaps in hot add regions

2016-08-08 Thread Vitaly Kuznetsov
"Alex Ng (LIS)" writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Friday, August 5, 2016 3:49 AM >> To: de...@linuxdriverproject.org >> Cc: linux-kernel@vger.kernel.org; Haiyang Zhang ; >> KY Srin

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

[PATCH v2 2/2] Drivers: hv: get rid of id in struct vmbus_channel

2016-08-23 Thread Vitaly Kuznetsov
The auto incremented counter is not being used anymore, get rid of it. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/channel_mgmt.c | 2 -- include/linux/hyperv.h| 3 --- 2 files changed, 5 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index b6c1211

[PATCH v2 0/2] Drivers: hv: vmbus: make bus ids in sysfs persistent

2016-08-23 Thread Vitaly Kuznetsov
of an auto incremented counter. Changes since v1: - Use if_instance instead of relid [K. Y. Srinivasan] Vitaly Kuznetsov (2): Drivers: hv: make VMBus bus ids persistent Drivers: hv: get rid of id in struct vmbus_channel drivers/hv/channel_mgmt.c | 2 -- drivers/hv/vmbus_drv.c| 4

[PATCH v2 1/2] Drivers: hv: make VMBus bus ids persistent

2016-08-23 Thread Vitaly Kuznetsov
. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/vmbus_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index e82f7e1..ca7ae7a 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -961,8 +961,8 @@ int

Re: [PATCH 2/5] Drivers: hv: balloon: account for gaps in hot add regions

2016-08-25 Thread Vitaly Kuznetsov
Yauheni Kaliuta writes: > Hi, kys! > >> On Wed, 24 Aug 2016 16:23:10 -0700, kys wrote: > > [...] > > > -static bool pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt) > > +static int pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt) > > { > >struct list_head *cur

Re: [tip:x86/platform] x86/hyper-v: Use hypercall for remote TLB flush

2017-08-16 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > Peter Zijlstra writes: > >> On Fri, Aug 11, 2017 at 09:16:29AM -0700, Linus Torvalds wrote: >>> On Fri, Aug 11, 2017 at 2:03 AM, Peter Zijlstra >>> wrote: >>> > >>> > I'm sure we talked about using HAVE_RC

Re: [tip:x86/platform] x86/hyper-v: Use hypercall for remote TLB flush

2017-08-17 Thread Vitaly Kuznetsov
Boris Ostrovsky writes: > On 08/16/2017 12:42 PM, Vitaly Kuznetsov wrote: >> Vitaly Kuznetsov writes: >> >>> In case we decide to go HAVE_RCU_TABLE_FREE for all PARAVIRT-enabled >>> kernels (as it seems to be the easiest/fastest way to fix Xen PV) - what &g

[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: [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

[PATCH v2 0/2] hyper-v: avoid tsc calibration

2017-06-22 Thread Vitaly Kuznetsov
information we can easily avoid calibration. This is already done for other hypervisors (KVM, Vmware). Vitaly Kuznetsov (2): hyper-v: check frequency MSRs presence according to the specification hyper-v: read TSC frequency from a synthetic MSR arch/x86/include/uapi/asm/hyperv.h | 15

[PATCH v2 1/2] hyper-v: check frequency MSRs presence according to the specification

2017-06-22 Thread Vitaly Kuznetsov
accordingly. Signed-off-by: Vitaly Kuznetsov --- arch/x86/include/uapi/asm/hyperv.h | 15 ++- arch/x86/kernel/cpu/mshyperv.c | 3 ++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include/uapi/asm/hyperv.h index

[PATCH v2 2/2] hyper-v: read TSC frequency from a synthetic MSR

2017-06-22 Thread Vitaly Kuznetsov
ing a error prone calibration. Reported-by: Ladi Prosek Tested-by: Ladi Prosek Signed-off-by: Vitaly Kuznetsov --- arch/x86/kernel/cpu/mshyperv.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 3563c8e..20

[PATCH v5 00/10] Hyper-V: praravirtualized remote TLB flushing and hypercall improvements

2017-05-30 Thread Vitaly Kuznetsov
ments along the way: fast hypercall implementation and using it for event signaling, rep hypercalls implementation, hyperv tracing subsystem (which only traces the newly added remote TLB flush for now). Vitaly Kuznetsov (10): x86/hyper-v: include hyperv/ only when CONFIG_HYPERV is set x86/hyper-v: stas

[PATCH v5 01/10] x86/hyper-v: include hyperv/ only when CONFIG_HYPERV is set

2017-05-30 Thread Vitaly Kuznetsov
Code is arch/x86/hyperv/ is only needed when CONFIG_HYPERV is set, the 'basic' support and detection lives in arch/x86/kernel/cpu/mshyperv.c which is included when CONFIG_HYPERVISOR_GUEST is set. Signed-off-by: Vitaly Kuznetsov Acked-by: K. Y. Srinivasan Tested-by: Simon Xiao

[PATCH v5 02/10] x86/hyper-v: stash the max number of virtual/logical processor

2017-05-30 Thread Vitaly Kuznetsov
Max virtual processor will be needed for 'extended' hypercalls supporting more than 64 vCPUs. While on it, unify on 'Hyper-V' in mshyperv.c as we currently have a mix, report acquired misc features as well. Signed-off-by: Vitaly Kuznetsov Acked-by: K. Y. Srinivasan Tested-by

[PATCH v5 04/10] x86/hyper-v: fast hypercall implementation

2017-05-30 Thread Vitaly Kuznetsov
Hyper-V supports 'fast' hypercalls when all parameters are passed through registers. Implement an inline version of a simpliest of these calls: hypercall with one 8-byte input and no output. Signed-off-by: Vitaly Kuznetsov Acked-by: K. Y. Srinivasan --- Changes since v4: - Avoid unio

[PATCH v5 09/10] x86/hyper-v: support extended CPU ranges for TLB flush hypercalls

2017-05-30 Thread Vitaly Kuznetsov
Hyper-V hosts may support more than 64 vCPUs, we need to use HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX/LIST_EX hypercalls in this case. Signed-off-by: Vitaly Kuznetsov Acked-by: K. Y. Srinivasan --- Changes since v4: - Use __set_bit(), minor code style changes [Andy Shevchenko] --- arch/x86/hyperv

[PATCH v5 08/10] x86/hyper-v: use hypercall for remote TLB flush

2017-05-30 Thread Vitaly Kuznetsov
sible and easy to implement local TLB flushing too and there is even a hint for that. However, I don't see a room for optimization on the host side as both hypercall and native tlb flush will result in vmexit. The hint is also not set on modern Hyper-V versions. Signed-off-by: Vitaly Kuznetsov A

[PATCH v5 07/10] hyper-v: globalize vp_index

2017-05-30 Thread Vitaly Kuznetsov
To support implementing remote TLB flushing on Hyper-V with a hypercall we need to make vp_index available outside of vmbus module. Rename and globalize. Signed-off-by: Vitaly Kuznetsov Acked-by: K. Y. Srinivasan Tested-by: Simon Xiao Tested-by: Srikanth Myakam --- arch/x86/hyperv/hv_init.c

[PATCH v5 10/10] tracing/hyper-v: trace hyperv_mmu_flush_tlb_others()

2017-05-30 Thread Vitaly Kuznetsov
Add Hyper-V tracing subsystem and trace hyperv_mmu_flush_tlb_others(). Tracing is done the same way we do xen_mmu_flush_tlb_others(). Signed-off-by: Vitaly Kuznetsov Acked-by: K. Y. Srinivasan Tested-by: Simon Xiao Tested-by: Srikanth Myakam --- MAINTAINERS | 1

[PATCH v5 06/10] x86/hyper-v: implement rep hypercalls

2017-05-30 Thread Vitaly Kuznetsov
HvFlushVirtualAddressList hypercall for remote TLB flushing. Signed-off-by: Vitaly Kuznetsov Acked-by: K. Y. Srinivasan --- Changes since v4: - Avoid union aliasing [Andy Shevchenko] --- arch/x86/include/asm/mshyperv.h | 36 1 file changed, 36 insertions(+) diff --git a

[PATCH v5 05/10] hyper-v: use fast hypercall for HVCALL_SIGNAL_EVENT

2017-05-30 Thread Vitaly Kuznetsov
We need to pass only 8 bytes of input for HvSignalEvent which makes it a perfect fit for fast hypercall. hv_input_signal_event_buffer is not needed any more and hv_input_signal_event is converted to union for convenience. Signed-off-by: Vitaly Kuznetsov Acked-by: K. Y. Srinivasan --- Changes

[PATCH v5 03/10] x86/hyper-v: make hv_do_hypercall() inline

2017-05-30 Thread Vitaly Kuznetsov
uring hypercall and with inlining this is somewhat important, add the clobbers. Signed-off-by: Vitaly Kuznetsov Acked-by: K. Y. Srinivasan --- Changes since v4: - Use upper_32_bits()/lower_32_bits macros [Andy Shevchenko] - Use "A" in 32 bits asm [Jork Loeser] --- arch/x86/hyperv/hv_in

[PATCH net-next 0/4] hv_netvsc: fix some crashes and hangs on channel/mtu changes

2017-10-31 Thread Vitaly Kuznetsov
ixing everything VMs seem to survive overnight test. I'll send one more related patch to VMBus core too. Vitaly Kuznetsov (4): hv_netvsc: netvsc_teardown_gpadl() split hv_netvsc: protect nvdev->extension with RCU hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer()

[PATCH net-next 2/4] hv_netvsc: protect nvdev->extension with RCU

2017-10-31 Thread Vitaly Kuznetsov
rndis_filter_receive() is called from interrupt context and may race with rndis_filter_device_remove() resetting extension pointer. RNDIS_MSG_HALT does not help, host may still send us messages after it. Protect extension pointer with RCU. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv

[PATCH net-next 4/4] hv_netvsc: hide warnings about uninitialized/missing rndis device

2017-10-31 Thread Vitaly Kuznetsov
Hyper-V hosts are known to send RNDIS messages even after we halt the device in rndis_filter_halt_device(). Remove user visible messages as they are not really useful. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/rndis_filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH net-next 1/4] hv_netvsc: netvsc_teardown_gpadl() split

2017-10-31 Thread Vitaly Kuznetsov
reliably. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc.c | 69 +++-- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 5bb6a20072dd..bfc79698b8f4 100644 --- a/drivers

[PATCH net-next 3/4] hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer()

2017-10-31 Thread Vitaly Kuznetsov
RCU_INIT_POINTER() is not suitable here as it doesn't give us ordering guarantees (see the comment in rcupdate.h). This is also not a hotpath. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/h

Re: [PATCH net-next 3/4] hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer()

2017-10-31 Thread Vitaly Kuznetsov
Eric Dumazet writes: > On Tue, 2017-10-31 at 14:42 +0100, Vitaly Kuznetsov wrote: >> RCU_INIT_POINTER() is not suitable here as it doesn't give us ordering >> guarantees (see the comment in rcupdate.h). This is also not a hotpath. >> >> Signed-off-by: Vitaly K

Re: [PATCH net-next 3/4] hv_netvsc: reset net_device_ctx->nvdev with rcu_assign_pointer()

2017-10-31 Thread Vitaly Kuznetsov
David Miller writes: > From: Vitaly Kuznetsov > Date: Tue, 31 Oct 2017 15:40:06 +0100 > >> Eric Dumazet writes: >> >>> On Tue, 2017-10-31 at 14:42 +0100, Vitaly Kuznetsov wrote: >>>> RCU_INIT_POINTER() is not suitable here as it doesn't give

Re: [PATCH net-next 2/4] hv_netvsc: protect nvdev->extension with RCU

2017-10-31 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > On Tue, 31 Oct 2017 14:42:02 +0100 > Vitaly Kuznetsov wrote: > >> @@ -2002,7 +2002,9 @@ static int netvsc_probe(struct hv_device *dev, >> device_info.recv_sections = NETVSC_DEFAULT_RX; >> device_info.recv_section_size

Re: [PATCH char-misc 1/1] Drivers: hv: vmbus: Implement Direct Mode for stimer0

2017-11-01 Thread Vitaly Kuznetsov
mikel...@exchange.microsoft.com writes: > From: Michael Kelley > > The 2016 version of Hyper-V offers the option to operate the guest VM > per-vcpu stimer's in Direct Mode, which means the timer interupts on its > own vector rather than queueing a VMbus message. Direct Mode reduces > timer proce

Re: [PATCH char-misc 1/1] Drivers: hv: vmbus: Implement Direct Mode for stimer0

2017-11-01 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > mikel...@exchange.microsoft.com writes: > >> From: Michael Kelley >> >> The 2016 version of Hyper-V offers the option to operate the guest VM >> per-vcpu stimer's in Direct Mode, which means the timer interupts on its >> own ve

Re: [PATCH net-next 2/4] hv_netvsc: protect nvdev->extension with RCU

2017-11-02 Thread Vitaly Kuznetsov
Vitaly Kuznetsov writes: > > Ok, I may have missed something. I'll try reproducing the crash and > finding a better fine-grained solution. > It's been two days and I'm failing to reproduce the crash in rndis_filter_receive() in my environment so I'll probably

[PATCH net-next v2 0/2] hv_netvsc: fix a hang on channel/mtu changes

2017-11-02 Thread Vitaly Kuznetsov
d messages. Changes since v1: - Throw away patches 2 and 3 of the original series as one is unneeded and the other is not justified [Eric Dumazet, Stephen Hemminger] so I'm only fixing the hang now, the crash doesn't reproduce. Will keep an eye on it. Vitaly Kuznetsov (2): hv_netvsc: n

[PATCH net-next v2 1/2] hv_netvsc: netvsc_teardown_gpadl() split

2017-11-02 Thread Vitaly Kuznetsov
reliably. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/netvsc.c | 69 +++-- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 5bb6a20072dd..bfc79698b8f4 100644 --- a/drivers

[PATCH net-next v2 2/2] hv_netvsc: hide warnings about uninitialized/missing rndis device

2017-11-02 Thread Vitaly Kuznetsov
Hyper-V hosts are known to send RNDIS messages even after we halt the device in rndis_filter_halt_device(). Remove user visible messages as they are not really useful. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/rndis_filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

Re: [RFC] hv_netvsc: safer orderly shutdown

2017-11-13 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > > The NAPI disable is already handled by rndis close. Sorry, but I'm probably missing something: I can only see netif_napi_del() call in netvsc_device_remove() but this happens much later. And I don see us doing napi_disable() anywhere on the path. But I'm probably mi

[PATCH net] hv_netvsc: preserve hw_features on mtu/channels/ringparam changes

2017-11-14 Thread Vitaly Kuznetsov
additional flags which are set outside of the driver, e.g. register_netdevice() adds NETIF_F_SOFT_FEATURES and many others. Fill hw_features in only when we're called from netvsc_probe() and hw_features is empty. Signed-off-by: Vitaly Kuznetsov --- drivers/net/hyperv/rndis_filter.c

Re: [PATCH net] hv_netvsc: preserve hw_features on mtu/channels/ringparam changes

2017-11-14 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > On Tue, 14 Nov 2017 16:22:05 +0100 > Vitaly Kuznetsov wrote: > > Yes, this looks like a real issue. > >> +/* Query hardware capabilities if we're called from netvsc_probe() */ >> +if (!net->hw_features) { >> +

[PATCH] tools/hv: add install target to Makefile

2017-11-03 Thread Vitaly Kuznetsov
Makefiles usually come with 'install' target included so each distro doesn't need to implement the procedure from scratch. Add it to tools/hv. Signed-off-by: Vitaly Kuznetsov --- tools/hv/Makefile | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) dif

Re: [PATCH v10 0/9] Hyper-V: paravirtualized remote TLB flushing and hypercall improvements

2017-11-06 Thread Vitaly Kuznetsov
Wanpeng Li writes: > 2017-08-03 0:09 GMT+08:00 Vitaly Kuznetsov : >> Changes since v9: >> - Rebase to 4.13-rc3. >> - Drop PATCH1 as it was already taken by Greg to char-misc tree. There're no >> functional dependencies on this patch so the series can go throug

Re: [PATCH v10 0/9] Hyper-V: paravirtualized remote TLB flushing and hypercall improvements

2017-11-06 Thread Vitaly Kuznetsov
Wanpeng Li writes: > 2017-11-06 17:14 GMT+08:00 Vitaly Kuznetsov : >> Wanpeng Li writes: >> >>> 2017-08-03 0:09 GMT+08:00 Vitaly Kuznetsov : >>>> Changes since v9: >>>> - Rebase to 4.13-rc3. >>>> - Drop PATCH1 as it wa

Re: [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,

Re: [PATCH 10/17] hyper-v: trace vmbus_open()

2017-10-30 Thread Vitaly Kuznetsov
Greg KH writes: > On Sun, Oct 29, 2017 at 12:21:09PM -0700, k...@exchange.microsoft.com wrote: >> From: Vitaly Kuznetsov >> >> Add tracepoint to CHANNELMSG_OPENCHANNEL sender. >> >> Signed-off-by: Vitaly Kuznetsov >> Signed-off-by: K. Y. Srinivasan

Re: [PATCH 10/17] hyper-v: trace vmbus_open()

2017-10-30 Thread Vitaly Kuznetsov
Greg KH writes: > On Mon, Oct 30, 2017 at 09:16:19AM +0100, Vitaly Kuznetsov wrote: >> Greg KH writes: >> >> > On Sun, Oct 29, 2017 at 12:21:09PM -0700, k...@exchange.microsoft.com >> > wrote: >> >> From: Vitaly Kuznetsov >> >&g

[PATCH] panic: release stale console lock to always get the logbuf printed out

2015-10-07 Thread Vitaly Kuznetsov
uffer printed out on crash should be top priority. Signed-off-by: Vitaly Kuznetsov --- kernel/panic.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/kernel/panic.c b/kernel/panic.c index 04e91ff..f94525f 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -23,6 +23,7 @@ #in

Re: [PATCH 1/1] drivers/hv: cleanup synic msrs if vmbus connect failed

2015-10-07 Thread Vitaly Kuznetsov
tch does appropriate cleanup in case of vmbus_connect() failure. > > Signed-off-by: Andrey Smetanin > Signed-off-by: Denis V. Lunev > CC: "K. Y. Srinivasan" > CC: Haiyang Zhang > CC: Vitaly Kuznetsov Reviewed-by: Vitaly Kuznetsov > --- > drivers/hv/vmbus_drv.c | 4

[PATCH] scsi_scan: move 'INQUIRY result too short' message to debug level

2015-08-31 Thread Vitaly Kuznetsov
ts serial port being extremely slow multi-VCPU guests we get CPU blocked putting these (useless) messages on console (e.g. happens when we add multiple disks). Move them to debug level. Signed-off-by: Vitaly Kuznetsov --- drivers/scsi/scsi_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

[PATCH] serial: core: prevent softlockups on slow consoles

2015-08-31 Thread Vitaly Kuznetsov
() disables irqs for all its execution time (which on such slow consoles can be dozens of seconds), it should be possible to observe devices being stuck on this CPU. We need to find a better way, e.g. do output in batches enabling irqs in between. Signed-off-by: Vitaly Kuznetsov --- drivers/tty/serial

[PATCH] scsi_scan: don't dump trace when scsi_prep_async_scan() is called twice

2015-08-31 Thread Vitaly Kuznetsov
n is still running we get the message and stack dump on console. Signed-off-by: Vitaly Kuznetsov --- drivers/scsi/scsi_scan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index f9f3f82..01ad016 100644 --- a/drivers/scsi/s

Re: [PATCH] scsi_scan: move 'INQUIRY result too short' message to debug level

2015-09-01 Thread Vitaly Kuznetsov
James Bottomley writes: > On Mon, 2015-08-31 at 14:50 +0200, Vitaly Kuznetsov wrote: >> Some Hyper-V hosts are known for ignoring SPC-2/3/4 requirement >> for 'INQUIRY data (see table ...) shall contain at least 36 bytes'. As a >> result we get tons on 'scs

Re: [PATCH v3] scsi: report 'INQUIRY result too short' once per host

2015-10-12 Thread Vitaly Kuznetsov
Hannes Reinecke writes: > On 10/08/2015 06:54 PM, Vitaly Kuznetsov wrote: >> Some host adapters (e.g. Hyper-V storvsc) are known for not respecting the >> SPC-2/3/4 requirement for 'INQUIRY data (see table ...) shall contain at >> least 36 bytes'. As a result we

Re: [PATCH v3] scsi: report 'INQUIRY result too short' once per host

2015-10-13 Thread Vitaly Kuznetsov
Hannes Reinecke writes: > On 10/12/2015 05:16 PM, Vitaly Kuznetsov wrote: >> Hannes Reinecke writes: >> >>> On 10/08/2015 06:54 PM, Vitaly Kuznetsov wrote: >>>> Some host adapters (e.g. Hyper-V storvsc) are known for not respecting the >>>> SP

Re: [PATCH] hyperv: fix build if KEXEC not enabled

2015-09-08 Thread Vitaly Kuznetsov
Introduced by: >commit b4370df2b1f5158de028e167974263c5757b34a6 >Author: Vitaly Kuznetsov >Date: Sat Aug 1 16:08:09 2015 -0700 > >Drivers: hv: vmbus: add special crash handler > > Signed-off-by: Stephen Hemminger > > --- a/arch/x86/kernel/cpu/mshyperv.c 2015-09-07 10:11:24.994885115

Re: [PATCH] hyperv: fix build if KEXEC not enabled

2015-09-08 Thread Vitaly Kuznetsov
' >> >> Introduced by: >>commit b4370df2b1f5158de028e167974263c5757b34a6 >>Author: Vitaly Kuznetsov >>Date: Sat Aug 1 16:08:09 2015 -0700 >> >>Drivers: hv: vmbus: add special crash handler >> >> >> Signed-off

Re: [PATCH] hyperv: fix build if KEXEC not enabled

2015-09-08 Thread Vitaly Kuznetsov
Ingo Molnar writes: > * Vitaly Kuznetsov wrote: > >> Ingo Molnar writes: >> >> > * Stephen Hemminger wrote: >> > >> >> Fixes regression 4.3 mergw window in my config >> >> where hyperv is enable but CONFIG_KEXEC not enabled

[PATCH] x86/ioapic: Disable interrupts when re-routing legacy IRQs

2015-10-15 Thread Vitaly Kuznetsov
: Jiang Liu Cc: Yinghai Lu Cc: K. Y. Srinivasan Signed-off-by: Vitaly Kuznetsov --- It may make sense to have interrupts disabled for non-legacy IRQs as well but I'm unaware of any bugs with them at this moment. --- arch/x86/kernel/apic/io_apic.c | 8 +++- 1 file changed, 7 inser

[PATCH] scsi_sysfs: protect against double execution of __scsi_remove_device()

2015-10-22 Thread Vitaly Kuznetsov
try doing scsi_remove_device(). shost->scan_mutex only serializes their calls to __scsi_remove_device() and we end up doing the cleanup path twice. Signed-off-by: Vitaly Kuznetsov --- drivers/scsi/scsi_sysfs.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/scsi_sysfs

Re: [PATCH] serial: core: prevent softlockups on slow consoles

2015-09-02 Thread Vitaly Kuznetsov
Peter Hurley writes: > Hi Vitaly, > > On 08/31/2015 10:34 AM, Vitaly Kuznetsov wrote: >> Hyper-V serial port is very slow on multi-vCPU guest > > How slow and why? > Not sure why, but here is a trace: 1) | serial82

[PATCH v2] scsi: introduce short_inquiry flag for broken host adapters

2015-09-03 Thread Vitaly Kuznetsov
console. This can be problematic for slow consoles. Introduce short_inquiry host template flag to avoid printing error messages for such adapters. Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - This is a successor of previously sent "scsi_scan: move 'INQUIRY result too short' mes

Re: [PATCH] serial: core: prevent softlockups on slow consoles

2015-09-04 Thread Vitaly Kuznetsov
Greg Kroah-Hartman writes: > On Mon, Aug 31, 2015 at 04:34:16PM +0200, Vitaly Kuznetsov wrote: >> Hyper-V serial port is very slow on multi-vCPU guest, this causes >> soflockups on intensive console writes. Touch nmi watchdog after putting >> every char on port to avoid the

[PATCH] lib/string_helpers.c: fix infinite loop in string_get_size()

2015-09-04 Thread Vitaly Kuznetsov
string_get_size(1, 512, 0, ..., ...) call results in an infinite loop. The problem is that if size == 0 when we start calculating sf_cap this loop will never end. The caller causing the issue is sd_read_capacity(), the problem was noticed on Hyper-V. Signed-off-by: Vitaly Kuznetsov --- lib

Re: [PATCH] Drivers: hv: vss: run only on supported host versions

2015-10-19 Thread Vitaly Kuznetsov
Olaf Hering writes: > The Backup integration service on WS2012 has appearently trouble to > negotiate with a guest which does not support the provided util version. > Currently the VSS driver supports only version 5/0. A WS2012 offers only > version 1/x and 3/x, and vmbus_prep_negotiate_resp corr

Re: [PATCH] scsi_sysfs: protect against double execution of __scsi_remove_device()

2015-10-23 Thread Vitaly Kuznetsov
Bart Van Assche writes: > On 10/22/2015 10:12 AM, Vitaly Kuznetsov wrote: >> On some host errors storvsc module tries to remove sdev by scheduling a job >> which does the following: >> >> sdev = scsi_device_lookup(wrk->host, 0, 0, wrk->lun); >> if

Re: [PATCH v5 2/2] lib/test-string_helpers.c: add string_get_size() tests

2015-10-23 Thread Vitaly Kuznetsov
Rasmus Villemoes writes: > On Thu, Sep 17 2015, Vitaly Kuznetsov wrote: > >> + >> +static __init void test_string_get_size(void) >> +{ >> +test_string_get_size_one(16384, 512, STRING_UNITS_2, "8.00 MiB"); >> +test_string_get_size_one(8192,

[PATCH 2/3] lib/string_helpers.c: don't lose precision in string_get_size()

2015-10-26 Thread Vitaly Kuznetsov
as it can overflow. Do the math in two steps: 1) Reduce size to something < blk_size * divisor[units] 2) Multiply the result (and the remainder) by blk_size and do final calculations. Reported-by: Rasmus Villemoes Signed-off-by: Vitaly Kuznetsov --- lib/string_helpers.c | 46 +++

[PATCH 3/3] lib/test-string_helpers.c: add string_get_size() tests

2015-10-26 Thread Vitaly Kuznetsov
Add a couple of simple tests for string_get_size(). Signed-off-by: Vitaly Kuznetsov --- lib/test-string_helpers.c | 44 1 file changed, 44 insertions(+) diff --git a/lib/test-string_helpers.c b/lib/test-string_helpers.c index 8e376ef..a158cb3 100644

[PATCH 0/3] lib/string_helpers: fix precision issues and introduce tests

2015-10-26 Thread Vitaly Kuznetsov
quot; series but afaics wasn't merged. In this submission I add additional tests to it. Vitaly Kuznetsov (3): lib/string_helpers: change blk_size to u32 for string_get_size() interface lib/string_helpers.c: don't lose precision in string_get_size() lib/test-string_helpers.c: add

[PATCH 1/3] lib/string_helpers: change blk_size to u32 for string_get_size() interface

2015-10-26 Thread Vitaly Kuznetsov
string_get_size() can't really handle huge block sizes, especially blk_size > U32_MAX but string_get_size() interface states the opposite. Change blk_size from u64 to u32 to reflect the reality. Signed-off-by: Vitaly Kuznetsov --- include/linux/string_helpers.h | 2 +- lib/string_h

Re: [PATCH 3/3] lib/test-string_helpers.c: add string_get_size() tests

2015-10-26 Thread Vitaly Kuznetsov
Andy Shevchenko writes: > On Mon, 2015-10-26 at 14:55 +0100, Vitaly Kuznetsov wrote: >> Add a couple of simple tests for string_get_size(). >> > > In linux-next this one (or similar?) is commit 29f3d140. > I don't think you need it in the series since it's in A

Re: [PATCH 3/3] lib/test-string_helpers.c: add string_get_size() tests

2015-10-26 Thread Vitaly Kuznetsov
Andy Shevchenko writes: > On Mon, 2015-10-26 at 16:18 +0100, Vitaly Kuznetsov wrote: >> Andy Shevchenko writes: >> >> > On Mon, 2015-10-26 at 14:55 +0100, Vitaly Kuznetsov wrote: >> > > Add a couple of simple tests for string_get_size(). >> > >

Re: [PATCH 2/3] lib/string_helpers.c: don't lose precision in string_get_size()

2015-10-27 Thread Vitaly Kuznetsov
Andy Shevchenko writes: > On Mon, 2015-10-26 at 14:55 +0100, Vitaly Kuznetsov wrote: >> string_get_size() loses precision when there is a remainder for >> blk_size / divisor[units] and size is big enough. E.g >> string_get_size(8192, 4096, STRING_UNITS_10, ...) returns &qu

Re: [PATCH 2/3] lib/string_helpers.c: don't lose precision in string_get_size()

2015-10-27 Thread Vitaly Kuznetsov
Rasmus Villemoes writes: > So I also played with this over the weekend, and also threw together a > stupid script to check the output. I see you have more or less the same > idea I used, namely to combine size and blk_size earlier. > > I put some code on github, https://github.com/Villemoes/get_s

Re: [PATCH 3/3] lib/test-string_helpers.c: add string_get_size() tests

2015-10-27 Thread Vitaly Kuznetsov
Rasmus Villemoes writes: > On Mon, Oct 26 2015, Vitaly Kuznetsov wrote: > >> Add a couple of simple tests for string_get_size(). >> >> Signed-off-by: Vitaly Kuznetsov >> --- >> lib/test-string_helpers.c | 44 ++

Re: [PATCH] x86: guest: rely on leaf 0x40000001 to detect Hyper-V

2015-10-02 Thread Vitaly Kuznetsov
_INTERFACE. > > Change ms_hyperv_platform to actually do what the specification suggests. > This roughy matches what Windows looks for, though Windows actually > ignores HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS completely. > > Signed-off-by: Paolo Bonzini Reviewed-by: Vitaly Kuznetsov

Re: [PATCH RFC] x86/kvm/lapic: always disable MMIO interface in x2APIC mode

2018-08-02 Thread Vitaly Kuznetsov
Paolo Bonzini writes: > On 30/07/2018 11:14, Vitaly Kuznetsov wrote: >> Paolo Bonzini writes: >> >>> On 27/07/2018 18:48, Jim Mattson wrote: >>>> On a physical machine, I would expect the default local APIC page to >>>> fall in the PCI ho

[PATCH] x86/kvm/lapic: always disable MMIO interface in x2APIC mode

2018-08-02 Thread Vitaly Kuznetsov
y is enabled: we allocate APIC access page and create KVM memory region so in x2APIC modes all reads and writes go to this pre-allocated page which is, btw, the same for all vCPUs. Signed-off-by: Vitaly Kuznetsov --- Changes since RFC: - add KVM_X86_QUIRK_LAPIC_MMIO_HOLE disabling the newly introduc

[PATCH v2 0/6] KVM: nVMX: Enlightened VMCS for Hyper-V on KVM

2018-06-21 Thread Vitaly Kuznetsov
sted Hyper-V on KVM. Using it helps to spare 1500 cpu cycles for nested vmexit (tight cpuid loop in WS2016 with Hyper-V role on KVM: 15200 cycles -> 13700 cycles). Ladi Prosek (1): KVM: hyperv: define VP assist page helpers Vitaly Kuznetsov (5): KVM: VMX: refactor evmcs_sanitize_exec_ctrls(

[PATCH v2 3/6] KVM: nVMX: add KVM_CAP_HYPERV_ENLIGHTENED_VMCS capability

2018-06-21 Thread Vitaly Kuznetsov
KVM_CAP_HYPERV_ENLIGHTENED_VMCS. The version is to be advertised to the nested hypervisor, currently done via a cpuid leaf for Hyper-V. Suggested-by: Ladi Prosek Signed-off-by: Vitaly Kuznetsov Reviewed-by: Liran Alon --- Changes since v1: - Add a comment explaining "<< 8) | 1" [Liran Alon] --- arch

[PATCH v2 2/6] KVM: VMX: refactor evmcs_sanitize_exec_ctrls()

2018-06-21 Thread Vitaly Kuznetsov
Split off EVMCS1_UNSUPPORTED_* macros so we can re-use them when enabling Enlightened VMCS for Hyper-V on KVM. Signed-off-by: Vitaly Kuznetsov --- arch/x86/kvm/vmx.c | 108 +++-- 1 file changed, 47 insertions(+), 61 deletions(-) diff --git a/arch

[PATCH v2 5/6] KVM: nVMX: implement enlightened VMPTRLD and VMCLEAR

2018-06-21 Thread Vitaly Kuznetsov
tened VMCS structure for the current L2 guest permanently mapped from struct nested_vmx instead of mapping it every time. Suggested-by: Ladi Prosek Signed-off-by: Vitaly Kuznetsov Reviewed-by: Liran Alon --- arch/x86/kvm/vmx.c | 98 ++ 1 file c

[PATCH v2 6/6] KVM: nVMX: optimize prepare_vmcs02{,_full} for Enlightened VMCS case

2018-06-21 Thread Vitaly Kuznetsov
-dependent (and a bit ugly). Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - Convert evmcs_needs_write() to inline function [Liran Alon] --- arch/x86/kvm/vmx.c | 158 +++-- 1 file changed, 94 insertions(+), 64 deletions(-) diff --git a/ar

[PATCH v2 4/6] KVM: nVMX: add enlightened VMCS state

2018-06-21 Thread Vitaly Kuznetsov
Adds hv_evmcs pointer and implement copy_enlightened_to_vmcs12() and copy_enlightened_to_vmcs12(). prepare_vmcs02()/prepare_vmcs02_full() separation is not valid for Enlightened VMCS, do full sync for now. Suggested-by: Ladi Prosek Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - Drop

[PATCH v2 1/6] KVM: hyperv: define VP assist page helpers

2018-06-21 Thread Vitaly Kuznetsov
From: Ladi Prosek The state related to the VP assist page is still managed by the LAPIC code in the pv_eoi field. Signed-off-by: Ladi Prosek Signed-off-by: Vitaly Kuznetsov Reviewed-by: Liran Alon --- arch/x86/kvm/hyperv.c | 23 +-- arch/x86/kvm/hyperv.h | 4 arch

[PATCH v2] x86/hyper-v: use cheaper HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST,SPACE} hypercalls when possible

2018-06-21 Thread Vitaly Kuznetsov
. Nothing stops us from being equally 'smart' in Linux too. Switch to doing cheaper hypercalls whenever possible. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley --- Changes since v1: - Re-worded comment about the optimization in hyperv_flush_tlb_others() [Thomas Gl

[PATCH 3/3] KVM: x86: hyperv: implement PV IPI send hypercalls

2018-06-22 Thread Vitaly Kuznetsov
passing parameters through registers) but apparently this is not true, Windows always uses it as 'fast' so we need to support that. Signed-off-by: Vitaly Kuznetsov --- Documentation/virtual/kvm/api.txt | 8 +++ arch/x86/kvm/hyperv.c | 116

  1   2   3   4   5   6   7   8   9   10   >