Re: [RFC/PATCH v2 03/12] hw/arm/virt: confidential guest support

2024-05-16 Thread Srivatsa Vaddagiri
* Daniel P. Berrang? [2024-05-16 16:04:24]: > On Thu, May 16, 2024 at 02:33:47PM +0000, Srivatsa Vaddagiri wrote: > > This adds support to launch hypervisor-assisted confidential guests, > > where guest's memory is protected from a potentially untrusted host. > > Hyperv

[RFC/PATCH v2 01/12] gunyah: UAPI header (NOT FOR MERGE)

2024-05-16 Thread Srivatsa Vaddagiri
present in Android-14. https://android.googlesource.com/kernel/common Branch: android14-6.1 Signed-off-by: Srivatsa Vaddagiri --- linux-headers/linux/gunyah.h | 311 +++ 1 file changed, 311 insertions(+) create mode 100644 linux-headers/linux/gunyah.h diff --git a

[RFC/PATCH v2 06/12] gunyah: Add IRQFD and IOEVENTFD functions

2024-05-16 Thread Srivatsa Vaddagiri
to access @addr. Signed-off-by: Srivatsa Vaddagiri --- include/sysemu/gunyah_int.h | 1 + accel/gunyah/gunyah-all.c | 94 + 2 files changed, 95 insertions(+) diff --git a/include/sysemu/gunyah_int.h b/include/sysemu/gunyah_int.h index 0967b2d7d7..8c0b479f62

[RFC/PATCH v2 12/12] gunyah: Documentation

2024-05-16 Thread Srivatsa Vaddagiri
Add gunyah.rst that provide some informaiton on how to build and test 'gunyah' accelerator with open-source Gunyah hypervisor. Signed-off-by: Srivatsa Vaddagiri --- MAINTAINERS| 1 + docs/system/arm/gunyah.rst | 326 + 2 files ch

[RFC/PATCH v2 07/12] gunyah: Add gicv3 interrupt controller

2024-05-16 Thread Srivatsa Vaddagiri
interrupt. An eventfd is created and associated with each doorbell/irq. Injection of a specific irq is accomplished by writing to the eventfd associated with that irq. Signed-off-by: Srivatsa Vaddagiri --- MAINTAINERS| 2 + include/sysemu/gunyah_int.h| 3 + accel

[RFC/PATCH v2 11/12] gunyah: Workarounds (NOT FOR MERGE)

2024-05-16 Thread Srivatsa Vaddagiri
These are some work-arounds required temporarily until some limitations with Gunyah hypervisor are addressed. Signed-off-by: Srivatsa Vaddagiri --- include/sysemu/gunyah_int.h | 1 + accel/gunyah/gunyah-all.c | 18 ++ hw/arm/boot.c | 17 - hw/arm

Re: [RFC/PATCH v2 00/12] Gunyah hypervisor support

2024-05-16 Thread Srivatsa Vaddagiri
* Srivatsa Vaddagiri [2024-05-16 14:33:08]: > Appreciate any quick comments you have. This is v2 that I intend to publish on > qemu lists. Main changes since v1 is adding support for protected VM. Pls ignore this !

[RFC/PATCH v2 10/12] gunyah: CPU execution loop

2024-05-16 Thread Srivatsa Vaddagiri
Complete the cpu execution loop. At this time, we recognize exits associated with only MMIO access. Future patches will add support for recognizing other exit reasons, such as PSCI calls made by guest. Signed-off-by: Srivatsa Vaddagiri --- include/sysemu/gunyah_int.h | 9 ++ accel/gunyah

[RFC/PATCH v2 08/12] gunyah: Specific device-tree location

2024-05-16 Thread Srivatsa Vaddagiri
Specify the location of device-tree and its size, as Gunyah requires the device-tree to be parsed before VM can begin its execution. Signed-off-by: Srivatsa Vaddagiri --- MAINTAINERS | 1 + include/sysemu/gunyah.h | 2 ++ accel/stubs/gunyah-stub.c | 5 + hw/arm/virt.c

[RFC/PATCH v2 09/12] gunyah: Customize device-tree

2024-05-16 Thread Srivatsa Vaddagiri
Customize device-tree with Gunyah specific properties. Some of these properties include specification of doorbells that need to be created and associated with various interrupts. Signed-off-by: Srivatsa Vaddagiri --- include/sysemu/gunyah.h | 2 + accel/stubs/gunyah-stub.c | 5 +++ hw/arm

[RFC/PATCH v2 04/12] gunyah: Basic support

2024-05-16 Thread Srivatsa Vaddagiri
Add a new accelerator, gunyah, with basic functionality of creating a VM. Subsequent patches will add support for other functions required to run a VM. Signed-off-by: Srivatsa Vaddagiri --- MAINTAINERS | 7 ++ docs/about/build-platforms.rst | 2 +- meson.build

[RFC/PATCH v2 02/12] accel: Introduce check_capability() callback

2024-05-16 Thread Srivatsa Vaddagiri
: Srivatsa Vaddagiri --- include/sysemu/accel-ops.h | 8 1 file changed, 8 insertions(+) diff --git a/include/sysemu/accel-ops.h b/include/sysemu/accel-ops.h index ef91fc28bb..f76d5bb8ed 100644 --- a/include/sysemu/accel-ops.h +++ b/include/sysemu/accel-ops.h @@ -20,6 +20,12 @@ typedef

[RFC/PATCH v2 05/12] gunyah: Support memory assignment

2024-05-16 Thread Srivatsa Vaddagiri
d. 1. Refer GH_VM_ANDROID_LEND_USER_MEM and GH_VM_SET_USER_MEM_REGION in https://android.googlesource.com/kernel/common/+/refs/heads/android14-6.1/drivers/virt/gunyah/vm_mgr.c Signed-off-by: Srivatsa Vaddagiri --- include/sysemu/gunyah.h | 2 + include/sysemu/gunyah_int.h | 26 accel/g

[RFC/PATCH v2 03/12] hw/arm/virt: confidential guest support

2024-05-16 Thread Srivatsa Vaddagiri
that all DMA allocations requested by guest's virtio-pcie device drivers are satisfied from the shared swiotlb region. Signed-off-by: Srivatsa Vaddagiri --- qapi/qom.json | 14 + include/hw/arm/virt.h | 1 + hw/arm/virt.c | 141

[RFC/PATCH v2 00/12] Gunyah hypervisor support

2024-05-16 Thread Srivatsa Vaddagiri
ers/virt/gunyah/ Base commit on which this series was tested: 4e66a08546 (origin/master, origin/HEAD) Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging Srivatsa Vaddagiri (12): gunyah: UAPI header (NOT FOR MERGE) accel: Introduce check_capability() callback

[RFC/PATCH v2 00/12] Gunyah hypervisor support

2024-05-16 Thread Srivatsa Vaddagiri
ttps://gitlab.com/bonzini/qemu into staging Srivatsa Vaddagiri (12): gunyah: UAPI header (NOT FOR MERGE) accel: Introduce check_capability() callback hw/arm/virt: confidential guest support gunyah: Basic support gunyah: Support memory assignment gunyah: Add IRQFD and IOEVENTFD func

Re: [RFC/PATCH v1 07/11] gunyah: Specify device-tree location

2024-01-10 Thread Srivatsa Vaddagiri
* Philippe Mathieu-Daud? [2024-01-09 14:36:12]: > > +#include "qemu/osdep.h" > > +#include "qemu/error-report.h" > > +#include "sysemu/gunyah.h" > > +#include "sysemu/gunyah_int.h" > > +#include "linux-headers/linux/gunyah.h" > I'm getting on macOS: > > In file included from ../../target/arm/gun

Re: [RFC/PATCH v1 07/11] gunyah: Specify device-tree location

2024-01-10 Thread Srivatsa Vaddagiri
* Philippe Mathieu-Daud? [2024-01-09 14:31:03]: > Hi Srivatsa, > > On 9/1/24 10:00, Srivatsa Vaddagiri wrote: > > Specify the location of device-tree and its size, as Gunyah requires the > > device-tree to be parsed before VM can begin its execution. > > > >

[RFC/PATCH v1 10/11] gunyah: Workarounds (NOT FOR MERGE)

2024-01-09 Thread Srivatsa Vaddagiri
These are some work-arounds required temporarily until some limitations with Gunyah hypervisor are addressed. Signed-off-by: Srivatsa Vaddagiri --- accel/gunyah/gunyah-all.c | 18 ++ hw/arm/boot.c | 3 ++- hw/arm/virt.c | 3 ++- include/sysemu

[RFC/PATCH v1 07/11] gunyah: Specify device-tree location

2024-01-09 Thread Srivatsa Vaddagiri
Specify the location of device-tree and its size, as Gunyah requires the device-tree to be parsed before VM can begin its execution. Signed-off-by: Srivatsa Vaddagiri --- MAINTAINERS | 1 + accel/stubs/gunyah-stub.c | 5 + hw/arm/virt.c | 6 ++ include

[RFC/PATCH v1 05/11] gunyah: Add IRQFD and IOEVENTFD functions

2024-01-09 Thread Srivatsa Vaddagiri
to access @addr. Signed-off-by: Srivatsa Vaddagiri --- accel/gunyah/gunyah-all.c | 94 + include/sysemu/gunyah_int.h | 1 + 2 files changed, 95 insertions(+) diff --git a/accel/gunyah/gunyah-all.c b/accel/gunyah/gunyah-all.c index 8b6b2d2017..8aaf5b7354

[RFC/PATCH v1 04/11] gunyah: Support memory assignment

2024-01-09 Thread Srivatsa Vaddagiri
ry will combine the two ioctls into one, when this patch will be updated. 1. Refer GH_VM_ANDROID_LEND_USER_MEM and GH_VM_SET_USER_MEM_REGION in https://android.googlesource.com/kernel/common/+/refs/heads/android14-6.1/drivers/virt/gunyah/vm_mgr.c Signed-off-by: Srivatsa Vaddagiri --- accel/guny

[RFC/PATCH v1 06/11] gunyah: Add gicv3 interrupt controller

2024-01-09 Thread Srivatsa Vaddagiri
interrupt. An eventfd is created and associated with each doorbell/irq. Injection of a specific irq is accomplished by writing to the eventfd associated with that irq. Signed-off-by: Srivatsa Vaddagiri --- MAINTAINERS| 2 + accel/gunyah/gunyah-all.c | 5 ++ hw/arm

[RFC/PATCH v1 03/11] gunyah: Add VM properties

2024-01-09 Thread Srivatsa Vaddagiri
data should remain private to the VM. Since a protected VM may need some memory shared with its host, for exchange of information, 'preshmem-size' specifies what portion of a protected VM's memory should be shared with its host, with the remaining portion being private to it. Signed-

[RFC/PATCH v1 09/11] gunyah: CPU execution loop

2024-01-09 Thread Srivatsa Vaddagiri
Complete the cpu execution loop. At this time, we recognize exits associated with only MMIO access. Future patches will add support for recognizing other exit reasons, such as PSCI calls made by guest. Signed-off-by: Srivatsa Vaddagiri --- accel/gunyah/gunyah-accel-ops.c | 7 ++ accel/gunyah

[RFC/PATCH v1 01/11] gunyah: UAPI header (NOT FOR MERGE)

2024-01-09 Thread Srivatsa Vaddagiri
present in Android-14. https://android.googlesource.com/kernel/common Branch: android14-6.1 Signed-off-by: Srivatsa Vaddagiri --- linux-headers/linux/gunyah.h | 311 +++ 1 file changed, 311 insertions(+) create mode 100644 linux-headers/linux/gunyah.h diff --git a

[RFC/PATCH v1 11/11] gunyah: Documentation

2024-01-09 Thread Srivatsa Vaddagiri
Add gunyah.rst that provide some informaiton on how to build and test 'gunyah' accelerator with open-source Gunyah hypervisor. Signed-off-by: Srivatsa Vaddagiri --- MAINTAINERS| 1 + docs/system/arm/gunyah.rst | 358 + 2 files ch

[RFC/PATCH v1 00/11] Gunyah hypervisor support

2024-01-09 Thread Srivatsa Vaddagiri
ed: 0c1eccd368 Merge tag 'hw-cpus-20240105' of https://github.com/philmd/qemu into staging Srivatsa Vaddagiri (11): gunyah: UAPI header (NOT FOR MERGE) gunyah: Basic support gunyah: Add VM properties gunyah: Support memory assignment gunyah: Add IRQFD and IOEVENTFD functions gu

[RFC/PATCH v1 08/11] gunyah: Customize device-tree

2024-01-09 Thread Srivatsa Vaddagiri
Customize device-tree with Gunyah specific properties. Some of these properties include specification of doorbells that need to be created and associated with various interrupts. Signed-off-by: Srivatsa Vaddagiri --- accel/stubs/gunyah-stub.c | 5 +++ hw/arm/virt.c | 11

[RFC/PATCH v1 02/11] gunyah: Basic support

2024-01-09 Thread Srivatsa Vaddagiri
Add a new accelerator, gunyah, with basic functionality of creating a VM. Subsequent patches will add support for other functions required to run a VM. Signed-off-by: Srivatsa Vaddagiri --- MAINTAINERS | 7 +++ accel/Kconfig | 3 + accel/gunyah/gunyah

Re: [RFC/PATCH v0 02/12] update-linux-headers: Include gunyah.h

2023-12-01 Thread Srivatsa Vaddagiri
* Alex Benn?e [2023-11-29 16:44:06]: > Srivatsa Vaddagiri writes: > > > gunyah.h containts UAPI definitions exported by Gunyah Linux kernel > > driver. This file will be referenced by Gunyah accelerator driver in > > Qemu. > > > > Note: Gunyah Linux kern

Re: [RFC/PATCH v0 03/12] gunyah: Basic support

2023-12-01 Thread Srivatsa Vaddagiri
* Alex Benn?e [2023-11-29 16:56:38]: > Srivatsa Vaddagiri writes: > > > Add a new accelerator, gunyah, with basic functionality of creating a > > VM. Subsequent patches will add support for other functions required to > > run a VM. > > > > Signed-off-b

Re: [RFC/PATCH v0 12/12] gunyah: Documentation

2023-10-17 Thread Srivatsa Vaddagiri
* Alex Benn?e [2023-10-12 15:55:59]: > > Hi Phil, > > We do want to see Gunyah support merged in Qemu at the earliest (as soon > > as the kernel driver is merged upstream that is), so any dependent change in > > Qemu for Gunyah would be of much interest to us! I am not sure though if > > Qui

Re: [RFC/PATCH v0 12/12] gunyah: Documentation

2023-10-12 Thread Srivatsa Vaddagiri
* Philippe Mathieu-Daud? [2023-10-12 06:52:04]: > > +Limitations > > +--- > > + > > +Below features are not yet supported. > > + > > +* virtio-pci (support for which in Qemu seems to rely heavily on KVM, which > > + needs to be made multi-hypervisor friendly). > > Is QUIC interested in

Re: [RFC/PATCH v0 10/12] gunyah: CPU execution loop

2023-10-12 Thread Srivatsa Vaddagiri
* Philippe Mathieu-Daud? [2023-10-12 06:43:38]: > > -void *gunyah_cpu_thread_fn(void *arg) > > -{ > > -CPUState *cpu = arg; > > - > > -do { > > -/* Do nothing */ > > -} while (!cpu->unplug || cpu_can_run(cpu)); > > - > > -return NULL; > > -} > > This diff could be nicer i

Re: [RFC/PATCH v0 03/12] gunyah: Basic support

2023-10-12 Thread Srivatsa Vaddagiri
* Alex Benn?e [2023-10-12 12:32:34]: > >> create mode 100644 include/sysemu/gunyah_int.h > > > > Can we move gunyah_int.h to accel/gunyah/? > > If it's all internal to gunyah itself you could rename it to internal.h > (although we do have various forms of foo-internal.h across the code > base)

Re: [RFC/PATCH v0 01/12] hw/arm/virt: Avoid NULL pointer de-reference

2023-10-12 Thread Srivatsa Vaddagiri
* Philippe Mathieu-Daud? [2023-10-12 06:30:24]: > Hi Srivatsa, > > (+Markus/Peter for QOM fu) > > On 11/10/23 18:52, Srivatsa Vaddagiri wrote: > > Avoid dereferencing a NULL pointer that its_class_name() could return. > > While your patch is correct, there

Re: [RFC/PATCH v0 02/12] update-linux-headers: Include gunyah.h

2023-10-11 Thread Srivatsa Vaddagiri
* Srivatsa Vaddagiri [2023-10-11 16:52:24]: > One of the subsequent versions of the patch is expected to be merged > upstream soon, after this this change to 'update-linux-headers' can be Sorry about the typo, will be fixed in next version! s/this this/which, this > run aga

[RFC/PATCH v0 07/12] gunyah: Add gicv3 interrupt controller

2023-10-11 Thread Srivatsa Vaddagiri
interrupt. An eventfd is created and associated with each doorbell/irq. Injection of a specific irq is accomplished by writing to the eventfd associated with that irq. Signed-off-by: Srivatsa Vaddagiri --- MAINTAINERS| 1 + accel/gunyah/gunyah-all.c | 5 ++ hw/arm

[RFC/PATCH v0 12/12] gunyah: Documentation

2023-10-11 Thread Srivatsa Vaddagiri
Add gunyah.rst that provide some informaiton on how to build and test 'gunyah' accelerator with open-source Gunyah hypervisor. Signed-off-by: Srivatsa Vaddagiri --- MAINTAINERS| 1 + docs/system/arm/gunyah.rst | 214 + 2 files ch

[RFC/PATCH v0 11/12] gunyah: Workarounds (NOT FOR MERGE)

2023-10-11 Thread Srivatsa Vaddagiri
These are some work-arounds required temporarily until some limitations with Gunyah hypervisor are addressed. Signed-off-by: Srivatsa Vaddagiri --- accel/gunyah/gunyah-all.c | 18 ++ hw/arm/boot.c | 3 ++- hw/arm/virt.c | 3 ++- include/sysemu

[RFC/PATCH v0 06/12] gunyah: Add IRQFD and IOEVENTFD functions

2023-10-11 Thread Srivatsa Vaddagiri
to access @addr. Signed-off-by: Srivatsa Vaddagiri --- accel/gunyah/gunyah-all.c | 94 + include/sysemu/gunyah_int.h | 1 + 2 files changed, 95 insertions(+) diff --git a/accel/gunyah/gunyah-all.c b/accel/gunyah/gunyah-all.c index 38d0a52b7f..6ec60aa8e8

[RFC/PATCH v0 04/12] gunyah: Add VM properties

2023-10-11 Thread Srivatsa Vaddagiri
data should remain private to the VM. Since a protected VM may need some memory shared with its host, for exchange of information, 'preshmem-size' specifies what portion of a protected VM's memory should be shared with its host, with the remaining portion being private to it. Signed-

[RFC/PATCH v0 03/12] gunyah: Basic support

2023-10-11 Thread Srivatsa Vaddagiri
Add a new accelerator, gunyah, with basic functionality of creating a VM. Subsequent patches will add support for other functions required to run a VM. Signed-off-by: Srivatsa Vaddagiri --- MAINTAINERS | 7 +++ accel/Kconfig | 3 + accel/gunyah/gunyah

[RFC/PATCH v0 05/12] gunyah: Support memory assignment

2023-10-11 Thread Srivatsa Vaddagiri
ry will combine the two ioctls into one, when this patch will be updated. 1. Refer GH_VM_ANDROID_LEND_USER_MEM and GH_VM_SET_USER_MEM_REGION in https://android.googlesource.com/kernel/common/+/refs/heads/android14-6.1/drivers/virt/gunyah/vm_mgr.c Signed-off-by: Srivatsa Vaddagiri --- accel/guny

[RFC/PATCH v0 09/12] gunyah: Customize device-tree

2023-10-11 Thread Srivatsa Vaddagiri
Customize device-tree with Gunyah specific properties. Some of these properties include specification of doorbells that need to be created and associated with various interrupts. Signed-off-by: Srivatsa Vaddagiri --- hw/arm/virt.c | 11 ++ include/sysemu/gunyah.h | 7 target

[RFC/PATCH v0 01/12] hw/arm/virt: Avoid NULL pointer de-reference

2023-10-11 Thread Srivatsa Vaddagiri
Avoid dereferencing a NULL pointer that its_class_name() could return. Signed-off-by: Srivatsa Vaddagiri --- hw/arm/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index a13c658bbf..b55d5c7282 100644 --- a/hw/arm/virt.c +++ b/hw/arm

[RFC/PATCH v0 08/12] gunyah: Specific device-tree location

2023-10-11 Thread Srivatsa Vaddagiri
Specify the location of device-tree and its size, as Gunyah requires the device-tree to be parsed before VM can begin its execution. Signed-off-by: Srivatsa Vaddagiri --- MAINTAINERS | 1 + hw/arm/virt.c | 6 ++ include/sysemu/gunyah.h | 7 +++ target/arm

[RFC/PATCH v0 10/12] gunyah: CPU execution loop

2023-10-11 Thread Srivatsa Vaddagiri
Complete the cpu execution loop. At this time, we recognize exits associated with only MMIO access. Future patches will add support for recognizing other exit reasons, such as PSCI calls made by guest. Signed-off-by: Srivatsa Vaddagiri --- accel/gunyah/gunyah-accel-ops.c | 1 + accel/gunyah

[RFC/PATCH v0 02/12] update-linux-headers: Include gunyah.h

2023-10-11 Thread Srivatsa Vaddagiri
of Gunyah kernel driver is available in Android kernel repository, against which this change can be run. https://android.googlesource.com/kernel/common Branch: android14-6.1 Signed-off-by: Srivatsa Vaddagiri --- scripts/update-linux-headers.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletio

[RFC/PATCH v0 00/12] Gunyah hypervisor support

2023-10-11 Thread Srivatsa Vaddagiri
commit on which this series was tested: d77b7b28a8 target/arm: Fix 64-bit SSRA Srivatsa Vaddagiri (12): hw/arm/virt: Avoid NULL pointer de-reference update-linux-headers: Include gunyah.h gunyah: Basic support gunyah: Add VM properties gunyah: Support memory assignment gunyah

Re: Question on Qemu flash driver - pflash_cfi01

2023-09-23 Thread Srivatsa Vaddagiri
* Peter Maydell [2023-09-23 13:39:55]: > On Sat, 23 Sept 2023 at 13:11, Srivatsa Vaddagiri > wrote: > > > > cfi01 driver initializes a rom device with ops represented by > > pflash_cfi01_ops. > > > > static const MemoryRegionOps pflash_cf

Question on Qemu flash driver - pflash_cfi01

2023-09-23 Thread Srivatsa Vaddagiri
cfi01 driver initializes a rom device with ops represented by pflash_cfi01_ops. static const MemoryRegionOps pflash_cfi01_ops = { .read_with_attrs = pflash_mem_read_with_attrs, .write_with_attrs = pflash_mem_write_with_attrs, .endianness = DEVICE_NATIVE_ENDIAN, }; memory_region_i

virtio-pci support for non-KVM hypervisors?

2023-09-08 Thread Srivatsa Vaddagiri
I was looking to add support for a Qualcomm hypervisor (Gunyah [1]) in Qemu and intend to publish the RFC patches soon. I noticed that hw/virtio/virtio-pci.c seems to support only KVM (esp related to use of IRQFD). Is there any efforts underway to make it support other hypervisors? I wanted to ref

Re: [Stratos-dev] [PATCH 0/5] virtio: Add vhost-user based RNG service

2021-06-04 Thread Srivatsa Vaddagiri
* Mathieu Poirier via Stratos-dev [2021-06-01 20:03:14]: > Hi all, > > This sets adds a vhost-user based random number generator (RNG), > similar to what has been done for i2c and virtiofsd. In fact > the implementation for vhost-user-rng and vhost-user-rng-pci > follow what was done for vhost

[Qemu-devel] Re: [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2)

2010-12-02 Thread Srivatsa Vaddagiri
Actually CCing Rik now! On Thu, Dec 02, 2010 at 08:57:16PM +0530, Srivatsa Vaddagiri wrote: > On Thu, Dec 02, 2010 at 03:49:44PM +0200, Avi Kivity wrote: > > On 12/02/2010 03:13 PM, Srivatsa Vaddagiri wrote: > > >On Thu, Dec 02, 2010 at 02:41:35PM +0200, Avi Kivity wrote: >

[Qemu-devel] Re: [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2)

2010-12-02 Thread Srivatsa Vaddagiri
On Thu, Dec 02, 2010 at 05:33:40PM +0200, Avi Kivity wrote: > A0 and A1's vruntime will keep growing, eventually B will become > leftmost and become runnable (assuming leftmost == min vruntime, not > sure what the terminology is). Donation (in directed yield) will cause vruntime to drop as well (t

[Qemu-devel] Re: [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2)

2010-12-02 Thread Srivatsa Vaddagiri
On Thu, Dec 02, 2010 at 03:49:44PM +0200, Avi Kivity wrote: > On 12/02/2010 03:13 PM, Srivatsa Vaddagiri wrote: > >On Thu, Dec 02, 2010 at 02:41:35PM +0200, Avi Kivity wrote: > >> >> What I'd like to see in directed yield is donating exactly the > >> &g

[Qemu-devel] Re: [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2)

2010-12-02 Thread Srivatsa Vaddagiri
On Thu, Dec 02, 2010 at 11:17:52AM +0200, Avi Kivity wrote: > What I'd like to see in directed yield is donating exactly the > amount of vruntime that's needed to make the target thread run. The How would that work well with hard-limits? The target thread would have been rate limited and no amoun

[Qemu-devel] Re: [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2)

2010-12-02 Thread Srivatsa Vaddagiri
On Thu, Dec 02, 2010 at 05:17:00PM +0530, Srivatsa Vaddagiri wrote: > Just was wondering how this would work in case of buggy guests. Lets say that > a > guest ran into a AB<->BA deadlock. VCPU0 spins on lock B (held by VCPU1 > currently), while VCPU spins on lock A (held

[Qemu-devel] Re: [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2)

2010-12-02 Thread Srivatsa Vaddagiri
On Thu, Dec 02, 2010 at 11:17:52AM +0200, Avi Kivity wrote: > On 12/01/2010 09:09 PM, Peter Zijlstra wrote: > >> > >> We are dealing with just one task here (the task that is yielding). > >> After recording how much timeslice we are "giving up" in > >> current->donate_time > >> (donate_time is

[Qemu-devel] Re: [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2)

2010-12-02 Thread Srivatsa Vaddagiri
On Thu, Dec 02, 2010 at 02:41:35PM +0200, Avi Kivity wrote: > >> What I'd like to see in directed yield is donating exactly the > >> amount of vruntime that's needed to make the target thread run. > > > >I presume this requires the target vcpu to move left in rb-tree to run > >earlier than schedu

[Qemu-devel] Re: [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2)

2010-12-01 Thread Srivatsa Vaddagiri
On Wed, Dec 01, 2010 at 05:25:18PM +0100, Peter Zijlstra wrote: > On Wed, 2010-12-01 at 21:42 +0530, Srivatsa Vaddagiri wrote: > > > Not if yield() remembers what timeslice was given up and adds that back when > > thread is finally ready to run. Figure below ill

[Qemu-devel] Re: [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2)

2010-12-01 Thread Srivatsa Vaddagiri
On Wed, Dec 01, 2010 at 06:45:02PM +0100, Peter Zijlstra wrote: > On Wed, 2010-12-01 at 22:59 +0530, Srivatsa Vaddagiri wrote: > > > > yield_task_fair(...) > > { > > > > + ideal_runtime = sched_slice(cfs_rq, curr); > > + del

[Qemu-devel] Re: [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2)

2010-12-01 Thread Srivatsa Vaddagiri
On Wed, Dec 01, 2010 at 02:56:44PM +0200, Avi Kivity wrote: > >> (a directed yield implementation would find that all vcpus are > >> runnable, yielding optimal results under this test case). > > > >I would think a plain yield() (rather than usleep/directed yield) would > >suffice > >here (yield

[Qemu-devel] Re: [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2)

2010-12-01 Thread Srivatsa Vaddagiri
On Wed, Nov 24, 2010 at 04:23:15PM +0200, Avi Kivity wrote: > >>I'm more concerned about lock holder preemption, and interaction > >>of this mechanism with any kernel solution for LHP. > > > >Can you suggest some scenarios and I'll create some test cases? > >I'm trying figure out the best way to ev