[PATCH v2 1/3] hw/nvme: support irq(de)assertion with eventfd

2022-08-25 Thread Jinhao Fan
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 emulation is not thread safe. Asserting and

Re: [PATCH 1/1] hw/i2c/aspeed: Fix old reg slave receive

2022-08-25 Thread Peter Delevoryas
On Wed, Aug 24, 2022 at 04:31:50PM +0200, Cédric Le Goater wrote: > On 8/23/22 19:27, Peter Delevoryas wrote: > > On Tue, Aug 23, 2022 at 11:23:55AM +0200, Klaus Jensen wrote: > > > On Aug 20 15:57, Peter Delevoryas wrote: > > > > I think when Klaus ported his slave mode changes from the original

[PATCH v3 01/15] virtio: sync relevant definitions with linux

2022-08-25 Thread Kangjie Xu
From: Xuan Zhuo This is updated using scripts/update-linux-headers.sh. Added VIRTIO_F_RING_RESET, VIRTIO_PCI_COMMON_Q_RESET. It came from here: https://github.com/oasis-tcs/virtio-spec/issues/124 https://github.com/oasis-tcs/virtio-spec/issues/139 Add VIRTIO_PCI_COMMON_Q_NDATA, which comes

Re: [RFC 1/2] virtio: expose used buffers

2022-08-25 Thread Eugenio Perez Martin
On Thu, Aug 25, 2022 at 9:16 AM Guo Zhi wrote: > > > > - Original Message - > > From: "eperezma" > > To: "Guo Zhi" > > Cc: "jasowang" , "sgarzare" , > > "Michael Tsirkin" , > > "qemu-devel@nongnu.org Developers" > > Sent: Monday, August 22, 2022 10:08:32 PM > > Subject: Re: [RFC 1/2]

[PULL for-7.1 1/1] hw/i2c/aspeed: Fix old reg slave receive

2022-08-25 Thread Cédric Le Goater
From: Peter Delevoryas I think when Klaus ported his slave mode changes from the original patch series to the rewritten I2C module, he changed the behavior of the first byte that is received by the slave device. What's supposed to happen is that the AspeedI2CBus's slave device's i2c_event

Re: [PATCH 19/51] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.39, Bin Meng wrote: From: Bin Meng The test-filter-{mirror,redirector} cases use socketpair() API that is only available on POSIX and should only be built for POSIX. Signed-off-by: Bin Meng --- tests/qtest/meson.build | 28 ++-- 1 file changed, 18

Re: [PATCH v1 18/40] i386/tdx: Implement user specified tsc frequency

2022-08-25 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:28PM +0800, Xiaoyao Li wrote: > Reuse "-cpu,tsc-frequency=" to get user wanted tsc frequency and call VM > scope VM_SET_TSC_KHZ to set the tsc frequency of TD before KVM_TDX_INIT_VM. > > Besides, sanity check the tsc frequency to be in the legal range and > legal

Re: [PATCH 25/51] tests/qtest: libqos: Rename malloc.h to libqos-malloc.h

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.40, Bin Meng wrote: From: Xuzhou Cheng The qtest/libqos directory is included via the "-I" option to search for header files when building qtest. Unfortunately the malloc.h has a name conflict with the standard libc header, leading to a build failure on the Windows host, due

Re: [PATCH 22/51] tests/qtest: qmp-test: Skip running test_qmp_oob for win32

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.40, Bin Meng wrote: From: Bin Meng The test_qmp_oob test case calls mkfifo() which does not exist on win32. Exclude it. Signed-off-by: Bin Meng --- tests/qtest/qmp-test.c | 6 ++ 1 file changed, 6 insertions(+) Reviewed-by: Thomas Huth

Re: [PATCH 26/51] tests/qtest: libqtest: Move global_qtest definition back to libqtest.c

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.40, Bin Meng wrote: From: Xuzhou Cheng Commit dd2107497275 ("tests/libqtest: Use libqtest-single.h in tests that require global_qtest") moved global_qtest to libqtest-single.h, by declaring global_qtest attribute to be common and weak. This trick unfortunately does not work

Re: [PATCH 36/51] tests/qtest: machine-none-test: Use double quotes to pass the cpu option

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.40, Bin Meng wrote: From: Bin Meng Single quotes in the arguments (e.g.: -cpu 'qemu64,apic-id=0') are not removed in the Windows environment before it is passed to the QEMU executable. Such argument causes a failure in the QEMU CPU option parser codes. Change to use double

Re: [PATCH v2 1/3] hw/nvme: support irq(de)assertion with eventfd

2022-08-25 Thread Klaus Jensen
On Aug 25 13:56, Klaus Jensen wrote: > On Aug 25 19:16, Jinhao Fan wrote: > > On 8/25/2022 5:33 PM, Klaus Jensen wrote: > > > I'm still a bit perplexed by this issue, so I just tried moving > > > nvme_init_irq_notifier() to the end of nvme_init_cq() and removing this > > > first_io_cqe thing. I

Re: [PATCH v1 08/40] i386/tdx: Adjust the supported CPUID based on TDX restrictions

2022-08-25 Thread Xiaoyao Li
On 8/25/2022 7:26 PM, Gerd Hoffmann wrote: Hi, between VMM and TDs. Adjust supported CPUID for TDs based on TDX restrictions. Automatic adjustment depending on hardware capabilities isn't going to fly long-term, you'll run into compatibility problems sooner or later, for example when

[PATCH 0/2] Fix dumping in kdump format with non-aligned memory

2022-08-25 Thread marcandre . lureau
From: Marc-André Lureau Hi, dump.c:get_next_page expects GuestPhysBlock to be page-aligned, and crashes over memory regions such as "tpm-crb-cmd". Teach it to handle non-aligned regions too, by returning allocated and filled up pages as necessary. Fixes:

[PATCH 1/2] dump: simplify a bit kdump get_next_page()

2022-08-25 Thread marcandre . lureau
From: Marc-André Lureau This should be functionally equivalent, but slightly easier to read, with simplified paths and checks at the end of the function. The following patch is a major rewrite to get rid of the assert(). Signed-off-by: Marc-André Lureau --- dump/dump.c | 30

Re: [PATCH v1 08/40] i386/tdx: Adjust the supported CPUID based on TDX restrictions

2022-08-25 Thread Gerd Hoffmann
Hi, > between VMM and TDs. Adjust supported CPUID for TDs based on TDX > restrictions. Automatic adjustment depending on hardware capabilities isn't going to fly long-term, you'll run into compatibility problems sooner or later, for example when different hardware with diverging capabilities

Re: [PATCH v1 15/40] i386/tdx: Add property sept-ve-disable for tdx-guest object

2022-08-25 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:25PM +0800, Xiaoyao Li wrote: > Bit 28, named SEPT_VE_DISABLE, disables EPT violation conversion to #VE > on guest TD access of PENDING pages when set to 1. Some guest OS (e.g., > Linux TD guest) may require this bit set as 1. Otherwise refuse to boot.

Re: [PATCH 20/51] tests/qtest: i440fx-test: Skip running request_{bios,pflash} for win32

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.39, Bin Meng wrote: From: Bin Meng The request_{bios,pflash} test cases call mmap() which does not exist on win32. Exclude them. Signed-off-by: Bin Meng --- tests/qtest/i440fx-test.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tests/qtest/i440fx-test.c

Re: [PATCH v2 1/3] hw/nvme: support irq(de)assertion with eventfd

2022-08-25 Thread Klaus Jensen
On Aug 25 19:16, Jinhao Fan wrote: > On 8/25/2022 5:33 PM, Klaus Jensen wrote: > > I'm still a bit perplexed by this issue, so I just tried moving > > nvme_init_irq_notifier() to the end of nvme_init_cq() and removing this > > first_io_cqe thing. I did not observe any particular issues? > > > >

Re: [PATCH 32/51] tests/qtest: Fix ERROR_SHARING_VIOLATION for win32

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.40, Bin Meng wrote: From: Bin Meng On Windows, the MinGW provided mkstemp() API opens the file with exclusive access, denying other processes to read/write the file. Such behavior prevents the QEMU executable from opening the file, (e.g.: CreateFile returns

Re: [PATCH 38/51] tests/qtest: {ahci,ide}-test: Open file in binary mode

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.40, Bin Meng wrote: From: Xuzhou Cheng By default Windows opens file in text mode, while a POSIX compliant implementation treats text files and binary files the same. The fopen() 'mode' string can include the letter 'b' to indicate binary mode shall be used. POSIX spec says

Re: [PATCH 18/51] tests/qtest: Build cases that use memory-backend-file for posix only

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.39, Bin Meng wrote: From: Bin Meng As backends/meson.build tells us, hostmem-file.c is only supported on POSIX platforms, hence any test case that utilizes the memory backend file should be guarded by CONFIG_POSIX too. Signed-off-by: Bin Meng ---

[PATCH] tests/tcg: x86_64: improve consistency with i386

2022-08-25 Thread Paolo Bonzini
Include test-i386-bmi2, and specify manually the tests (only one for now) that need -cpu max. Signed-off-by: Paolo Bonzini --- tests/tcg/i386/Makefile.target | 2 +- tests/tcg/x86_64/Makefile.target | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git

Re: [PATCH v1 14/40] i386/tdx: Initialize TDX before creating TD vcpus

2022-08-25 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:24PM +0800, Xiaoyao Li wrote: > Invoke KVM_TDX_INIT in kvm_arch_pre_create_vcpu() that KVM_TDX_INIT > configures global TD state, e.g. the canonical CPUID config, and must > be executed prior to creating vCPUs. > > Use kvm_x86_arch_cpuid() to setup the CPUID settings

Re: [PATCH 17/51] tests/qtest: Build virtio-net-test for posix only

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.39, Bin Meng wrote: From: Bin Meng All of the virtio-net-test test cases require socketpair() to do the test setup. I think that is not true. Look at the end of the file, after the comment "These tests do not need a loopback backend" ... these tests are using

Re: [PATCH v1 13/40] KVM: Introduce kvm_arch_pre_create_vcpu()

2022-08-25 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:23PM +0800, Xiaoyao Li wrote: > Introduce kvm_arch_pre_create_vcpu(), to perform arch-dependent > work prior to create any vcpu. This is for i386 TDX because it needs > call TDX_INIT_VM before creating any vcpu. > > Signed-off-by: Xiaoyao Li Acked-by: Gerd Hoffmann

Re: [PATCH v1 17/40] i386/tdx: Validate TD attributes

2022-08-25 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:27PM +0800, Xiaoyao Li wrote: > Validate TD attributes with tdx_caps that fixed-0 bits must be zero and > fixed-1 bits must be set. > > Besides, sanity check the attribute bits that have not been supported by > QEMU yet. e.g., debug bit, it will be allowed in the

Re: Page alignment & memory regions expectations

2022-08-25 Thread Peter Maydell
On Thu, 25 Aug 2022 at 08:27, David Hildenbrand wrote: > On 24.08.22 21:55, Peter Maydell wrote: > > Lumps of memory can be any size you like and anywhere in > > memory you like. Sometimes we are modelling real hardware > > that has done something like that. Sometimes it's just > > a convenient

Re: [PATCH 30/51] tests: Skip iotests and qtest when '--without-default-devices'

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.40, Bin Meng wrote: From: Bin Meng When QEMU is configured with '--without-default-devices', we should not build and run iotests and qtest because devices used by these test cases are not built in. Signed-off-by: Bin Meng --- tests/qemu-iotests/meson.build | 5 +

Re: [PATCH 2/2] dump: fix kdump to work over non-aligned blocks

2022-08-25 Thread Peter Maydell
On Thu, 25 Aug 2022 at 14:21, wrote: > > From: Marc-André Lureau > > Rewrite get_next_page() to work over non-aligned blocks. When it > encounters non aligned addresses, it will allocate a zero-page and try > to fill it. > > This solves a kdump crash with "tpm-crb-cmd" RAM memory region, >

Re: [PATCH v1 3/5] vhost-user-blk: make it possible to disable write-zeroes/discard

2022-08-25 Thread Stefan Hajnoczi
On Wed, Aug 24, 2022 at 11:24:55PM +0300, Daniil Tatianin wrote: > On 8/24/22 9:00 PM, Stefan Hajnoczi wrote: > > On Wed, Aug 24, 2022 at 12:18:35PM +0300, Daniil Tatianin wrote: > > > diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c > > > index 9117222456..e89164c358 100644 > >

Re: [PATCH 16/51] tests/qtest: Build e1000e-test for posix only

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.39, Bin Meng wrote: From: Bin Meng The whole e1000e-test test case relies on socketpair() which does not exist on win32. Signed-off-by: Bin Meng --- tests/qtest/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qtest/meson.build

Re: [PATCH v2 1/3] hw/nvme: support irq(de)assertion with eventfd

2022-08-25 Thread Jinhao Fan
On 8/25/2022 5:33 PM, Klaus Jensen wrote: I'm still a bit perplexed by this issue, so I just tried moving nvme_init_irq_notifier() to the end of nvme_init_cq() and removing this first_io_cqe thing. I did not observe any particular issues? What bad behavior did you encounter, it seems to work

Re: [PATCH v1 16/40] i386/tdx: Wire CPU features up with attributes of TD guest

2022-08-25 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:26PM +0800, Xiaoyao Li wrote: > For QEMU VMs, PKS is configured via CPUID_7_0_ECX_PKS and PMU is > configured by x86cpu->enable_pmu. Reuse the existing configuration > interface for TDX VMs. Acked-by: Gerd Hoffmann

Re: [PATCH 24/51] tests/qtest: libqos: Drop inclusion of

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.40, Bin Meng wrote: From: Xuzhou Cheng There is no in the Windows build environment. Actually this is not needed in the non-win32 builds too. Drop it. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng --- tests/qtest/libqos/libqos.c | 2 -- 1 file changed, 2

Re: [PATCH 45/51] tests/qtest: prom-env-test: Use double quotes to pass the prom-env option

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.40, Bin Meng wrote: From: Bin Meng Single quotes like -prom-env 'nvramrc=cafec0de 4000 l!' in the arguments are not removed in the Windows environment before it is passed to the QEMU executable. Such argument causes a failure in the QEMU prom-env option parser codes. Change

Re: [PATCH 43/51] tests/qtest: npcm7xx_emc-test: Skip running test_{tx,rx} on win32

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.40, Bin Meng wrote: From: Bin Meng The test cases 'test_{tx,rx}' call socketpair() which does not exist on win32. Exclude them. Signed-off-by: Bin Meng --- tests/qtest/npcm7xx_emc-test.c | 8 1 file changed, 8 insertions(+) Reviewed-by: Thomas Huth

Re: [PATCH 2/2] dump: fix kdump to work over non-aligned blocks

2022-08-25 Thread Marc-André Lureau
Hi On Thu, Aug 25, 2022 at 5:35 PM Peter Maydell wrote: > > On Thu, 25 Aug 2022 at 14:21, wrote: > > > > From: Marc-André Lureau > > > > Rewrite get_next_page() to work over non-aligned blocks. When it > > encounters non aligned addresses, it will allocate a zero-page and try > > to fill it. >

Re: Page alignment & memory regions expectations

2022-08-25 Thread David Hildenbrand
On 25.08.22 13:47, Peter Maydell wrote: > On Thu, 25 Aug 2022 at 08:27, David Hildenbrand wrote: >> On 24.08.22 21:55, Peter Maydell wrote: >>> Lumps of memory can be any size you like and anywhere in >>> memory you like. Sometimes we are modelling real hardware >>> that has done something like

Re: Page alignment & memory regions expectations

2022-08-25 Thread Peter Maydell
On Thu, 25 Aug 2022 at 12:57, David Hildenbrand wrote: > > On 25.08.22 13:47, Peter Maydell wrote: > > On Thu, 25 Aug 2022 at 08:27, David Hildenbrand wrote: > >> On 24.08.22 21:55, Peter Maydell wrote: > >>> Lumps of memory can be any size you like and anywhere in > >>> memory you like.

Re: [PATCH 35/51] tests/qtest: device-plug-test: Reverse the usage of double/single quotes

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.40, Bin Meng wrote: From: Bin Meng The usage of double/single quotes in test_pci_unplug_json_request() should be reversed to work on both win32 and non-win32 platforms: - The value of -device parameter needs to be surrounded by "" as Windows does not drop '' when passing

[PATCH] tests/tcg: i386: extend BMI test

2022-08-25 Thread Paolo Bonzini
Cover all BMI1 and BMI2 instructions, both 32- and 64-bit. Due to the use of inlines, the test now has to be compiled with -O2. Signed-off-by: Paolo Bonzini --- tests/tcg/i386/Makefile.target | 1 + tests/tcg/i386/test-i386-bmi2.c | 169 ++-- 2 files changed, 162

Re: [PATCH 27/51] tests/qtest: Use send/recv for socket communication

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.40, Bin Meng wrote: From: Xuzhou Cheng Socket communication in the libqtest and libqmp codes uses read() and write() which work on any file descriptor on *nix, and sockets in *nix are an example of a file descriptor. However sockets on Windows do not use *nix-style file

Re: [PATCH v2 1/3] hw/nvme: support irq(de)assertion with eventfd

2022-08-25 Thread Jinhao Fan
> 在 2022年8月25日,20:39,Klaus Jensen 写道: > > On Aug 25 13:56, Klaus Jensen wrote: >>> On Aug 25 19:16, Jinhao Fan wrote: >>> On 8/25/2022 5:33 PM, Klaus Jensen wrote: I'm still a bit perplexed by this issue, so I just tried moving nvme_init_irq_notifier() to the end of nvme_init_cq()

[PATCH 2/2] dump: fix kdump to work over non-aligned blocks

2022-08-25 Thread marcandre . lureau
From: Marc-André Lureau Rewrite get_next_page() to work over non-aligned blocks. When it encounters non aligned addresses, it will allocate a zero-page and try to fill it. This solves a kdump crash with "tpm-crb-cmd" RAM memory region, qemu-kvm: ../dump/dump.c:1162: _Bool

Re: [PATCH v1 2/5] virtio-blk: move config space sizing code to virtio-blk-common

2022-08-25 Thread Stefan Hajnoczi
On Thu, Aug 25, 2022 at 12:11:10AM +0300, Daniil Tatianin wrote: > > > On 8/24/22 9:13 PM, Stefan Hajnoczi wrote: > > On Wed, Aug 24, 2022 at 12:18:34PM +0300, Daniil Tatianin wrote: > > > +size_t virtio_blk_common_get_config_size(uint64_t host_features) > > > +{ > > > +size_t config_size =

[PATCH v2 2/3] hw/nvme: use KVM irqfd when available

2022-08-25 Thread Jinhao Fan
Use KVM's irqfd to send interrupts when possible. This approach is thread safe. Moreover, it does not have the inter-thread communication overhead of plain event notifiers since handler callback are called in the same system call as irqfd write. Signed-off-by: Jinhao Fan --- hw/nvme/ctrl.c | 50

Re: [PATCH v2 4/5] bios-tables-test: add test for number of cores > 255

2022-08-25 Thread Igor Mammedov
On Sun, 31 Jul 2022 18:21:40 +0200 Julia Suvorova wrote: > The new test is run with a large number of cpus and checks if the > core_count field in smbios_cpu_test (structure type 4) is correct. > > Choose q35 as it allows to run with -smp > 255. > > Signed-off-by: Julia Suvorova pls, run

[PATCH v3 11/15] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_restart()

2022-08-25 Thread Kangjie Xu
Introduce vhost_net_virtqueue_restart(), which can restart the specific virtqueue when the vhost net started running before. If it fails to restart the virtqueue, the device will be stopped. Here we do not reuse vhost_net_start_one() or vhost_dev_start() because they work at queue pair level. The

[PATCH v3 04/15] virtio: introduce virtio_queue_enable()

2022-08-25 Thread Kangjie Xu
Introduce the interface queue_enable() in VirtioDeviceClass and the fucntion virtio_queue_enable() in virtio, it can be called when VIRTIO_PCI_COMMON_Q_ENABLE is written and related virtqueue can be started. It only supports the devices of virtio 1 or later. The not-supported devices can only

[PATCH v3 10/15] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_reset()

2022-08-25 Thread Kangjie Xu
Introduce vhost_virtqueue_reset(), which can reset the specific virtqueue in the device. Then it will unmap vrings and the desc of the virtqueue. Here we do not reuse the vhost_net_stop_one() or vhost_dev_stop(), because they work at queue pair level. We do not use vhost_virtqueue_stop() because

[PATCH v3 08/15] vhost: extract the logic of unmapping the vrings and desc

2022-08-25 Thread Kangjie Xu
Introduce vhost_virtqueue_unmap() to ummap the vrings and desc of a virtqueue. The function will be re-used when resetting a virtqueue. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/virtio/vhost.c | 20 ++-- include/hw/virtio/vhost.h |

[PATCH v3 03/15] virtio: introduce virtio_queue_reset()

2022-08-25 Thread Kangjie Xu
From: Xuan Zhuo Introduce a new interface function virtio_queue_reset() to implement reset for vq. Add a new callback to VirtioDeviceClass for queue reset operation for each child device. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/virtio/virtio.c | 11 +++

Re: [PATCH 07/51] tests: Avoid using hardcoded /tmp in test cases

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.39, Bin Meng wrote: From: Bin Meng Use g_get_tmp_dir() to get the directory to use for temporary files. Signed-off-by: Bin Meng --- tests/qtest/fuzz/generic_fuzz_configs.h | 6 -- tests/qtest/ahci-test.c | 15 +++

Re: [PATCH v1 07/40] i386/tdx: Introduce is_tdx_vm() helper and cache tdx_guest object

2022-08-25 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:17PM +0800, Xiaoyao Li wrote: > It will need special handling for TDX VMs all around the QEMU. > Introduce is_tdx_vm() helper to query if it's a TDX VM. > > Cache tdx_guest object thus no need to cast from ms->cgs every time. > > Signed-off-by: Xiaoyao Li

Re: [RFC 0/2] Virtio in order feature support for virtio-net device.

2022-08-25 Thread Jason Wang
On Thu, Aug 18, 2022 at 11:13 PM Guo Zhi wrote: > > In virtio-spec 1.1, new feature bit VIRTIO_F_IN_ORDER was introduced. > When this feature has been negotiated, virtio driver will use > descriptors in ring order: starting from offset 0 in the table, and > wrapping around at the end of the

Re: [PATCH 11/17] target/i386: add 60-67, 70-77 opcodes

2022-08-25 Thread Paolo Bonzini
On 8/25/22 02:33, Richard Henderson wrote: On 8/24/22 10:32, Paolo Bonzini wrote: +static void decode_group_0x63(DisasContext *s, CPUX86State *env, X86OpEntry *entry, uint8_t *b) +{ +    static X86OpEntry arpl = X86_OP_ENTRY2(ARPL, E,w, G,w, .special = X86_SPECIAL_ProtMode); +    static

[PATCH v2 0/3] hw/nvme: add irqfd support

2022-08-25 Thread Jinhao Fan
This patch series changes qemu-nvme's interrupt emulation to use event notifiers, which can ensure thread-safe interrupt delivery when iothread is used. In the first patche, I convert qemu-nvme's IO emulation logic to send irq via eventfd, so that the actual assertion and deassertion is always

[PATCH v2 3/3] hw/nvme: add MSI-x mask handlers for irqfd

2022-08-25 Thread Jinhao Fan
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 vector is masked. Signed-off-by: Jinhao

Re: [PATCH 40/51] chardev/char-file: Add FILE_SHARE_WRITE when openning the file for win32

2022-08-25 Thread Marc-André Lureau
Hi On Wed, Aug 24, 2022 at 1:43 PM Bin Meng wrote: > > From: Xuzhou Cheng > > The combination of GENERIC_WRITE and FILE_SHARE_READ options does > not allow the same file to be opened again by CreateFile() from > another QEMU process with the same options when the previous QEMU > process still

Re: [PATCH 2/4] hw/acpi: set ATS capability explicitly per pcie root port

2022-08-25 Thread Igor Mammedov
On Wed, 24 Aug 2022 21:46:58 +0530 Ani Sinha wrote: > On Wed, Aug 24, 2022 at 8:54 PM Igor Mammedov wrote: > > > On Mon, 22 Aug 2022 14:38:09 +0530 > > Ani Sinha wrote: > > > > > Currently the bit 0 of the flags field of Root Port ATS capability > > reporting > > > structure sub-table

[PATCH v3 12/15] virtio-net: introduce flush_or_purge_queued_packets()

2022-08-25 Thread Kangjie Xu
Introduce the fucntion flush_or_purge_queued_packets(), it will be used in device reset and virtqueue reset. Therefore, we extract the common logic as a new function. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/net/virtio-net.c | 17 +++-- 1 file changed, 11

[PATCH v3 06/15] virtio-pci: support queue reset

2022-08-25 Thread Kangjie Xu
From: Xuan Zhuo PCI devices support vq reset. Based on this function, the driver can adjust the size of the ring, and quickly recycle the buffer in the ring. The migration of the virtio devices will not happen during a reset operation. This is becuase the global iothread lock is held.

[PATCH v3 02/15] virtio: introduce __virtio_queue_reset()

2022-08-25 Thread Kangjie Xu
From: Xuan Zhuo Separate the logic of vq reset. This logic will be called directly later. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/virtio/virtio.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/hw/virtio/virtio.c

Re: [PATCH 50/51] .gitlab-ci.d/windows.yml: Increase the timeout to the runner limit

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.40, Bin Meng wrote: From: Bin Meng commit 9f8e6cad65a6 ("gitlab-ci: Speed up the msys2-64bit job by using --without-default-devices" changed to compile QEMU with the --without-default-devices switch for the msys2-64bit job, due to the build could not complete within the

[PULL for-7.1 0/1] aspeed queue

2022-08-25 Thread Cédric Le Goater
The following changes since commit 9a99f964b152f8095949bbddca7841744ad418da: Update version for v7.1.0-rc4 release (2022-08-24 19:27:56 -0700) are available in the Git repository at: https://github.com/legoater/qemu/ tags/pull-aspeed-20220825 for you to fetch changes up

Re: [PATCH 1/1] hw/i2c/aspeed: Fix old reg slave receive

2022-08-25 Thread Cédric Le Goater
On 8/25/22 10:04, Peter Delevoryas wrote: On Wed, Aug 24, 2022 at 04:31:50PM +0200, Cédric Le Goater wrote: On 8/23/22 19:27, Peter Delevoryas wrote: On Tue, Aug 23, 2022 at 11:23:55AM +0200, Klaus Jensen wrote: On Aug 20 15:57, Peter Delevoryas wrote: I think when Klaus ported his slave

[PATCH v2] hw/net/vmxnet3: allow VMXNET3_MAX_MTU itself as a value

2022-08-25 Thread Fiona Ebner
Currently, VMXNET3_MAX_MTU itself (being 9000) is not considered a valid value for the MTU, but a guest running ESXi 7.0 might try to set it and fail the assert [0]. In the Linux kernel, dev->max_mtu itself is a valid value for the MTU and for the vmxnet3 driver it's 9000, so a guest running

Re: [RFC 1/2] virtio: expose used buffers

2022-08-25 Thread Jason Wang
On Thu, Aug 18, 2022 at 11:13 PM Guo Zhi wrote: > > Follow VIRTIO 1.1 spec, we can only writing out a single used ring for a > batch of descriptors, and only notify guest when the batch of > descriptors have all been used. Yes, but I don't see anything that is related to the "exposing used

Re: [PATCH 05/17] target/i386: add 00-07, 10-17 opcodes

2022-08-25 Thread Paolo Bonzini
On 8/25/22 02:27, Richard Henderson wrote: If you were sharing this with the old decoder, and thus needed to retain it, that would be one thing.  But there's no shared prefix or postfix in this function, so you might as well split each case into the functions. Yes, absolutely. Paolo

Re: [PATCH 15/51] tests/qtest: Adapt {m48t59,rtc}-test cases for win32

2022-08-25 Thread Thomas Huth
On 24/08/2022 11.39, Bin Meng wrote: From: Bin Meng There is no tm_gmtoff member in 'struct tm' on Windows. Update rtc-test.c and m48t59-test.c accordingly. Signed-off-by: Bin Meng --- tests/qtest/m48t59-test.c | 2 +- tests/qtest/rtc-test.c| 2 +- 2 files changed, 2 insertions(+),

[PATCH v3 05/15] virtio: core: vq reset feature negotation support

2022-08-25 Thread Kangjie Xu
A a new command line parameter "queue_reset" is added. Meanwhile, the vq reset feature is disabled for pre-7.1 machines. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/core/machine.c | 1 + include/hw/virtio/virtio.h | 4 +++- 2 files changed, 4 insertions(+), 1

[PATCH v3 14/15] virtio-net: support queue_enable

2022-08-25 Thread Kangjie Xu
Support queue_enable in vhost-kernel scenario. It can be called when a vq reset operation has been performed and the vq is restared. It should be noted that we can restart the vq when the vhost has already started. When launching a new vhost device, the vhost is not started and all vqs are not

Re: [PATCH 04/17] target/i386: add ALU load/writeback core

2022-08-25 Thread Paolo Bonzini
On 8/25/22 02:23, Richard Henderson wrote: +    op->v = v; +} Surely this assignment... +static void gen_writeback(DisasContext *s, X86DecodedOp *op) +{ ... +    case X86_ALU_GPR: +    gen_op_mov_reg_v(s, op->ot, op->n, s->T0); ... can be used here instead of hard-coding T0.  It

Re: [RFC 1/2] virtio: expose used buffers

2022-08-25 Thread Guo Zhi
- Original Message - > From: "eperezma" > To: "Guo Zhi" > Cc: "jasowang" , "sgarzare" , > "Michael Tsirkin" , > "qemu-devel@nongnu.org Developers" > Sent: Monday, August 22, 2022 10:08:32 PM > Subject: Re: [RFC 1/2] virtio: expose used buffers > On Thu, Aug 18, 2022 at 5:13 PM Guo

Re: [RFC] hw/net/vmxnet3: allow VMXNET3_MAX_MTU itself as a value

2022-08-25 Thread P J P
On Wednesday, 24 August, 2022, 04:46:21 pm IST, Fiona Ebner wrote: >Reported by one of our users running into the failing assert(): >https://forum.proxmox.com/threads/114011/#post-492916 > >- assert(VMXNET3_MIN_MTU <= s->mtu && s->mtu < VMXNET3_MAX_MTU); >+ assert(VMXNET3_MIN_MTU <= s->mtu &&

Re: Page alignment & memory regions expectations

2022-08-25 Thread David Hildenbrand
On 24.08.22 21:55, Peter Maydell wrote: > On Wed, 24 Aug 2022 at 17:43, David Hildenbrand wrote: >> One idea is doing another pass over the list at the end (after possible >> merging of sections) and making sure everything is page-aligned. >> >> Another idea is specifying somehow that that memory

Re: [RFC v4 11/11] virtio-blk: use BDRV_REQ_REGISTERED_BUF optimization hint

2022-08-25 Thread David Hildenbrand
On 23.08.22 21:22, Stefan Hajnoczi wrote: > On Tue, Aug 23, 2022 at 10:01:59AM +0200, David Hildenbrand wrote: >> On 23.08.22 00:24, Stefan Hajnoczi wrote: >>> Register guest RAM using BlockRAMRegistrar and set the >>> BDRV_REQ_REGISTERED_BUF flag so block drivers can optimize memory >>> accesses

[PATCH v3 09/15] vhost: expose vhost_virtqueue_start()

2022-08-25 Thread Kangjie Xu
Expose vhost_virtqueue_start(), we need to use it when restarting a virtqueue. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/virtio/vhost.c | 8 include/hw/virtio/vhost.h | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/virtio/vhost.c

[PATCH v3 07/15] virtio-pci: support queue enable

2022-08-25 Thread Kangjie Xu
PCI devices support device specific vq enable. Based on this function, the driver can re-enable the virtqueue after the virtqueue is reset. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/virtio/virtio-pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio-pci.c

Re: [PATCH v2 1/3] hw/nvme: support irq(de)assertion with eventfd

2022-08-25 Thread Klaus Jensen
On Aug 25 15:47, 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 4/5] virtio-net: Update virtio-net curr_queue_pairs in vdpa backends

2022-08-25 Thread Eugenio Perez Martin
On Thu, Aug 25, 2022 at 2:38 AM Si-Wei Liu wrote: > > > > On 8/23/2022 9:27 PM, Jason Wang wrote: > > > > 在 2022/8/20 01:13, Eugenio Pérez 写道: > >> It was returned as error before. Instead of it, simply update the > >> corresponding field so qemu can send it in the migration data. > >> > >>

Re: [RFC PATCH 00/17] (The beginning of) a new i386 decoder

2022-08-25 Thread Paolo Bonzini
On 8/25/22 01:01, Richard Henderson wrote: One notable difference is that the new decoder always sign-extends 8-bit immediates, so for example a "cmpb $e9, %dl" instruction will subtract $0xfff...fffe9 from the temporary value.  This is the way Intel intended "Ib" immediates to work, and there's

Re: [PATCH 03/17] target/i386: add core of new i386 decoder

2022-08-25 Thread Paolo Bonzini
On 8/25/22 02:12, Richard Henderson wrote: Surely it would be just as readable as static const X86OpEntry onebyte[256] = {     /* * Table A-2: One-byte Opcode Map: 00H — F7H */     [0x00] = X86_OP_ENTRY2(ADD, E,b, G,b),     [0x01] = X86_OP_ENTRY2(ADD, E,v, G,v),     ...    

Re: [PATCH v1 06/40] i386/tdx: Get tdx_capabilities via KVM_TDX_CAPABILITIES

2022-08-25 Thread Gerd Hoffmann
Hi, > +r = tdx_platform_ioctl(KVM_TDX_CAPABILITIES, 0, caps); > +if (r == -E2BIG) { > +g_free(caps); > +nr_cpuid_configs *= 2; > +if (nr_cpuid_configs > KVM_MAX_CPUID_ENTRIES) { > +error_report("KVM TDX seems broken"); Maybe,

Re: [PATCH 03/17] target/i386: add core of new i386 decoder

2022-08-25 Thread Paolo Bonzini
On 8/25/22 03:47, Richard Henderson wrote: On 8/24/22 10:31, Paolo Bonzini wrote: diff --git a/target/i386/tcg/decode-old.c.inc b/target/i386/tcg/decode-old.c.inc index 603642d6e1..fb86855501 100644 --- a/target/i386/tcg/decode-old.c.inc +++ b/target/i386/tcg/decode-old.c.inc @@ -1808,10

Re: [PATCH v2 2/5] bios-tables-test: teach test to use smbios 3.0 tables

2022-08-25 Thread Igor Mammedov
On Sun, 31 Jul 2022 18:21:38 +0200 Julia Suvorova wrote: > Introduce the 64-bit entry point. Since we no longer have a total > number of structures, stop checking for the new ones at the EOF > structure (type 127). needs fixing checkpatch warnings other than that Reviewed-by: Igor Mammedov

[PATCH v3 13/15] virtio-net: support queue reset

2022-08-25 Thread Kangjie Xu
From: Xuan Zhuo virtio-net and vhost-kernel implement queue reset. Queued packets in the corresponding queue pair are flushed or purged. Signed-off-by: Xuan Zhuo Signed-off-by: Kangjie Xu --- hw/net/virtio-net.c | 18 ++ 1 file changed, 18 insertions(+) diff --git

[PATCH v3 00/15] Support VIRTIO_F_RING_RESET for virtio-net, vhost-net kernel in virtio pci-modern

2022-08-25 Thread Kangjie Xu
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 https://github.com/oasis-tcs/virtio-spec/issues/139 This patch set is to support this function in QEMU. It

[PATCH v3 15/15] vhost: vhost-kernel: enable vq reset feature

2022-08-25 Thread Kangjie Xu
Add virtqueue reset feature for vhost-kernel. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 0716f6cd96..74c5147d6e 100644 --- a/hw/net/vhost_net.c +++

Re: [PATCH v2 1/3] hw/nvme: support irq(de)assertion with eventfd

2022-08-25 Thread Jinhao Fan
On 8/25/2022 7:56 PM, Klaus Jensen wrote: On Aug 25 19:16, Jinhao Fan wrote: On 8/25/2022 5:33 PM, Klaus Jensen wrote: I'm still a bit perplexed by this issue, so I just tried moving nvme_init_irq_notifier() to the end of nvme_init_cq() and removing this first_io_cqe thing. I did not observe

Re: [PATCH] tests/avocado: Fix trivial typo

2022-08-25 Thread Philippe Mathieu-Daudé via
On 24/8/22 10:09, Thomas Huth wrote: The intention was likely to use "intend" instead of "indent" here. Signed-off-by: Thomas Huth --- tests/avocado/avocado_qemu/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 00/11] misc: Remove variable-length arrays on the stack

2022-08-25 Thread Philippe Mathieu-Daudé via
On 19/8/22 17:39, Peter Maydell wrote: This is a resend of a subset of patches from a series that Philippe sent out last year: https://patchew.org/QEMU/20210505211047.1496765-1-phi...@redhat.com/ Basically I just pulled out the patches which: (1) trivially applied on a rebase (2) had got a

[PATCH v6 06/10] parallels: Move check of unclean image to a separate function

2022-08-25 Thread Alexander Ivanov
We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/parallels.c | 31

[PATCH v6 05/10] parallels: Use generic infrastructure for BAT writing in parallels_co_check()

2022-08-25 Thread Alexander Ivanov
BAT is written in the context of conventional operations over the image inside bdrv_co_flush() when it calls parallels_co_flush_to_os() callback. Thus we should not modify BAT array directly, but call parallels_set_bat_entry() helper and bdrv_co_flush() further on. After that there is no need to

Re: [PATCH v1 15/40] i386/tdx: Add property sept-ve-disable for tdx-guest object

2022-08-25 Thread Xiaoyao Li
On 8/25/2022 7:36 PM, Gerd Hoffmann wrote: On Tue, Aug 02, 2022 at 03:47:25PM +0800, Xiaoyao Li wrote: Bit 28, named SEPT_VE_DISABLE, disables EPT violation conversion to #VE on guest TD access of PENDING pages when set to 1. Some guest OS (e.g., Linux TD guest) may require this bit set as 1.

[PATCH v6 03/10] parallels: Fix data_end after out-of-image check

2022-08-25 Thread Alexander Ivanov
Set data_end to the end of the last cluster inside the image. In such a way we can be shure that corrupted offsets in the BAT can't affect on the image size. Signed-off-by: Alexander Ivanov --- block/parallels.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/parallels.c

Re: [PATCH] tests/tcg: i386: extend BMI test

2022-08-25 Thread Richard Henderson
On 8/25/22 05:34, Paolo Bonzini wrote: Cover all BMI1 and BMI2 instructions, both 32- and 64-bit. Due to the use of inlines, the test now has to be compiled with -O2. Signed-off-by: Paolo Bonzini --- tests/tcg/i386/Makefile.target | 1 + tests/tcg/i386/test-i386-bmi2.c | 169

Re: [PATCH 43/51] tests/qtest: npcm7xx_emc-test: Skip running test_{tx, rx} on win32

2022-08-25 Thread Hao Wu
On Wed, Aug 24, 2022 at 3:35 AM Bin Meng wrote: > From: Bin Meng > > The test cases 'test_{tx,rx}' call socketpair() which does not exist > on win32. Exclude them. > > Signed-off-by: Bin Meng > Reviewed-by: Hao Wu > --- > > tests/qtest/npcm7xx_emc-test.c | 8 > 1 file changed, 8

[PATCH 4/7] configure: Add './' on front of glob of */config-devices.mak.d

2022-08-25 Thread Peter Maydell
Shellcheck warns that in rm -f */config-devices.mak.d the glob might expand to something with a '-' in it, which would then be misinterpreted as an option to rm. Fix this by adding './'. Signed-off-by: Peter Maydell --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

  1   2   3   >