Re: [Qemu-devel] [PATCH v2] util: add is_equal to UUID API

2017-12-20 Thread Roman Kagan
On Tue, Nov 28, 2017 at 03:49:46PM +0800, Fam Zheng wrote: > On Mon, 11/27 15:43, Roman Kagan wrote: > > It's going to be useful, in particular, in VMBus code massively using > > uuids aka GUIDs. > > > > Signed-off-by: Roman Kagan > > --- > > v1 ->

Re: [Qemu-devel] [PATCH v2 0/2] add UUID property type

2017-12-20 Thread Roman Kagan
On Mon, Nov 27, 2017 at 04:05:16PM +0300, Roman Kagan wrote: > UUIDs (GUIDs) are widely used in VMBus-related stuff, so a dedicated > property type becomes helpful. > > In the existing code, vmgenid can immediately profit from it. > > Roman Kagan (2): > qdev-properties: a

Re: [Qemu-devel] [PATCH 2/2] virtio: fix IO request length in virtio SCSI/block

2017-12-19 Thread Roman Kagan
On Mon, Dec 18, 2017 at 10:42:35PM +0300, Denis V. Lunev wrote: > On 12/18/2017 10:35 PM, Felipe Franciosi wrote: > >> On 18 Dec 2017, at 16:16, Harris, James R wrote: > >>> On Dec 18, 2017, at 6:38 AM, Stefan Hajnoczi wrote: > >>> On Fri, Dec 15, 2017 at 06:02:50PM +0300, Denis V. Lunev wrote: >

Re: [Qemu-devel] [PATCH] i386: turn off l3-cache property by default

2017-11-29 Thread Roman Kagan
On Wed, Nov 29, 2017 at 06:15:05PM +0100, Paolo Bonzini wrote: > On 29/11/2017 14:35, Roman Kagan wrote: > >> > >>> IMO, the long term solution is to make Linux guests not misbehave > >>> when we stop lying about the L3 cache. Maybe we could provide a > >

Re: [Qemu-devel] [PATCH] i386: turn off l3-cache property by default

2017-11-29 Thread Roman Kagan
On Wed, Nov 29, 2017 at 07:58:19PM +0800, Longpeng (Mike) wrote: > On 2017/11/29 18:41, Eduardo Habkost wrote: > > On Wed, Nov 29, 2017 at 01:20:38PM +0800, Longpeng (Mike) wrote: > >> On 2017/11/29 5:13, Eduardo Habkost wrote: > >>> On Tue, Nov 28, 2017 at 11:20:27PM +0300, Denis V. Lunev wrote: >

Re: [Qemu-devel] [PATCH] i386: turn off l3-cache property by default

2017-11-28 Thread Roman Kagan
On Wed, Nov 29, 2017 at 06:17:40AM +0200, Michael S. Tsirkin wrote: > On Tue, Nov 28, 2017 at 11:20:27PM +0300, Denis V. Lunev wrote: > > > There's one thing I don't understand in your test case: if you > > > just found out that Linux will behave worse if it assumes that > > > the VCPUs are sharing

Re: [Qemu-devel] [PATCH] i386: turn off l3-cache property by default

2017-11-28 Thread Roman Kagan
On Wed, Nov 29, 2017 at 01:20:38PM +0800, Longpeng (Mike) wrote: > On 2017/11/29 5:13, Eduardo Habkost wrote: > > > [CCing the people who were copied in the original patch that > > enabled l3cache] > > > > On Tue, Nov 28, 2017 at 11:20:27PM +0300, Denis V. Lunev wrote: > >> On 11/28/2017 10:58 PM

Re: [Qemu-devel] [PATCH] i386: turn off l3-cache property by default

2017-11-28 Thread Roman Kagan
On Tue, Nov 28, 2017 at 07:13:26PM -0200, Eduardo Habkost wrote: > [CCing the people who were copied in the original patch that > enabled l3cache] Thanks, and sorry to have forgotten to do so in the patch! > On Tue, Nov 28, 2017 at 11:20:27PM +0300, Denis V. Lunev wrote: > > On 11/28/2017 10:58 P

Re: [Qemu-devel] [PATCH] i386: turn off l3-cache property by default

2017-11-28 Thread Roman Kagan
On Tue, Nov 28, 2017 at 08:50:54PM +0100, Paolo Bonzini wrote: > On 28/11/2017 19:54, Michael S. Tsirkin wrote: > >> Now there's a downside: with L3 cache the Linux scheduler is more eager > >> to wake up tasks on sibling CPUs, resulting in unnecessary cross-vCPU > >> interactions and therefore exe

Re: [Qemu-devel] [PATCH v2 2/2] vmgenid: use UUID property type

2017-11-28 Thread Roman Kagan
On Mon, Nov 27, 2017 at 08:38:41AM -0800, Ben Warren wrote: > It looks like you dropped Marc-André and my Reviewed-by lines. Please put > them back. Oops. I thought that the amount of changes in the first patch was too big to keep the R-b; however, the second patch was basically the same so I s

[Qemu-devel] [PATCH v2 0/2] add UUID property type

2017-11-27 Thread Roman Kagan
UUIDs (GUIDs) are widely used in VMBus-related stuff, so a dedicated property type becomes helpful. In the existing code, vmgenid can immediately profit from it. Roman Kagan (2): qdev-properties: add UUID property type vmgenid: use UUID property type v1 -> v2: - make the property defa

[Qemu-devel] [PATCH v2 2/2] vmgenid: use UUID property type

2017-11-27 Thread Roman Kagan
/vmgenid.txt this is actually desirable. Signed-off-by: Roman Kagan --- v1 -> v2: - use the corresponding define for "guid" field name hw/acpi/vmgenid.c | 30 -- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgen

[Qemu-devel] [PATCH v2 1/2] qdev-properties: add UUID property type

2017-11-27 Thread Roman Kagan
y. Signed-off-by: Roman Kagan --- v1 -> v2: - make the property default to autogeneration if not specified explicitly include/hw/qdev-properties.h | 9 +++ hw/core/qdev-properties.c| 61 2 files changed, 70 insertions(+) diff --git

[Qemu-devel] [PATCH v2] util: add is_equal to UUID API

2017-11-27 Thread Roman Kagan
It's going to be useful, in particular, in VMBus code massively using uuids aka GUIDs. Signed-off-by: Roman Kagan --- v1 -> v2: - drop dedicated testcase (for it was of no value) and incorporate is_null and is_equal assertions into uuid_generate testcase include/qemu/uuid.h | 2 +

Re: [Qemu-devel] [PATCH] util: add is_equal to UUID API

2017-11-27 Thread Roman Kagan
On Mon, Nov 27, 2017 at 11:45:52AM +, Daniel P. Berrange wrote: > On Fri, Nov 24, 2017 at 06:34:03PM +0100, Thomas Huth wrote: > > On 24.11.2017 15:32, Roman Kagan wrote: > > > It's going to be useful, in particular, in VMBus code massively using > > > uuids ak

Re: [Qemu-devel] [PATCH] util: add is_equal to UUID API

2017-11-27 Thread Roman Kagan
On Fri, Nov 24, 2017 at 06:34:03PM +0100, Thomas Huth wrote: > On 24.11.2017 15:32, Roman Kagan wrote: > > +++ b/tests/test-uuid.c > > @@ -116,6 +116,29 @@ static void test_uuid_is_null(void) > > g_assert_false(qemu_uuid_is_null(&uuid_not_null_2)); >

Re: [Qemu-devel] [PATCH 1/2] qdev-properties: add UUID property type

2017-11-27 Thread Roman Kagan
On Fri, Nov 24, 2017 at 08:36:53PM -0600, Corey Minyard wrote: > On 11/24/2017 09:36 AM, Roman Kagan wrote: > > UUIDs (GUIDs) are widely used in VMBus-related stuff, so a dedicated > > property type becomes helpful. > > > > Signed-off-by: Roman Kagan > > --- &

[Qemu-devel] [PATCH 2/2] vmgenid: use UUID property type

2017-11-24 Thread Roman Kagan
/vmgenid.txt this is actually desirable. Signed-off-by: Roman Kagan --- hw/acpi/vmgenid.c | 30 -- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c index 105044f666..84ff015bda 100644 --- a/hw/acpi/vmgenid.c +++ b/hw/acpi/

[Qemu-devel] [PATCH 1/2] qdev-properties: add UUID property type

2017-11-24 Thread Roman Kagan
UUIDs (GUIDs) are widely used in VMBus-related stuff, so a dedicated property type becomes helpful. Signed-off-by: Roman Kagan --- include/hw/qdev-properties.h | 3 +++ hw/core/qdev-properties.c| 52 2 files changed, 55 insertions(+) diff --git

[Qemu-devel] [PATCH 0/2] add UUID property type

2017-11-24 Thread Roman Kagan
UUIDs (GUIDs) are widely used in VMBus-related stuff, so a dedicated property type becomes helpful. In the existing code, vmgenid can immediately profit from it. Roman Kagan (2): qdev-properties: add UUID property type vmgenid: use UUID property type include/hw/qdev-properties.h | 3

[Qemu-devel] [PATCH] util: add is_equal to UUID API

2017-11-24 Thread Roman Kagan
It's going to be useful, in particular, in VMBus code massively using uuids aka GUIDs. Signed-off-by: Roman Kagan --- include/qemu/uuid.h | 2 ++ tests/test-uuid.c | 24 util/uuid.c | 7 ++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --

[Qemu-devel] [PATCH 3/3] hyperv: make SynIC version msr constant

2017-11-22 Thread Roman Kagan
The value of HV_X64_MSR_SVERSION is initialized once at vcpu init, and is reset to zero on vcpu reset, which is wrong. It is supposed to be a constant, so drop the field from X86CPU, set the msr with the constant value, and don't bother getting it. Signed-off-by: Roman Kagan --- target

[Qemu-devel] [PATCH 1/3] hyperv: set partition-wide MSRs only on first vcpu

2017-11-22 Thread Roman Kagan
-off-by: Roman Kagan --- target/i386/cpu.h | 5 - target/i386/kvm.c | 23 +++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index b086b1528b..ea9db80de5 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h

[Qemu-devel] [PATCH 2/3] hyperv: ensure SINTx msrs are reset properly

2017-11-22 Thread Roman Kagan
Initially SINTx msrs should be in "masked" state. To ensure that happens on *every* reset, move setting their values to kvm_arch_vcpu_reset. Signed-off-by: Roman Kagan --- target/i386/kvm.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/target/i3

[Qemu-devel] [PATCH 0/3] hyperv: hv msr initialization fixes

2017-11-22 Thread Roman Kagan
These patches fix problems with hyperv msr initialization. Evgeny Yakovlev (1): hyperv: set partition-wide MSRs only on first vcpu Roman Kagan (2): hyperv: ensure SINTx msrs are reset properly hyperv: make SynIC version msr constant target/i386/cpu.h | 6 -- target/i386/kvm.c | 44

Re: [Qemu-devel] [PATCH] fix scripts/update-linux-headers.sh here document

2017-11-10 Thread Roman Kagan
t; "$output/linux-headers/asm-x86/" > cp "$tmpdir/include/asm/unistd_64.h" "$output/linux-headers/asm-x86/" Ugh, indeed, the minus sign after << causes the shell to strip only preceding tabs, not spaces. Apparently I expanded the tabs after I tested the script to work... Fixes: 40bf8e9aede0f9105a9e1e4aaf17b20aaa55f9a0 Reviewed-by: Roman Kagan Thanks, Roman.

Re: [Qemu-devel] [PULL 43/50] update-linux-headers: prepare for hyperv.h removal

2017-09-19 Thread Roman Kagan
On Tue, Sep 19, 2017 at 02:29:32PM +0200, Paolo Bonzini wrote: > From: Roman Kagan > > All definitions related to Hyper-V emulation are now taken from the QEMU > own header, so the one imported from the kernel is no longer needed. > > Unfortunately it's included by kvm

Re: [Qemu-devel] [PATCH 0/2] hyperv: own protocol header instead of kernel's

2017-08-31 Thread Roman Kagan
On Thu, Jul 13, 2017 at 11:15:20PM +0300, Roman Kagan wrote: > Supersede kernel's header for Hyper-V protocol definitions with our own. > The reason is that, since this is a third-party protocol and not a > kernel API, the kernel folks are not happy exposing it in the kernel &g

[Qemu-devel] [PATCH 1/2] hyperv: add header with protocol definitions

2017-07-13 Thread Roman Kagan
t new names. While at this, the protocol data structures are defined in a more conventional way, without bitfields, enums, and excessive unions. The code using this stuff is adjusted, too; it can now be built both with and without the kernel header in the tree. Signed-off-by: Roman Kagan --- target

[Qemu-devel] [PATCH 0/2] hyperv: own protocol header instead of kernel's

2017-07-13 Thread Roman Kagan
p working. Once (if) this lands in QEMU I'll post patches to KVM to move its hyperv.h out of uapi. This is the first part split out of my former biggish "hyperv fixes and enhancements" series. The only change is the underscore replaced with a dash in the header file name. Roman K

[Qemu-devel] [PATCH 2/2] update-linux-headers: prepare for hyperv.h removal

2017-07-13 Thread Roman Kagan
erv.h with a dummy. Signed-off-by: Roman Kagan --- scripts/update-linux-headers.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 2f906c4d16..ad80fe3fca 100755 --- a/scripts/update-linux-headers.sh +++

Re: [Qemu-devel] [PATCH v2 14/23] hyperv: qom-ify SynIC

2017-07-07 Thread Roman Kagan
On Fri, Jul 07, 2017 at 02:22:20PM +0200, Igor Mammedov wrote: > On Thu, 29 Jun 2017 20:51:01 +0300 > Roman Kagan wrote: > > > On Thu, Jun 29, 2017 at 05:05:46PM +0200, Igor Mammedov wrote: > > > On Wed, 21 Jun 2017 19:24:15 +0300 > > > Roman Kagan wrote:

Re: [Qemu-devel] [PATCH v2 00/23] hyperv fixes and enhancements

2017-06-29 Thread Roman Kagan
On Thu, Jun 29, 2017 at 05:20:30PM +0200, Igor Mammedov wrote: > On Wed, 21 Jun 2017 19:24:01 +0300 > Roman Kagan wrote: > > > This series applies miscellaneous fixes and enhancements to Hyper-V > > emulation code in QEMU, and lays out the ground for VMBus devices. >

Re: [Qemu-devel] [PATCH v2 14/23] hyperv: qom-ify SynIC

2017-06-29 Thread Roman Kagan
On Thu, Jun 29, 2017 at 05:05:46PM +0200, Igor Mammedov wrote: > On Wed, 21 Jun 2017 19:24:15 +0300 > Roman Kagan wrote: > > +static void synic_realize(DeviceState *dev, Error **errp) > > +{ > > +Object *obj = OBJECT(dev); > > +SynICState *synic = SYNIC(d

Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index

2017-06-29 Thread Roman Kagan
On Thu, Jun 29, 2017 at 04:39:00PM +0200, Igor Mammedov wrote: > On Thu, 29 Jun 2017 16:10:20 +0300 > Roman Kagan wrote: > > > On Thu, Jun 29, 2017 at 01:53:29PM +0200, Igor Mammedov wrote: > > > On Thu, 29 Jun 2017 12:53:27 +0300 > > > Roman Kagan wrote: >

Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index

2017-06-29 Thread Roman Kagan
On Thu, Jun 29, 2017 at 01:53:29PM +0200, Igor Mammedov wrote: > On Thu, 29 Jun 2017 12:53:27 +0300 > Roman Kagan wrote: > > > On Wed, Jun 28, 2017 at 04:47:43PM +0200, Igor Mammedov wrote: > > > On Wed, 21 Jun 2017 19:24:08 +0300 > > > Roman Kagan wrote: &g

Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index

2017-06-29 Thread Roman Kagan
On Wed, Jun 28, 2017 at 04:47:43PM +0200, Igor Mammedov wrote: > On Wed, 21 Jun 2017 19:24:08 +0300 > Roman Kagan wrote: > > > Hyper-V identifies vCPUs by Virtual Processor (VP) index which can be > > queried by the guest via HV_X64_MSR_VP_INDEX msr. It is defined

[Qemu-devel] [PATCH v2 23/23] hyperv: update copyright notices

2017-06-21 Thread Roman Kagan
Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 1 + hw/misc/hyperv_testdev.c | 1 + target/i386/hyperv.c | 1 + 3 files changed, 3 insertions(+) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index f101144..cba6cbf 100644 --- a/target/i386/hyperv.h +++ b/target/i386

[Qemu-devel] [PATCH v2 18/23] hyperv: add synic event flag signaling

2017-06-21 Thread Roman Kagan
Add infrastructure to signal SynIC event flags by atomically setting the corresponding bit in the event flags page and firing a SINT if necessary. Signed-off-by: Roman Kagan --- v1 -> v2: - swapped kvm_hv_sint_route_set_sint and memory_region_set_dirty target/i386/hyperv.h | 2 ++ tar

[Qemu-devel] [PATCH v2 22/23] MAINTAINERS: add myself and eyakovlev@ for hyperv*

2017-06-21 Thread Roman Kagan
Signed-off-by: Roman Kagan --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 120788d..16c5422 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -852,6 +852,13 @@ F: hw/core/machine.c F: hw/core/null-machine.c F: include/hw/boards.h +Hyper

[Qemu-devel] [PATCH v2 21/23] hyperv_testdev: add SynIC message and event testmodes

2017-06-21 Thread Roman Kagan
the incoming events are signaled on the configured vCPUs. Signed-off-by: Roman Kagan --- hw/misc/hyperv_testdev.c | 162 ++- 1 file changed, 161 insertions(+), 1 deletion(-) diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c index fa435ab

[Qemu-devel] [PATCH v2 14/23] hyperv: qom-ify SynIC

2017-06-21 Thread Roman Kagan
Make Hyper-V SynIC a device which is attached as a child to X86CPU. For now it only makes SynIC visibile in the qom hierarchy, and maintains its internal fields in sync with the respecitve msrs of the parent cpu (the fields will be used in followup patches). Signed-off-by: Roman Kagan --- v1

[Qemu-devel] [PATCH v2 20/23] hyperv: process POST_MESSAGE hypercall

2017-06-21 Thread Roman Kagan
Add handling of POST_MESSAGE hypercall. For that, add an interface to regsiter a handler for the messages arrived from the guest on a particular connection id (IOW set up a message connection in Hyper-V speak). Signed-off-by: Roman Kagan --- v1 -> v2: - use single mutex for evt and msg hand

[Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index

2017-06-21 Thread Roman Kagan
to wrap the mapping between a vCPU and its vp_index. Besides, a few variables are renamed to avoid confusion of vp_index with vcpu_id (== apic_id). Signed-off-by: Roman Kagan --- v1 -> v2: - were patches 5, 6 in v1 - move vp_index initialization to hyperv_init_vcpu - check capability before tryin

[Qemu-devel] [PATCH v2 19/23] hyperv: process SIGNAL_EVENT hypercall

2017-06-21 Thread Roman Kagan
avoid expensive user exit just to look up an eventfd by connection number and signal it. Signed-off-by: Roman Kagan --- v1 -> v2: - use single mutex for evt and msg handler lists target/i386/hyperv.h | 2 + target/i386/hyperv.c | 113 +--

[Qemu-devel] [PATCH v2 16/23] hyperv: make overlay pages for SynIC

2017-06-21 Thread Roman Kagan
added when in_kvm_only == false, no extra compat logic is necessary. Signed-off-by: Roman Kagan --- v1 -> v2: - was patch 15 in v1 - add comment on using async_safe_run_on_cpu target/i386/hyperv.c | 72 +++- 1 file changed, 66 insertions(+), 6 delet

[Qemu-devel] [PATCH v2 12/23] hyperv: address HvSintRoute by X86CPU pointer

2017-06-21 Thread Roman Kagan
Use X86CPU pointer to refer to the respective HvSintRoute instead of vp_index. This is more convenient and also paves the way for future enhancements. Signed-off-by: Roman Kagan --- v1 -> v2: - was patch 11 in v1 - pass vp_index to sint_route_create, and lookup X86CPU * inside target/i

[Qemu-devel] [PATCH v2 13/23] hyperv: make HvSintRoute reference-counted

2017-06-21 Thread Roman Kagan
Multiple entities (e.g. VMBus devices) can use the same SINT route. To make their lives easier in maintaining SINT route ownership, make it reference-counted. Adjust the respective API names accordingly. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 10 +- hw/misc

[Qemu-devel] [PATCH v2 15/23] hyperv: block SynIC use in QEMU in incompatible configurations

2017-06-21 Thread Roman Kagan
PU init and via compat logic (as older QEMU had no users for SynIC beyond the test device). Also a function is added that allows the devices to query the status of SynIC support across vCPUs. Signed-off-by: Roman Kagan --- v1 -> v2: - new patch include/hw/i386/pc.h | 5 + target/

[Qemu-devel] [PATCH v2 06/23] [not to commit] add new hyperv-related caps

2017-06-21 Thread Roman Kagan
Add two hyperv-related caps [they should arrive through the usual kernel header harvesting; this patch allows to build QEMU before that happens]. Signed-off-by: Roman Kagan --- linux-headers/linux/kvm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-headers/linux/kvm.h b/linux

[Qemu-devel] [PATCH v2 04/23] hyperv: ensure SINTx msrs are reset properly

2017-06-21 Thread Roman Kagan
Initially SINTx msrs should be in "masked" state. To ensure that happens on *every* reset, move setting their values to kvm_arch_vcpu_reset. Signed-off-by: Roman Kagan --- v1 -> v2: - split out of v1 patch 4 target/i386/kvm.c | 12 +++- 1 file changed, 7 insertions(+)

[Qemu-devel] [PATCH v2 11/23] hyperv: allow passing arbitrary data to sint ack callback

2017-06-21 Thread Roman Kagan
the header. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 14 +++--- hw/misc/hyperv_testdev.c | 2 +- target/i386/hyperv.c | 16 ++-- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index 82f4757

[Qemu-devel] [PATCH v2 05/23] hyperv: make SynIC version msr constant

2017-06-21 Thread Roman Kagan
The value of HV_X64_MSR_SVERSION is initialized once at vcpu init, and is reset to zero on vcpu reset, which is wrong. It is supposed to be a constant, so drop the field from X86CPU, set the msr with the constant value, and don't bother getting it. Signed-off-by: Roman Kagan --- v1

[Qemu-devel] [PATCH v2 09/23] hyperv: cosmetic: g_malloc -> g_new

2017-06-21 Thread Roman Kagan
Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 4f57447..2121d8f 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -88,7 +88,7 @@ HvSintRoute

[Qemu-devel] [PATCH v2 10/23] hyperv: synic: only setup ack notifier if there's a callback

2017-06-21 Thread Roman Kagan
There's no point setting up an sint ack notifier if no callback is specified. Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 21

[Qemu-devel] [PATCH v2 03/23] hyperv: set partition-wide MSRs only on first vcpu

2017-06-21 Thread Roman Kagan
-off-by: Roman Kagan --- target/i386/cpu.h | 5 - target/i386/kvm.c | 20 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 464ed1e..ad8600d 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1089,10

[Qemu-devel] [PATCH v2 01/23] hyperv: add header with protocol definitions

2017-06-21 Thread Roman Kagan
names. While at this, the protocol data structures are defined in a more conventional way, without bitfields, enums, and excessive unions. The code using this stuff is adjusted, too; it can now be built both with and without the kernel header in the tree. Signed-off-by: Roman Kagan --- target

[Qemu-devel] [PATCH v2 00/23] hyperv fixes and enhancements

2017-06-21 Thread Roman Kagan
cpu Roman Kagan (22): hyperv: add header with protocol definitions update-linux-headers: prepare for hyperv.h removal hyperv: ensure SINTx msrs are reset properly hyperv: make SynIC version msr constant [not to commit] add new hyperv-related caps hyperv: ensure VP index equal to QEMU cpu_in

[Qemu-devel] [PATCH v2 02/23] update-linux-headers: prepare for hyperv.h removal

2017-06-21 Thread Roman Kagan
erv.h with a dummy. Signed-off-by: Roman Kagan --- scripts/update-linux-headers.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 2f906c4..ad80fe3 100755 --- a/scripts/update-linux-headers.sh +++ b/scri

[Qemu-devel] [PATCH v2 08/23] hyperv_testdev: refactor for readability

2017-06-21 Thread Roman Kagan
Make hyperv_testdev slightly easier to follow and enhance in future. For that, put the hyperv sint routes (wrapped in a helper structure) on a linked list rather than a fixed-size array. Signed-off-by: Roman Kagan --- v1 -> v2: - was patch 7 in v1 - renamed the variables to distingu

Re: [Qemu-devel] [PATCH 05/23] hyperv: ensure VP index equal to QEMU cpu_index

2017-06-15 Thread Roman Kagan
On Thu, Jun 15, 2017 at 03:27:28PM +0200, Igor Mammedov wrote: > On Thu, 15 Jun 2017 15:41:08 +0300 > Roman Kagan wrote: > > On Wed, Jun 14, 2017 at 03:00:27PM +0200, Igor Mammedov wrote: > > > On Wed, 14 Jun 2017 13:26:44 +0200 > > > Paolo Bonzini wrote: > &

Re: [Qemu-devel] [PATCH 05/23] hyperv: ensure VP index equal to QEMU cpu_index

2017-06-15 Thread Roman Kagan
On Wed, Jun 14, 2017 at 03:00:27PM +0200, Igor Mammedov wrote: > On Wed, 14 Jun 2017 13:26:44 +0200 > Paolo Bonzini wrote: > > > On 14/06/2017 13:25, Roman Kagan wrote: > > >> The problem with that is that it will break as soon as we create > > >> VCPUs in

Re: [Qemu-devel] [PATCH 05/23] hyperv: ensure VP index equal to QEMU cpu_index

2017-06-15 Thread Roman Kagan
On Thu, Jun 15, 2017 at 01:42:56PM +0200, Paolo Bonzini wrote: > > > On 15/06/2017 13:40, Roman Kagan wrote: > > On Thu, Jun 15, 2017 at 10:26:58AM +0200, Paolo Bonzini wrote: > >> On 14/06/2017 20:59, Eduardo Habkost wrote: > >>> On Wed, Jun 14, 2017 at

Re: [Qemu-devel] [PATCH 05/23] hyperv: ensure VP index equal to QEMU cpu_index

2017-06-15 Thread Roman Kagan
On Thu, Jun 15, 2017 at 10:26:58AM +0200, Paolo Bonzini wrote: > On 14/06/2017 20:59, Eduardo Habkost wrote: > > On Wed, Jun 14, 2017 at 09:40:37PM +0300, Roman Kagan wrote: > >> One more data point is that until now there was no use for vp_index in > >> QEMU, so it did

Re: [Qemu-devel] [PATCH 05/23] hyperv: ensure VP index equal to QEMU cpu_index

2017-06-14 Thread Roman Kagan
On Wed, Jun 14, 2017 at 10:45:23AM -0300, Eduardo Habkost wrote: > On Wed, Jun 14, 2017 at 03:38:59PM +0200, Igor Mammedov wrote: > > On Wed, 14 Jun 2017 10:22:16 -0300 > > Eduardo Habkost wrote: > > > > > On Wed, Jun 14, 2017 at 03:17:54PM +0200, Paolo Bonzini wrote: > > > > > > > > > > > > On

Re: [Qemu-devel] [PATCH 12/23] hyperv: make HvSintRoute reference-counted

2017-06-14 Thread Roman Kagan
On Wed, Jun 14, 2017 at 10:53:25AM -0300, Eduardo Habkost wrote: > On Tue, Jun 06, 2017 at 09:19:37PM +0300, Roman Kagan wrote: > > Multiple entities (e.g. VMBus devices) can use the same SINT route. To > > make their lives easier in maintaining SINT route ownership, make it > &

Re: [Qemu-devel] [PATCH 17/23] hyperv: add synic message delivery

2017-06-14 Thread Roman Kagan
On Wed, Jun 14, 2017 at 05:32:12PM +0200, Paolo Bonzini wrote: > > > On 14/06/2017 17:28, Roman Kagan wrote: > > On Wed, Jun 14, 2017 at 05:08:02PM +0200, Paolo Bonzini wrote: > >> > >> > >> On 06/06/2017 20:19, Roman Kagan wrote: > >>> +

Re: [Qemu-devel] [PATCH 17/23] hyperv: add synic message delivery

2017-06-14 Thread Roman Kagan
On Wed, Jun 14, 2017 at 05:08:02PM +0200, Paolo Bonzini wrote: > > > On 06/06/2017 20:19, Roman Kagan wrote: > > +sint_route->msg_status = ret; > > +/* notify the msg originator of the progress made; if the slot was > > busy we > > + * set msg_

Re: [Qemu-devel] [PATCH 13/23] hyperv: qdev-ify SynIC

2017-06-14 Thread Roman Kagan
On Wed, Jun 14, 2017 at 09:46:20AM -0300, Eduardo Habkost wrote: > On Wed, Jun 14, 2017 at 12:58:04PM +0300, Roman Kagan wrote: > > On Tue, Jun 13, 2017 at 03:34:34PM -0300, Eduardo Habkost wrote: > > > On Tue, Jun 06, 2017 at 09:19:38PM +0300, Roman Kagan wrote: > &

Re: [Qemu-devel] [PATCH 20/23] hyperv: process POST_MESSAGE hypercall

2017-06-14 Thread Roman Kagan
On Wed, Jun 14, 2017 at 01:19:21PM +0200, Paolo Bonzini wrote: > On 06/06/2017 20:19, Roman Kagan wrote: > > +typedef struct MsgHandler { > > +struct rcu_head rcu; > > +QLIST_ENTRY(MsgHandler) le; > > +uint32_t conn_id; > > +HvMsgHan

Re: [Qemu-devel] [PATCH 16/23] hyperv: map overlay pages after updating msrs

2017-06-14 Thread Roman Kagan
On Wed, Jun 14, 2017 at 02:11:56PM +0200, Paolo Bonzini wrote: > On 14/06/2017 13:54, Roman Kagan wrote: > >> Why not disable the zeroing for host-initiated MSR writes? This is > >> pretty clearly a KVM bug, we can push it to stable kernels too. > > > > The on

Re: [Qemu-devel] [PATCH 11/23] hyperv: address HvSintRoute by X86CPU pointer

2017-06-14 Thread Roman Kagan
On Wed, Jun 14, 2017 at 01:08:43PM +0200, Paolo Bonzini wrote: > > > On 13/06/2017 21:02, Eduardo Habkost wrote: > >> @@ -101,16 +101,18 @@ static void hv_test_dev_control(void *opaque, hwaddr > >> addr, uint64_t data, > >> uint8_t sint = data & 0xFF; > >> uint8_t vcpu_id = (data >> 8U

Re: [Qemu-devel] [PATCH 16/23] hyperv: map overlay pages after updating msrs

2017-06-14 Thread Roman Kagan
On Wed, Jun 14, 2017 at 01:12:12PM +0200, Paolo Bonzini wrote: > > > On 06/06/2017 20:19, Roman Kagan wrote: > > There is a design flaw in the Hyper-V SynIC implementation in KVM: when > > message page or event flags page is enabled by setting the corresponding > > ms

Re: [Qemu-devel] [PATCH 05/23] hyperv: ensure VP index equal to QEMU cpu_index

2017-06-14 Thread Roman Kagan
On Tue, Jun 13, 2017 at 03:57:52PM -0300, Eduardo Habkost wrote: > On Tue, Jun 06, 2017 at 09:19:30PM +0300, Roman Kagan wrote: > > Hyper-V identifies vcpus by the virtual processor (VP) index which is > > normally queried by the guest via HV_X64_MSR_VP_INDEX msr. > > >

Re: [Qemu-devel] [PATCH 13/23] hyperv: qdev-ify SynIC

2017-06-14 Thread Roman Kagan
On Tue, Jun 13, 2017 at 03:34:34PM -0300, Eduardo Habkost wrote: > On Tue, Jun 06, 2017 at 09:19:38PM +0300, Roman Kagan wrote: > > Make Hyper-V SynIC a device which is attached as a child to X86CPU. For > > now it only makes SynIC visibile in the qom hierarchy and exposes a few

[Qemu-devel] [PATCH 21/23] hyperv_testdev: add SynIC message and event testmodes

2017-06-06 Thread Roman Kagan
the incoming events are signaled on the configured vCPUs. Signed-off-by: Roman Kagan --- hw/misc/hyperv_testdev.c | 163 ++- 1 file changed, 162 insertions(+), 1 deletion(-) diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c index 929bf4f

[Qemu-devel] [PATCH 23/23] hyperv: update copyright notices

2017-06-06 Thread Roman Kagan
Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 1 + hw/misc/hyperv_testdev.c | 1 + target/i386/hyperv.c | 1 + 3 files changed, 3 insertions(+) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index f82c770..cca4723 100644 --- a/target/i386/hyperv.h +++ b/target/i386

[Qemu-devel] [PATCH 17/23] hyperv: add synic message delivery

2017-06-06 Thread Roman Kagan
callback. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 7 ++-- target/i386/hyperv.c | 116 ++- 2 files changed, 109 insertions(+), 14 deletions(-) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index 9dd5ca0..fa3e988 100644 --- a

[Qemu-devel] [PATCH 22/23] MAINTAINERS: add myself and eyakovlev@ for hyperv*

2017-06-06 Thread Roman Kagan
Signed-off-by: Roman Kagan --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 120788d..16c5422 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -852,6 +852,13 @@ F: hw/core/machine.c F: hw/core/null-machine.c F: include/hw/boards.h +Hyper

[Qemu-devel] [PATCH 18/23] hyperv: add synic event flag signaling

2017-06-06 Thread Roman Kagan
Add infrastructure to signal SynIC event flags by atomically setting the corresponding bit in the event flags page and firing a SINT if necessary. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 2 ++ target/i386/hyperv.c | 32 2 files changed, 34

[Qemu-devel] [PATCH 15/23] hyperv: make overlay pages for SynIC

2017-06-06 Thread Roman Kagan
rrent code (in a followup patch). Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 67 +++- 1 file changed, 61 insertions(+), 6 deletions(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 2d9e9fe..165133a 100644 --- a/t

[Qemu-devel] [PATCH 19/23] hyperv: process SIGNAL_EVENT hypercall

2017-06-06 Thread Roman Kagan
avoid expensive user exit just to look up an eventfd by connection number and signal it. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 2 + target/i386/hyperv.c | 113 +-- 2 files changed, 111 insertions(+), 4 deletions(-) diff --git a/t

[Qemu-devel] [PATCH 10/23] hyperv: allow passing arbitrary data to sint ack callback

2017-06-06 Thread Roman Kagan
the header. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 14 +++--- hw/misc/hyperv_testdev.c | 2 +- target/i386/hyperv.c | 16 ++-- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index c5843c9

[Qemu-devel] [PATCH 16/23] hyperv: map overlay pages after updating msrs

2017-06-06 Thread Roman Kagan
msr writes, which is tolerable. Signed-off-by: Roman Kagan --- target/i386/kvm.c | 8 target/i386/machine.c | 9 - 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 433c912..b0b7595 100644 --- a/target/i386/kvm.c +++

[Qemu-devel] [PATCH 09/23] hyperv: synic: only setup ack notifier if there's a callback

2017-06-06 Thread Roman Kagan
There's no point setting up an sint ack notifier if no callback is specified. Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 9a

[Qemu-devel] [PATCH 13/23] hyperv: qdev-ify SynIC

2017-06-06 Thread Roman Kagan
Make Hyper-V SynIC a device which is attached as a child to X86CPU. For now it only makes SynIC visibile in the qom hierarchy and exposes a few properties which are maintained in sync with the respecitve msrs of the parent cpu. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 4

[Qemu-devel] [PATCH 20/23] hyperv: process POST_MESSAGE hypercall

2017-06-06 Thread Roman Kagan
Add handling of POST_MESSAGE hypercall. For that, add an interface to regsiter a handler for the messages arrived from the guest on a particular connection id (IOW set up a message connection in Hyper-V speak). Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 5 +++ target/i386/hyperv.c

[Qemu-devel] [PATCH 04/23] hyperv: ensure msrs are inited properly

2017-06-06 Thread Roman Kagan
Make sure HV_X64_MSR_SVERSION and HV_X64_MSR_SINTx are properly initialized at guest start. For that, move the field containing SVERSION value into the region in CPUX86State which is preserved across resets, and move the initialization of SINTx to kvm_arch_vcpu_reset(). Signed-off-by: Roman

[Qemu-devel] [PATCH 12/23] hyperv: make HvSintRoute reference-counted

2017-06-06 Thread Roman Kagan
Multiple entities (e.g. VMBus devices) can use the same SINT route. To make their lives easier in maintaining SINT route ownership, make it reference-counted. Adjust the respective API names accordingly. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 10 +- hw/misc

[Qemu-devel] [PATCH 14/23] kvm-all: make async_safe_run_on_cpu safe on kvm too

2017-06-06 Thread Roman Kagan
Wrap the bulk of kvm_cpu_exec with cpu_exec_start/end, so that kvm version can also enjoy performing certain operations while all vCPUs are quiescent. Signed-off-by: Roman Kagan --- kvm-all.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kvm-all.c b/kvm-all.c index 494b925..85668fb

[Qemu-devel] [PATCH 00/23] hyperv fixes and enhancements

2017-06-06 Thread Roman Kagan
; when used with modified SeaBIOS it can also install and boot with no extra drivers required. We hope to submit it within 2.10 merge window in a few reasonably-sized self-contained patchsets; this is the first one. Evgeny Yakovlev (1): hyperv: set partition-wide MSRs only on first vcpu Roman

[Qemu-devel] [PATCH 08/23] hyperv: cosmetic: g_malloc -> g_new

2017-06-06 Thread Roman Kagan
Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 480bdfe..9aa5ec5 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -88,7 +88,7 @@ HvSintRoute

[Qemu-devel] [PATCH 07/23] hyperv_testdev: refactor for readability

2017-06-06 Thread Roman Kagan
Make hyperv_testdev slightly easier to follow and enhance in future. For that, put the hyperv sint routes (wrapped in a helper structure) on a linked list rather than a fixed-size array. Signed-off-by: Roman Kagan --- hw/misc/hyperv_testdev.c | 113

[Qemu-devel] [PATCH 01/23] hyperv: add header with protocol definitions

2017-06-06 Thread Roman Kagan
names. While at this, the protocol data structures are defined in a more conventional way, without bitfields, enums, and excessive unions. The code using this stuff is adjusted, too; it can now be built both with and without the kernel header in the tree. Signed-off-by: Roman Kagan --- target

[Qemu-devel] [PATCH 02/23] update-linux-headers: prepare for hyperv.h removal

2017-06-06 Thread Roman Kagan
erv.h with a dummy. Signed-off-by: Roman Kagan --- scripts/update-linux-headers.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 2f906c4..ad80fe3 100755 --- a/scripts/update-linux-headers.sh +++ b/scri

[Qemu-devel] [PATCH 05/23] hyperv: ensure VP index equal to QEMU cpu_index

2017-06-06 Thread Roman Kagan
ssert that it's equal to cpu_index. On current kernels this will work by luck; future ones will accept the value from userspace. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 2 ++ target/i386/hyperv.c | 5 + target/i386/kvm.c| 26 ++ 3 files c

[Qemu-devel] [PATCH 06/23] hyperv: helper to find vcpu by VP index

2017-06-06 Thread Roman Kagan
Locate the vcpu by its VP index (equal to QEMU cpu_index). Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 1 + target/i386/hyperv.c | 5 + 2 files changed, 6 insertions(+) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index 35da0b1..c5843c9 100644 --- a/target/i386

[Qemu-devel] [PATCH 03/23] hyperv: set partition-wide MSRs only on first vcpu

2017-06-06 Thread Roman Kagan
-off-by: Roman Kagan --- target/i386/cpu.h | 5 - target/i386/kvm.c | 20 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 9335dcc..7af2cce 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1089,10

Re: [Qemu-devel] [PATCH v3] kvmclock: update system_time_msr address forcibly

2017-05-29 Thread Roman Kagan
is needed. > > Signed-off-by: Denis Plotnikov > --- > hw/i386/kvm/clock.c | 3 +++ > 1 file changed, 3 insertions(+) > Please don't forget the changelog. Reviewed-by: Roman Kagan

Re: [Qemu-devel] [PATCH v2] kvmclock: update system_time_msr address forcibly

2017-05-26 Thread Roman Kagan
is needed. > > Signed-off-by: Denis Plotnikov > --- > hw/i386/kvm/clock.c | 2 ++ > 1 file changed, 2 insertions(+) Reviewed-by: Roman Kagan

<    1   2   3   4   5   6   7   >