[PATCH RFC 4/7] KVM: hyperv: define VP assist page structure and add helpers

2017-12-18 Thread Vitaly Kuznetsov
From: Ladi Prosek <lpro...@redhat.com> Structure layout is specified in Hyper-V TLFS 5.0b. 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 <lpro...@redhat.com> Signed-off-by: Vitaly Kuznetsov <vkuz

[PATCH RFC 0/7] KVM: nVMX: enlightened VMCS initial implementation

2017-12-18 Thread Vitaly Kuznetsov
The original author of these patches does no longer work at Red Hat, I agreed to take this over and send upstream. Here is his original description: "Makes KVM implement the enlightened VMCS feature per Hyper-V TLFS 5.0b. I've measured about %5 improvement in cost of a nested VM exit (Hyper-V

[PATCH RFC 1/7] KVM: x86: rename HV_X64_MSR_APIC_ASSIST_PAGE to HV_X64_MSR_VP_ASSIST_PAGE

2017-12-18 Thread Vitaly Kuznetsov
From: Ladi Prosek <lpro...@redhat.com> The assist page has been used only for the paravirtual EOI so far, hence the "APIC" in the MSR name. Renaming to match the Hyper-V TLFS where it's called "Virtual VP Assist MSR". Signed-off-by: Ladi Prosek <lpro...@redh

Re: [PATCH] hv: Fix unnecessary sleeping in hv_synic_alloc

2017-12-18 Thread Vitaly Kuznetsov
(hv_context.hv_numa_map == NULL) { > pr_err("Unable to allocate NUMA map\n"); > goto err; Reviewed-by: Vitaly Kuznetsov <vkuzn...@redhat.com> The subject line is not very accurate: GFP_KERNEL you switch too is the one supporting 'sleep' when there's

Re: [PATCH v2 0/7] x86/kvm/hyperv: stable clocksorce for L2 guests when running nested KVM on Hyper-V

2017-12-15 Thread Vitaly Kuznetsov
Paolo Bonzini <pbonz...@redhat.com> writes: > On 13/12/2017 16:09, Vitaly Kuznetsov wrote: >> Currently, KVM passes PVCLOCK_TSC_STABLE_BIT to its guests when running in >> so called 'masterclock' mode and this is only possible when the clocksource >> on the host

[PATCH v2 7/7] x86/kvm: support Hyper-V reenlightenment

2017-12-13 Thread Vitaly Kuznetsov
-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- arch/x86/kvm/x86.c | 45 + 1 file changed, 45 insertions(+) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 843a8596f57e..d98e5165c1ad 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm

[PATCH v2 4/7] x86/hyper-v: redirect reenlightment notifications on CPU offlining

2017-12-13 Thread Vitaly Kuznetsov
without any Hyper-V devices of have a CPU with no assigned channels. Reassign reenlightenment notifications to some other active CPU when the CPU which is assigned to get them goes offline. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- arch/x86/hyperv/hv_init.

[PATCH v2 6/7] x86/kvm: pass stable clocksource to guests when running nested on Hyper-V

2017-12-13 Thread Vitaly Kuznetsov
for it in KVM. The only non-trivial change in the patch is in vgettsc(): when updating our gtod copy we now need to get both the clockread and tsc value. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- arch/x86/kvm/x86.c | 93 +++

[PATCH v2 3/7] x86/hyper-v: reenlightenment notifications support

2017-12-13 Thread Vitaly Kuznetsov
specifies EAX:BIT(12) of CPUID:0x4009 as the feature identification bit. The right one to check is EAX:BIT(13) of CPUID:0x4003. I was assured that the fix in on the way. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- v1 -> v2: - rename register_hv_t

[PATCH v2 5/7] x86/irq: Count Hyper-V reenlightenment interrupts

2017-12-13 Thread Vitaly Kuznetsov
Hyper-V reenlightenment interrupts arrive when the VM is migrated, we're not supposed to see many of them. However, it may be important to know that the event has happened in case we have L2 nested guests. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- arch/x86/hyperv/hv_

[PATCH v2 1/7] x86/hyper-v: check for required priviliges in hyperv_init()

2017-12-13 Thread Vitaly Kuznetsov
In hyperv_init() we presume we always have access to VP index and hypercall MSRs while according to the specification we should check if we're allowed to access the corresponding MSRs before accessing them. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- arch/x86/hyperv/hv_init

[PATCH v2 2/7] x86/hyper-v: add a function to read both TSC and TSC page value simulateneously

2017-12-13 Thread Vitaly Kuznetsov
This is going to be used from KVM code where we need to get both TSC and TSC page value. When Hyper-V code is compiled out just return rdtsc(), this will allow us to avoid ugly ifdefs in non-Hyper-V code. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- arch/x86/hyperv/hv_

[PATCH v2 0/7] x86/kvm/hyperv: stable clocksorce for L2 guests when running nested KVM on Hyper-V

2017-12-13 Thread Vitaly Kuznetsov
ely easy, it is done in PATCH 5 of the series. All the rest is required to support L1 migration when TSC frequency changes, we use a special feature from Hyper-V to do the job. Vitaly Kuznetsov (7): x86/hyper-v: check for required priviliges in hyperv_init() x86/hyper-v: add a function to read b

Re: [PATCH 3/6] x86/hyper-v: reenlightenment notifications support

2017-12-13 Thread Vitaly Kuznetsov
"Michael Kelley (EOSG)" <michael.h.kel...@microsoft.com> writes: > On Fri, Dec 08, 2017 at 11:49:57AM +0100, Vitaly Kuznetsov wrote: > >> -Original Message----- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Friday, December 8, 201

Re: [PATCH 6/6] x86/kvm: support Hyper-V reenlightenment

2017-12-12 Thread Vitaly Kuznetsov
Vitaly Kuznetsov <vkuzn...@redhat.com> writes: > Roman Kagan <rka...@virtuozzo.com> writes: > >> On Fri, Dec 08, 2017 at 11:50:00AM +0100, Vitaly Kuznetsov wrote: >>> When we run nested KVM on Hyper-V guests we need to update masterclocks for >>

Re: [PATCH 3/6] x86/hyper-v: reenlightenment notifications support

2017-12-12 Thread Vitaly Kuznetsov
Roman Kagan <rka...@virtuozzo.com> writes: > On Mon, Dec 11, 2017 at 10:56:33AM +0100, Vitaly Kuznetsov wrote: >> Roman Kagan <rka...@virtuozzo.com> writes: >> > On Fri, Dec 08, 2017 at 11:49:57AM +0100, Vitaly Kuznetsov wrote: >> >> +v

Re: [PATCH 6/6] x86/kvm: support Hyper-V reenlightenment

2017-12-11 Thread Vitaly Kuznetsov
Roman Kagan <rka...@virtuozzo.com> writes: > On Fri, Dec 08, 2017 at 11:50:00AM +0100, Vitaly Kuznetsov wrote: >> When we run nested KVM on Hyper-V guests we need to update masterclocks for >> all guests when L1 migrates to a host with different TSC frequency. >&

Re: [PATCH 3/6] x86/hyper-v: reenlightenment notifications support

2017-12-11 Thread Vitaly Kuznetsov
Roman Kagan <rka...@virtuozzo.com> writes: > On Fri, Dec 08, 2017 at 11:49:57AM +0100, Vitaly Kuznetsov wrote: >> Hyper-V supports Live Migration notification. This is supposed to be used >> in conjunction with TSC emulation: when we are migrated to a host with >> diffe

[PATCH 0/6] x86/kvm/hyperv: stable clocksorce for L2 guests when running nested KVM on Hyper-V

2017-12-08 Thread Vitaly Kuznetsov
, it is done in PATCH 5 of the series. All the rest is required to support L1 migration when TSC frequency changes, we use a special feature from Hyper-V to do the job. Vitaly Kuznetsov (6): x86/hyper-v: check for required priviliges in hyperv_init() x86/hyper-v: add a function to read both TSC

[PATCH 4/6] x86/hyper-v: redirect reenlightment notifications on CPU offlining

2017-12-08 Thread Vitaly Kuznetsov
without any Hyper-V devices of have a CPU with no assigned channels. Reassign reenlightenment notifications to some other active CPU when the CPU which is assigned to get them goes offline. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- RFC -> v1: - protect hv_cpu_die() from r

[PATCH 2/6] x86/hyper-v: add a function to read both TSC and TSC page value simulateneously

2017-12-08 Thread Vitaly Kuznetsov
This is going to be used from KVM code where we need to get both TSC and TSC page value. When Hyper-V code is compiled out just return rdtsc(), this will allow us to avoid ugly ifdefs in non-Hyper-V code. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- RFC -> v1: - EXPORT_S

[PATCH 3/6] x86/hyper-v: reenlightenment notifications support

2017-12-08 Thread Vitaly Kuznetsov
specifies EAX:BIT(12) of CPUID:0x4009 as the feature identification bit. The right one to check is EAX:BIT(13) of CPUID:0x4003. I was assured that the fix in on the way. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- RFC -> v1: - #include [kbuild test robot] - use

[PATCH 6/6] x86/kvm: support Hyper-V reenlightenment

2017-12-08 Thread Vitaly Kuznetsov
-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- arch/x86/kvm/x86.c | 45 + 1 file changed, 45 insertions(+) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 96e04a0cb921..04d90712ffd2 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm

[PATCH 1/6] x86/hyper-v: check for required priviliges in hyperv_init()

2017-12-08 Thread Vitaly Kuznetsov
In hyperv_init() we presume we always have access to VP index and hypercall MSRs while according to the specification we should check if we're allowed to access the corresponding MSRs before accessing them. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- RFC -> v1: - 'req

[PATCH 5/6] x86/kvm: pass stable clocksource to guests when running nested on Hyper-V

2017-12-08 Thread Vitaly Kuznetsov
for it in KVM. The only non-trivial change in the patch is in vgettsc(): when updating our gtod copy we now need to get both the clockread and tsc value. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- RFC -> v1: - 'gtod_cs_mode_good' -> 'gtod_is_based_on_tsc' [Radim Krčmá

Re: [PATCH RFC 2/6] x86/hyper-v: add a function to read both TSC and TSC page value simulateneously

2017-12-04 Thread Vitaly Kuznetsov
Paolo Bonzini writes: > On 01/12/2017 18:29, Stephen Hemminger wrote: >>> +static inline u64 hv_read_tsc_page_tsc(const struct ms_hyperv_tsc_page >>> *tsc_pg, >>> + u64 *cur_tsc) >>> +{ >>> + *cur_tsc = rdtsc(); >>> + >>> + return

[PATCH RFC 6/6] x86/kvm: support Hyper-V reenlightenment

2017-12-01 Thread Vitaly Kuznetsov
-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- arch/x86/kvm/x86.c | 45 + 1 file changed, 45 insertions(+) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 42063b6d8e48..e4fee6db70a8 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm

[PATCH RFC 3/6] x86/hyper-v: reenlightenment notifications support

2017-12-01 Thread Vitaly Kuznetsov
specifies EAX:BIT(12) of CPUID:0x4009 as the feature identification bit. The right one to check is EAX:BIT(13) of CPUID:0x4003. I was assured that the fix in on the way. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- arch/x86/entry/entry_64.S | 4 +++ arch/x86/

[PATCH RFC 0/6] x86/kvm/hyperv: stable clocksorce for L2 guests when running nested KVM on Hyper-V

2017-12-01 Thread Vitaly Kuznetsov
for masterclock. This series brings the required support. Making KVM work with TSC page clocksource is relatively easy, it is done in PATCH 5 of the series. All the rest is required to support L1 migration when TSC frequency changes, we use a special feature from Hyper-V to do the job. Vitaly Kuznetsov (6

[PATCH RFC 2/6] x86/hyper-v: add a function to read both TSC and TSC page value simulateneously

2017-12-01 Thread Vitaly Kuznetsov
This is going to be used from KVM code were we need to get both TSC and TSC page value. When Hyper-V code is compiled out just return rdtsc(), this will allow us to avoid ugly ifdefs in non-Hyper-V code. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- arch/x86/include/asm/mshy

[PATCH RFC 4/6] x86/hyper-v: redirect reenlightment notifications on CPU offlining

2017-12-01 Thread Vitaly Kuznetsov
without any Hyper-V devices of have a CPU with no assigned channels. Reassign reenlightenment notifications to some other active CPU when the CPU which is assigned to get them goes offline. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- arch/x86/hyperv/hv_init.

[PATCH RFC 5/6] x86/kvm: pass stable clocksource to guests when running nested on Hyper-V

2017-12-01 Thread Vitaly Kuznetsov
for it in KVM. The only non-trivial change in the patch is in vgettsc(): when updating our gtod copy we now need to get both the clockread and tsc value. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- arch/x86/kvm/x86.c | 59 +++

[PATCH RFC 1/6] x86/hyper-v: check for required priviliges in hyperv_init()

2017-12-01 Thread Vitaly Kuznetsov
In hyperv_init() we presume we always have access to VP index and hypercall MSRs while according to the specification we should check if we're allowed to access the corresponding MSRs before accessing them. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- arch/x86/hyperv/hv_init

Re: [PATCH 0/4] hv_balloon: fixes for num_pages_onlined accounting and misc improvements

2017-11-28 Thread Vitaly Kuznetsov
Vitaly Kuznetsov <vkuzn...@redhat.com> writes: > While doing routing code review I noticed that commit 6df8d9aaf3af > ("Drivers: hv: balloon: Correctly update onlined page count") introduced > an issue with num_pages_onlined accounting on memory offlining. Deeper look >

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

2017-11-15 Thread Vitaly Kuznetsov
life I guess but let's be consistent). Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- Changes since v1: call rndis_netdev_set_hwcaps() unconditionally; clear net->hw_features flags we set and set them again based on host's data. Clear missing features from net->featur

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

2017-11-15 Thread Vitaly Kuznetsov
Haiyang Zhang <haiya...@microsoft.com> writes: >> -Original Message----- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Tuesday, November 14, 2017 11:58 AM >> To: Stephen Hemminger <step...@networkplumber.org> >> Cc: net...@vger.kerne

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

2017-11-14 Thread Vitaly Kuznetsov
Stephen Hemminger <step...@networkplumber.org> writes: > On Tue, 14 Nov 2017 16:22:05 +0100 > Vitaly Kuznetsov <vkuzn...@redhat.com> wrote: > > Yes, this looks like a real issue. > >> +/* Query hardware capabilities if we're called from netvsc_probe()

[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 <vkuzn...@redhat.com> --- drivers/net/

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

Re: [RFC] hv_netvsc: safer orderly shutdown

2017-11-10 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > Several types of control operations require that the underlying RNDIS > infrastructure be restarted. This patch changes the ordering of the > shutdown to avoid race conditions. > Stop all transmits before doing RNDIS halt. This involves

[PATCH 3/4] hv_balloon: fix bugs in num_pages_onlined accounting

2017-11-08 Thread Vitaly Kuznetsov
f8d9aaf3af ("Drivers: hv: balloon: Correctly update onlined page count") Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/hv_balloon.c | 82 + 1 file changed, 69 insertions(+), 13 deletions(-) diff --git a/drivers/hv

[PATCH 4/4] hv_balloon: trace post_status

2017-11-08 Thread Vitaly Kuznetsov
Hyper-V balloon driver makes non-trivial calculations to convert Linux's representation of free/used memory to what Hyper-V host expects to see. Add a tracepoint to see what's being sent and where the data comes from. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/Ma

[PATCH 2/4] hv_balloon: simplify hv_online_page()/hv_page_online_one()

2017-11-08 Thread Vitaly Kuznetsov
Instead of doing pfn_to_page() and continuosly casting page to unsigned long just cache the pfn of the page with page_to_pfn(). Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/hv_balloon.c | 27 +-- 1 file changed, 5 insertions(+), 22 del

[PATCH 1/4] hv_balloon: fix printk loglevel

2017-11-08 Thread Vitaly Kuznetsov
We have a mix of different ideas of which loglevel should be used. Unify on the following: - pr_info() for normal operation - pr_warn() for 'strange' host behavior - pr_err() for all errors. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/hv_balloon.c | 12 ++---

[PATCH 0/4] hv_balloon: fixes for num_pages_onlined accounting and misc improvements

2017-11-08 Thread Vitaly Kuznetsov
t possible. Tested with WS2016 only. Vitaly Kuznetsov (4): hv_balloon: fix printk loglevel hv_balloon: simplify hv_online_page()/hv_page_online_one() hv_balloon: fix bugs in num_pages_onlined accounting hv_balloon: trace post_status drivers/hv/Makefile | 1 + drivers/hv/hv

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

2017-11-08 Thread Vitaly Kuznetsov
Stephen Hemminger <step...@networkplumber.org> writes: > On Nov 2, 2017 19:35, "Vitaly Kuznetsov" <vkuzn...@redhat.com> wrote: > > Hyper-V hosts are known to send RNDIS messages even after we halt the > device in rndis_filter_halt_device(). Remove user visible

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

2017-11-06 Thread Vitaly Kuznetsov
Wanpeng Li <kernel...@gmail.com> writes: > 2017-11-06 17:14 GMT+08:00 Vitaly Kuznetsov <vkuzn...@redhat.com>: >> Wanpeng Li <kernel...@gmail.com> writes: >> >>> 2017-08-03 0:09 GMT+08:00 Vitaly Kuznetsov <vkuzn...@redhat.com>: >>>> Cha

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

2017-11-06 Thread Vitaly Kuznetsov
Wanpeng Li <kernel...@gmail.com> writes: > 2017-08-03 0:09 GMT+08:00 Vitaly Kuznetsov <vkuzn...@redhat.com>: >> 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 depen

[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 <vkuzn...@redhat.com> --- tools/hv/Makefile | 23 ++- 1 file changed, 22 insertions(+), 1 de

[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 <vkuzn...@redhat.com> --- drivers/net/hyperv/rndis_filter.c | 4 ++-- 1 file chan

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

2017-11-02 Thread Vitaly Kuznetsov
reliably. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- 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..bfc796

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

2017-11-02 Thread Vitaly Kuznetsov
sages. 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: netvsc_teardown_

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

2017-11-02 Thread Vitaly Kuznetsov
Vitaly Kuznetsov <vkuzn...@redhat.com> 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 pro

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

2017-11-01 Thread Vitaly Kuznetsov
Vitaly Kuznetsov <vkuzn...@redhat.com> writes: > mikel...@exchange.microsoft.com writes: > >> From: Michael Kelley <mikel...@microsoft.com> >> >> The 2016 version of Hyper-V offers the option to operate the guest VM >> per-vcpu stimer's in Direct Mo

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

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

2017-10-31 Thread Vitaly Kuznetsov
Stephen Hemminger <step...@networkplumber.org> writes: > On Tue, 31 Oct 2017 14:42:02 +0100 > Vitaly Kuznetsov <vkuzn...@redhat.com> wrote: > >> @@ -2002,7 +2002,9 @@ static int netvsc_probe(struct hv_device *dev, >> device_info.

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 <da...@davemloft.net> writes: > From: Vitaly Kuznetsov <vkuzn...@redhat.com> > Date: Tue, 31 Oct 2017 15:40:06 +0100 > >> Eric Dumazet <eric.duma...@gmail.com> writes: >> >>> On Tue, 2017-10-31 at 14:42 +0100, Vitaly Kuznetsov wro

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 <eric.duma...@gmail.com> 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. >> >>

[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 <vkuzn...@redhat.com> --- drivers/net/hyperv/rndis_filter.c | 4 ++-- 1 file chan

[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 <vkuzn...@redhat.com> --- drivers/net/hyperv/netvsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[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 <vkuzn...@redhat.

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

2017-10-31 Thread Vitaly Kuznetsov
reliably. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- 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..bfc796

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

2017-10-31 Thread Vitaly Kuznetsov
g 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() hv_netvsc: hide war

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

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

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

2017-10-30 Thread Vitaly Kuznetsov
Greg KH <gre...@linuxfoundation.org> writes: > On Sun, Oct 29, 2017 at 12:21:09PM -0700, k...@exchange.microsoft.com wrote: >> From: Vitaly Kuznetsov <vkuzn...@redhat.com> >> >> Add tracepoint to CHANNELMSG_OPENCHANNEL sender. >> >> Signed-

Re: [PATCH 3/3] Drivers: hv: vmbus: Make pannic reporting to be more useful

2017-10-12 Thread Vitaly Kuznetsov
k...@exchange.microsoft.com writes: > From: "K. Y. Srinivasan" > > Hyper-V allows the guest to report panic and the guest can pass additional > information. All this is logged on the host. Currently Linux is passing back > information that is not particularly useful. Make the

[PATCH] x86/hyperv: clear vcpu banks between calls to avoid flushing unneeded vCPUs

2017-10-06 Thread Vitaly Kuznetsov
way stash the maximum possible vCPU number (this may differ from Linux CPU id). Reported-by: Jork Loeser <jork.loe...@microsoft.com> Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- arch/x86/hyperv/hv_init.c | 5 + arch/x86/hyperv/mmu.c | 17 ---

[PATCH v3 15/17] hyper-v: trace vmbus_release_relid()

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_RELID_RELEASED sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 7 +-- drivers/hv/hv_trace.h | 16 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/hv/channel_mg

[PATCH v3 14/17] hyper-v: trace vmbus_negotiate_version()

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_INITIATE_CONTACT sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/connection.c | 3 +++ drivers/hv/hv_trace.h | 26 ++ 2 files changed, 29 insertions(+) diff --git a/drivers/hv/connection.c b/driv

[PATCH v3 03/17] hyper-v: trace vmbus_onoffer()

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_OFFERCHANNEL handler. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 2 ++ drivers/hv/hv_trace.h | 37 + 2 files changed, 39 insertions(+) diff --git a/drivers/hv/channel_mg

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

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_OPENCHANNEL sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel.c | 2 ++ drivers/hv/hv_trace.h | 27 +++ 2 files changed, 29 insertions(+) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c

[PATCH v3 17/17] hyper-v: trace channel events

2017-10-05 Thread Vitaly Kuznetsov
Added an additional set of trace points for when channel gets notified or signals host. Suggested-by: Stephen Hemminger <sthem...@microsoft.com> Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel.c| 2 ++ drivers/hv/connection.c | 2 ++ drivers/h

[PATCH v3 07/17] hyper-v: trace vmbus_ongpadl_torndown()

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_GPADL_TORNDOWN handler. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 2 ++ drivers/hv/hv_trace.h | 8 2 files changed, 10 insertions(+) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c

[PATCH v3 12/17] hyper-v: trace vmbus_establish_gpadl()

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_GPADL_HEADER/CHANNELMSG_GPADL_BODY sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel.c | 6 ++ drivers/hv/hv_trace.h | 42 ++ 2 files changed, 48 insertions(+) diff --git a/driv

[PATCH v3 11/17] hyper-v: trace vmbus_close_internal()

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_CLOSECHANNEL sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel.c | 2 ++ drivers/hv/hv_trace.h | 15 +++ 2 files changed, 17 insertions(+) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index 82cb57

[PATCH v3 08/17] hyper-v: trace vmbus_onversion_response()

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_VERSION_RESPONSE handler. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 3 +++ drivers/hv/hv_trace.h | 11 +++ 2 files changed, 14 insertions(+) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_

[PATCH v3 02/17] hyper-v: trace vmbus_on_message()

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to vmbus_on_message() which is called when we start processing a blocking from work context. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 2 ++ drivers/hv/hv_trace.h | 5 + 2 files changed, 7 insertions(+) diff --git a/driv

[PATCH v3 09/17] hyper-v: trace vmbus_request_offers()

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_REQUESTOFFERS sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 4 +++- drivers/hv/hv_trace.h | 8 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/hv/channel_mgmt.c b/driv

[PATCH v3 13/17] hyper-v: trace vmbus_teardown_gpadl()

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_GPADL_TEARDOWN sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel.c | 2 ++ drivers/hv/hv_trace.h | 18 ++ 2 files changed, 20 insertions(+) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c

[PATCH v3 16/17] hyper-v: trace vmbus_send_tl_connect_request()

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_TL_CONNECT_REQUEST sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel.c | 7 ++- drivers/hv/hv_trace.h | 20 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/hv/channel.c b/driv

[PATCH v3 01/17] hyper-v: trace vmbus_on_msg_dpc()

2017-10-05 Thread Vitaly Kuznetsov
Add tracing subsystem to Hyper-V VMBus module and add tracepoint to vmbus_on_msg_dpc() which is called when we receive a message from host. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/Makefile | 4 +++- drivers/hv/hv_trace.c | 4 drivers/hv/hv_t

[PATCH v3 06/17] hyper-v: trace vmbus_ongpadl_created()

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_GPADL_CREATED handler. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 2 ++ drivers/hv/hv_trace.h | 17 + 2 files changed, 19 insertions(+) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_

[PATCH v3 05/17] hyper-v: trace vmbus_onopen_result()

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_OPENCHANNEL_RESULT handler. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 2 ++ drivers/hv/hv_trace.h | 17 + 2 files changed, 19 insertions(+) diff --git a/drivers/hv/channel_mgmt.c b/driv

[PATCH v3 04/17] hyper-v: trace vmbus_onoffer_rescind()

2017-10-05 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_RESCIND_CHANNELOFFER handler. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 2 ++ drivers/hv/hv_trace.h | 8 2 files changed, 10 insertions(+) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_

[PATCH v3 00/17] Hyper-V: add tracing to VMBus module and trace messages/events

2017-10-05 Thread Vitaly Kuznetsov
ANNELMSG_UNLOAD/CHANNELMSG_UNLOAD_RESPONSE are not traced as these are mostly used on crash. Vitaly Kuznetsov (17): hyper-v: trace vmbus_on_msg_dpc() hyper-v: trace vmbus_on_message() hyper-v: trace vmbus_onoffer() hyper-v: trace vmbus_onoffer_rescind() hyper-v: trace vmbus_onopen_result()

[PATCH] x86/hyperv: don't use percpu areas for pcpu_flush/pcpu_flush_ex structures

2017-10-05 Thread Vitaly Kuznetsov
somewhere. Reported-by: Simon Xiao <six...@microsoft.com> Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- - Please cosider this for 4.14. --- arch/x86/hyperv/mmu.c | 34 -- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/arch/x86/hyperv/

Re: [PATCH v2 16/16] hyper-v: trace vmbus_send_tl_connect_request()

2017-10-04 Thread Vitaly Kuznetsov
Stephen Hemminger writes: > I added an additional set of trace points for when channel gets notified or > signals host. > Will add this in v3, thanks! > diff -urNp linux-msft/drivers/hv/channel.c msft-4.14-rc3/drivers/hv/channel.c > ---

Re: [PATCH 02/16] hyper-v: trace vmbus_on_message()

2017-10-04 Thread Vitaly Kuznetsov
Stephen Hemminger <step...@networkplumber.org> writes: > On Thu, 21 Sep 2017 10:17:18 +0200 > Vitaly Kuznetsov <vkuzn...@redhat.com> wrote: > >> Steven Rostedt <rost...@goodmis.org> writes: >> >> > On Wed, 20 Sep 2017 19:21:53 +0200 &

[PATCH v2 16/16] hyper-v: trace vmbus_send_tl_connect_request()

2017-09-29 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_TL_CONNECT_REQUEST sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel.c | 7 ++- drivers/hv/hv_trace.h | 20 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/hv/channel.c b/driv

[PATCH v2 14/16] hyper-v: trace vmbus_negotiate_version()

2017-09-29 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_INITIATE_CONTACT sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/connection.c | 3 +++ drivers/hv/hv_trace.h | 26 ++ 2 files changed, 29 insertions(+) diff --git a/drivers/hv/connection.c b/driv

[PATCH v2 05/16] hyper-v: trace vmbus_onopen_result()

2017-09-29 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_OPENCHANNEL_RESULT handler. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 2 ++ drivers/hv/hv_trace.h | 17 + 2 files changed, 19 insertions(+) diff --git a/drivers/hv/channel_mgmt.c b/driv

[PATCH v2 11/16] hyper-v: trace vmbus_close_internal()

2017-09-29 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_CLOSECHANNEL sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel.c | 2 ++ drivers/hv/hv_trace.h | 15 +++ 2 files changed, 17 insertions(+) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index 82cb57

[PATCH v2 12/16] hyper-v: trace vmbus_establish_gpadl()

2017-09-29 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_GPADL_HEADER/CHANNELMSG_GPADL_BODY sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel.c | 6 ++ drivers/hv/hv_trace.h | 42 ++ 2 files changed, 48 insertions(+) diff --git a/driv

[PATCH v2 01/16] hyper-v: trace vmbus_on_msg_dpc()

2017-09-29 Thread Vitaly Kuznetsov
Add tracing subsystem to Hyper-V VMBus module and add tracepoint to vmbus_on_msg_dpc() which is called when we receive a message from host. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/Makefile | 4 +++- drivers/hv/hv_trace.c | 4 drivers/hv/hv_t

[PATCH v2 06/16] hyper-v: trace vmbus_ongpadl_created()

2017-09-29 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_GPADL_CREATED handler. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 2 ++ drivers/hv/hv_trace.h | 17 + 2 files changed, 19 insertions(+) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_

[PATCH v2 04/16] hyper-v: trace vmbus_onoffer_rescind()

2017-09-29 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_RESCIND_CHANNELOFFER handler. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 2 ++ drivers/hv/hv_trace.h | 8 2 files changed, 10 insertions(+) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_

[PATCH v2 08/16] hyper-v: trace vmbus_onversion_response()

2017-09-29 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_VERSION_RESPONSE handler. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 3 +++ drivers/hv/hv_trace.h | 11 +++ 2 files changed, 14 insertions(+) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_

[PATCH v2 10/16] hyper-v: trace vmbus_open()

2017-09-29 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_OPENCHANNEL sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel.c | 2 ++ drivers/hv/hv_trace.h | 27 +++ 2 files changed, 29 insertions(+) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c

[PATCH v2 13/16] hyper-v: trace vmbus_teardown_gpadl()

2017-09-29 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_GPADL_TEARDOWN sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel.c | 2 ++ drivers/hv/hv_trace.h | 18 ++ 2 files changed, 20 insertions(+) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c

[PATCH v2 09/16] hyper-v: trace vmbus_request_offers()

2017-09-29 Thread Vitaly Kuznetsov
Add tracepoint to CHANNELMSG_REQUESTOFFERS sender. Signed-off-by: Vitaly Kuznetsov <vkuzn...@redhat.com> --- drivers/hv/channel_mgmt.c | 4 +++- drivers/hv/hv_trace.h | 8 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/hv/channel_mgmt.c b/driv

<    1   2   3   4   5   6   7   8   9   10   >