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

2017-12-11 Thread Roman Kagan
On Mon, Dec 11, 2017 at 10:56:33AM +0100, Vitaly Kuznetsov wrote: > Roman Kagan writes: > > On Fri, Dec 08, 2017 at 11:49:57AM +0100, Vitaly Kuznetsov wrote: > >> +void register_hv_tsc_update(void (*cb)(void)) > >> +{ > > > > The function name seems

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

2017-12-08 Thread Roman Kagan
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 > different TSC frequency for some short period host emulates our accesses > to TSC

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

2017-12-08 Thread Roman Kagan
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. > Implement the procedure in the following way: > - Pause all guests. > - Tell our ho

Re: [PATCH 12/15] hyperv: move VMBus connection ids to uapi

2017-01-09 Thread Roman Kagan
On Mon, Jan 02, 2017 at 09:19:57AM +0100, Paolo Bonzini wrote: > On 28/12/2016 18:09, Roman Kagan wrote: > > Am I correct assuming that QEMU is currently the only user of > > arch/x86/include/uapi/asm/hyperv.h? > > > > Then I think we're fine withdrawing it

Re: [PATCH 12/15] hyperv: move VMBus connection ids to uapi

2017-01-09 Thread Roman Kagan
On Mon, Jan 09, 2017 at 12:40:48AM -0800, h...@zytor.com wrote: > On January 9, 2017 12:32:23 AM PST, Roman Kagan wrote: > >On Mon, Jan 02, 2017 at 09:19:57AM +0100, Paolo Bonzini wrote: > >> On 28/12/2016 18:09, Roman Kagan wrote: > >> > Am I correct assuming that Q

Re: [PATCH 12/15] hyperv: move VMBus connection ids to uapi

2016-12-28 Thread Roman Kagan
On Wed, Dec 21, 2016 at 07:54:11PM +, KY Srinivasan wrote: > > > > -Original Message- > > From: Stephen Hemminger [mailto:step...@networkplumber.org] > > Sent: Wednesday, December 21, 2016 10:03 AM > > To: Christoph Hellwig > > Cc: Paolo Bonzini ;

Re: [PATCH 00/15] hyperv: more stuff to uapi + cleanup

2016-12-28 Thread Roman Kagan
[ Sorry for such a slow reply; flu and office relocation knocked me out for a while ] On Wed, Dec 21, 2016 at 06:00:17PM +, KY Srinivasan wrote: > > -Original Message- > > From: Roman Kagan [mailto:rka...@virtuozzo.com] > > Sent: Tuesday, December 20, 2016 7:56 AM &

Re: [PATCH 12/15] hyperv: move VMBus connection ids to uapi

2016-12-21 Thread Roman Kagan
On Wed, Dec 21, 2016 at 06:26:54AM -0800, Christoph Hellwig wrote: > On Wed, Dec 21, 2016 at 03:59:20PM +0300, Roman Kagan wrote: > > That's fine by me. > > > > I guess the series should then start with a complete move > > arch/x86/include/uapi/asm/hype

Re: [PATCH 03/15] hyperv: use standard bitops

2016-12-21 Thread Roman Kagan
On Wed, Dec 21, 2016 at 01:00:44PM +0100, Olaf Hering wrote: > On Tue, Dec 20, Roman Kagan wrote: > > Reverting commit 22356585712d ("staging: hv: use sync_bitops when > interacting with the hypervisor") is save because ... > > > - sy

Re: [PATCH 12/15] hyperv: move VMBus connection ids to uapi

2016-12-21 Thread Roman Kagan
On Wed, Dec 21, 2016 at 04:18:58AM -0800, Christoph Hellwig wrote: > On Wed, Dec 21, 2016 at 09:29:39AM +0300, Roman Kagan wrote: > > QEMU in particular. We're planning to implement VMBus devices in QEMU > > and would like to have the definitions shared with the Linux guest &

Re: [PATCH 02/15] hyperv: uapi-fy synic event flags definitions

2016-12-20 Thread Roman Kagan
On Tue, Dec 20, 2016 at 09:24:53AM -0800, Stephen Hemminger wrote: > On Tue, 20 Dec 2016 18:55:49 +0300 > Roman Kagan wrote: > > > Move definitions related to the Hyper-V SynIC event flags to a header > > where they can be consumed by userspace. > > > > While

Re: [PATCH 12/15] hyperv: move VMBus connection ids to uapi

2016-12-20 Thread Roman Kagan
On Tue, Dec 20, 2016 at 09:25:43AM -0800, Stephen Hemminger wrote: > On Tue, 20 Dec 2016 18:55:59 +0300 > Roman Kagan wrote: > > > Userspace will need them too. > > > > Signed-off-by: Roman Kagan > > What userspace? I am worried about creating more stable API

Re: [PATCH 01/15] hyperv: consolidate TSC ref page definitions

2016-12-20 Thread Roman Kagan
On Tue, Dec 20, 2016 at 08:57:28PM +, KY Srinivasan wrote: > > > > -Original Message- > > From: Roman Kagan [mailto:rka...@virtuozzo.com] > > Sent: Tuesday, December 20, 2016 7:56 AM > > To: Paolo Bonzini ; Radim Krčmář > > ; KY Srinivasan ;

[PATCH 11/15] hyperv: uapi-fy monitored notification structures

2016-12-20 Thread Roman Kagan
Move structures for monitored notifications to the uapi header for userspace to be able to consume. Also observe that hv_monitor_parameter is by definition the same as hv_input_signal_event so use the latter and nuke the former. Signed-off-by: Roman Kagan --- arch/x86/include/uapi/asm/hyperv.h

[PATCH 05/15] hyperv: GFP_ATOMIC -> GFP_KERNEL

2016-12-20 Thread Roman Kagan
There's no need in GFP_ATOMIC when initializing the driver state. While at this, also rely on free_page() to take null argument. Signed-off-by: Roman Kagan --- drivers/hv/hv.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/hv/h

[PATCH 01/15] hyperv: consolidate TSC ref page definitions

2016-12-20 Thread Roman Kagan
Consolidate the guest-side and kvm-side definitions for Hyper-V TSC reference page. While at this, rewrite read_hv_clock_tsc using the existing helpers. Signed-off-by: Roman Kagan --- arch/x86/include/asm/kvm_host.h| 2 +- arch/x86/include/uapi/asm/hyperv.h | 4 +-- drivers/hv

[PATCH 03/15] hyperv: use standard bitops

2016-12-20 Thread Roman Kagan
Signed-off-by: Roman Kagan --- drivers/hv/channel.c| 8 +++- drivers/hv/connection.c | 9 +++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index 5fb4c6d..f9df275 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv

[PATCH 08/15] hyperv: dedup crash msr related definitions

2016-12-20 Thread Roman Kagan
Use the definitions already present in the uapi header throughout the guest driver, too. Signed-off-by: Roman Kagan --- drivers/hv/hyperv_vmbus.h | 11 --- drivers/hv/vmbus_drv.c| 6 +++--- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/hv/hyperv_vmbus.h b

[PATCH 09/15] hyperv: unify Hyper-V msr definitions

2016-12-20 Thread Roman Kagan
Use the definitions already present in the uapi header. Besides, drop all bitfields for the msr values and use bitwise operations instead. Signed-off-by: Roman Kagan --- drivers/hv/hyperv_vmbus.h | 88 --- drivers/hv/hv.c | 150

[PATCH 04/15] hyperv: define VMBus message type

2016-12-20 Thread Roman Kagan
Give a name to the constant (1) already used in the code. Signed-off-by: Roman Kagan --- arch/x86/include/uapi/asm/hyperv.h | 2 ++ drivers/hv/connection.c| 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include

[PATCH 07/15] hyperv: dedup cpuid definitions

2016-12-20 Thread Roman Kagan
Use the definitions already present in the uapi header throughout the guest driver, too. Signed-off-by: Roman Kagan --- drivers/hv/hyperv_vmbus.h | 19 --- drivers/hv/hv.c | 6 +++--- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/drivers/hv

[PATCH 15/15] hyperv: redefine hv_message without bitfields

2016-12-20 Thread Roman Kagan
This brings more symmetry in the API. The downside is that this changes the userspace-visible structure. Hopefully no userspace code had a chance to use it yet. Signed-off-by: Roman Kagan --- arch/x86/include/uapi/asm/hyperv.h | 32 +--- drivers/hv/hyperv_vmbus.h

[PATCH 13/15] hyperv: move function close to its only callsite

2016-12-20 Thread Roman Kagan
Signed-off-by: Roman Kagan --- drivers/hv/hyperv_vmbus.h | 44 drivers/hv/hv.c | 39 +++ 2 files changed, 39 insertions(+), 44 deletions(-) diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv

[PATCH 12/15] hyperv: move VMBus connection ids to uapi

2016-12-20 Thread Roman Kagan
Userspace will need them too. Signed-off-by: Roman Kagan --- arch/x86/include/uapi/asm/hyperv.h | 9 + drivers/hv/hyperv_vmbus.h | 10 -- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include/uapi/asm

[PATCH 14/15] hyperv_vmbus: drop unused definitions

2016-12-20 Thread Roman Kagan
None of these is used in the kernel. Signed-off-by: Roman Kagan --- drivers/hv/hyperv_vmbus.h | 119 -- 1 file changed, 119 deletions(-) diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index fcb5d91..8ce6d64 100644 --- a/drivers/hv

[PATCH 06/15] hyperv: avoid unnecessary vmalloc

2016-12-20 Thread Roman Kagan
Make hypercall and tsc page allocation similar to the rest of the Hyper-V shared memory stuff instead of vmalloc-ing them. Also perform cleanup unconditionally which is safe. TODO: the skipping of free in case of a crash is probably no longer necessary, too. Signed-off-by: Roman Kagan

[PATCH 02/15] hyperv: uapi-fy synic event flags definitions

2016-12-20 Thread Roman Kagan
Move definitions related to the Hyper-V SynIC event flags to a header where they can be consumed by userspace. While doing so, also clean up their use by switching to standard bitops and struct-based dereferencing. The latter is also done for message pages. Signed-off-by: Roman Kagan --- arch

[PATCH 00/15] hyperv: more stuff to uapi + cleanup

2016-12-20 Thread Roman Kagan
appear reasonable to do at the same time. The most controversial is the last patch which modifies the stuff already published in the uapi header, in the hope that no userspace applications have started relying on it; I'm ok dropping it if this is unacceptable. Roman Kagan (15): hyperv: consol

[PATCH 10/15] hyperv: uapi-fy PostMessage and SignalEvent hypercall structures

2016-12-20 Thread Roman Kagan
Expose structures used for PostMessage and SignalEvent hypercalls in a uapi header. While doing so, simplify alignment handling and drop unnecessary complications in the connectionid field. Signed-off-by: Roman Kagan --- arch/x86/include/uapi/asm/hyperv.h | 18 ++ drivers/hv