Re: [RFC PATCH 0/2] riscv: Adding custom CSR related Kconfig options

2021-09-06 Thread Alistair Francis
On Mon, Sep 6, 2021 at 4:49 PM Ruinland ChuanTzu Tsai wrote: > > > Hi Alistair, > > Thanks for the heads up about the upcoming unification of RISC-V 32/64 > targets. > Yet I have several concerns and would like to have some brainstorming > regarding > such topics - - No worries, I'm happy to di

Re: [RFC PATCH 0/2] riscv: Adding custom CSR related Kconfig options

2021-09-06 Thread Ruinland ChuanTzu Tsai
Hi Alistair, So glad to hear from you. On Mon, Sep 06, 2021 at 05:05:16PM +1000, Alistair Francis wrote: > On Mon, Sep 6, 2021 at 4:49 PM Ruinland ChuanTzu Tsai > wrote: > > > > > > Hi Alistair, > > > > Thanks for the heads up about the upcoming unification of RISC-V 32/64 > > targets. > > Yet

Re: [RFC PATCH 0/2] riscv: Adding custom CSR related Kconfig options

2021-09-06 Thread Alistair Francis
On Mon, Sep 6, 2021 at 5:37 PM Ruinland ChuanTzu Tsai wrote: > > Hi Alistair, > > So glad to hear from you. > > On Mon, Sep 06, 2021 at 05:05:16PM +1000, Alistair Francis wrote: > > On Mon, Sep 6, 2021 at 4:49 PM Ruinland ChuanTzu Tsai > > wrote: > > > > > > > > > Hi Alistair, > > > > > > Thanks

Re: [PATCH 4/4] vl: Prioritize realizations of devices

2021-09-06 Thread Igor Mammedov
On Fri, 3 Sep 2021 12:03:06 -0400 Peter Xu wrote: > On Fri, Sep 03, 2021 at 03:00:05PM +0200, Igor Mammedov wrote: > > PS: > > Another, albeit machine depended approach to resolve IOMMU ordering problem > > can be adding to a specific machine pre_plug hook, an IOMMU handling. > > Which is called

Re: virtio "transitional devices"?

2021-09-06 Thread Daniel P . Berrangé
On Sun, Sep 05, 2021 at 01:47:48PM +, Alexander von Gluck IV wrote: > Could someone explain to me what virtio "transitional devices" are? > > https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/virtio-v1.1-cs01.html#x1-1020002 > > Are "Transitional devices" pre-1.0 specification? virtio devi

Re: [PATCH v3] hw/arm/aspeed: Add Fuji machine type

2021-09-06 Thread Philippe Mathieu-Daudé
On 9/5/21 8:55 PM, p...@fb.com wrote: > From: Peter Delevoryas > > This adds a new machine type "fuji-bmc" based on the following device tree: > > https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/aspeed-bmc-facebook-fuji.dts Sorry for being picky, but 'master' is a branch, not a

Re: [PATCH 4/4] vl: Prioritize realizations of devices

2021-09-06 Thread Eric Auger
Hi, On 8/25/21 6:23 AM, Jason Wang wrote: > On Tue, Aug 24, 2021 at 11:50 PM Peter Xu wrote: >> On Tue, Aug 24, 2021 at 10:52:24AM +0800, Jason Wang wrote: >>> It looks to me this doesn't solve the issue of using virtio-mmio with vhost? >> No IOMMU supported for any of the MMIO devices, right? O

Re: [PATCH] usb-storage: tag usb_msd_csw as packed struct

2021-09-06 Thread Philippe Mathieu-Daudé
On 9/6/21 6:55 AM, Gerd Hoffmann wrote: > Without this the struct has the wrong size: sizeof() evaluates > to 16 instead of 13. In most cases the bug is hidden by the > fact that guests submits a buffer which is exactly 13 bytes > long, so the padding added by the compiler is simply ignored. > >

Re: How does qemu detect the completion of interrupt execution?

2021-09-06 Thread Peter Maydell
On Mon, 6 Sept 2021 at 03:47, Duo jia wrote: > > Thank you for your explanation. > >> And finishing the execution of the interrupt routine will automatically >> allow a pending second interrupt to be taken immediately > > > I think this is a hardware feature. But how to achieve it with qemu That

[PATCH 1/3] tests/acpi: allow changes to DSDT.multi-bridge ACPI table blob for q35

2021-09-06 Thread Ani Sinha
We are adding a new unit test to cover the acpi hotplug support for multi-function bridges in q35 machines. This support was introduced with the following commit: d7346e614f4ec ("acpi: x86: pcihp: add support hotplug on multifunction bridges") The test uses a new table DSDT.multi-bridge. We need t

Add a unit test to exercize support for ACPI hotplug on multifunction bridges in q35

2021-09-06 Thread Ani Sinha
Hi Igor/Michael : Added a unit test to exercize the following commit : d7346e614f4ec353 ("acpi: x86: pcihp: add support hotplug on multifunction bridges") I had sent just the unit test earlier but since the review is getting delayed, I thought of sending the whole patch set which can be now re

Re: [PULL 00/35] pc,pci,virtio: fixes, cleanups

2021-09-06 Thread Peter Maydell
On Sat, 4 Sept 2021 at 22:36, Michael S. Tsirkin wrote: > > The following changes since commit 8880cc4362fde4ecdac0b2092318893118206fcf: > > Merge remote-tracking branch 'remotes/cschoenebeck/tags/pull-9p-20210902' > into staging (2021-09-03 08:27:38 +0100) > > are available in the Git reposito

[PATCH 2/3] tests/acpi/pcihp: add unit tests for hotplug on multifunction bridges for q35

2021-09-06 Thread Ani Sinha
commit d7346e614f4ec ("acpi: x86: pcihp: add support hotplug on multifunction bridges") added ACPI hotplug descriptions for cold plugged bridges for functions other than 0. For all other devices, the ACPI hotplug descriptions are limited to function 0 only. This change adds unit tests for this fea

[PATCH 3/3] tests/acpi: add DSDT binary blob for the unit test added in the previous commit

2021-09-06 Thread Ani Sinha
change 7feffbbf45 ("tests/acpi/pcihp: add unit tests for hotplug on multifunction bridges for q35") adds a new unit test to exercize multifunction bridge support in ACPI for q35. This change adds the ACPI DSDT table blob for this unit test. The changes that this unit test brings to the DSDT table

Re: [PULL 00/13] Testing, build system and misc patches

2021-09-06 Thread Thomas Huth
On 03/09/2021 18.49, Peter Maydell wrote: On Fri, 3 Sept 2021 at 17:37, Alex Bennée wrote: Thomas Huth writes: On 03/09/2021 15.22, Peter Maydell wrote: This provokes a new warning from meson on a linux-static build: Run-time dependency appleframeworks found: NO (tried framework) Library rt

Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need

2021-09-06 Thread Philippe Mathieu-Daudé
Hi Ani, On 9/4/21 11:36 PM, Michael S. Tsirkin wrote: > From: Ani Sinha > > Currently various acpi hotplug modules like cpu hotplug, memory hotplug, pci > hotplug, nvdimm hotplug are all pulled in when CONFIG_ACPI_X86 is turned on. > This brings in support for whole lot of subsystems that some t

Re: [PATCH v3 02/13] s390x/tcg: fix ignoring bit 63 when setting the storage key in SSKE

2021-09-06 Thread Thomas Huth
On 03/09/2021 17.55, David Hildenbrand wrote: Right now we could set an 8-bit storage key via SSKE and retrieve it again via ISKE, which is against the architecture description: SSKE: " The new seven-bit storage-key value, or selected bits thereof, is obtained from bit positions 56-62 of gen- er

Re: [PATCH v3 03/13] s390x/tcg: convert real to absolute address for RRBE, SSKE and ISKE

2021-09-06 Thread Thomas Huth
On 03/09/2021 17.55, David Hildenbrand wrote: For RRBE, SSKE, and ISKE, we're dealing with real addresses, so we have to convert to an absolute address first. In the future, when adding EDAT1 support, we'll have to pay attention to SSKE handling, as we'll be dealing with absolute addresses when

Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need

2021-09-06 Thread Ani Sinha
On Mon, 6 Sep 2021, Philippe Mathieu-Daudé wrote: > Hi Ani, > > On 9/4/21 11:36 PM, Michael S. Tsirkin wrote: > > From: Ani Sinha > > > > Currently various acpi hotplug modules like cpu hotplug, memory hotplug, pci > > hotplug, nvdimm hotplug are all pulled in when CONFIG_ACPI_X86 is turned on.

Re: [PATCH v3 12/13] hw/s390x/s390-skeys: rename skeys_enabled to skeys_are_enabled

2021-09-06 Thread Thomas Huth
On 03/09/2021 17.55, David Hildenbrand wrote: ... and make it return a bool instead. Signed-off-by: David Hildenbrand --- hw/s390x/s390-skeys-kvm.c | 4 ++-- hw/s390x/s390-skeys.c | 12 ++-- include/hw/s390x/storage-keys.h | 2 +- 3 files changed, 9 insertions(+),

Re: [PATCH v3 04/13] s390x/tcg: check for addressing exceptions for RRBE, SSKE and ISKE

2021-09-06 Thread Thomas Huth
On 03/09/2021 17.55, David Hildenbrand wrote: Let's replace the ram_size check by a proper physical address space check (for example, to prepare for memory hotplug), trigger addressing exceptions and trace the return value of the storage key getter/setter. Provide an helper mmu_absolute_addr_val

Re: [PATCH v3 11/13] hw/s390x/s390-skeys: check if an address is valid before dumping the key

2021-09-06 Thread Thomas Huth
On 03/09/2021 17.55, David Hildenbrand wrote: Let's validate the given address and report a proper error in case it's not. All call paths now properly check the validity of the given GFN. Remove the TODO. The errors inside the getter and setter should only trigger if something really goes wrong

Re: [PATCH v3 13/13] hw/s390x/s390-skeys: lazy storage key enablement under TCG

2021-09-06 Thread Thomas Huth
On 03/09/2021 17.55, David Hildenbrand wrote: Let's enable storage keys lazily under TCG, just as we do under KVM. Only fairly old Linux versions actually make use of storage keys, so it can be kind of wasteful to allocate quite some memory and track changes and references if nobody cares. We ha

Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need

2021-09-06 Thread Philippe Mathieu-Daudé
On 9/6/21 12:03 PM, Ani Sinha wrote: > On Mon, 6 Sep 2021, Philippe Mathieu-Daudé wrote: >> On 9/4/21 11:36 PM, Michael S. Tsirkin wrote: >>> From: Ani Sinha >>> >>> Currently various acpi hotplug modules like cpu hotplug, memory hotplug, pci >>> hotplug, nvdimm hotplug are all pulled in when CONF

[PATCH v3 1/3] hw/virtio: Comment virtqueue_flush() must be called with RCU read lock

2021-09-06 Thread Philippe Mathieu-Daudé
Reported-by: Stefano Garzarella Suggested-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- include/hw/virtio/virtio.h | 7 +++ hw/virtio/virtio.c | 1 + 2 files changed, 8 insertions(+) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 8bab9cfb

[PATCH v3 2/3] hw/virtio: Acquire RCU read lock in virtqueue_packed_drop_all()

2021-09-06 Thread Philippe Mathieu-Daudé
vring_get_region_caches() must be called with the RCU read lock acquired. virtqueue_packed_drop_all() does not, and uses the 'caches' pointer. Fix that by using the RCU_READ_LOCK_GUARD() macro. Reported-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio/virtio.c | 2 ++

[PATCH v3 3/3] hw/virtio: Have virtqueue_get_avail_bytes() pass caches arg to callees

2021-09-06 Thread Philippe Mathieu-Daudé
Both virtqueue_packed_get_avail_bytes() and virtqueue_split_get_avail_bytes() access the region cache, but their caller also does. Simplify by having virtqueue_get_avail_bytes calling both with RCU lock held, and passing the caches as argument. Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio

[PATCH v3 0/3] hw/virtio: Minor housekeeping patches

2021-09-06 Thread Philippe Mathieu-Daudé
Hi, This series contains few patches I gathered while tooking notes trying to understand issues #300-#302. Since v2: - Rebased on top of 88afdc92b64 ("Merge 'remotes/mst/tags/for_upstream' into staging") Since v1: - Added virtqueue_flush comment (Stefano) - Call RCU_READ_LOCK_GUARD in virtqueue

Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need

2021-09-06 Thread Ani Sinha
On Mon, Sep 6, 2021 at 3:54 PM Philippe Mathieu-Daudé wrote: > > On 9/6/21 12:03 PM, Ani Sinha wrote: > > On Mon, 6 Sep 2021, Philippe Mathieu-Daudé wrote: > >> On 9/4/21 11:36 PM, Michael S. Tsirkin wrote: > >>> From: Ani Sinha > >>> > >>> Currently various acpi hotplug modules like cpu hotplug,

[PULL v2 00/10] Testing, build system and misc patches

2021-09-06 Thread Thomas Huth
Hi Peter! The following changes since commit 31ebff513fad11f315377f6b07447169be8d9f86: Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-09-03' into staging (2021-09-04 19:21:19 +0100) are available in the Git repository at: https://gitlab.com/thuth/qemu.git tags/pull-reque

Re: [PATCH v3] qemu-sockets: fix unix socket path copy (again)

2021-09-06 Thread Michael Tokarev
03.09.2021 19:04, Marc-André Lureau wrote: [qemu-sockets.c unix path copy fix] Daniel or Michael, or someone else queued this already? Nope, at least not me. I can send a pull request with a single fix. Is it okay? /mjt

[PULL v2 06/10] configure / meson: Move the GBM handling to meson.build

2021-09-06 Thread Thomas Huth
The GBM library detection does not need to be in the configure script, since it does not have any user-facing options (there are no --enable-gbm or --disable-gbm switches). Let's move it to meson.build instead, so we don't have to clutter config-host.mak with the related switches. Additionally, on

Re: [PATCH v3] qemu-sockets: fix unix socket path copy (again)

2021-09-06 Thread Philippe Mathieu-Daudé
On 9/6/21 1:25 PM, Michael Tokarev wrote: > 03.09.2021 19:04, Marc-André Lureau wrote: > [qemu-sockets.c unix path copy fix] > >> Daniel or Michael, or someone else queued this already? > > Nope, at least not me. I can send a pull request with a > single fix. Is it okay? Certainly, but you could

Re: [PULL v2 06/10] configure / meson: Move the GBM handling to meson.build

2021-09-06 Thread Peter Maydell
On Mon, 6 Sept 2021 at 12:30, Thomas Huth wrote: > > The GBM library detection does not need to be in the configure script, > since it does not have any user-facing options (there are no > --enable-gbm or --disable-gbm switches). Let's move it to meson.build > instead, so we don't have to clutter

Re: [PATCH v3] qemu-sockets: fix unix socket path copy (again)

2021-09-06 Thread Michael Tokarev
06.09.2021 14:34, Philippe Mathieu-Daudé wrote: Certainly, but you could also pick the latest patches sent to qemu-trivial@ already reviewed ;) I haven't done this in years..

Re: [PATCH 1/2] chardev: Propagate error from logfile opening

2021-09-06 Thread Michal Prívozník
On 8/17/21 11:54 AM, Marc-André Lureau wrote: > On Tue, Aug 17, 2021 at 12:56 PM Michal Privoznik > wrote: > >> If a chardev has a logfile the file is opened using >> qemu_open_old() which does the job, but since @errp is not >> propagated into qemu_open_internal() we lose much more accurate >> e

Re: [PATCH v2 01/35] acpi: add helper routines to initialize ACPI tables

2021-09-06 Thread Igor Mammedov
On Sat, 4 Sep 2021 15:57:52 -0400 "Michael S. Tsirkin" wrote: > On Fri, Sep 03, 2021 at 09:12:21AM +0200, Igor Mammedov wrote: > > On Thu, 2 Sep 2021 14:56:00 +0200 > > Eric Auger wrote: > > > > > Hi Igor, > > > > > > On 7/8/21 5:45 PM, Igor Mammedov wrote: > > > > Patch introduces acpi_in

Re: [PATCH v2 01/35] acpi: add helper routines to initialize ACPI tables

2021-09-06 Thread Igor Mammedov
On Fri, 3 Sep 2021 09:22:10 +0200 Eric Auger wrote: > Hi Igor, > > On 9/3/21 9:12 AM, Igor Mammedov wrote: > > On Thu, 2 Sep 2021 14:56:00 +0200 > > Eric Auger wrote: > > > >> Hi Igor, > >> > >> On 7/8/21 5:45 PM, Igor Mammedov wrote: > >>> Patch introduces acpi_init_table()/acpi_table_com

[PATCH] docs/devel: memory: Document MemoryRegionOps requirement

2021-09-06 Thread Bin Meng
It's been a requirement that at least one function pointer for read and one for write are provided ever since the MemoryRegion APIs were introduced in 2012. Signed-off-by: Bin Meng --- docs/devel/memory.rst | 5 + 1 file changed, 5 insertions(+) diff --git a/docs/devel/memory.rst b/docs/de

Re: [PATCH] docs/devel: memory: Document MemoryRegionOps requirement

2021-09-06 Thread David Hildenbrand
On 06.09.21 14:20, Bin Meng wrote: It's been a requirement that at least one function pointer for read and one for write are provided ever since the MemoryRegion APIs were introduced in 2012. Signed-off-by: Bin Meng --- docs/devel/memory.rst | 5 + 1 file changed, 5 insertions(+) diff

[PATCH v2 0/3] hw/arm/virt_acpi_build: Generate DBG2 table

2021-09-06 Thread Eric Auger
This series generates the ACPI DBG2 table along with machvirt. It applies on top of Igor's [PATCH v2 00/35] acpi: refactor error prone build_header() and packed structures usage in ACPI tables The DBG2 specification can be found at https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/

[PATCH v2 1/3] tests/acpi: Add void table for virt/DBG2 bios-tables-test

2021-09-06 Thread Eric Auger
Add placeholders for DBG2 reference table for virt tests and ignore this later for the time being. Signed-off-by: Eric Auger --- tests/data/acpi/virt/DBG2 | 0 tests/qtest/bios-tables-test-allowed-diff.h | 1 + 2 files changed, 1 insertion(+) create mode 100644 tests/data/acpi

[PATCH v2 2/3] bios-tables-test: Generate reference table for virt/DBG2

2021-09-06 Thread Eric Auger
Add the DBG2 table generated with tests/data/acpi/rebuild-expected-aml.sh Signed-off-by: Eric Auger --- Tested by comparing the content with the table generated by EDK2 along with the SBSA-REF machine (code generated by DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c). I reuse

[PATCH v2 3/3] hw/arm/virt_acpi_build: Generate DBG2 table

2021-09-06 Thread Eric Auger
ARM SBBR specification mandates DBG2 table (Debug Port Table 2). this latter allows to describe one or more debug ports. Generate an DBG2 table featuring a single debug port, the PL011. The DBG2 specification can be found at: https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/acpi-

Re: [PATCH v7 5/7] qapi/qdev.json: add DEVICE_UNPLUG_GUEST_ERROR QAPI event

2021-09-06 Thread Daniel Henrique Barboza
On 9/4/21 8:49 AM, Markus Armbruster wrote: David Gibson writes: On Wed, Sep 01, 2021 at 03:19:26PM +0200, Markus Armbruster wrote: Daniel Henrique Barboza writes: At this moment we only provide one event to report a hotunplug error, MEM_UNPLUG_ERROR. As of Linux kernel 5.12 and QEMU 6.

Re: [PATCH v2 25/35] acpi: arm/virt: madt: use build_append_int_noprefix() API to compose MADT table

2021-09-06 Thread Igor Mammedov
On Fri, 3 Sep 2021 15:45:00 +0200 Eric Auger wrote: > Hi Igor, > On 7/8/21 5:46 PM, Igor Mammedov wrote: > > Drop usage of packed structures and explicit endian conversions > > when building MADT table for arm/x86 and use endian agnostic > > build_append_int_noprefix() API to build it. > > > > S

Re: [PATCH v2 1/8] acpi: Add VIOT structure definitions

2021-09-06 Thread Eric Auger
Hi Jean, On 9/3/21 4:32 PM, Jean-Philippe Brucker wrote: > The ACPI Virtual I/O Translation table (VIOT) table describes I/O > topology for paravirtual devices. At the moment it describes the > relation between virtio-iommu devices and their endpoints. Add the > structure definitions for VIOT. I

Re: configure / meson: Move the GBM handling to meson.build

2021-09-06 Thread Thomas Huth
On 06/09/2021 13.37, Peter Maydell wrote: On Mon, 6 Sept 2021 at 12:30, Thomas Huth wrote: The GBM library detection does not need to be in the configure script, since it does not have any user-facing options (there are no --enable-gbm or --disable-gbm switches). Let's move it to meson.build i

Re: configure / meson: Move the GBM handling to meson.build

2021-09-06 Thread Marc-André Lureau
Hi On Mon, Sep 6, 2021 at 4:49 PM Thomas Huth wrote: > On 06/09/2021 13.37, Peter Maydell wrote: > > On Mon, 6 Sept 2021 at 12:30, Thomas Huth wrote: > >> > >> The GBM library detection does not need to be in the configure script, > >> since it does not have any user-facing options (there are n

Re: [PATCH v2 2/8] hw/acpi: Add VIOT table

2021-09-06 Thread Eric Auger
Hi Jean, On 9/3/21 4:32 PM, Jean-Philippe Brucker wrote: > Add a function that generates a Virtual I/O Translation table (VIOT), > describing the topology of paravirtual IOMMUs. The table is created when > instantiating a virtio-iommu device. It contains a virtio-iommu node and > PCI Range nodes f

Re: [PATCH] docs/devel: memory: Document MemoryRegionOps requirement

2021-09-06 Thread Philippe Mathieu-Daudé
On 9/6/21 2:20 PM, Bin Meng wrote: > It's been a requirement that at least one function pointer for read > and one for write are provided ever since the MemoryRegion APIs were > introduced in 2012. > > Signed-off-by: Bin Meng > --- > > docs/devel/memory.rst | 5 + > 1 file changed, 5 insert

[PULL 12/36] i386: Add 'sgx-epc' device to expose EPC sections to guest

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson SGX EPC is enumerated through CPUID, i.e. EPC "devices" need to be realized prior to realizing the vCPUs themselves, which occurs long before generic devices are parsed and realized. Because of this, do not allow 'sgx-epc' devices to be instantiated after vCPUS have bee

[PULL 03/36] target/i386: Moved int_ctl into CPUX86State structure

2021-09-06 Thread Paolo Bonzini
From: Lara Lazier Moved int_ctl into the CPUX86State structure. It removes some unnecessary stores and loads, and prepares for tracking the vIRQ state even when it is masked due to vGIF. Signed-off-by: Lara Lazier Signed-off-by: Paolo Bonzini --- slirp| 2 +-

[PULL 00/36] (Mostly) x86 changes for 2021-09-06

2021-09-06 Thread Paolo Bonzini
The following changes since commit 31ebff513fad11f315377f6b07447169be8d9f86: Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-09-03' into staging (2021-09-04 19:21:19 +0100) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for yo

[PULL 01/36] target/i386: VMRUN and VMLOAD canonicalizations

2021-09-06 Thread Paolo Bonzini
From: Lara Lazier APM2 requires that VMRUN and VMLOAD canonicalize (sign extend to 63 from 48/57) all base addresses in the segment registers that have been respectively loaded. Signed-off-by: Lara Lazier Message-Id: <20210804113058.45186-1-laramglaz...@gmail.com> Signed-off-by: Paolo Bonzini

[PULL 05/36] target/i386: Added ignore TPR check in ctl_has_irq

2021-09-06 Thread Paolo Bonzini
From: Lara Lazier The APM2 states that if V_IGN_TPR is nonzero, the current virtual interrupt ignores the (virtual) TPR. Signed-off-by: Lara Lazier Signed-off-by: Paolo Bonzini --- target/i386/tcg/sysemu/svm_helper.c | 5 + 1 file changed, 5 insertions(+) diff --git a/target/i386/tcg/sys

[PULL 11/36] qom: Add memory-backend-epc ObjectOptions support

2021-09-06 Thread Paolo Bonzini
From: Yang Zhong Add the new 'memory-backend-epc' user creatable QOM object in the ObjectOptions to support SGX since v6.1, or the sgx backend object cannot bootup. Signed-off-by: Yang Zhong v1-->v2: - Added the new MemoryBackendEpcProperties and related documents, and updated the blur

[PULL 02/36] target/i386: Added VGIF feature

2021-09-06 Thread Paolo Bonzini
From: Lara Lazier VGIF allows STGI and CLGI to execute in guest mode and control virtual interrupts in guest mode. When the VGIF feature is enabled then: * executing STGI in the guest sets bit 9 of the VMCB offset 60h. * executing CLGI in the guest clears bit 9 of the VMCB offset 60h. Signed-o

[PULL 04/36] target/i386: Added VGIF V_IRQ masking capability

2021-09-06 Thread Paolo Bonzini
From: Lara Lazier VGIF provides masking capability for when virtual interrupts are taken. (APM2) Signed-off-by: Lara Lazier Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 7 +-- target/i386/cpu.h | 2 ++ target/i386/tcg/sysemu/svm_helper.c | 12

[PULL 08/36] configure / meson: Move the GBM handling to meson.build

2021-09-06 Thread Paolo Bonzini
From: Thomas Huth The GBM library detection does not need to be in the configure script, since it does not have any user-facing options (there are no --enable-gbm or --disable-gbm switches). Let's move it to meson.build instead, so we don't have to clutter config-host.mak with the related switche

[PULL 20/36] i386: Update SGX CPUID info according to hardware/KVM/user input

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson Expose SGX to the guest if and only if KVM is enabled and supports virtualization of SGX. While the majority of ENCLS can be emulated to some degree, because SGX uses a hardware-based root of trust, the attestation aspects of SGX cannot be emulated in software, i.e. ult

[PULL 07/36] target/i386: Added vVMLOAD and vVMSAVE feature

2021-09-06 Thread Paolo Bonzini
From: Lara Lazier The feature allows the VMSAVE and VMLOAD instructions to execute in guest mode without causing a VMEXIT. (APM2 15.33.1) Signed-off-by: Lara Lazier Signed-off-by: Paolo Bonzini --- target/i386/cpu.h| 2 ++ target/i386/svm.h| 2 ++ ta

[PULL 06/36] target/i386: Added changed priority check for VIRQ

2021-09-06 Thread Paolo Bonzini
From: Lara Lazier Writes to cr8 affect v_tpr. This could set or unset an interrupt request as the priority might have changed. Signed-off-by: Lara Lazier Signed-off-by: Paolo Bonzini --- target/i386/cpu.h| 15 +++ target/i386/tcg/sysemu/misc_helper.c | 7 +

[PULL 17/36] i386: Add SGX CPUID leaf FEAT_SGX_12_1_EAX

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson CPUID leaf 12_1_EAX is an Intel-defined feature bits leaf enumerating the platform's SGX capabilities that may be utilized by an enclave, e.g. whether or not an enclave can gain access to the provision key. Currently there are six capabilities: - INIT: set when the e

[PULL 09/36] memory: Add RAM_PROTECTED flag to skip IOMMU mappings

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson Add a new RAMBlock flag to denote "protected" memory, i.e. memory that looks and acts like RAM but is inaccessible via normal mechanisms, including DMA. Use the flag to skip protected memory regions when mapping RAM for DMA in VFIO. Signed-off-by: Sean Christopherson

[PULL 10/36] hostmem: Add hostmem-epc as a backend for SGX EPC

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson EPC (Enclave Page Cahe) is a specialized type of memory used by Intel SGX (Software Guard Extensions). The SDM desribes EPC as: The Enclave Page Cache (EPC) is the secure storage used to store enclave pages when they are a part of an executing enclave. For an

[PULL 23/36] Adjust min CPUID level to 0x12 when SGX is enabled

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson SGX capabilities are enumerated through CPUID_0x12. Signed-off-by: Sean Christopherson Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-16-yang.zh...@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 5 + 1 file changed, 5 insertions(+)

[PULL 13/36] vl: Add sgx compound properties to expose SGX EPC sections to guest

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson Because SGX EPC is enumerated through CPUID, EPC "devices" need to be realized prior to realizing the vCPUs themselves, i.e. long before generic devices are parsed and realized. From a virtualization perspective, the CPUID aspect also means that EPC sections cannot be h

[PULL 19/36] i386: Add feature control MSR dependency when SGX is enabled

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson SGX adds multiple flags to FEATURE_CONTROL to enable SGX and Flexible Launch Control. Signed-off-by: Sean Christopherson Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-12-yang.zh...@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c | 5 +

[PULL 15/36] i386: Add SGX CPUID leaf FEAT_SGX_12_0_EAX

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson CPUID leaf 12_0_EAX is an Intel-defined feature bits leaf enumerating the CPU's SGX capabilities, e.g. supported SGX instruction sets. Currently there are four enumerated capabilities: - SGX1 instruction set, i.e. "base" SGX - SGX2 instruction set for dynamic EP

[PULL 28/36] q35: Add support for SGX EPC

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson Enable SGX EPC virtualization, which is currently only support by KVM. Signed-off-by: Sean Christopherson Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-21-yang.zh...@intel.com> Signed-off-by: Paolo Bonzini --- hw/i386/pc_q35.c | 3 +++ 1 file changed,

[PULL 21/36] i386: kvm: Add support for exposing PROVISIONKEY to guest

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson If the guest want to fully use SGX, the guest needs to be able to access provisioning key. Add a new KVM_CAP_SGX_ATTRIBUTE to KVM to support provisioning key to KVM guests. Signed-off-by: Sean Christopherson Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-

[PULL 14/36] i386: Add primary SGX CPUID and MSR defines

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson Add CPUID defines for SGX and SGX Launch Control (LC), as well as defines for their associated FEATURE_CONTROL MSR bits. Define the Launch Enclave Public Key Hash MSRs (LE Hash MSRs), which exist when SGX LC is present (in CPUID), and are writable when SGX LC is enabled

[PULL 22/36] i386: Propagate SGX CPUID sub-leafs to KVM

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson The SGX sub-leafs are enumerated at CPUID 0x12. Indices 0 and 1 are always present when SGX is supported, and enumerate SGX features and capabilities. Indices >=2 are directly correlated with the platform's EPC sections. Because the number of EPC sections is dynamic a

[PULL 33/36] hostmem-epc: Make prealloc consistent with qemu cmdline during reset

2021-09-06 Thread Paolo Bonzini
From: Yang Zhong If qemu cmdline set the prealloc property for sgx epc and VM do the reset the prealloc property will be different with cmdline settings. This patch can make sure same prealloc property setting with cmdline. Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-26-yang.zh.

[PULL 24/36] hw/i386/fw_cfg: Set SGX bits in feature control fw_cfg accordingly

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson Request SGX an SGX Launch Control to be enabled in FEATURE_CONTROL when the features are exposed to the guest. Our design is the SGX Launch Control bit will be unconditionally set in FEATURE_CONTROL, which is unlike host bios. Signed-off-by: Sean Christopherson Signed-

[PULL 34/36] Kconfig: Add CONFIG_SGX support

2021-09-06 Thread Paolo Bonzini
From: Yang Zhong Add new CONFIG_SGX for sgx support in the Qemu, and the Kconfig default enable sgx in the i386 platform. Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-32-yang.zh...@intel.com> Signed-off-by: Paolo Bonzini --- backends/meson.build | 2 +- con

[PULL 16/36] i386: Add SGX CPUID leaf FEAT_SGX_12_0_EBX

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson CPUID leaf 12_0_EBX is an Intel-defined feature bits leaf enumerating the platform's SGX extended capabilities. Currently there is a single capabilitiy: - EXINFO: record information about #PFs and #GPs in the enclave's SSA Signed-off-by: Sean Christopherson Signed

[PULL 25/36] hw/i386/pc: Account for SGX EPC sections when calculating device memory

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson Add helpers to detect if SGX EPC exists above 4g, and if so, where SGX EPC above 4g ends. Use the helpers to adjust the device memory range if SGX EPC exists above 4g. For multiple virtual EPC sections, we just put them together physically contiguous for the simplicity

[PULL 26/36] i386/pc: Add e820 entry for SGX EPC section(s)

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson Note that SGX EPC is currently guaranteed to reside in a single contiguous chunk of memory regardless of the number of EPC sections. Signed-off-by: Sean Christopherson Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-19-yang.zh...@intel.com> Signed-off-by:

[PULL 18/36] i386: Add get/set/migrate support for SGX_LEPUBKEYHASH MSRs

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson On real hardware, on systems that supports SGX Launch Control, those MSRs are initialized to digest of Intel's signing key; on systems that don't support SGX Launch Control, those MSRs are not available but hardware always uses digest of Intel's signing key in EINIT. KV

[PULL 29/36] i440fx: Add support for SGX EPC

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson Enable SGX EPC virtualization, which is currently only support by KVM. Signed-off-by: Sean Christopherson Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-22-yang.zh...@intel.com> Signed-off-by: Paolo Bonzini --- hw/i386/pc_piix.c | 4 1 file changed

Re: [PATCH v3] hw/arm/aspeed: Add Fuji machine type

2021-09-06 Thread Peter Delevoryas
> On Sep 6, 2021, at 2:15 AM, Philippe Mathieu-Daudé wrote: > > On 9/5/21 8:55 PM, p...@fb.com wrote: >> From: Peter Delevoryas >> >> This adds a new machine type "fuji-bmc" based on the following device tree: >> >> https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/aspeed-bmc-fa

[PULL 30/36] hostmem-epc: Add the reset interface for EPC backend reset

2021-09-06 Thread Paolo Bonzini
From: Yang Zhong Add the sgx_memory_backend_reset() interface to handle EPC backend reset when VM is reset. This reset function will destroy previous backend memory region and re-mmap the EPC section for guest. Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-23-yang.zh...@intel.com>

[PULL 27/36] i386: acpi: Add SGX EPC entry to ACPI tables

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson The ACPI Device entry for SGX EPC is essentially a hack whose primary purpose is to provide software with a way to autoprobe SGX support, e.g. to allow software to implement SGX support as a driver. Details on the individual EPC sections are not enumerated through ACPI

[PULL 36/36] doc: Add the SGX doc

2021-09-06 Thread Paolo Bonzini
From: Sean Christopherson Signed-off-by: Sean Christopherson Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-34-yang.zh...@intel.com> Signed-off-by: Paolo Bonzini --- docs/intel-sgx.txt | 167 + 1 file changed, 167 insertions(+) create

[PULL 31/36] sgx-epc: Add the reset interface for sgx-epc virt device

2021-09-06 Thread Paolo Bonzini
From: Yang Zhong If the VM is reset, we need make sure sgx virt epc in clean status. Once the VM is reset, and sgx epc virt device will be reseted by reset callback registered by qemu_register_reset(). Since this epc virt device depend on backend, this reset will call backend reset interface to r

Re: [PATCH v4 00/33] Qemu SGX virtualization

2021-09-06 Thread Paolo Bonzini
Hi, the monitor patches did not pass the test-hmp qtest, and also they should be in target/i386/monitor.c (see other commands that were implemented there for SEV). However, I've sent a pull request with the rest. Thanks, Paolo On Mon, Jul 19, 2021 at 1:27 PM Yang Zhong wrote: > > Since Sean C

[PULL 32/36] sgx-epc: Avoid bios reset during sgx epc initialization

2021-09-06 Thread Paolo Bonzini
From: Yang Zhong Since bios do the reset when qemu boot up, and sgx epc will be reset by the registered reset callback function. Like this, the sgx epc will do two times initialization. This patch will check protected mode from cr0 register, and will bypass reset operation from bios. The reset ca

[PATCH v2 1/1] hw/arm/aspeed: Initialize AST2600 UART clock selection registers

2021-09-06 Thread pdel
From: Peter Delevoryas UART5 is typically used as the default debug UART on the AST2600, but UART1 is also designed to be a debug UART. All the AST2600 UART's have semi-configurable clock rates through registers in the System Control Unit (SCU), but only UART5 works out of the box with zero-initi

[PULL 35/36] sgx-epc: Add the fill_device_info() callback support

2021-09-06 Thread Paolo Bonzini
From: Yang Zhong Since there is no fill_device_info() callback support, and when we execute "info memory-devices" command in the monitor, the segfault will be found. This patch will add this callback support and "info memory-devices" will show sgx epc memory exposed to guest. The result as below

[PATCH v2 0/1] hw/arm/aspeed: Initialize AST2600 UART clock selection registers

2021-09-06 Thread pdel
From: Peter Delevoryas After fixing some commit log issues in another patch: https://lore.kernel.org/qemu-devel/2f2f44c6-4817-4d58-a7a0-496446ac7...@fb.com/ I noticed that I had similar issues in another patch I submitted: https://lore.kernel.org/qemu-devel/20210831142502.279485-1-p...@fb.com/

[PATCH v2] Prevent vhost-user-blk-test hang

2021-09-06 Thread Raphael Norwitz
In the vhost-user-blk-test, as of now there is nothing stoping vhost-user-blk in QEMU writing to the socket right after forking off the storage daemon before it has a chance to come up properly, leaving the test hanging forever. This intermittently hanging test has caused QEMU automation failures r

[PATCH v4] hw/arm/aspeed: Add Fuji machine type

2021-09-06 Thread pdel
From: Peter Delevoryas This adds a new machine type "fuji-bmc" based on the following device tree: https://github.com/torvalds/linux/blob/40cb6373b46/arch/arm/boot/dts/aspeed-bmc-facebook-fuji.dts Most of the i2c devices are not there, they're added here: https://github.com/facebook/openbmc/bl

Re: [PULL 08/36] configure / meson: Move the GBM handling to meson.build

2021-09-06 Thread Thomas Huth
On 06/09/2021 15.10, Paolo Bonzini wrote: From: Thomas Huth The GBM library detection does not need to be in the configure script, since it does not have any user-facing options (there are no --enable-gbm or --disable-gbm switches). Let's move it to meson.build instead, so we don't have to clut

Re: [PULL v2 00/10] Testing, build system and misc patches

2021-09-06 Thread Peter Maydell
On Mon, 6 Sept 2021 at 12:29, Thomas Huth wrote: > > Hi Peter! > > The following changes since commit 31ebff513fad11f315377f6b07447169be8d9f86: > > Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-09-03' > into staging (2021-09-04 19:21:19 +0100) > > are available in the Git re

Re: [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread

2021-09-06 Thread Stefano Garzarella
Ping :-) Looks like it went into the crack during feature freeze, should I resend it? On Tue, Jul 27, 2021 at 04:59:34PM +0200, Stefano Garzarella wrote: We recently added a new parameter (aio-max-batch) to IOThread. This series cleans up the code a bit, no functional changes. Stefano Garzarel

Re: [PULL 00/36] (Mostly) x86 changes for 2021-09-06

2021-09-06 Thread Peter Maydell
On Mon, 6 Sept 2021 at 14:13, Paolo Bonzini wrote: > > The following changes since commit 31ebff513fad11f315377f6b07447169be8d9f86: > > Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-09-03' > into staging (2021-09-04 19:21:19 +0100) > > are available in the Git repository at:

Re: [PATCH 0/2] iothread: cleanup after adding a new parameter to IOThread

2021-09-06 Thread Philippe Mathieu-Daudé
On 7/27/21 4:59 PM, Stefano Garzarella wrote: > We recently added a new parameter (aio-max-batch) to IOThread. > This series cleans up the code a bit, no functional changes. > > Stefano Garzarella (2): > iothread: rename PollParamInfo to IOThreadParamInfo > iothread: use IOThreadParamInfo in i

Re: [PULL 18/28] file-posix: try BLKSECTGET on block devices too, do not round to power of 2

2021-09-06 Thread Halil Pasic
On Fri, 25 Jun 2021 16:18:12 +0200 Paolo Bonzini wrote: > bs->sg is only true for character devices, but block devices can also > be used with scsi-block and scsi-generic. Unfortunately BLKSECTGET > returns bytes in an int for /dev/sgN devices, and sectors in a short > for block devices, so acco

  1   2   3   >