[PATCH v7 4/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-08-16 Thread Sam Li
By adding zone management operations in BlockDriver, storage controller emulation can use the new block layer APIs including Report Zone and four zone management operations (open, close, finish, reset). Add zoned storage commands of the device: zone_report(zrp), zone_open(zo), zone_close(zc),

Re: [RFC PATCH v4 18/36] i386/tdx: Skip BIOS shadowing setup

2022-08-16 Thread Gerd Hoffmann
On Fri, Jul 29, 2022 at 03:14:02PM +0800, Xiaoyao Li wrote: > On 5/30/2022 7:49 PM, Gerd Hoffmann wrote: > > On Thu, May 26, 2022 at 10:48:56AM +0800, Xiaoyao Li wrote: > > > On 5/24/2022 3:08 PM, Gerd Hoffmann wrote: > > > > On Thu, May 12, 2022 at 11:17:45AM +0800, Xiaoyao Li wrote: > > > > >

Re: [PATCH v12 2/6] target/riscv: Simplify counter predicate function

2022-08-16 Thread Atish Kumar Patra
On Mon, Aug 15, 2022 at 12:54 AM Andrew Jones wrote: > On Tue, Aug 02, 2022 at 04:33:03PM -0700, Atish Patra wrote: > > All the hpmcounters and the fixed counters (CY, IR, TM) can be > represented > > as a unified counter. Thus, the predicate function doesn't need handle > each > > case

Re: [PATCH] RFC: char: deprecate usage of bidirectional pipe

2022-08-16 Thread Gerd Hoffmann
On Tue, Jul 26, 2022 at 09:44:25AM +0100, Daniel P. Berrangé wrote: > On Tue, Jul 26, 2022 at 12:32:32PM +0400, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > As Ed Swierk explained back in 2006: > > https://lists.nongnu.org/archive/html/qemu-devel/2006-12/msg00160.html >

[PATCH] target/hppa: Fix proberi instruction emulation for linux-user

2022-08-16 Thread Helge Deller
The proberi assembler instruction checks the read/write access rights for the page of a given address and shall return a value of 1 if the test succeeds and a value of 0 on failure in the target register. But when run in linux-user mode, qemu currently simply returns the return code of

Re: [PATCH 15/22] hw/intc/ppc-uic: Convert ppc-uic to a PPC4xx DCR device

2022-08-16 Thread Cédric Le Goater
On 8/13/22 17:34, BALATON Zoltan wrote: Make ppc-uic a subclass of ppc4xx-dcr-device which will handle the cpu link and make it uniform with the other PPC4xx devices. Reviewed-by: Cédric Le Goater Thanks, C. Signed-off-by: BALATON Zoltan --- hw/intc/ppc-uic.c | 26

Re: [PATCH v5 05/18] dump: Rework filter area variables

2022-08-16 Thread Marc-André Lureau
Hi On Thu, Aug 11, 2022 at 4:12 PM Janosch Frank wrote: > > While the DumpState begin and length variables directly mirror the API > variable names they are not very descriptive. So let's add a > "filter_area_" prefix and make has_filter a function checking length > 0. > > Signed-off-by: Janosch

Re: [PATCH 00/24] Support VIRTIO_F_RING_RESET for virtio-net, vhost-user, vhost-kernel in virtio pci-modern

2022-08-16 Thread Michael S. Tsirkin
On Tue, Aug 16, 2022 at 09:06:12AM +0800, Kangjie Xu wrote: > The virtio queue reset function has already been defined in the virtio spec > 1.2. > The relevant virtio spec information is here: > > https://github.com/oasis-tcs/virtio-spec/issues/124 >

[PATCH v7 0/8] Add support for zoned device

2022-08-16 Thread Sam Li
Zoned Block Devices (ZBDs) devide the LBA space to block regions called zones that are larger than the LBA size. It can only allow sequential writes, which reduces write amplification in SSD, leading to higher throughput and increased capacity. More details about ZBDs can be found at:

[PATCH v7 6/8] config: add check to block layer

2022-08-16 Thread Sam Li
Putting zoned/non-zoned BlockDrivers on top of each other is not allowed. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- block.c | 14 ++ block/raw-format.c | 1 + include/block/block_int-common.h | 5 + 3 files changed, 20

[PATCH v7 1/8] include: add zoned device structs

2022-08-16 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- include/block/block-common.h | 43 1 file changed, 43 insertions(+) diff --git a/include/block/block-common.h b/include/block/block-common.h index fdb7306e78..36bd0e480e 100644 ---

[PATCH v7 2/8] file-posix: introduce get_sysfs_str_val for device zoned model

2022-08-16 Thread Sam Li
Use sysfs attribute files to get the string value of device zoned model. Then get_sysfs_zoned_model can convert it to BlockZoneModel type in QEMU. Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke --- block/file-posix.c | 93 ++--

[PATCH v7 7/8] qemu-iotests: test new zone operations

2022-08-16 Thread Sam Li
We have added new block layer APIs of zoned block devices. Test it with: Create a null_blk device, run each zone operation on it and see whether reporting right zone information. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- tests/qemu-iotests/tests/zoned.out | 53 ++

[PATCH v7 5/8] raw-format: add zone operations to pass through requests

2022-08-16 Thread Sam Li
raw-format driver usually sits on top of file-posix driver. It needs to pass through requests of zone commands. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- block/raw-format.c | 13 + 1 file changed, 13 insertions(+) diff --git a/block/raw-format.c b/block/raw-format.c

Re: [RFC v2 00/10] Introduce an extensible static analyzer

2022-08-16 Thread Marc-André Lureau
Hi On Fri, Aug 12, 2022 at 7:49 PM Alberto Faria wrote: > > On Thu, Aug 4, 2022 at 12:44 PM Marc-André Lureau > wrote: > > On fc36, I had several dependencies I needed to install manually (imho > > they should have been pulled by python3-clang), but more annoyingly I > > got: > >

Re: [RFC PATCH v4 18/36] i386/tdx: Skip BIOS shadowing setup

2022-08-16 Thread Gerd Hoffmann
Hi, > I did some tracing for this, and the result differs for q35 machine type and > pc machine type. > > - For q35, the memslot update for isa-bios/pc.rom happens when mc->reset() > that is triggered via > > qdev_machine_creation_done() > -> qemu_system_reset(SHUTDOWN_CASE_NONE); > >

Re: [PATCH 01/22] ppc/ppc4xx: Introduce a DCR device model

2022-08-16 Thread Cédric Le Goater
On 8/13/22 17:34, BALATON Zoltan wrote: From: Cédric Le Goater The Device Control Registers (DCR) of on-SoC devices are accessed by software through the use of the mtdcr and mfdcr instructions. These are converted in transactions on a side band bus, the DCR bus, which connects the on-SoC

Re: [PATCH 13/22] ppc4xx: Move EBC model to ppc4xx_devs.c

2022-08-16 Thread Cédric Le Goater
On 8/13/22 17:34, BALATON Zoltan wrote: The EBC is shared between 405 and 440 so move it to shared file. Should we rename the device to Ppc4xxEbcState ? Thanks, C. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc405.h | 15 hw/ppc/ppc405_uc.c | 191

Re: [PATCH 20/22] hw/ppc/Kconfig: Move imply before select

2022-08-16 Thread Cédric Le Goater
On 8/13/22 17:34, BALATON Zoltan wrote: In pegasos2 section move imply before select to match other sections. Reviewed-by: Cédric Le Goater Thanks, C. Signed-off-by: BALATON Zoltan --- hw/ppc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/Kconfig

Re: [PATCH] ui/console: fix qemu_console_resize() regression

2022-08-16 Thread Gerd Hoffmann
> > >> diff --git a/ui/console.c b/ui/console.c > > >> index e139f7115e1f..765892f84f1c 100644 > > >> --- a/ui/console.c > > >> +++ b/ui/console.c > > >> @@ -2575,11 +2575,13 @@ static void vc_chr_open(Chardev *chr, > > >> void qemu_console_resize(QemuConsole *s, int width, int height) > > >>

Re: [PATCH v5 01/18] dump: Replace opaque DumpState pointer with a typed one

2022-08-16 Thread Marc-André Lureau
On Thu, Aug 11, 2022 at 4:13 PM Janosch Frank wrote: > > It's always better to convey the type of a pointer if at all > possible. So let's add the DumpState typedef to typedefs.h and move > the dump note functions from the opaque pointers to DumpState > pointers. > > Signed-off-by: Janosch Frank

Re: [PATCH 18/22] ppc405: Move machine specific code to ppc405_boards.c

2022-08-16 Thread Cédric Le Goater
On 8/13/22 17:34, BALATON Zoltan wrote: These are only used by tha board code so move out from the shared SoC s/tha/the/ model and put it in the boards file. Reviewed-by: Cédric Le Goater Thanks, C. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc405.h| 38 -

Re: Bluetooth support in QEMU

2022-08-16 Thread vaishu venkat
Thomas, Sure will try with the USB Passthrough. Do you have any thoughts on accessing the wireless interface inside the QEMU. Thanks in Anticipation. Regards, Vaishnavi On Tue, Aug 16, 2022 at 11:27 AM Thomas Huth wrote: > On 16/08/2022 06.22, vaishu venkat wrote: > > Hi Thomas, > > > >

Re: [PATCH 00/24] Support VIRTIO_F_RING_RESET for virtio-net, vhost-user, vhost-kernel in virtio pci-modern

2022-08-16 Thread Michael S. Tsirkin
On Tue, Aug 16, 2022 at 02:15:57PM +0800, Xuan Zhuo wrote: > On Tue, 16 Aug 2022 02:14:10 -0400, "Michael S. Tsirkin" > wrote: > > On Tue, Aug 16, 2022 at 09:06:12AM +0800, Kangjie Xu wrote: > > > The virtio queue reset function has already been defined in the virtio > > > spec 1.2. > > > The

[PATCH v7 3/8] file-posix: introduce get_sysfs_long_val for the long sysfs attribute

2022-08-16 Thread Sam Li
Use sysfs attribute files to get the long value of zoned device information. Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke Reviewed-by: Stefan Hajnoczi --- block/file-posix.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/block/file-posix.c

[PATCH v7 8/8] docs/zoned-storage: add zoned device documentation

2022-08-16 Thread Sam Li
Add the documentation about the zoned device support to virtio-blk emulation. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- docs/devel/zoned-storage.rst | 41 ++ docs/system/qemu-block-drivers.rst.inc | 6 2 files changed, 47 insertions(+)

Re: [PATCH 12/22] ppc4xx: Move PLB model to ppc4xx_devs.c

2022-08-16 Thread Cédric Le Goater
On 8/13/22 17:34, BALATON Zoltan wrote: The PLB is shared between 405 and 440 so move it to the shared file. Should we rename the device to Ppc4xxPlbState ? Thanks, C. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc405.h | 11 - hw/ppc/ppc405_uc.c | 93

Re: [PATCH 19/22] hw/ppc/Kconfig: Remove PPC405 dependency from sam460ex

2022-08-16 Thread Cédric Le Goater
On 8/13/22 17:34, BALATON Zoltan wrote: Now that shared PPC4xx devices are separated from PPC405 ones we can drop this depencency. Reviewed-by: Cédric Le Goater Thanks, C. Signed-off-by: BALATON Zoltan --- hw/ppc/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git

Re: [PATCH v5 03/18] dump: Refactor dump_iterate and introduce dump_filter_memblock_*()

2022-08-16 Thread Marc-André Lureau
On Thu, Aug 11, 2022 at 4:12 PM Janosch Frank wrote: > > The iteration over the memblocks in dump_iterate() is hard to > understand so it's about time to clean it up. Instead of manually > grabbing the next memblock we can use QTAILQ_FOREACH to iterate over > all memblocks. > > Additionally we

Re: [PATCH v5 07/18] dump: Split elf header functions into prepare and write

2022-08-16 Thread Marc-André Lureau
On Thu, Aug 11, 2022 at 4:29 PM Janosch Frank wrote: > Let's split the write from the modification of the elf header so we > can consolidate the write of the data in one function. > > Signed-off-by: Janosch Frank > Reviewed-by: Marc-André Lureau > --- > dump/dump.c | 100

Re: [PATCH v5 08/18] dump: Rename write_elf*_phdr_note to prepare_elf*_phdr_note

2022-08-16 Thread Marc-André Lureau
On Thu, Aug 11, 2022 at 4:43 PM Janosch Frank wrote: > The functions in question do not actually write to the file descriptor > they set up a buffer which is later written to the fd. > > Signed-off-by: Janosch Frank > Reviewed-by: Marc-André Lureau --- > dump/dump.c | 8 > 1 file

Re: [PATCH] hw/usb/hcd-xhci: Fix endless loop in case the DMA access fails (CVE-2020-14394)

2022-08-16 Thread Thomas Huth
On 16/08/2022 10.37, Gerd Hoffmann wrote: On Thu, Aug 04, 2022 at 01:43:14PM +0200, Thomas Huth wrote: On 04/08/2022 12.17, Peter Maydell wrote: That sounds like we do still have an unbounded-loop problem, then: there's no limit on the number of consecutive TRBs we try to read in that

Re: [PATCH v2 for-7.1] hw/usb/hcd-xhci: Fix unbounded loop in xhci_ring_chain_length() (CVE-2020-14394)

2022-08-16 Thread Gerd Hoffmann
> + > +/* > + * According to the xHCI spec, Transfer Ring segments should have > + * a maximum size of 64 kB (see chapter "6 Data Structures") > + */ > +} while (length < TRB_LINK_LIMIT * 65536 / TRB_SIZE); Acked-by: Gerd Hoffmann take care, Gerd

Re: [PATCH] acpi_ged: Add ospm_status hook implementation

2022-08-16 Thread Peter Maydell
On Tue, 16 Aug 2022 at 10:26, Keqian Zhu wrote: > > This fixes a bug that causes segmentation fault with following dumpstack: > #1 0xab64235c in qmp_query_acpi_ospm_status > (errp=errp@entry=0xf030) at ../monitor/qmp-cmds.c:312 > #2 0xabfc4e20 in

[PATCH v3] xio3130_upstream: Add ACS, Access Control Services, capability

2022-08-16 Thread Paul Schlacter
v2 -> v3: - Add the missing code in V2. v1 -> v2: - Allow ACS to be disabled. - Suggested by Michael S. Tsirkin, use disable-acs to set property. v1: - Add ACS (Access Control Services) capability. If it is a pcie device, check that all devices on the path from the device to the root complex

Re: [PATCH] hw/riscv: microchip_pfsoc: fix kernel panics due to missing peripherals

2022-08-16 Thread Conor.Dooley
On 16/08/2022 01:40, Philippe Mathieu-Daudé wrote: > [You don't often get email from f4...@amsat.org. Learn why this is important > at https://aka.ms/LearnAboutSenderIdentification ] > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > Hi Conor,

[PATCH v3 1/2] virtio: Add shared memory capability

2022-08-16 Thread Antonio Caggiano
From: "Dr. David Alan Gilbert" Define a new capability type 'VIRTIO_PCI_CAP_SHARED_MEMORY_CFG' and the data structure 'virtio_pci_shm_cap' to go with it. They allow defining shared memory regions with sizes and offsets of 2^32 and more. Multiple instances of the capability are allowed and

Re: [PATCH 3/7] target/m68k: Honour -semihosting-config userspace=on

2022-08-16 Thread Laurent Vivier
Le 15/08/2022 à 21:02, Peter Maydell a écrit : Honour the commandline -semihosting-config userspace=on option, instead of never permitting userspace semihosting calls in system emulation mode, by passing the correct value to the is_userspace argument of semihosting_enabled(), instead of manually

Re: [PATCH] [PATCH] linux-user/aarch64: Reset target data on MADV_DONTNEED

2022-08-16 Thread Alex Bennée
Laurent Vivier writes: > Le 11/08/2022 à 17:18, Alex Bennée a écrit : >> Laurent Vivier writes: >> >>> Le 11/08/2022 à 13:54, Peter Maydell a écrit : On Thu, 11 Aug 2022 at 09:29, Laurent Vivier wrote: > > Le 10/08/2022 à 22:47, Richard Henderson a écrit : >> On 8/10/22

[PATCH] virtio-crypto: support asynchronous mode

2022-08-16 Thread Lei He
virtio-crypto: Modify the current interface of virtio-crypto device to support asynchronous mode. Signed-off-by: lei he --- backends/cryptodev-builtin.c| 69 ++--- backends/cryptodev-vhost-user.c | 51 +-- backends/cryptodev.c| 44 +++--- hw/virtio/virtio-crypto.c

Re: [PATCH v2] hw/i386: place setup_data at fixed place in memory

2022-08-16 Thread Gerd Hoffmann
Hi, > > We can make setup_data chaining work with OVMF, but the whole chain > > should be located in a GPA range that OVMF dictates. > > It sounds like what you describe is pretty OVMF-specific though, > right? Do we want to tie things together so tightly like that? > > Given we only need 48

[PATCH v2] xio3130_upstream: Add ACS (Access Control Services) capability

2022-08-16 Thread Paul Schlacter
v1 -> v2: - Allow ACS to be disabled. - Suggested by Michael S. Tsirkin, use disable-acs to set property. v1: - Add ACS (Access Control Services) capability. If it is a pcie device, check that all devices on the path from the device to the root complex have ACS enabled, and then the device

Re: [PATCH 01/22] ppc/ppc4xx: Introduce a DCR device model

2022-08-16 Thread BALATON Zoltan
On Tue, 16 Aug 2022, Cédric Le Goater wrote: On 8/13/22 17:34, BALATON Zoltan wrote: From: Cédric Le Goater The Device Control Registers (DCR) of on-SoC devices are accessed by software through the use of the mtdcr and mfdcr instructions. These are converted in transactions on a side band

Re: [PATCH 12/22] ppc4xx: Move PLB model to ppc4xx_devs.c

2022-08-16 Thread BALATON Zoltan
On Tue, 16 Aug 2022, Cédric Le Goater wrote: On 8/13/22 17:34, BALATON Zoltan wrote: The PLB is shared between 405 and 440 so move it to the shared file. Should we rename the device to Ppc4xxPlbState ? I could do that (also for the other one moved). Ptobably nothing in these boards care

答复: [PATCH] acpi_ged: Add ospm_status hook implementation

2022-08-16 Thread zhukeqian via
Hi Peter, Setup an ARM virtual machine of machine virt and execute qmp "query-acpi-ospm-status" can trigger this bug. Thanks. -邮件原件- 发件人: Qemu-devel [mailto:qemu-devel-bounces+zhukeqian1=huawei@nongnu.org] 代表 Peter Maydell 发送时间: 2022年8月16日 17:30 收件人: zhukeqian 抄送:

Re: [PATCH] acpi_ged: Add ospm_status hook implementation

2022-08-16 Thread Peter Maydell
On Tue, 16 Aug 2022 at 10:40, zhukeqian wrote: > > Hi Peter, > > Setup an ARM virtual machine of machine virt and execute qmp > "query-acpi-ospm-status" can trigger this bug. Thanks. That is worth stating in the commit message, I think. -- PMm

[PATCH v3 2/2] virtio-gpu: hostmem

2022-08-16 Thread Antonio Caggiano
From: Gerd Hoffmann Use VIRTIO_GPU_SHM_ID_HOST_VISIBLE as id for virtio-gpu. v2: Formatting fixes Signed-off-by: Antonio Caggiano Acked-by: Michael S. Tsirkin --- hw/display/virtio-gpu-pci.c| 15 +++ hw/display/virtio-gpu.c| 1 + hw/display/virtio-vga.c| 33

答复: [PATCH] acpi_ged: Add ospm_status hook implementation

2022-08-16 Thread zhukeqian via
OK, I'll send v2 soon. -邮件原件- 发件人: Peter Maydell [mailto:peter.mayd...@linaro.org] 发送时间: 2022年8月16日 17:42 收件人: zhukeqian 抄送: qemu-devel@nongnu.org; qemu-...@nongnu.org; qemu-triv...@nongnu.org; Philippe Mathieu-Daudé ; Eric Auger ; Peter Xu ; Igor Mammedov ; Wanghaibin (D) 主题: Re:

[PULL 2/2] hw/usb/hcd-xhci: Fix unbounded loop in xhci_ring_chain_length() (CVE-2020-14394)

2022-08-16 Thread Thomas Huth
The loop condition in xhci_ring_chain_length() is under control of the guest, and additionally the code does not check for failed DMA transfers (e.g. if reaching the end of the RAM), so the loop there could run for a very long time or even forever. Fix it by checking the return value of

Re: Teensy 4.1 Implementation

2022-08-16 Thread Alex Bennée
Shiny Saana writes: > Thank you very much for your answer! > > Apologies if I mess up the process of communicating via mailing lists, > it's my first time communicating via this channel. Don't worry about it - mailing lists are absolutely a good place to discuss things ahead of time. I

[PULL 0/2] Two small fixes for QEMU 7.1-rc3

2022-08-16 Thread Thomas Huth
Hi Richard! Two minor fixes for rc3. If this is too late for rc3, please feel free to ignore, I think they are not severe enough to justify an rc4 later. The following changes since commit d102b8162a1e5fe8288d4d5c01801ce6536ac2d1: Merge tag 'pull-la-20220814' of

Re: Teensy 4.1 Implementation

2022-08-16 Thread Peter Maydell
On Tue, 16 Aug 2022 at 10:59, Alex Bennée wrote: > Shiny Saana writes: > > I personally don't need any of the GPIO interfaces, but if needed > > by someone else, that could be a good second step to > > work on once that part of the board is implemented. > > Handling GPIOs in QEMU is fine (we

[RFC PATCH 2/2] kvm/kvm-all.c: listener should delay kvm_vm_ioctl to the commit phase

2022-08-16 Thread Emanuele Giuseppe Esposito
Instead of sending a single ioctl every time ->region_* or ->log_* callbacks are called, "queue" all memory regions in a list that will be emptied only when committing. This allow the KVM kernel API to be extended and support multiple memslots updates in a single call. Signed-off-by: Emanuele

[RFC PATCH 0/2] accel/kvm: extend kvm memory listener to support

2022-08-16 Thread Emanuele Giuseppe Esposito
The aim of this serie is to prepare kvm memory listener to support atomic memslots update. In order to do that, QEMU should take care of sending all memslot updates in a single ioctl, so that they can all be processed atomically. In order to do that, implement kml->begin() and kml->commit()

Re: [PATCH] [PATCH] linux-user/aarch64: Reset target data on MADV_DONTNEED

2022-08-16 Thread Laurent Vivier
Le 16/08/2022 à 10:41, Alex Bennée a écrit : Laurent Vivier writes: Le 11/08/2022 à 17:18, Alex Bennée a écrit : Laurent Vivier writes: Le 11/08/2022 à 13:54, Peter Maydell a écrit : On Thu, 11 Aug 2022 at 09:29, Laurent Vivier wrote: Le 10/08/2022 à 22:47, Richard Henderson a écrit

Re: [PATCH] hw/usb/hcd-xhci: Fix endless loop in case the DMA access fails (CVE-2020-14394)

2022-08-16 Thread Gerd Hoffmann
On Thu, Aug 04, 2022 at 01:43:14PM +0200, Thomas Huth wrote: > On 04/08/2022 12.17, Peter Maydell wrote: > > That sounds like we do still have an unbounded-loop problem, > > then: there's no limit on the number of consecutive TRBs > > we try to read in that function. Maybe we're missing an > >

Re: [PATCH v5 09/18] dump: Use a buffer for ELF section data and headers

2022-08-16 Thread Marc-André Lureau
Hi On Thu, Aug 11, 2022 at 4:16 PM Janosch Frank wrote: > Currently we're writing the NULL section header if we overflow the > physical header number in the ELF header. But in the future we'll add > custom section headers AND section data. > > To facilitate this we need to rearange section

Re: [PATCH 1/7] semihosting: Allow optional use of semihosting from userspace

2022-08-16 Thread Alex Bennée
Peter Maydell writes: > Currently our semihosting implementations generally prohibit use of > semihosting calls in system emulation from the guest userspace. This > is a very long standing behaviour justified originally "to provide > some semblance of security" (since code with access to the

[PATCH] acpi_ged: Add ospm_status hook implementation

2022-08-16 Thread Keqian Zhu via
This fixes a bug that causes segmentation fault with following dumpstack: #1 0xab64235c in qmp_query_acpi_ospm_status (errp=errp@entry=0xf030) at ../monitor/qmp-cmds.c:312 #2 0xabfc4e20 in qmp_marshal_query_acpi_ospm_status (args=, ret=0xea4ffe90,

[PATCH v2] hw/acpi: Add ospm_status hook implementation for acpi-ged

2022-08-16 Thread Keqian Zhu via
Setup an ARM virtual machine of machine virt and execute qmp "query-acpi-ospm-status" causes segmentation fault with following dumpstack: #1 0xab64235c in qmp_query_acpi_ospm_status (errp=errp@entry=0xf030) at ../monitor/qmp-cmds.c:312 #2 0xabfc4e20 in

[PATCH v3 0/2] virtio-gpu: Shared memory capability

2022-08-16 Thread Antonio Caggiano
Previously part of [0], now a patch series on its own. This patch series cherry picks two commits from [1] and applies one fix according to [2], which should answer Gerd's comment [3] on previous patch. v2: Squash patch #3 into patch #2, and formatting fixes to patch #1. v3: Reverse commits

[PULL 1/2] tests/qtest: misc tweaks to readconfig

2022-08-16 Thread Thomas Huth
From: Daniel P. Berrangé The property name parameter is ignored when visiting a top level type, but the obvious typo should be fixed to avoid confusion. A few indentation issues were tidied up. We can break out of the loop when finding the RNG device. Finally, close the temp FD immediately when

[RFC PATCH 1/2] softmmu/memory: add missing begin/commit callback calls

2022-08-16 Thread Emanuele Giuseppe Esposito
kvm listeners now need ->commit callback in order to actually send the ioctl to the hypervisor. Therefore, add missing callers around address_space_set_flatview(), which in turn calls address_space_update_topology_pass() which calls ->region_* and ->log_* callbacks. Using

Re: [PATCH v2] xio3130_upstream: Add ACS (Access Control Services) capability

2022-08-16 Thread Michael S. Tsirkin
On Tue, Aug 16, 2022 at 05:16:38PM +0800, Paul Schlacter wrote: > v1 -> v2: > - Allow ACS to be disabled. > - Suggested by Michael S. Tsirkin, use disable-acs to set property. > > v1: > - Add ACS (Access Control Services) capability. changelog generally after --- > > If it is a pcie device,

Re: [PATCH 4/4] hw/nvme: add MSI-x mask handlers for irqfd

2022-08-16 Thread Klaus Jensen
On Aug 11 23:37, Jinhao Fan wrote: > When irqfd is enabled, we bypass QEMU's irq emulation and let KVM to > directly assert the irq. However, KVM is not aware of the device's MSI-x > masking status. Add MSI-x mask bookkeeping in NVMe emulation and > detach the corresponding irqfd when the certain

Re: [PATCH 01/22] ppc/ppc4xx: Introduce a DCR device model

2022-08-16 Thread Cédric Le Goater
On 8/16/22 11:33, BALATON Zoltan wrote: On Tue, 16 Aug 2022, Cédric Le Goater wrote: On 8/13/22 17:34, BALATON Zoltan wrote: From: Cédric Le Goater The Device Control Registers (DCR) of on-SoC devices are accessed by software through the use of the mtdcr and mfdcr instructions. These are

Re: [PATCH 2/4] hw/nvme: add option to (de)assert irq with eventfd

2022-08-16 Thread Klaus Jensen
On Aug 11 23:37, Jinhao Fan wrote: > When the new option 'irq-eventfd' is turned on, the IO emulation code > signals an eventfd when it want to (de)assert an irq. The main loop > eventfd handler does the actual irq (de)assertion. This paves the way > for iothread support since QEMU's interrupt

Re: [PATCH 2/2] hw/mips/boston: Pack fdt in fdt filter

2022-08-16 Thread Jiaxun Yang
> 2022年8月16日 01:44,Philippe Mathieu-Daudé 写道: > > On 13/8/22 18:27, Jiaxun Yang wrote: >> FDT can be awfully fat after series of modifications in fdt >> filter. Just pack it up before add to ram. >> Signed-off-by: Jiaxun Yang >> --- >> hw/mips/boston.c | 1 + >> 1 file changed, 1

KVM Forum gpg key signing

2022-08-16 Thread Peter Maydell
Hi; we haven't had an in-person KVM Forum for a while. This seems like a good opportunity for people who are or who expect to be submitting pull requests to get their GPG key signed, if it's not been signed by anybody else yet or it's a bit low on signatures. If that's you, and you're planning to

[PULL for 7.1 0/3] memory leak and testing tweaks

2022-08-16 Thread Alex Bennée
The following changes since commit d102b8162a1e5fe8288d4d5c01801ce6536ac2d1: Merge tag 'pull-la-20220814' of https://gitlab.com/rth7680/qemu into staging (2022-08-14 08:48:11 -0500) are available in the Git repository at: https://github.com/stsquad/qemu.git tags/pull-for-7.1-fixes-160822-1

[PULL 2/3] tests/avocado: add timeout to the aspeed tests

2022-08-16 Thread Alex Bennée
On some systems the test can hang. At least defining a timeout stops it from hanging forever. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220811151413.3350684-7-alex.ben...@linaro.org> diff --git a/tests/avocado/machine_aspeed.py

[PULL 1/3] linux-user: un-parent OBJECT(cpu) when closing thread

2022-08-16 Thread Alex Bennée
While forcing the CPU to unrealize by hand does trigger the clean-up code we never fully free resources because refcount never reaches zero. This is because QOM automatically added objects without an explicit parent to /unattached/, incrementing the refcount. Instead of manually triggering

[PULL 3/3] tests/avocado: apply a band aid to aspeed-evb login

2022-08-16 Thread Alex Bennée
This is really a limitation of the underlying console code which doesn't allow us to detect the login: and following "#" prompts because it reads input line wise. By adding a small delay we ensure that the login prompt has appeared so we don't accidentally spaff the shell commands to a confused

Re: [PATCH 21/22] ppc4xx: Drop empty default cases

2022-08-16 Thread Cédric Le Goater
On 8/13/22 17:34, BALATON Zoltan wrote: Remove default case labels that do nothing or only there to set a default value that could easily be done at the variable definition instead. May be instead, the default case labels deserve a LOG_GUEST_ERROR or a UNIMP or even g_assert_not_reached() ?

Re: [PATCH 00/22] QOMify PPC4xx devices and minor clean ups

2022-08-16 Thread Cédric Le Goater
On 8/13/22 17:34, BALATON Zoltan wrote: Hello, This is mased on gitlab.com/danielhb/qemu/tree/ppc-7.2 This series contains the rest of Cédric's patches modified according my review comments and some other small clean ups I've noticed along the way. I've kept the From line of Cédric for patches

Re: [PATCH v2] ppc/pnv: Add initial P9/10 SBE model

2022-08-16 Thread Daniel Henrique Barboza
On 8/11/22 06:37, Nicholas Piggin wrote: The SBE (Self Boot Engine) are on-chip microcontrollers that perform early boot steps, as well as provide some runtime facilities (e.g., timer, secure register access, MPIPL). The latter facilities are accessed mostly via a message system called

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-08-16 Thread Gupta, Pankaj
Hi Chao, Actually the current version allows you to delay the allocation to a later time (e.g. page fault time) if you don't call fallocate() on the private fd. fallocate() is necessary in previous versions because we treat the existense in the fd as 'private' but in this version we track

Re: [PATCH 21/22] ppc4xx: Drop empty default cases

2022-08-16 Thread BALATON Zoltan
On Tue, 16 Aug 2022, Cédric Le Goater wrote: On 8/13/22 17:34, BALATON Zoltan wrote: Remove default case labels that do nothing or only there to set a default value that could easily be done at the variable definition instead. May be instead, the default case labels deserve a LOG_GUEST_ERROR

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-08-16 Thread Kirill A . Shutemov
On Tue, Aug 16, 2022 at 01:33:00PM +0200, Gupta, Pankaj wrote: > Hi Chao, > > > > > Actually the current version allows you to delay the allocation to a > > later time (e.g. page fault time) if you don't call fallocate() on the > > private fd. fallocate() is necessary in previous versions

Re: [PULL 2/3] tests/avocado: add timeout to the aspeed tests

2022-08-16 Thread Peter Maydell
On Tue, 16 Aug 2022 at 13:26, Alex Bennée wrote: > > On some systems the test can hang. At least defining a timeout stops > it from hanging forever. Aha. Yeah, I've seen this test hang forever sometimes. Is there some place (in the superclass??) that we can put a default timeout that applies to

Re: [PATCH v10 18/21] job.c: enable job lock/unlock and remove Aiocontext locks

2022-08-16 Thread Emanuele Giuseppe Esposito
Am 27/07/2022 um 17:53 schrieb Vladimir Sementsov-Ogievskiy: >>    * job_lock: >> @@ -672,7 +673,7 @@ void job_user_cancel_locked(Job *job, bool force, >> Error **errp); >>    * Returns the return value from the job if the job actually completed >>    * during the call, or -ECANCELED if it was

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-08-16 Thread Gupta, Pankaj
Actually the current version allows you to delay the allocation to a later time (e.g. page fault time) if you don't call fallocate() on the private fd. fallocate() is necessary in previous versions because we treat the existense in the fd as 'private' but in this version we track

Re: [PATCH v3 0/8] parallels: Refactor the code of images checks and fix a bug

2022-08-16 Thread Denis V. Lunev
On 15.08.2022 11:02, Alexander Ivanov wrote: Fix image inflation when offset in BAT is out of image. Replace whole BAT syncing by flushing only dirty blocks. Move all the checks outside the main check function in separate functions Use WITH_QEMU_LOCK_GUARD for simplier code. Alexander

Re: [PATCH v10 17/21] blockjob: protect iostatus field in BlockJob struct

2022-08-16 Thread Emanuele Giuseppe Esposito
Am 27/07/2022 um 17:29 schrieb Vladimir Sementsov-Ogievskiy: > On 7/25/22 10:38, Emanuele Giuseppe Esposito wrote: >> iostatus is the only field (together with .job) that needs >> protection using the job mutex. >> >> It is set in the main loop (GLOBAL_STATE functions) but read >> in I/O code

Re: [PATCH v2] xio3130_upstream: Add ACS (Access Control Services) capability

2022-08-16 Thread Paul Schlacter
On Tue, Aug 16, 2022 at 6:11 PM Michael S. Tsirkin wrote: > > On Tue, Aug 16, 2022 at 05:16:38PM +0800, Paul Schlacter wrote: > > v1 -> v2: > > - Allow ACS to be disabled. > > - Suggested by Michael S. Tsirkin, use disable-acs to set property. > > > > v1: > > - Add ACS (Access Control Services)

Re: [PATCH v10 18/21] job.c: enable job lock/unlock and remove Aiocontext locks

2022-08-16 Thread Emanuele Giuseppe Esposito
> >>   } >> @@ -501,8 +481,12 @@ void job_unref_locked(Job *job)>   >> assert(!job->txn); >>     if (job->driver->free) { >> +    AioContext *aio_context = job->aio_context; >>   job_unlock(); >> +    /* FIXME: aiocontext lock is required because cb

Re: [PULL 2/3] tests/avocado: add timeout to the aspeed tests

2022-08-16 Thread Alex Bennée
Peter Maydell writes: > On Tue, 16 Aug 2022 at 13:26, Alex Bennée wrote: >> >> On some systems the test can hang. At least defining a timeout stops >> it from hanging forever. > > Aha. Yeah, I've seen this test hang forever sometimes. > > Is there some place (in the superclass??) that we can

[RFC PATCH] tests/avocado: push default timeout to QemuBaseTest

2022-08-16 Thread Alex Bennée
All of the QEMU tests eventually end up derrived from this class. Move the default timeout from LinuxTest to ensure we catch them all. Signed-off-by: Alex Bennée --- tests/avocado/avocado_qemu/__init__.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

Re: qemu-system-aarch64: Failed to retrieve host CPU features

2022-08-16 Thread Peter Maydell
On Sat, 13 Aug 2022 at 14:32, Marc Zyngier wrote: > But we probably need to handle EINTR when creating the mini VM. It's easy enough to add a retry-on-EINTR loop to the KVM_CREATE_VM ioctl in the target/arm/ code. But do we need to do that more widely ? At the moment QEMU seems to assume that

Re: [PULL 2/3] tests/avocado: add timeout to the aspeed tests

2022-08-16 Thread Peter Maydell
On Tue, 16 Aug 2022 at 14:34, Alex Bennée wrote: > Peter Maydell writes: > > Is there some place (in the superclass??) that we can put a > > default timeout that applies to *all* avocado tests, so we > > don't have the risk of forgetting it in a particular test? > > It's a bit muddy. Most tests

Re: [RFC v3 7/8] blkio: implement BDRV_REQ_REGISTERED_BUF optimization

2022-08-16 Thread Stefan Hajnoczi
On Tue, Jul 12, 2022 at 04:28:02PM +0200, Stefano Garzarella wrote: > On Fri, Jul 08, 2022 at 05:17:36AM +0100, Stefan Hajnoczi wrote: > > Avoid bounce buffers when QEMUIOVector elements are within previously > > registered bdrv_register_buf() buffers. > > > > The idea is that emulated storage

Re: [RFC v3 8/8] virtio-blk: use BDRV_REQ_REGISTERED_BUF optimization hint

2022-08-16 Thread Stefan Hajnoczi
On Thu, Jul 14, 2022 at 12:16:16PM +0200, Hanna Reitz wrote: > On 08.07.22 06:17, Stefan Hajnoczi wrote: > > Register guest RAM using BlockRAMRegistrar and set the > > BDRV_REQ_REGISTERED_BUF flag so block drivers can optimize memory > > accesses in I/O requests. > > > > This is for vdpa-blk,

[PATCH v2 33/33] target/arm: Enable TARGET_TB_PCREL

2022-08-16 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/cpu-param.h | 2 ++ target/arm/translate.h | 6 target/arm/cpu.c | 23 +++--- target/arm/translate-a64.c | 37 ++- target/arm/translate.c | 62 ++ 5 files

[PATCH v2 18/33] accel/tcg: Add fast path for translator_ld*

2022-08-16 Thread Richard Henderson
Cache the translation from guest to host address, so we may use direct loads when we hit on the primary translation page. Look up the second translation page only once, during translation. This obviates another lookup of the second page within tb_gen_code after translation. Fixes a bug in that

[PATCH v2 25/33] target/arm: Introduce curr_insn_len

2022-08-16 Thread Richard Henderson
A simple helper to retrieve the length of the current insn. Signed-off-by: Richard Henderson --- target/arm/translate.h | 5 + target/arm/translate-vfp.c | 2 +- target/arm/translate.c | 5 ++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/target/arm/translate.h

Re: [PATCH v12 0/6] Improve PMU support

2022-08-16 Thread Atish Kumar Patra
On Sun, Aug 14, 2022 at 5:02 PM Alistair Francis wrote: > On Fri, Aug 12, 2022 at 12:05 PM Atish Patra > wrote: > > > > On Tue, Aug 2, 2022 at 4:33 PM Atish Patra wrote: > > > > > > The latest version of the SBI specification includes a Performance > Monitoring > > > Unit(PMU) extension[1]

[PATCH v2 26/33] target/arm: Change gen_goto_tb to work on displacements

2022-08-16 Thread Richard Henderson
In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 40 -- target/arm/translate.c | 10 ++ 2 files changed, 27 insertions(+), 23 deletions(-) diff --git

[PATCH v2 19/33] accel/tcg: Use DisasContextBase in plugin_gen_tb_start

2022-08-16 Thread Richard Henderson
Use the pc coming from db->pc_first rather than the TB. Use the cached host_addr rather than re-computing for the first page. We still need a separate lookup for the second page because it won't be computed for DisasContextBase until the translator actually performs a read from the page.

Re: [PATCH for-7.2 00/21] accel/tcg: minimize tlb lookups during translate + user-only PROT_EXEC fixes

2022-08-16 Thread Ilya Leoshkevich
On Fri, 2022-08-12 at 11:07 -0700, Richard Henderson wrote: > This is part of a larger body of work, but in the process of > reorganizing I was reminded that PROT_EXEC wasn't being enforced > properly for user-only.  As this has come up in the context of > some of Ilya's patches, I thought I'd go

[PATCH v2 04/33] linux-user: Honor PT_GNU_STACK

2022-08-16 Thread Richard Henderson
Map the stack executable if required by default or on demand. Signed-off-by: Richard Henderson --- include/elf.h| 1 + linux-user/qemu.h| 1 + linux-user/elfload.c | 19 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/elf.h

  1   2   3   >