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

[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

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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] vmbus bridge: machine property or device?

2017-04-11 Thread Roman Kagan
While hammering out the VMBus / storage series, we've been struggling to figure out the best practices solution to the following problem: VMBus is provided by a vmbus bridge; it appears the most natural to have it subclassed from SysBusDevice. There can only be one VMBus in the VM. Now the quest

Re: [Qemu-devel] WinDbg module

2017-04-12 Thread Roman Kagan
On Wed, Apr 12, 2017 at 05:05:45PM +0300, Mihail Abakumov wrote: > Hello. > > We made the debugger module WinDbg (like GDB) for QEMU. This is the > replacement of the remote stub in Windows kernel. Used for remote Windows > kernel debugging without debugging mode. > > The latest build and instruc

Re: [Qemu-devel] vmbus bridge: machine property or device?

2017-04-13 Thread Roman Kagan
On Wed, Apr 12, 2017 at 05:18:51PM +0200, Markus Armbruster wrote: > Roman Kagan writes: > > VMBus is provided by a vmbus bridge; it appears the most natural to have > > it subclassed from SysBusDevice. There can only be one VMBus in the > > VM. > > TYPE_DEVI

Re: [Qemu-devel] [Qemu-block] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-13 Thread Roman Kagan
On Thu, Apr 13, 2017 at 04:27:35PM +0200, Kevin Wolf wrote: > Am 13.04.2017 um 16:15 hat Alberto Garcia geschrieben: > > On Thu 13 Apr 2017 03:51:55 PM CEST, Kevin Wolf wrote: > > >> This invariant is already broken by the very design of the qcow2 > > >> format, subclusters don't really add anythin

Re: [Qemu-devel] vmbus bridge: machine property or device?

2017-04-13 Thread Roman Kagan
On Wed, Apr 12, 2017 at 05:07:20PM -0300, Eduardo Habkost wrote: > On Wed, Apr 12, 2017 at 05:18:51PM +0200, Markus Armbruster wrote: > > Roman Kagan writes: > > > VMBus is provided by a vmbus bridge; it appears the most natural to have > > > it subclassed from SysBu

Re: [Qemu-devel] vmbus bridge: machine property or device?

2017-04-13 Thread Roman Kagan
On Thu, Apr 13, 2017 at 05:58:51PM +0100, Peter Maydell wrote: > On 13 April 2017 at 17:44, Eduardo Habkost wrote: > > On Thu, Apr 13, 2017 at 06:15:34PM +0300, Roman Kagan wrote: > >> Can you (or anybody else) please help me decide if I need > >> TYPE_SYS_BUS_DEVICE?

Re: [Qemu-devel] vmbus bridge: machine property or device?

2017-04-13 Thread Roman Kagan
On Thu, Apr 13, 2017 at 01:44:57PM -0300, Eduardo Habkost wrote: > On Thu, Apr 13, 2017 at 06:15:34PM +0300, Roman Kagan wrote: > > Can you (or anybody else) please help me decide if I need > > TYPE_SYS_BUS_DEVICE? Logically the VMBus bridge is "attached directly > >

Re: [Qemu-devel] [Qemu-block] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-14 Thread Roman Kagan
On Thu, Apr 13, 2017 at 09:06:19PM -0400, John Snow wrote: > So if we have a 1MB cluster with 64k subclusters as a hypothetical, if > we write just the first subcluster, we'll have a map like: > > X--- > > Whatever actually happens to exist in this space, whether it be a hole > we pun

[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

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 1/4] virtio: assert on ->inuse underflow

2016-08-18 Thread Roman Kagan
irtio-balloon where virtqueue_push() was called before the matching virtqueu_pop(). [That problem will be addressed in followup patches]. Signed-off-by: Roman Kagan Cc: "Michael S. Tsirkin" Cc: Stefan Hajnoczi --- hw/virtio/virtio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deleti

[Qemu-devel] [PATCH 2/4] virtio-balloon: make stats virtqueue length 1

2016-08-18 Thread Roman Kagan
n the generic virtio code to handle overflows. Signed-off-by: Roman Kagan Cc: "Michael S. Tsirkin" Cc: Ladi Prosek --- hw/virtio/virtio-balloon.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 5

[Qemu-devel] [PATCH 3/4] virtio-balloon: don't restart stats timer in callback

2016-08-18 Thread Roman Kagan
e presence of ->stats_vq_elem is enough to indicate there's work to do here, and drop the check for the stats feature. Signed-off-by: Roman Kagan Cc: "Michael S. Tsirkin" --- hw/virtio/virtio-balloon.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) d

[Qemu-devel] [PATCH 0/4] virtio-balloon: assorted fixes

2016-08-18 Thread Roman Kagan
27;t trigger an abort and are thus not as easy to notice. Roman Kagan (4): virtio: assert on ->inuse underflow virtio-balloon: make stats virtqueue length 1 virtio-balloon: don't restart stats timer in callback virtio-balloon: keep collecting stats on save/restore Cc: "Mich

[Qemu-devel] [PATCH 4/4] virtio-balloon: keep collecting stats on save/restore

2016-08-18 Thread Roman Kagan
t the used element would introduce unjustified vmstate incompatibility. So instead just make sure the element is pushed before save, leaving the ball on the guest side. For that, add vm state change handler to virtio-ballon which would take care of pushing the element if there is one. Signed-off-by:

Re: [Qemu-devel] [PATCH 4/4] virtio-balloon: keep collecting stats on save/restore

2016-08-19 Thread Roman Kagan
On Fri, Aug 19, 2016 at 11:57:44AM +0200, Ladi Prosek wrote: > On Thu, Aug 18, 2016 at 8:27 PM, Roman Kagan wrote: > > Upon save/restore virtio-balloon stats acquisition stops. The reason is > > that the fact that the (only) virtqueue element is being used by QEMU is > > not

[Qemu-devel] [PATCH v2 2/6] virtio-balloon: make stats virtqueue length 1

2016-08-19 Thread Roman Kagan
n the generic virtio code to handle overflows. Signed-off-by: Roman Kagan Cc: "Michael S. Tsirkin" Cc: Ladi Prosek Cc: Stefan Hajnoczi --- v1 > v2: - added assert in virtio_balloon_receive_stats hw/virtio/virtio-balloon.c | 10 +++--- 1 file changed, 3 insertions(+), 7

[Qemu-devel] [PATCH v2 4/6] virtio-balloon: keep collecting stats on save/restore

2016-08-19 Thread Roman Kagan
t the used element would introduce unjustified vmstate incompatibility. So instead just make sure the element is pushed before save, leaving the ball on the guest side. For that, add vm state change handler to virtio-ballon which would take care of pushing the element if there is one. Signed-off-by:

Re: [Qemu-devel] [PATCH 2/4] virtio-balloon: make stats virtqueue length 1

2016-08-19 Thread Roman Kagan
On Fri, Aug 19, 2016 at 02:44:10PM +0100, Stefan Hajnoczi wrote: > On Thu, Aug 18, 2016 at 09:27:52PM +0300, Roman Kagan wrote: > > The protocol for virtio-balloon stats virtqueue doesn't allow more than > > one element in the virtqueue. > > > > So, instead o

Re: [Qemu-devel] [PATCH v2 0/6] virtio-balloon: assorted fixes

2016-08-19 Thread Roman Kagan
On Fri, Aug 19, 2016 at 04:39:19PM +0300, Roman Kagan wrote: > This patchset addresses a few problems discovered when analyzing aborts > of (an older version of) QEMU with backported commit > afd9096eb1882f23929f5b5c177898ed231bac66 "virtio: error out if guest > exceeds virtqu

Re: [Qemu-devel] [PATCH 4/4] virtio-balloon: keep collecting stats on save/restore

2016-08-19 Thread Roman Kagan
On Fri, Aug 19, 2016 at 02:08:50PM +0200, Ladi Prosek wrote: > On Fri, Aug 19, 2016 at 1:37 PM, Roman Kagan wrote: > > On Fri, Aug 19, 2016 at 11:57:44AM +0200, Ladi Prosek wrote: > >> On Thu, Aug 18, 2016 at 8:27 PM, Roman Kagan wrote: > >> > Upon save/restore vi

Re: [Qemu-devel] [PATCH v2 6/6] virtio-ballon: drop reset handler

2016-08-19 Thread Roman Kagan
On Fri, Aug 19, 2016 at 04:39:25PM +0300, Roman Kagan wrote: > Since the release of ->stat_vq_elem is now ensured by the vm state > change handler, there's no need in the reset handler doing it. Oops, sorry, this is a duplicate of the same message modulo typo in the subject, please ignore. Roman.

Re: [Qemu-devel] [PATCH 2/4] virtio-balloon: make stats virtqueue length 1

2016-08-19 Thread Roman Kagan
On Fri, Aug 19, 2016 at 12:05:29PM +0200, Ladi Prosek wrote: > On Thu, Aug 18, 2016 at 8:27 PM, Roman Kagan wrote: > > The protocol for virtio-balloon stats virtqueue doesn't allow more than > > one element in the virtqueue. > > > > So, instead of trying to compen

[Qemu-devel] [PATCH v2 5/6] virtio-balloon: drop ->stats_vq_offset

2016-08-19 Thread Roman Kagan
As we don't write anything to guest on stats virtqueue we should pass len=0 to virtqueue_push(). This makes ->stats_vq_offset unnecessary, so drop it. Signed-off-by: Roman Kagan Cc: "Michael S. Tsirkin" Cc: Ladi Prosek Cc: Stefan Hajnoczi --- hw/virtio/virtio-bal

[Qemu-devel] [PATCH v2 6/6] virtio-ballon: drop reset handler

2016-08-19 Thread Roman Kagan
Since the release of ->stat_vq_elem is now ensured by the vm state change handler, there's no need in the reset handler doing it. Signed-off-by: Roman Kagan Cc: "Michael S. Tsirkin" Cc: Ladi Prosek Cc: Stefan Hajnoczi --- hw/virtio/virtio-balloon.c | 11 ---

[Qemu-devel] [PATCH v2 0/6] virtio-balloon: assorted fixes

2016-08-19 Thread Roman Kagan
27;t trigger an abort and are thus not as easy to notice. Roman Kagan (6): virtio: assert on ->inuse underflow virtio-balloon: make stats virtqueue length 1 virtio-balloon: don't restart stats timer in callback virtio-balloon: keep collecting stats on save/restore virtio-balloon:

[Qemu-devel] [PATCH v2 6/6] virtio-balloon: drop reset handler

2016-08-19 Thread Roman Kagan
Since the release of ->stat_vq_elem is now ensured by the vm state change handler, there's no need in the reset handler doing it. Signed-off-by: Roman Kagan Cc: "Michael S. Tsirkin" Cc: Ladi Prosek Cc: Stefan Hajnoczi --- hw/virtio/virtio-balloon.c | 11 ---

[Qemu-devel] [PATCH v2 3/6] virtio-balloon: don't restart stats timer in callback

2016-08-19 Thread Roman Kagan
e presence of ->stats_vq_elem is enough to indicate there's work to do here, and drop the check for the stats feature. Signed-off-by: Roman Kagan Cc: "Michael S. Tsirkin" Cc: Ladi Prosek Cc: Stefan Hajnoczi --- hw/virtio/virtio-balloon.c | 13 - 1 file changed,

[Qemu-devel] [PATCH v2 1/6] virtio: assert on ->inuse underflow

2016-08-19 Thread Roman Kagan
irtio-balloon where virtqueue_push() was called before the matching virtqueu_pop(). [That problem will be addressed in followup patches]. Signed-off-by: Roman Kagan Cc: "Michael S. Tsirkin" Cc: Ladi Prosek Cc: Stefan Hajnoczi --- hw/virtio/virtio.c | 3 ++- 1 file changed, 2 insertions(

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

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

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

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 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 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 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-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] [svt-core] [PATCH] kvmclock: update system_time_msr address forcibly

2017-05-24 Thread Roman Kagan
On Wed, May 24, 2017 at 05:07:24PM +0300, Denis Plotnikov wrote: > Do an update of system_time_msr address every time before reading > the value of tsc_timestamp from guest's kvmclock page. > > It should be done in a forcible manner because there is a situation > when system_time_msr has been set

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

2017-05-25 Thread Roman Kagan
On Wed, May 24, 2017 at 02:20:05PM -0300, Marcelo Tosatti wrote: > On Wed, May 24, 2017 at 06:54:09PM +0300, Roman Kagan wrote: > > On Wed, May 24, 2017 at 05:07:24PM +0300, Denis Plotnikov wrote: > > > Do an update of system_time_msr address every time before reading

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

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] 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 > >

[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

<    1   2   3   4   5   6   7   >