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

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: > > clang.cindex.Li

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); > > I

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 device

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 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 b/

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 a/hw/ppc/Kconf

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 >

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 separatel

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

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 - hw/ppc/ppc40

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 mov

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

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

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 13:3

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 function.

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 handl

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

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 b

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

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

[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, errp=0xea4ffe8

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 qmp_marshal_query_acpi

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 bus,

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 abo

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

答复: [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 抄送: qemu-devel@nongn

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 +

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

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

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

答复: [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: [P

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

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

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 have

[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 https://gitlab.com/rth7680/qem

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 suspect

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

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, che

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

[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() callba

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 v

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

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() ? C.

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

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 SBEFIFO

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 priva

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 insertion(+

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 o

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

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 because

[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 b/tests/avocado/machine_aspeed.

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

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

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 c

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 private/shared

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 Ivanov

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 (b

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) ca

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 ca

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 p

[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 a/tests/avocado/avoca

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 KVM

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 a

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 con

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, vhos

Re: [PATCH v10 10/21] block/mirror.c: use of job helpers in drivers to avoid TOC/TOU

2022-08-16 Thread Emanuele Giuseppe Esposito
Am 04/08/2022 um 18:35 schrieb Kevin Wolf: > Am 25.07.2022 um 09:38 hat Emanuele Giuseppe Esposito geschrieben: >> Once job lock is used and aiocontext is removed, mirror has >> to perform job operations under the same critical section, >> using the helpers prepared in previous commit. >> >> Not

Re: [PATCH v10 11/21] jobs: group together API calls under the same job lock

2022-08-16 Thread Emanuele Giuseppe Esposito
Am 04/08/2022 um 19:10 schrieb Kevin Wolf: > Am 25.07.2022 um 09:38 hat Emanuele Giuseppe Esposito geschrieben: >> Now that the API offers also _locked() functions, take advantage >> of it and give also the caller control to take the lock and call >> _locked functions. >> >> This makes sense esp

Re: [PATCH v10 12/21] commit and mirror: create new nodes using bdrv_get_aio_context, and not the job aiocontext

2022-08-16 Thread Emanuele Giuseppe Esposito
Am 05/08/2022 um 10:14 schrieb Kevin Wolf: > Am 25.07.2022 um 09:38 hat Emanuele Giuseppe Esposito geschrieben: >> We are always using the given bs AioContext, so there is no need >> to take the job ones (which is identical anyways). >> This also reduces the point we need to check when protectin

Re: [PATCH v10 13/21] job: detect change of aiocontext within job coroutine

2022-08-16 Thread Emanuele Giuseppe Esposito
Am 05/08/2022 um 10:37 schrieb Kevin Wolf: > Am 25.07.2022 um 09:38 hat Emanuele Giuseppe Esposito geschrieben: >> From: Paolo Bonzini >> >> We want to make sure access of job->aio_context is always done >> under either BQL or job_mutex. > > Is this the goal of this series? If so, it would hav

Re: [PATCH 1/4] hw/nvme: avoid unnecessary call to irq (de)assertion functions

2022-08-16 Thread Stefan Hajnoczi
On Thu, 11 Aug 2022 at 11:38, Jinhao Fan wrote: > > nvme_irq_assert() only does useful work when cq->irq_enabled is true. > nvme_irq_deassert() only works for pin-based interrupts. Avoid calls > into these functions if we are sure they will not do useful work. > > This will be most useful when we

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

2022-08-16 Thread Sean Christopherson
On Tue, Aug 16, 2022, Gupta, Pankaj wrote: > > > > > 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 ex

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

2022-08-16 Thread Richard Henderson
On 8/16/22 07:26, Alex Bennée wrote: 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/q

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

2022-08-16 Thread Sam Li
Sam Li 于2022年8月16日周二 14:25写道: > > 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 +++

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

2022-08-16 Thread Sam Li
Sam Li 于2022年8月16日周二 14:25写道: > > 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(

Re: [PATCH v2 4/4] virt/hw/virt: Add virt_set_high_memmap() helper

2022-08-16 Thread Zhenyu Zhang
commit 49e00c1fe2ab24b73ac16908f3c05ebe88b9186d (HEAD -> master) Author: Gavin Shan Date: Mon Aug 15 14:29:58 2022 +0800 virt/hw/virt: Add virt_set_high_memmap() helper The logic to assign high memory region's address in virt_set_memmap() is independent. Lets move the logic to virt

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

2022-08-16 Thread Xuan Zhuo
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 relevant virtio spec information is here: > > > > https://github.com/

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

2022-08-16 Thread Xuan Zhuo
On Tue, 16 Aug 2022 02:22:16 -0400, "Michael S. Tsirkin" wrote: > 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 f

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

2022-08-16 Thread Damien Le Moal
On 2022/08/15 23:25, Sam Li wrote: > Signed-off-by: Sam Li > Reviewed-by: Stefan Hajnoczi Looks good. Reviewed-by: Damien Le Moal > --- > include/block/block-common.h | 43 > 1 file changed, 43 insertions(+) > > diff --git a/include/block/block-common.h

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

2022-08-16 Thread Damien Le Moal
On 2022/08/15 23:25, Sam Li wrote: > 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 for-7.2 v3 00/20] QMP/HMP: add 'dumpdtb' and 'info fdt' commands

2022-08-16 Thread Daniel Henrique Barboza
Hi, In this new version the most notable changes are: - removed fdt_pack() from machine specific code. As discussed in the previous version, the proper use of fdt_pack() would require more work/thought and, since it's not required for the work we're doing here, it was removed; - we're now handli

[PATCH for-7.2 v3 01/20] hw/arm: do not free machine->fdt in arm_load_dtb()

2022-08-16 Thread Daniel Henrique Barboza
At this moment, arm_load_dtb() can free machine->fdt when binfo->dtb_filename is NULL. If there's no 'dtb_filename', 'fdt' will be retrieved by binfo->get_dtb(). If get_dtb() returns machine->fdt, as is the case of machvirt_dtb() from hw/arm/virt.c, fdt now has a pointer to machine->fdt. And, in th

[PATCH for-7.2 v3 03/20] hw/nios2: set machine->fdt in nios2_load_dtb()

2022-08-16 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for all nios2 machines that uses nios2_load_dtb(). Cc: Chris Wulff Cc: Marek Vasut Signed-off-by: Daniel Henrique Barboza --- hw/nios2/boot.c | 11 ++- hw/nios2/meson.build | 2 +- 2 files changed, 11 insertions(+

[PATCH for-7.2 v3 02/20] hw/microblaze: set machine->fdt in microblaze_load_dtb()

2022-08-16 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for all microblaze machines that uses microblaze_load_dtb(). Cc: Edgar E. Iglesias Signed-off-by: Daniel Henrique Barboza --- hw/microblaze/boot.c | 11 ++- hw/microblaze/meson.build | 2 +- 2 files changed, 11 ins

[PATCH for-7.2 v3 04/20] hw/ppc: set machine->fdt in ppce500_load_device_tree()

2022-08-16 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for the e500 machine. Cc: Cédric Le Goater Signed-off-by: Daniel Henrique Barboza --- hw/ppc/e500.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 32495d0123

[PATCH for-7.2 v3 07/20] hw/ppc: set machine->fdt in xilinx_load_device_tree()

2022-08-16 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for the virtex_ml507 machine. Cc: Edgar E. Iglesias Signed-off-by: Daniel Henrique Barboza --- hw/ppc/virtex_ml507.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/

  1   2   >