Re: [Qemu-devel] [virtio-dev] [PATCH v3 0/7] Vhost-pci for inter-VM communication

2017-12-06 Thread Avi Cohen (A)
There is already a virtio mechanism in which 2 VMs assigned a virtio device , are communicating via a veth pair in the host . KVM just passes a pointer of the page of the writer VM to the reader VM - resulting in excellent performance (no vSwitch in the middle) **Question**: What is the

[Qemu-devel] .qcow file recovery

2017-12-06 Thread RR via Qemu-devel
Hi, A .qcow file was deleted by mistake. No recovery or backup is available. Hard disk was plugged out from the NAS after half a hour to prevent Synology OS operations writing over desallocated stockage. The file system on the virtual disk was ntfs. Virtualisation OS is Proxmox. Ease Us

Re: [Qemu-devel] [PATCH v4 0/2] check VirtiQueue Vring objects

2017-12-06 Thread P J P
+-- On Thu, 30 Nov 2017, P J P wrote --+ | +-- On Thu, 30 Nov 2017, Stefan Hajnoczi wrote --+ | | Michael is the virtio maintainer. I have added him to this email | | thread so the patch series can be merged. -> https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg05473.html @mst: this

[Qemu-devel] [PATCH] hw/input/hid: Add support for several keys.

2017-12-06 Thread Tao Wu via Qemu-devel
Add support for these keys: audiomute volumedown volumeup power. Tested with "sendkey" command in monitor and verify the behavior in guest OS. Signed-off-by: Tao Wu --- hw/input/hid.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/input/hid.c

Re: [Qemu-devel] [PATCH] vhost: fix crash on virtio_error while device stop

2017-12-06 Thread Ilya Maximets
On 06.12.2017 19:45, Michael S. Tsirkin wrote: > On Wed, Dec 06, 2017 at 04:06:18PM +0300, Ilya Maximets wrote: >> In case virtio error occured after vhost_dev_close(), qemu will crash >> in nested cleanup while checking IOMMU flag because dev->vdev already >> set to zero and resources are already

Re: [Qemu-devel] [qemu-s390x] [RFC PATCH v2 0/3] tests for CCW IDA

2017-12-06 Thread Thomas Huth
On 08.11.2017 17:54, Halil Pasic wrote: > I've keept the title althogh the scope shifted a bit: it's > more about introducing ccw-testdev than about IDA. The goal > is to facilitate testing the virtual channel subsystem > implementation, and the ccw interpretation. > > The first patch is the

Re: [Qemu-devel] [RFC PATCH v2 1/3] s390x/ccs: add ccw-testdev emulated device

2017-12-06 Thread Thomas Huth
Hi Halil, just a high-level review since I'm not a CSS expert... On 08.11.2017 17:54, Halil Pasic wrote: [...] > I'm not really happy with the side effects of moving it to hw/misc, which > ain't s390x specific. Sorry, I'm missing the context - why can't this go into hw/s390x/ ? > I've pretty

Re: [Qemu-devel] [virtio-dev] [PATCH v3 0/7] Vhost-pci for inter-VM communication

2017-12-06 Thread Stefan Hajnoczi
On Thu, Dec 7, 2017 at 3:57 AM, Wei Wang wrote: > On 12/07/2017 12:27 AM, Stefan Hajnoczi wrote: >> >> On Wed, Dec 6, 2017 at 4:09 PM, Wang, Wei W wrote: >>> >>> On Wednesday, December 6, 2017 9:50 PM, Stefan Hajnoczi wrote: On Tue, Dec 05,

Re: [Qemu-devel] [PATCH v2] hw/ide: Remove duplicated definitions from ahci_internal.h

2017-12-06 Thread Thomas Huth
On 06.12.2017 23:16, John Snow wrote: > I tweaked this again, sorry: > > The names need to stay public, but the wrappers to manipulate the > objects can stay internal. Minor difference. > > If that's okay, I'll just merge this in. > OK? Sure. Feel also free to replace my "Signed-off-by" with

Re: [Qemu-devel] [virtio-dev] [PATCH v3 0/7] Vhost-pci for inter-VM communication

2017-12-06 Thread Wei Wang
On 12/07/2017 01:11 PM, Michael S. Tsirkin wrote: On Thu, Dec 07, 2017 at 11:57:33AM +0800, Wei Wang wrote: On 12/07/2017 12:27 AM, Stefan Hajnoczi wrote: On Wed, Dec 6, 2017 at 4:09 PM, Wang, Wei W wrote: On Wednesday, December 6, 2017 9:50 PM, Stefan Hajnoczi wrote:

Re: [Qemu-devel] [PATCHv2 5/5] sunhme: switch sunhme_receive() over to use net_crc32_le()

2017-12-06 Thread Mark Cave-Ayland
On 06/12/17 03:34, Philippe Mathieu-Daudé wrote: Hi Mark, On 12/05/2017 05:17 AM, Mark Cave-Ayland wrote: Signed-off-by: Mark Cave-Ayland --- hw/net/sunhme.c | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --git

Re: [Qemu-devel] [PATCHv2 4/5] eepro100: switch e100_compute_mcast_idx() over to use net_crc32()

2017-12-06 Thread Mark Cave-Ayland
On 05/12/17 15:13, Stefan Weil wrote: Am 05.12.2017 um 09:17 schrieb Mark Cave-Ayland: Signed-off-by: Mark Cave-Ayland --- hw/net/eepro100.c | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/hw/net/eepro100.c

Re: [Qemu-devel] [virtio-dev] [PATCH v3 0/7] Vhost-pci for inter-VM communication

2017-12-06 Thread Michael S. Tsirkin
On Thu, Dec 07, 2017 at 11:57:33AM +0800, Wei Wang wrote: > On 12/07/2017 12:27 AM, Stefan Hajnoczi wrote: > > On Wed, Dec 6, 2017 at 4:09 PM, Wang, Wei W wrote: > > > On Wednesday, December 6, 2017 9:50 PM, Stefan Hajnoczi wrote: > > > > On Tue, Dec 05, 2017 at 11:33:09AM

Re: [Qemu-devel] [PATCHv2 2/5] net: introduce net_crc32_le() function

2017-12-06 Thread Mark Cave-Ayland
On 05/12/17 14:31, Eric Blake wrote: On 12/05/2017 02:17 AM, Mark Cave-Ayland wrote: This provides a standard ethernet CRC32 little-endian implementation. Signed-off-by: Mark Cave-Ayland --- include/net/net.h | 2 ++ net/net.c | 22

Re: [Qemu-devel] [PATCHv2 4/5] eepro100: switch e100_compute_mcast_idx() over to use net_crc32()

2017-12-06 Thread Mark Cave-Ayland
On 05/12/17 14:28, Eric Blake wrote: On 12/05/2017 02:17 AM, Mark Cave-Ayland wrote: Signed-off-by: Mark Cave-Ayland --- hw/net/eepro100.c | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) -if (carry) { -

Re: [Qemu-devel] [virtio-dev] [PATCH v3 0/7] Vhost-pci for inter-VM communication

2017-12-06 Thread Wei Wang
On 12/07/2017 12:27 AM, Stefan Hajnoczi wrote: On Wed, Dec 6, 2017 at 4:09 PM, Wang, Wei W wrote: On Wednesday, December 6, 2017 9:50 PM, Stefan Hajnoczi wrote: On Tue, Dec 05, 2017 at 11:33:09AM +0800, Wei Wang wrote: Vhost-pci is a point-to-point based inter-VM

Re: [Qemu-devel] [PATCH] input: free InputEvent when it can't be inserted into a full kdb queue

2017-12-06 Thread Tian Dianchen
Hi, Marc-André Lureau Thank you for your comments. Hi,Gerd Hoffmann, If there is no other comments,please join this note when merge this patch . 2017-12-06 17:46 GMT+08:00 Marc-André Lureau : > Hi > > On Wed, Dec 6, 2017 at 3:29 AM, 田殿臣

[Qemu-devel] [PATCH] ui: Add enabled field to egl_fb struct

2017-12-06 Thread Tina Zhang
Add a switch to enable/disable a egl_fb to make sure a egl_fb can only be flushed when it's enabled. For example, the cursor plane might be disabled by guest Apps on purpose. With the "enabled" field, a cursor plane can be ignored when it's disabled by guest Apps. Against branch: work/intel-vgpu

Re: [Qemu-devel] About the light VM solution!

2017-12-06 Thread Gonglei (Arei)
> -Original Message- > From: Stefan Hajnoczi [mailto:stefa...@redhat.com] > Sent: Wednesday, December 06, 2017 11:10 PM > To: Gonglei (Arei) > Cc: Paolo Bonzini; Yang Zhong; Stefan Hajnoczi; qemu-devel > Subject: Re: [Qemu-devel] About the light VM solution! > > On Wed, Dec 06, 2017 at

Re: [Qemu-devel] [PATCH for-2.12 0/4] qmp dirty bitmap API

2017-12-06 Thread John Snow
On 11/30/2017 07:10 AM, Vladimir Sementsov-Ogievskiy wrote: > 18.11.2017 00:35, John Snow wrote: >> >> On 11/17/2017 03:22 AM, Vladimir Sementsov-Ogievskiy wrote: >>> 17.11.2017 06:10, John Snow wrote: On 11/16/2017 03:17 AM, Vladimir Sementsov-Ogievskiy wrote: > 16.11.2017 00:20, John

Re: [Qemu-devel] [PATCH for-2.11] vfio: Fix vfio-kvm group registration

2017-12-06 Thread Alexey Kardashevskiy
On 06/12/17 12:30, Alex Williamson wrote: > On Wed, 6 Dec 2017 12:02:01 +1100 > Alexey Kardashevskiy wrote: > >> On 06/12/17 08:09, Alex Williamson wrote: >>> Commit 8c37faa475f3 ("vfio-pci, ppc64/spapr: Reorder group-to-container >>> attaching") moved registration of groups with

Re: [Qemu-devel] [PATCH-2.12 v2 2/3] xilinx_spips: Set all of the reset values

2017-12-06 Thread francisco iglesias
Hi Alistair, On 6 December 2017 at 23:22, Alistair Francis wrote: > Following the ZynqMP register spec let's ensure that all reset values > are set. > > Signed-off-by: Alistair Francis > --- > V2: > - Don't bother double setting

Re: [Qemu-devel] [PATCH 2/2] virtio-blk: reject configs with logical block size > physical block size

2017-12-06 Thread Martin K. Petersen
Mark, > virtio-blk logical block size should never be larger than physical block > size because it doesn't make sense to have such configurations. QEMU doesn't > have a way to effectively express this condition; the best it can do is > report the physical block exponent as 0 - indicating the

Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] qcow2: add overlap check for bitmap directory

2017-12-06 Thread John Snow
On 11/30/2017 11:47 AM, Vladimir Sementsov-Ogievskiy wrote: > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2.h | 7 +-- > block/qcow2-refcount.c | 12 > block/qcow2.c | 6 ++ > 3 files changed, 23

Re: [Qemu-devel] [RFC PATCH] target/sh4/translate.c: fix TCG leak during gusa sequence

2017-12-06 Thread Aurelien Jarno
On 2017-12-06 09:30, Alex Bennée wrote: > This fixes bug #1735384 while running java under qemu-sh4. When debug > was enabled it showed a problem with TCG temps. Once fixed I was able > to run java -version normally. > > Reported-by: John Paul Adrian Glaubitz >

[Qemu-devel] [PATCH-2.12 v2 3/3] xilinx_spips: Use memset instead of a for loop to zero registers

2017-12-06 Thread Alistair Francis
Use memset() instead of a for loop to zero all of the registers. Signed-off-by: Alistair Francis Reviewed-by: KONRAD Frederic Reviewed-by: Francisco Iglesias --- hw/ssi/xilinx_spips.c | 11 +++ 1

[Qemu-devel] [PATCH-2.12 v2 1/3] xilinx_spips: Update the QSPI Mod ID reset value

2017-12-06 Thread Alistair Francis
Update the reset value to match the latest ZynqMP register spec. Signed-off-by: Alistair Francis Reviewed-by: KONRAD Frederic Reviewed-by: Francisco Iglesias --- hw/ssi/xilinx_spips.c | 1 + 1 file changed,

[Qemu-devel] [PATCH-2.12 v2 0/3] Update the reset values of the Xilinx ZynqMP QSPI

2017-12-06 Thread Alistair Francis
Update the reset values of the Xilinx ZynqMP QSPI device to match the resister spec here: https://www.xilinx.com/html_docs/registers/ug1087/ug1087-zynq-ultrascale-registers.html V2: - Don't double set registers Based-on: 20171126231634.9531-14-frasse.igles...@gmail.com Alistair Francis (3):

[Qemu-devel] [PATCH-2.12 v2 2/3] xilinx_spips: Set all of the reset values

2017-12-06 Thread Alistair Francis
Following the ZynqMP register spec let's ensure that all reset values are set. Signed-off-by: Alistair Francis --- V2: - Don't bother double setting registers hw/ssi/xilinx_spips.c | 35 ++- include/hw/ssi/xilinx_spips.h |

Re: [Qemu-devel] [PATCH v2] hw/ide: Remove duplicated definitions from ahci_internal.h

2017-12-06 Thread John Snow
I tweaked this again, sorry: The names need to stay public, but the wrappers to manipulate the objects can stay internal. Minor difference. If that's okay, I'll just merge this in. OK? --js diff --git a/hw/ide/ahci_internal.h b/hw/ide/ahci_internal.h index ce2e818c8c..8c755d4ca1 100644 ---

Re: [Qemu-devel] [Qemu-block] [PATCH 2/7] ide: account UNMAP (TRIM) operations

2017-12-06 Thread John Snow
On 12/05/2017 12:14 PM, Anton Nefedov wrote: > > > On 5/12/2017 6:21 PM, Alberto Garcia wrote: >> On Mon 20 Nov 2017 05:50:59 PM CET, Anton Nefedov wrote: >>> Signed-off-by: Anton Nefedov >>> Reviewed-by: Vladimir Sementsov-Ogievskiy >>>

Re: [Qemu-devel] [PATCH v5 01/23] memattrs: add debug attribute

2017-12-06 Thread Peter Maydell
On 6 December 2017 at 20:03, Brijesh Singh wrote: > The debug attribute will be set when qemu attempts to access the guest > memory for debug (e.g memory access from gdbstub, memory dump commands > etc). > > When guest memory is encrypted, the debug access will need to go

Re: [Qemu-devel] [PATCH 1/2] target/sh4: add missing tcg_temp_free() in gen_conditional_jump()

2017-12-06 Thread Aurelien Jarno
On 2017-12-05 14:00, Philippe Mathieu-Daudé wrote: > missed in c55497ecb8c. > > Signed-off-by: Philippe Mathieu-Daudé > --- > target/sh4/translate.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/target/sh4/translate.c b/target/sh4/translate.c >

Re: [Qemu-devel] [PATCH 2/2] target/sh4: add missing tcg_temp_free() in _decode_opc()

2017-12-06 Thread Aurelien Jarno
On 2017-12-05 14:00, Philippe Mathieu-Daudé wrote: > missed in c55497ecb8c and 852d481faf7. > > Signed-off-by: Philippe Mathieu-Daudé > --- > target/sh4/translate.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/target/sh4/translate.c b/target/sh4/translate.c >

Re: [Qemu-devel] [Qemu-block] [PATCH 4/4] iotests: add dirty bitmap migration test

2017-12-06 Thread John Snow
On 12/06/2017 04:51 AM, Vladimir Sementsov-Ogievskiy wrote: > 28.11.2017 10:14, Vladimir Sementsov-Ogievskiy wrote: >> The test creates two vms (vm_a, vm_b), create dirty bitmap in >> the first one, do several writes to corresponding device and >> then migrate vm_a to vm_b with dirty bitmaps. >>

Re: [Qemu-devel] [RFC 4/7] vhost: update_mem_cb implementation

2017-12-06 Thread Dr. David Alan Gilbert
* Igor Mammedov (imamm...@redhat.com) wrote: > On Wed, 29 Nov 2017 18:50:23 + > "Dr. David Alan Gilbert (git)" wrote: > > > From: "Dr. David Alan Gilbert" > > > > Add the meat of update_mem_cb; this is called for each region, > > to add a region

[Qemu-devel] [PATCH v5 20/23] hw: i386: set ram_debug_ops when memory encryption is enabled

2017-12-06 Thread Brijesh Singh
When memory encryption is enabled, the guest RAM and boot flash ROM will contain the encrypted data. By setting the debug ops allow us to invoke encryption APIs when accessing the memory for the debug purposes. Cc: Paolo Bonzini Cc: Richard Henderson Cc:

[Qemu-devel] [PATCH v5 19/23] sev: Finalize the SEV guest launch flow

2017-12-06 Thread Brijesh Singh
SEV launch flow requires us to issue LAUNCH_FINISH command before guest is ready to run. Cc: Paolo Bonzini Cc: k...@vger.kernel.org Signed-off-by: Brijesh Singh --- accel/kvm/sev.c | 30 ++ 1 file changed, 30 insertions(+)

[Qemu-devel] [PATCH v5 13/23] hmp: display memory encryption support in 'info kvm'

2017-12-06 Thread Brijesh Singh
update 'info kvm' to display the memory encryption support. (qemu) info kvm kvm support: enabled memory encryption: disabled Cc: "Dr. David Alan Gilbert" Cc: Eric Blake Cc: Markus Armbruster Cc: Paolo Bonzini

[Qemu-devel] [PATCH v5 16/23] target/i386: encrypt bios rom

2017-12-06 Thread Brijesh Singh
SEV requires that guest bios must be encrypted before booting the guest. Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Brijesh Singh ---

[Qemu-devel] [PATCH v5 12/23] kvm: introduce memory encryption APIs

2017-12-06 Thread Brijesh Singh
Inorder to integerate the Secure Encryption Virtualization (SEV) support add few high-level memory encryption APIs which can be used for encrypting the guest memory region. Cc: Paolo Bonzini Cc: k...@vger.kernel.org Signed-off-by: Brijesh Singh ---

[Qemu-devel] [PATCH v5 14/23] sev: add command to create launch memory encryption context

2017-12-06 Thread Brijesh Singh
The KVM_SEV_LAUNCH_START command creates a new VM encryption key (VEK). The encryption key created with the command will be used for encrypting the bootstrap images (such as guest bios). Cc: Paolo Bonzini Cc: k...@vger.kernel.org Signed-off-by: Brijesh Singh

[Qemu-devel] [PATCH v5 04/23] monitor/i386: use debug APIs when accessing guest memory

2017-12-06 Thread Brijesh Singh
Updates HMP commands to use the debug version of APIs when accessing the guest memory. Cc: Paolo Bonzini Cc: Peter Crosthwaite Cc: Richard Henderson Cc: "Dr. David Alan Gilbert" Cc: Markus Armbruster

[Qemu-devel] [PATCH v5 10/23] sev: add command to initialize the memory encryption context

2017-12-06 Thread Brijesh Singh
When memory encryption is enabled, KVM_SEV_INIT command is used to initialize the platform. The command loads the SEV related persistent data from non-volatile storage and initializes the platform context. This command should be first issued before invoking any other guest commands provided by the

Re: [Qemu-devel] [PATCH] Remove MemoryRegionSection check code from sparc_cpu_get_phys_page_debug()

2017-12-06 Thread Jean-Christophe DUBOIS
Le 04/12/2017 à 21:45, Mark Cave-Ayland a écrit : On 27/11/17 20:19, Jean-Christophe DUBOIS wrote: Hello Mark, Did you get any second opinion on this? Also do you need me to resend the patch with the SPARC keyword in the patch subject line? Hi Jean-Christophe, Apologies for the delay as

[Qemu-devel] [PATCH v5 02/23] exec: add ram_debug_ops support

2017-12-06 Thread Brijesh Singh
Currently, the guest memory access for the debug purpose is performed using the memcpy(). Lets extend the 'struct MemoryRegion' to include ram_debug_ops callbacks. The ram_debug_ops can be used to override memcpy() with something else. The feature can be used by encrypted guest -- which can

[Qemu-devel] [PATCH v5 09/23] accel: add Secure Encrypted Virtulization (SEV) object

2017-12-06 Thread Brijesh Singh
Add a new memory encryption object 'sev-guest'. The object will be used to create enrypted VMs on AMD EPYC CPU. The object provides the properties to pass guest owner's public Diffie-hellman key, guest policy and session information required to create the memory encryption context within the SEV

[Qemu-devel] [PATCH v5 00/23] x86: Secure Encrypted Virtualization (AMD)

2017-12-06 Thread Brijesh Singh
This patch series provides support for AMD's new Secure Encrypted Virtualization (SEV) feature. SEV is an extension to the AMD-V architecture which supports running multiple VMs under the control of a hypervisor. The SEV feature allows the memory contents of a virtual machine (VM) to be

[Qemu-devel] [PATCH v5 06/23] machine: add -memory-encryption property

2017-12-06 Thread Brijesh Singh
When CPU supports memory encryption feature, the property can be used to specify the encryption object to use when launching an encrypted guest. Cc: Paolo Bonzini Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: Stefan Hajnoczi

[Qemu-devel] [PATCH 2/2] virtio-blk: reject configs with logical block size > physical block size

2017-12-06 Thread Mark Kanda
virtio-blk logical block size should never be larger than physical block size because it doesn't make sense to have such configurations. QEMU doesn't have a way to effectively express this condition; the best it can do is report the physical block exponent as 0 - indicating the logical block size

[Qemu-devel] [PATCH v5 05/23] target/i386: add memory encryption feature cpuid support

2017-12-06 Thread Brijesh Singh
AMD EPYC processors support memory encryption feature. The feature is reported through CPUID 8000_001F[EAX]. Fn8000_001F [EAX]: Bit 0 Secure Memory Encryption (SME) supported Bit 1 Secure Encrypted Virtualization (SEV) supported Bit 2 Page flush MSR supported Bit 3 Ecrypted State

[Qemu-devel] [PATCH v5 23/23] sev: add migration blocker

2017-12-06 Thread Brijesh Singh
SEV guest migration is not yet implemented yet. Signed-off-by: Brijesh Singh --- accel/kvm/sev.c | 13 + 1 file changed, 13 insertions(+) diff --git a/accel/kvm/sev.c b/accel/kvm/sev.c index 3edfb5b08416..10647645eacd 100644 --- a/accel/kvm/sev.c +++

[Qemu-devel] reminder: please include justification/explanation for any pull request after rc2

2017-12-06 Thread Peter Maydell
Hi; I just wanted to send out a general email to ask submaintainers who send me pullrequests for patches to go in after about rc2 to make sure they include a justification and explanation of why the bugs being fixed mean the changes need to go into the release. I realized that I wasn't sure if I'd

[Qemu-devel] [PATCH 0/2] virtio-blk: miscellaneous changes

2017-12-06 Thread Mark Kanda
This series is for two minor virtio-blk changes. The first patch makes the virtio-blk queue size user configurable. The second patch rejects logical block size > physical block configurations (similar to a recent change in virtio-scsi). Mark Kanda (2): virtio-blk: make queue size configurable

[Qemu-devel] [PATCH v5 03/23] exec: add debug version of physical memory read and write API

2017-12-06 Thread Brijesh Singh
Adds the following new APIs - cpu_physical_memory_read_debug - cpu_physical_memory_write_debug - cpu_physical_memory_rw_debug - ldl_phys_debug - ldq_phys_debug Cc: Paolo Bonzini Cc: Peter Crosthwaite Cc: Richard Henderson

[Qemu-devel] [PATCH v5 21/23] sev: add debug encrypt and decrypt commands

2017-12-06 Thread Brijesh Singh
KVM_SEV_DBG_DECRYPT and KVM_SEV_DBG_ENCRYPT commands are used for decrypting and encrypting guest memory region. The command works only if the guest policy allows the debugging. Cc: Paolo Bonzini Cc: k...@vger.kernel.org Signed-off-by: Brijesh Singh

[Qemu-devel] [PATCH v5 22/23] target/i386: clear C-bit when walking SEV guest page table

2017-12-06 Thread Brijesh Singh
In SEV-enabled guest the pte entry will have C-bit set, we need to clear the C-bit when walking the page table. The C-bit position should be available in cpuid Fn8000_001f[EBX] Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost

[Qemu-devel] [PATCH v5 01/23] memattrs: add debug attribute

2017-12-06 Thread Brijesh Singh
The debug attribute will be set when qemu attempts to access the guest memory for debug (e.g memory access from gdbstub, memory dump commands etc). When guest memory is encrypted, the debug access will need to go through the memory encryption APIs. Cc: Alistair Francis

[Qemu-devel] [PATCH v5 15/23] sev: add command to encrypt guest memory region

2017-12-06 Thread Brijesh Singh
The KVM_SEV_LAUNCH_UPDATE_DATA command is used to encrypt a guest memory region using the VM Encryption Key created using LAUNCH_START. Signed-off-by: Brijesh Singh --- accel/kvm/kvm-all.c | 2 ++ accel/kvm/sev.c | 44

[Qemu-devel] [PATCH v5 18/23] sev: emit the SEV_MEASUREMENT event

2017-12-06 Thread Brijesh Singh
During machine creation we encrypted the guest bios image, the LAUNCH_MEASURE command can be used to retrieve the measurement of the encrypted memory region. Emit the SEV_MEASUREMENT event so that libvirt can grab the measurement value as soon as we are done with creating the encrypted machine.

[Qemu-devel] [PATCH 1/2] virtio-blk: make queue size configurable

2017-12-06 Thread Mark Kanda
Depending on the configuration, it can be beneficial to adjust the virtio-blk queue size to something other than the current default of 128. Add a new property to make the queue size configurable. Signed-off-by: Mark Kanda Reviewed-by: Karl Heubaum

[Qemu-devel] [PATCH v5 17/23] qapi: add SEV_MEASUREMENT event

2017-12-06 Thread Brijesh Singh
Add SEV_MEASUREMENT event which can be used by libvirt to get the measurement of the memory regions encrypted through the SEV launch flow. The measurement value is base64 encoded. Cc: Daniel P. Berrange Cc: Eric Blake Cc: Markus Armbruster

[Qemu-devel] [PATCH v5 11/23] sev: register the guest memory range which may contain encrypted data

2017-12-06 Thread Brijesh Singh
When SEV is enabled, the hardware encryption engine uses a tweak such that the two identical plaintext at different location will have a different ciphertexts. So swapping or moving a ciphertexts of two guest pages will not result in plaintexts being swapped. Hence relocating a physical backing

[Qemu-devel] [PATCH v5 08/23] docs: add AMD Secure Encrypted Virtualization (SEV)

2017-12-06 Thread Brijesh Singh
Create a documentation entry to describe the AMD Secure Encrypted Virtualization (SEV) feature. Cc: Paolo Bonzini Signed-off-by: Brijesh Singh --- docs/amd-memory-encryption.txt | 92 ++ 1 file changed, 92

[Qemu-devel] [PATCH 08/55] memory: Move FlatView allocation to a helper

2017-12-06 Thread Michael Roth
From: Alexey Kardashevskiy This moves a FlatView allocation and initialization to a helper. While we are nere, replace g_new with g_new0 to not to bother if we add new fields in the future. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy

Re: [Qemu-devel] [PATCH 19/25] spapr: add hcalls support for the XIVE interrupt mode

2017-12-06 Thread Benjamin Herrenschmidt
On Wed, 2017-12-06 at 20:20 +1100, David Gibson wrote: > On Tue, Dec 05, 2017 at 08:50:26AM -0600, Benjamin Herrenschmidt wrote: > > On Tue, 2017-12-05 at 18:00 +1100, David Gibson wrote: > > > > The CPU revision. But we won't introduce XIVE exploitation mode on > > > > anything else than DD2.0

[Qemu-devel] [PATCH v5 07/23] kvm: update kvm.h to include memory encryption ioctls

2017-12-06 Thread Brijesh Singh
Updates kmv.h to include memory encryption ioctls and SEV commands. Cc: Christian Borntraeger Cc: Cornelia Huck Cc: Paolo Bonzini Signed-off-by: Brijesh Singh --- linux-headers/linux/kvm.h | 90

[Qemu-devel] [PATCH 04/55] kvmclock: use the updated system_timer_msr

2017-12-06 Thread Michael Roth
From: Jim Somerville Fixes e2b6c17 (kvmclock: update system_time_msr address forcibly) which makes a call to get the latest value of the address stored in system_timer_msr, but then uses the old address anyway. Signed-off-by: Jim Somerville

[Qemu-devel] [PATCH 07/55] memory: Open code FlatView rendering

2017-12-06 Thread Michael Roth
From: Alexey Kardashevskiy We are going to share FlatView's between AddressSpace's and per-AS memory listeners won't suit the purpose anymore so open code the dispatch tree rendering. Since there is a good chance that dispatch_listener was the only listener, this avoids

[Qemu-devel] [PATCH 51/55] nbd/server: fix nbd_negotiate_handle_info

2017-12-06 Thread Michael Roth
From: Vladimir Sementsov-Ogievskiy namelen should be here, length is unrelated, and always 0 at this point. Broken in introduction in commit f37708f6, but mostly harmless (replying with '' as the name does not violate protocol, and does not confuse qemu as the nbd

[Qemu-devel] [PATCH 53/55] nbd/client: Don't hard-disconnect on ESHUTDOWN from server

2017-12-06 Thread Michael Roth
From: Eric Blake The NBD spec says that a server may fail any transmission request with ESHUTDOWN when it is apparent that no further request from the client can be successfully honored. The client is supposed to then initiate a soft shutdown (wait for all remaining in-flight

[Qemu-devel] [PATCH 55/55] vga: handle cirrus vbe mode wraparounds.

2017-12-06 Thread Michael Roth
From: Gerd Hoffmann Commit "3d90c62548 vga: stop passing pointers to vga_draw_line* functions" is incomplete. It doesn't handle the case that the vga rendering code tries to create a shared surface, i.e. a pixman image backed by vga video memory. That can not work in case

[Qemu-devel] [PATCH 49/55] nbd/server: CVE-2017-15118 Stack smash on large export name

2017-12-06 Thread Michael Roth
From: Eric Blake Introduced in commit f37708f6b8 (2.10). The NBD spec says a client can request export names up to 4096 bytes in length, even though they should not expect success on names longer than 256. However, qemu hard-codes the limit of 256, and fails to filter out a

[Qemu-devel] [PATCH 54/55] vga: drop line_offset variable

2017-12-06 Thread Michael Roth
From: Gerd Hoffmann Signed-off-by: Gerd Hoffmann (cherry picked from commit 362f811793ff6cb4d209ab61d76cc4f841bb5e46) Signed-off-by: Michael Roth --- hw/display/vga.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-)

[Qemu-devel] [PATCH 06/55] exec: Explicitly export target AS from address_space_translate_internal

2017-12-06 Thread Michael Roth
From: Alexey Kardashevskiy This adds an AS** parameter to address_space_do_translate() to make it easier for the next patch to share FlatViews. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy Message-Id:

[Qemu-devel] [PATCH 46/55] block/nfs: fix nfs_client_open for filesize greater than 1TB

2017-12-06 Thread Michael Roth
From: Peter Lieven DIV_ROUND_UP(st.st_size, BDRV_SECTOR_SIZE) was overflowing ret (int) if st.st_size is greater than 1TB. Cc: qemu-sta...@nongnu.org Signed-off-by: Peter Lieven Message-id: 1511798407-31129-1-git-send-email...@kamp.de Signed-off-by: Max Reitz

[Qemu-devel] [PATCH 52/55] nbd-client: Refuse read-only client with BDRV_O_RDWR

2017-12-06 Thread Michael Roth
From: Eric Blake The NBD spec says that clients should not try to write/trim to an export advertised as read-only by the server. But we failed to check that, and would allow the block layer to use NBD with BDRV_O_RDWR even when the server is read-only, which meant we were

[Qemu-devel] [PATCH 05/55] block: Perform copy-on-read in loop

2017-12-06 Thread Michael Roth
From: Eric Blake Improve our braindead copy-on-read implementation. Pre-patch, we have multiple issues: - we create a bounce buffer and perform a write for the entire request, even if the active image already has 99% of the clusters occupied, and really only needs to

[Qemu-devel] [PATCH 42/55] vhost: restore avail index from vring used index on disconnection

2017-12-06 Thread Michael Roth
From: Maxime Coquelin vhost_virtqueue_stop() gets avail index value from the backend, except if the backend is not responding. It happens when the backend crashes, and in this case, internal state of the virtio queue is inconsistent, making packets to corrupt the

[Qemu-devel] [PATCH 50/55] vhost: fix error check in vhost_verify_ring_mappings()

2017-12-06 Thread Michael Roth
From: Greg Kurz Since commit f1f9e6c5 "vhost: adapt vhost_verify_ring_mappings() to virtio 1 ring layout", we check the mapping of each part (descriptor table, available ring and used ring) of each virtqueue separately. The checking of a part is done by the

[Qemu-devel] [PATCH 41/55] virtio: Add queue interface to restore avail index from vring used index

2017-12-06 Thread Michael Roth
From: Maxime Coquelin In case of backend crash, it is not possible to restore internal avail index from the backend value as vhost_get_vring_base callback fails. This patch provides a new interface to restore internal avail index from the vring used index, as done by

[Qemu-devel] [PATCH 31/55] iotests: Add cluster_size=64k to 125

2017-12-06 Thread Michael Roth
From: Max Reitz Apparently it would be a good idea to test that, too. Signed-off-by: Max Reitz Message-id: 20171009215533.12530-4-mre...@redhat.com Reviewed-by: Eric Blake Reviewed-by: Jeff Cody Reviewed-by: Stefan

[Qemu-devel] [PATCH 48/55] nbd/server: CVE-2017-15119 Reject options larger than 32M

2017-12-06 Thread Michael Roth
From: Eric Blake The NBD spec gives us permission to abruptly disconnect on clients that send outrageously large option requests, rather than having to spend the time reading to the end of the option. No real option request requires that much data anyways; and meanwhile, we

[Qemu-devel] [PATCH 38/55] net: fix check for number of parameters to -netdev socket

2017-12-06 Thread Michael Roth
From: Jens Freimann Since commit 0f8c289ad "net: fix -netdev socket,fd= for UDP sockets" we allow more than one parameter for -netdev socket. But now we run into an assert when no parameter at all is specified > qemu-system-x86_64 -netdev socket socket.c:729:

[Qemu-devel] [PATCH 34/55] ppc: fix setting of compat mode

2017-12-06 Thread Michael Roth
From: Greg Kurz While trying to make KVM PR usable again, commit 5dfaa532ae introduced a regression: the current compat_pvr value is passed to KVM instead of the new one. This means that we always pass 0 instead of the max-cpu-compat PVR during the initial machine reset. And at

[Qemu-devel] [PATCH 45/55] scripts/make-release: ship u-boot source as a tarball

2017-12-06 Thread Michael Roth
The u-boot sources we ship currently cause problems with unpacking on a case-insensitive filesystem due to path conflicts. This has been fixed in upstream u-boot via commit 610eec7f, but since it is not yet included in an official release we implement this approach as a temporary workaround. Once

[Qemu-devel] [PATCH 03/55] block/mirror: check backing in bdrv_mirror_top_flush

2017-12-06 Thread Michael Roth
From: Vladimir Sementsov-Ogievskiy Backing may be zero after failed bdrv_append in mirror_start_job, which leads to SIGSEGV. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20170929152255.5431-1-vsement...@virtuozzo.com Signed-off-by:

[Qemu-devel] [PATCH 47/55] virtio-net: don't touch virtqueue if vm is stopped

2017-12-06 Thread Michael Roth
From: Jason Wang Guest state should not be touched if VM is stopped, unfortunately we didn't check running state and tried to drain tx queue unconditionally in virtio_net_set_status(). A crash was then noticed as a migration destination when user type quit after virtqueue

[Qemu-devel] [PATCH 28/55] hw/sd: fix out-of-bounds check for multi block reads

2017-12-06 Thread Michael Roth
From: Michael Olbrich The current code checks if the next block exceeds the size of the card. This generates an error while reading the last block of the card. Do the out-of-bounds check when starting to read a new block to fix this. This issue became visible with

[Qemu-devel] [PATCH 43/55] hw/ppc: clear pending_events on machine reset

2017-12-06 Thread Michael Roth
From: Daniel Henrique Barboza The sPAPR machine isn't clearing up the pending events QTAILQ on machine reboot. This allows for unprocessed hotplug/epow events to persist in the queue after reset and, when reasserting the IRQs in check_exception later on, these will

[Qemu-devel] [PATCH 40/55] util/stats64: Fix min/max comparisons

2017-12-06 Thread Michael Roth
From: Max Reitz stat64_min_slow() and stat64_max_slow() compare the wrong way. This makes iotest 136 fail with clang and -m32. Signed-off-by: Max Reitz Message-Id: <20171114232223.25207-1-mre...@redhat.com> Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 24/55] memory: Share special empty FlatView

2017-12-06 Thread Michael Roth
From: Alexey Kardashevskiy This shares an cached empty FlatView among address spaces. The empty FV is used every time when a root MR renders into a FV without memory sections which happens when MR or its children are not enabled or zero-sized. The empty_view is not NULL to keep

[Qemu-devel] [PATCH 44/55] spapr: reset DRCs after devices

2017-12-06 Thread Michael Roth
From: Greg Kurz A DRC with a pending unplug request releases its associated device at machine reset time. In the case of LMB, when all DRCs for a DIMM device have been reset, the DIMM gets unplugged, causing guest memory to disappear. This may be very confusing for anything

[Qemu-devel] [PATCH 39/55] nbd/client: Use error_prepend() correctly

2017-12-06 Thread Michael Roth
From: Eric Blake When using error prepend(), it is necessary to end with a space in the format string; otherwise, messages come out incorrectly, such as when connecting to a socket that hangs up immediately: can't open device nbd://localhost:10809/: Failed to read

[Qemu-devel] [PATCH 33/55] io: monitor encoutput buffer size from websocket GSource

2017-12-06 Thread Michael Roth
From: "Daniel P. Berrange" The websocket GSource is monitoring the size of the rawoutput buffer to determine if the channel can accepts more writes. The rawoutput buffer, however, is merely a temporary staging buffer before data is copied into the encoutput buffer. Thus its

[Qemu-devel] [PATCH 26/55] exec: simplify address_space_get_iotlb_entry

2017-12-06 Thread Michael Roth
From: Peter Xu This patch let address_space_get_iotlb_entry() to use the newly introduced page_mask parameter in flatview_do_translate(). Then we will be sure the IOTLB can be aligned to page mask, also we should nicely support huge pages now when introducing a764040. Fixes:

[Qemu-devel] [PATCH 35/55] translate.c: Fix usermode big-endian AArch32 LDREXD and STREXD

2017-12-06 Thread Michael Roth
From: Peter Maydell For AArch32 LDREXD and STREXD, architecturally the 32-bit word at the lowest address is always Rt and the one at addr+4 is Rt2, even if the CPU is big-endian. Our implementation does these with a single 64-bit store, so if we're big-endian then we

[Qemu-devel] [PATCH 36/55] hw/intc/arm_gicv3_its: Don't abort on table save failure

2017-12-06 Thread Michael Roth
From: Eric Auger The ITS is not fully properly reset at the moment. Caches are not emptied. After a reset, in case we attempt to save the state before the bound devices have registered their MSIs and after the 1st level table has been allocated by the ITS driver (device

[Qemu-devel] [PATCH 30/55] qcow2: Always execute preallocate() in a coroutine

2017-12-06 Thread Michael Roth
From: Max Reitz Some qcow2 functions (at least perform_cow()) expect s->lock to be taken. Therefore, if we want to make use of them, we should execute preallocate() (as "preallocate_co") in a coroutine so that we can use the qemu_co_mutex_* functions. Signed-off-by: Max

[Qemu-devel] [PATCH 18/55] memory: Share FlatView's and dispatch trees between address spaces

2017-12-06 Thread Michael Roth
From: Alexey Kardashevskiy This allows sharing flat views between address spaces (AS) when the same root memory region is used when creating a new address space. This is done by walking through all ASes and caching one FlatView per a physical root MR (i.e. not aliased). This

  1   2   3   >