Re: [PATCH 08/25] hw/arm/boot: Export write_bootloader for Aspeed machines

2023-01-31 Thread Cédric Le Goater
On 2/1/23 06:45, Joel Stanley wrote: On Thu, 19 Jan 2023 at 12:37, Cédric Le Goater wrote: AST2600 Aspeed machines have an home made boot loader for secondaries. To improve support, export the internal ARM boot loader and use it instead. I didn't quite follow why we're doing this. Is it just

Re: [PATCH 0/3] util/userfaultfd: Support /dev/userfaultfd

2023-01-31 Thread Michal Prívozník
On 1/31/23 22:01, Peter Xu wrote: > I'll wait 1-2 more days to see whether Michal has anything to comment. Yeah, we can go with your patches and leave FD passing for future work. It's orthogonal after all. In the end we can have (in the order of precedence): 1) new cmd line argument, say: qe

Re: [QEMU][PATCH v5 01/10] hw/i386/xen/: move xen-mapcache.c to hw/xen/

2023-01-31 Thread Paul Durrant
On 31/01/2023 22:51, Vikram Garhwal wrote: xen-mapcache.c contains common functions which can be used for enabling Xen on aarch64 with IOREQ handling. Moving it out from hw/i386/xen to hw/xen to make it accessible for both aarch64 and x86. Signed-off-by: Vikram Garhwal Signed-off-by: Stefano St

Re: [PATCH 04/25] avocado/boot_linux_console.py: Update ast2600 test

2023-01-31 Thread Cédric Le Goater
On 2/1/23 06:46, Joel Stanley wrote: On Thu, 19 Jan 2023 at 12:35, Cédric Le Goater wrote: From: Joel Stanley Update the test_arm_ast2600_debian test to - the latest Debian kernel Would you like a newer version of this patch that uses the latest kernel? Sure. We can not test all kerne

Re: [PATCH 02/25] aspeed: Add Supermicro X11 SPI machine type

2023-01-31 Thread Cédric Le Goater
On 2/1/23 06:39, Joel Stanley wrote: On Thu, 19 Jan 2023 at 12:36, Cédric Le Goater wrote: From: Guenter Roeck supermicrox11-bmc is configured with ast2400-a1 SoC. This does not match the Supermicro documentation for X11 BMCs, and it does not match the devicetree file in the Linux kernel.

Re: Emulating device configuration / max_virtqueue_pairs in vhost-vdpa and vhost-user

2023-01-31 Thread Eugenio Perez Martin
On Wed, Feb 1, 2023 at 4:29 AM Jason Wang wrote: > > On Wed, Feb 1, 2023 at 3:11 AM Eugenio Perez Martin > wrote: > > > > On Tue, Jan 31, 2023 at 8:10 PM Eugenio Perez Martin > > wrote: > > > > > > Hi, > > > > > > The current approach of offering an emulated CVQ to the guest and map > > > the c

Re: bamboo machine

2023-01-31 Thread Cédric Le Goater
Hello Mobin, On 1/31/23 20:24, Mobin Shaikh wrote: Hello Cédric , I found your contact information from GitHub. I am a new QEMU enthusiast and learning about QEMU. I emulated PPC bamboo machine using QEMU but I couldn't completely bootup the OS. Would you be able to share the example image fi

Re: Emulating device configuration / max_virtqueue_pairs in vhost-vdpa and vhost-user

2023-01-31 Thread Eugenio Perez Martin
On Wed, Feb 1, 2023 at 4:27 AM Jason Wang wrote: > > On Wed, Feb 1, 2023 at 3:10 AM Eugenio Perez Martin > wrote: > > > > Hi, > > > > The current approach of offering an emulated CVQ to the guest and map > > the commands to vhost-user is not scaling well: > > * Some devices already offer it, so

Re: accel/tcg/translator.c question about translator_access

2023-01-31 Thread Richard Henderson
On 1/31/23 17:06, Sid Manning wrote: There is an assert in translator_access that I hit while running on a version of QEMU integrated into a Virtual Platform. Since this function can return null anyway I tried the following experiment: ... -    assert(phys_page != -1); +    if

Re: [PATCH 03/25] hw/net: Fix read of uninitialized memory in ftgmac100

2023-01-31 Thread Joel Stanley
On Thu, 19 Jan 2023 at 12:39, Cédric Le Goater wrote: > > From: Stephen Longfield > > With the `size += 4` before the call to `crc32`, the CRC calculation > would overrun the buffer. Size is used in the while loop starting on > line 1009 to determine how much data to write back, with the last > f

Re: [PATCH 08/25] hw/arm/boot: Export write_bootloader for Aspeed machines

2023-01-31 Thread Joel Stanley
On Thu, 19 Jan 2023 at 12:37, Cédric Le Goater wrote: > > AST2600 Aspeed machines have an home made boot loader for secondaries. > To improve support, export the internal ARM boot loader and use it > instead. I didn't quite follow why we're doing this. Is it just a cleanup? > > Signed-off-by: Cé

Re: [PATCH 06/25] tests/avocado/machine_aspeed.py: update buildroot tests

2023-01-31 Thread Joel Stanley
On Thu, 19 Jan 2023 at 12:37, Cédric Le Goater wrote: > > Use buildroot 2022.11 based images plus some customization : > > - Linux version is bumped to 6.0.9 and kernel is built with a custom > config similar to what OpenBMC provides. > - U-Boot is switched to the one provided by OpenBMC f

Re: [PATCH 07/25] tests/avocado/machine_aspeed.py: Mask systemd services to speed up SDK boot

2023-01-31 Thread Joel Stanley
On Thu, 19 Jan 2023 at 12:39, Cédric Le Goater wrote: > > Signed-off-by: Cédric Le Goater NIce! Reviewed-by: Joel Stanley > --- > tests/avocado/machine_aspeed.py | 11 +-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/tests/avocado/machine_aspeed.py b/tests/avoca

Re: [PULL 16/22] tcg/aarch64: Reorg goto_tb implementation

2023-01-31 Thread Richard Henderson
On 1/31/23 15:45, Zenghui Yu wrote: On 2023/1/18 7:10, Richard Henderson wrote: +void tb_target_set_jmp_target(const TranslationBlock *tb, int n, +  uintptr_t jmp_rx, uintptr_t jmp_rw) +{ +    uintptr_t d_addr = tb->jmp_target_addr[n]; +    ptrdiff_t d_offset = d_addr

Re: [PATCH 02/25] aspeed: Add Supermicro X11 SPI machine type

2023-01-31 Thread Joel Stanley
On Thu, 19 Jan 2023 at 12:36, Cédric Le Goater wrote: > > From: Guenter Roeck > > supermicrox11-bmc is configured with ast2400-a1 SoC. This does not match > the Supermicro documentation for X11 BMCs, and it does not match the > devicetree file in the Linux kernel. I found this sentence confusing

Re: [PATCH 04/25] avocado/boot_linux_console.py: Update ast2600 test

2023-01-31 Thread Joel Stanley
On Thu, 19 Jan 2023 at 12:35, Cédric Le Goater wrote: > > From: Joel Stanley > > Update the test_arm_ast2600_debian test to > > - the latest Debian kernel Would you like a newer version of this patch that uses the latest kernel? > - use the Rainier machine instead of Tacoma > > Both of which

Re: [PATCH 09/25] hw/core/loader: Remove declarations of option_rom_has_mr/rom_file_has_mr

2023-01-31 Thread Joel Stanley
On Thu, 19 Jan 2023 at 12:37, Cédric Le Goater wrote: > > These globals were moved to MachineClass by commit 71ae9e94d9 ("pc: Move > option_rom_has_mr/rom_file_has_mr globals to MachineClass"). Finish cleanup. > > Cc: Eduardo Habkost > Cc: Marcel Apfelbaum > Reviewed-by: Alex Bennée > Reviewed-

Re: [PATCH 20/25] hw/arm/aspeed_ast10x0: Add various unimplemented peripherals

2023-01-31 Thread Joel Stanley
On Thu, 19 Jan 2023 at 12:36, Cédric Le Goater wrote: > > From: Philippe Mathieu-Daudé > > Based on booting Zephyr demo from [1] running QEMU with > '-d unimp' and checking missing devices in [2]. > > [1] https://github.com/AspeedTech-BMC/zephyr/releases/tag/v00.01.07 > [2] > https://github.com/

Re: [PATCH 05/25] m25p80: Add the is25wp256 SFPD table

2023-01-31 Thread Joel Stanley
On Thu, 19 Jan 2023 at 12:36, Cédric Le Goater wrote: > > From: Guenter Roeck > > Generated from hardware using the following command and then padding > with 0xff to fill out a power-of-2: > xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp > > Cc: Michael Walle > Cc: Tudor Ambarus > Sign

Re: [PULL 10/56] x86: don't let decompressed kernel image clobber setup_data

2023-01-31 Thread H. Peter Anvin
On January 31, 2023 1:22:43 PM PST, "Jason A. Donenfeld" wrote: >On Tue, Jan 31, 2023, 15:55 H. Peter Anvin wrote: > >> On January 30, 2023 12:19:14 PM PST, "Michael S. Tsirkin" >> wrote: >> >From: "Jason A. Donenfeld" >> > >> >The setup_data links are appended to the compressed kernel image.

Re: [PATCH v3 8/9] igb: respect VT_CTL ignore MAC field

2023-01-31 Thread Akihiko Odaki
On 2023/01/31 18:42, Sriram Yagnaraman wrote: Also trace out a warning if replication mode is disabled, since we only support replication mode enabled. Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 9 + hw/net/trace-events | 2 ++ 2 files changed, 11 insertions(+) diff

Re: [PATCH v3 9/9] igb: respect VMVIR and VMOLR for VLAN

2023-01-31 Thread Akihiko Odaki
On 2023/01/31 18:42, Sriram Yagnaraman wrote: Add support for stripping/inserting VLAN for VFs. Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 51 ++- 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/hw/net/igb_core.c b/hw/n

Re: [PATCH v3 4/9] igb: implement VFRE and VFTE registers

2023-01-31 Thread Akihiko Odaki
On 2023/01/31 18:42, Sriram Yagnaraman wrote: Also add checks for RXDCTL/TXDCTL queue enable bits Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 30 +- hw/net/igb_core.h | 1 + hw/net/igb_regs.h | 3 +++ 3 files changed, 29 insertions(+), 5 deletions

Re: [PATCH v3 5/9] igb: check oversized packets for VMDq

2023-01-31 Thread Akihiko Odaki
On 2023/01/31 18:42, Sriram Yagnaraman wrote: Signed-off-by: Sriram Yagnaraman --- hw/net/igb_core.c | 48 +++ 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c index 4a1b98bf0e..2f6f30341f 100644 -

Re: [PATCH v3 3/9] igb: add ICR_RXDW

2023-01-31 Thread Akihiko Odaki
On 2023/01/31 18:42, Sriram Yagnaraman wrote: IGB uses RXDW ICR bit to indicate that rx descriptor has been written back. This is the same as RXT0 bit in older HW. Signed-off-by: Sriram Yagnaraman --- hw/net/e1000x_regs.h | 4 hw/net/igb_core.c| 46 +

[PATCH v7 9/9] docs/system/devices/igb: Add igb documentation

2023-01-31 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- MAINTAINERS | 1 + docs/system/device-emulation.rst | 1 + docs/system/devices/igb.rst | 71 3 files changed, 73 insertions(+) create mode 100644 docs/system/devices/igb.rst diff --git a/MAINTAINERS b/

[PATCH v7 3/9] e1000: Split header files

2023-01-31 Thread Akihiko Odaki
Some definitions in the header files are invalid for igb so extract them to new header files to keep igb from referring to them. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 1 + hw/ne

[PATCH v7 7/9] igb: Introduce qtest for igb device

2023-01-31 Thread Akihiko Odaki
This change is derived from qtest for e1000e device. Signed-off-by: Akihiko Odaki Acked-by: Thomas Huth --- MAINTAINERS | 2 + hw/net/igb_core.c | 8 +- tests/qtest/fuzz/generic_fuzz_configs.h | 5 + tests/qtest/igb-test.c

[PATCH v7 6/9] tests/qtest/libqos/e1000e: Export macreg functions

2023-01-31 Thread Akihiko Odaki
They will be useful for igb testing. Signed-off-by: Akihiko Odaki Reviewed-by: Thomas Huth --- tests/qtest/libqos/e1000e.c | 12 tests/qtest/libqos/e1000e.h | 12 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/qtest/libqos/e1000e.c b/tests/qtest

[PATCH v7 8/9] tests/avocado: Add igb test

2023-01-31 Thread Akihiko Odaki
This automates ethtool tests for igb registers, interrupts, etc. Signed-off-by: Akihiko Odaki --- MAINTAINERS | 1 + .../org.centos/stream/8/x86_64/test-avocado | 1 + tests/avocado/igb.py | 38 +++ 3 files changed, 4

[PATCH v7 1/9] hw/net/net_tx_pkt: Introduce net_tx_pkt_get_eth_hdr

2023-01-31 Thread Akihiko Odaki
Expose the ethernet header so that igb can utilize it to perform the internal routing among its SR-IOV functions. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki --- hw/net/net_tx_pkt.c | 6 ++ hw/net/net_tx_pkt.h | 8 2 files changed, 14 ins

[PATCH v7 2/9] pcie: Introduce pcie_sriov_num_vfs

2023-01-31 Thread Akihiko Odaki
igb can use this function to change its behavior depending on the number of virtual functions currently enabled. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/pci/pcie_sriov.c | 5 + include/hw/pci

[PATCH v7 5/9] tests/qtest/e1000e-test: Fabricate ethernet header

2023-01-31 Thread Akihiko Odaki
e1000e understands ethernet header so fabricate something convincing. Signed-off-by: Akihiko Odaki Reviewed-by: Thomas Huth --- tests/qtest/e1000e-test.c | 25 +++-- tests/qtest/libqos/e1000e.h | 2 ++ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/tests

[PATCH v7 0/9] Introduce igb

2023-01-31 Thread Akihiko Odaki
Based-on: <20230201033539.30049-1-akihiko.od...@daynix.com> ([PATCH v5 00/29] e1000x cleanups (preliminary for IGB)) igb is a family of Intel's gigabit ethernet controllers. This series implements 82576 emulation in particular. You can see the last patch for the documentation. Note that there is

Re: [PATCH v9 4/5] riscv: Introduce satp mode hw capabilities

2023-01-31 Thread Bin Meng
On Tue, Jan 31, 2023 at 10:41 PM Alexandre Ghiti wrote: > > Currently, the max satp mode is set with the only constraint that it must be > implemented in QEMU, i.e. set in valid_vm_1_10_[32|64]. > > But we actually need to add another level of constraint: what the hw is > actually capable of, beca

Re: [PATCH v9 3/5] riscv: Allow user to set the satp mode

2023-01-31 Thread Bin Meng
On Tue, Jan 31, 2023 at 11:13 PM Alexandre Ghiti wrote: > > RISC-V specifies multiple sizes for addressable memory and Linux probes for > the machine's support at startup via the satp CSR register (done in > csr.c:validate_vm). > > As per the specification, sv64 must support sv57, which in turn mu

[PATCH v6 9/9] docs/system/devices/igb: Add igb documentation

2023-01-31 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- MAINTAINERS | 1 + docs/system/device-emulation.rst | 1 + docs/system/devices/igb.rst | 71 3 files changed, 73 insertions(+) create mode 100644 docs/system/devices/igb.rst diff --git a/MAINTAINERS b/

[PATCH v6 1/9] hw/net/net_tx_pkt: Introduce net_tx_pkt_get_eth_hdr

2023-01-31 Thread Akihiko Odaki
Expose the ethernet header so that igb can utilize it to perform the internal routing among its SR-IOV functions. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki --- hw/net/net_tx_pkt.c | 6 ++ hw/net/net_tx_pkt.h | 8 2 files changed, 14 ins

[PATCH v6 5/9] tests/qtest/e1000e-test: Fabricate ethernet header

2023-01-31 Thread Akihiko Odaki
e1000e understands ethernet header so fabricate something convincing. Signed-off-by: Akihiko Odaki Reviewed-by: Thomas Huth --- tests/qtest/e1000e-test.c | 25 +++-- tests/qtest/libqos/e1000e.h | 2 ++ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/tests

[PATCH v6 7/9] igb: Introduce qtest for igb device

2023-01-31 Thread Akihiko Odaki
This change is derived from qtest for e1000e device. Signed-off-by: Akihiko Odaki Acked-by: Thomas Huth --- MAINTAINERS | 2 + tests/qtest/fuzz/generic_fuzz_configs.h | 5 + tests/qtest/igb-test.c | 243 tests/qtest/libqo

[PATCH v6 6/9] tests/qtest/libqos/e1000e: Export macreg functions

2023-01-31 Thread Akihiko Odaki
They will be useful for igb testing. Signed-off-by: Akihiko Odaki Reviewed-by: Thomas Huth --- tests/qtest/libqos/e1000e.c | 12 tests/qtest/libqos/e1000e.h | 12 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/qtest/libqos/e1000e.c b/tests/qtest

Re: [PATCH 01/18] vfio/migration: Add VFIO migration pre-copy support

2023-01-31 Thread Alex Williamson
On Tue, 31 Jan 2023 19:29:48 -0400 Jason Gunthorpe wrote: > On Tue, Jan 31, 2023 at 03:43:01PM -0700, Alex Williamson wrote: > > > How does this affect our path towards supported migration? I'm > > thinking about a user experience where QEMU supports migration if > > device A OR device B are at

[PATCH v6 8/9] tests/avocado: Add igb test

2023-01-31 Thread Akihiko Odaki
This automates ethtool tests for igb registers, interrupts, etc. Signed-off-by: Akihiko Odaki --- MAINTAINERS | 1 + .../org.centos/stream/8/x86_64/test-avocado | 1 + tests/avocado/igb.py | 38 +++ 3 files changed, 4

[PATCH v6 3/9] e1000: Split header files

2023-01-31 Thread Akihiko Odaki
Some definitions in the header files are invalid for igb so extract them to new header files to keep igb from referring to them. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 1 + hw/ne

[PATCH v6 2/9] pcie: Introduce pcie_sriov_num_vfs

2023-01-31 Thread Akihiko Odaki
igb can use this function to change its behavior depending on the number of virtual functions currently enabled. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/pci/pcie_sriov.c | 5 + include/hw/pci

[PATCH v6 0/9] Introduce igb

2023-01-31 Thread Akihiko Odaki
Based-on: <20230201033539.30049-1-akihiko.od...@daynix.com> ([PATCH v5 00/29] e1000x cleanups (preliminary for IGB)) igb is a family of Intel's gigabit ethernet controllers. This series implements 82576 emulation in particular. You can see the last patch for the documentation. Note that there is

Re: [PATCH v2] target/riscv: set tval for triggered watchpoints

2023-01-31 Thread Bin Meng
On Wed, Feb 1, 2023 at 1:35 AM Sergey Matyukevich wrote: > > From: Sergey Matyukevich > > According to priviledged spec, if [sm]tval is written with a nonzero typo: privileged > value when a breakpoint exception occurs, then [sm]tval will contain > the faulting virtual address. Set tval to hit

[PATCH v5 14/29] e1000e: Configure ResettableClass

2023-01-31 Thread Akihiko Odaki
This is part of recent efforts of refactoring e1000 and e1000e. DeviceClass's reset member is deprecated so migrate to ResettableClass. There is no behavioral difference. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000e.c | 10 +

[PATCH v5 28/29] MAINTAINERS: Add e1000e test files

2023-01-31 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki Acked-by: Thomas Huth --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 958915f227..e920d0061e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2218,6 +2218,8 @@ R: Akihiko Odaki S: Maintained F: hw/net/e1000e* F:

[PATCH v5 29/29] e1000e: Combine rx traces

2023-01-31 Thread Akihiko Odaki
Whether a packet will be written back to the guest depends on the remaining space of the queue. Therefore, e1000e_rx_written_to_guest and e1000e_rx_not_written_to_guest should log the index of the queue instead of generated interrupts. This also removes the need of e1000e_rx_rss_dispatched_to_queue

[PATCH v5 06/29] e1000e: Mask registers when writing

2023-01-31 Thread Akihiko Odaki
When a register has effective bits fewer than their width, the old code inconsistently masked when writing or reading. Make the code consistent by always masking when writing, and remove some code duplication. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 94 +++

[PATCH v5 08/29] e1000e: Use more constant definitions

2023-01-31 Thread Akihiko Odaki
The definitions of SW Semaphore Register were copied from: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/ethernet/intel/e1000e/defines.h?h=v6.0.9#n374 Signed-off-by: Akihiko Odaki --- hw/net/e1000_regs.h | 7 +++ hw/net/e1000e_core.c | 49 +++

[PATCH v5 05/29] e1000: Mask registers when writing

2023-01-31 Thread Akihiko Odaki
When a register has effective bits fewer than their width, the old code inconsistently masked when writing or reading. Make the code consistent by always masking when writing, and remove some code duplication. Signed-off-by: Akihiko Odaki --- hw/net/e1000.c | 84 +++--

[PATCH v5 24/29] hw/net/net_tx_pkt: Implement TCP segmentation

2023-01-31 Thread Akihiko Odaki
There was no proper implementation of TCP segmentation before this change, and net_tx_pkt relied solely on IPv4 fragmentation. Not only this is not aligned with the specification, but it also resulted in corrupted IPv6 packets. This is particularly problematic for the igb, a new proposed device im

[PATCH v5 23/29] e1000e: Perform software segmentation for loopback

2023-01-31 Thread Akihiko Odaki
e1000e didn't perform software segmentation for loopback if virtio-net header is enabled, which is wrong. To fix the problem, introduce net_tx_pkt_send_custom(), which allows the caller to specify whether offloading should be assumed or not. net_tx_pkt_send_custom() also allows the caller to prov

[PATCH v5 21/29] hw/net/net_tx_pkt: Automatically determine if virtio-net header is used

2023-01-31 Thread Akihiko Odaki
The new function qemu_get_using_vnet_hdr() allows to automatically determine if virtio-net header is used. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 3 +-- hw/net/net_tx_pkt.c | 19 ++- hw/net/net_tx_pkt.h | 3 +-- hw/net/vmxnet3.c | 6 ++ 4 files chang

[PATCH v5 17/29] e1000e: Remove extra pointer indirection

2023-01-31 Thread Akihiko Odaki
e1000e_write_packet_to_guest() passes the reference of variable ba as a pointer to an array, and that pointer indirection is just unnecessary; all functions which uses the passed reference performs no pointer operation on the pointer and they simply dereference the passed pointer. Remove the extra

[PATCH v5 13/29] e1000: Configure ResettableClass

2023-01-31 Thread Akihiko Odaki
This is part of recent efforts of refactoring e1000 and e1000e. DeviceClass's reset member is deprecated so migrate to ResettableClass. There is no behavioral difference. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 13 --

[PATCH v5 10/29] e1000e: Use memcpy to intialize registers

2023-01-31 Thread Akihiko Odaki
Use memcpy instead of memmove to initialize registers. The initial register templates and register table instances will never overlap. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000

[PATCH v5 18/29] net: Check L4 header size

2023-01-31 Thread Akihiko Odaki
net_tx_pkt_build_vheader() inspects TCP header but had no check for the header size, resulting in an undefined behavior. Check the header size and drop the packet if the header is too small. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 19 ++- hw/net/net_tx_pkt.c | 13

[PATCH v5 11/29] e1000e: Remove pending interrupt flags

2023-01-31 Thread Akihiko Odaki
They are duplicate of running throttling timer flags and incomplete as the flags are not cleared when the interrupts are fired or the device is reset. Signed-off-by: Akihiko Odaki --- hw/net/e1000e.c | 5 ++--- hw/net/e1000e_core.c | 19 +++ hw/net/e1000e_core.h | 2 -- hw

[PATCH v5 19/29] e1000x: Alter the signature of e1000x_is_vlan_packet

2023-01-31 Thread Akihiko Odaki
e1000x_is_vlan_packet() had a pointer to uint8_t as a parameter, but it does not have to be uint8_t. Change the type to void *. Signed-off-by: Akihiko Odaki --- hw/net/e1000x_common.c | 2 +- hw/net/e1000x_common.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/e10

[PATCH v5 20/29] net: Strip virtio-net header when dumping

2023-01-31 Thread Akihiko Odaki
filter-dump specifiees Ethernet as PCAP LinkType, which does not expect virtio-net header. Having virtio-net header in such PCAP file breaks PCAP unconsumable. Unfortunately currently there is no LinkType for virtio-net so for now strip virtio-net header to convert the output to Ethernet. Signed-o

[PATCH v5 04/29] e1000: Use hw/net/mii.h

2023-01-31 Thread Akihiko Odaki
hw/net/mii.h provides common definitions for MII. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 86 ++-- hw/net/e1000_regs.h| 46 hw/net/e1000e.c| 1 + hw/net/e1000e_core.c | 99 +

[PATCH v5 25/29] hw/net/net_tx_pkt: Check the payload length

2023-01-31 Thread Akihiko Odaki
Check the payload length if checksumming to ensure the payload contains the space for the resulting value. This bug was found by Alexander Bulekov with the fuzzer: https://patchew.org/QEMU/20230129053316.1071513-1-alx...@bu.edu/ The fixed test case is: fuzz/crash_6aeaa33e7211ecd603726c53e834df4c6

[PATCH v5 22/29] hw/net/net_rx_pkt: Remove net_rx_pkt_has_virt_hdr

2023-01-31 Thread Akihiko Odaki
When virtio-net header is not set, net_rx_pkt_get_vhdr() returns zero-filled virtio_net_hdr, which is actually valid. In fact, tap device uses zero-filled virtio_net_hdr when virtio-net header is not provided by the peer. Therefore, we can just remove net_rx_pkt_has_virt_hdr() and always assume Net

[PATCH v5 27/29] MAINTAINERS: Add Akihiko Odaki as a e1000e reviewer

2023-01-31 Thread Akihiko Odaki
I want to know to be notified when there is a new change for e1000e as e1000e is similar to igb and such a change may also be applicable for igb. Signed-off-by: Akihiko Odaki --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 08ad1e5341..958915f

[PATCH v5 12/29] e1000e: Improve software reset

2023-01-31 Thread Akihiko Odaki
This change makes e1000e reset more things when software reset was triggered. Some registers are exempted from software reset in the datasheet and this change also implements the behavior accordingly. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 24 +++- 1 file cha

[PATCH v5 15/29] e1000e: Introduce e1000_rx_desc_union

2023-01-31 Thread Akihiko Odaki
Before this change, e1000e_write_packet_to_guest() allocated the receive descriptor buffer as an array of uint8_t. This does not ensure the buffer is sufficiently aligned. Introduce e1000_rx_desc_union type, a union type of all receive descriptor types to correct this. Signed-off-by: Akihiko Odak

[PATCH v5 16/29] e1000e: Set MII_ANER_NWAY

2023-01-31 Thread Akihiko Odaki
This keeps Windows driver 12.18.9.23 from generating an event with ID 30. The description of the event is as follows: > Intel(R) 82574L Gigabit Network Connection > PROBLEM: The network adapter is configured for auto-negotiation but > the link partner is not. This may result in a duplex mismatch.

[PATCH v5 26/29] e1000e: Do not assert when MSI-X is disabled later

2023-01-31 Thread Akihiko Odaki
Assertions will fail if MSI-X gets disabled while a timer for MSI-X interrupts is running so remove them to avoid abortions. Fortunately, nothing bad happens even if the assertions won't trigger as msix_notify(), called by timer handlers, does nothing when MSI-X is disabled. This bug was found by

[PATCH v5 07/29] e1000: Use more constant definitions

2023-01-31 Thread Akihiko Odaki
The definitions for E1000_VFTA_ENTRY_SHIFT, E1000_VFTA_ENTRY_MASK, and E1000_VFTA_ENTRY_BIT_SHIFT_MASK were copied from: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/ethernet/intel/e1000/e1000_hw.h?h=v6.0.9#n306 The definitions for E1000_NUM_UNICAST, E1000_MC_T

[PATCH v5 01/29] e1000e: Fix the code style

2023-01-31 Thread Akihiko Odaki
igb implementation first starts off by copying e1000e code. Correct the code style before that. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 41 hw/net/e1000e.c| 72 ++-- hw/net/e1000e_core.c |

[PATCH v5 03/29] fsl_etsec: Use hw/net/mii.h

2023-01-31 Thread Akihiko Odaki
hw/net/mii.h provides common definitions for MII. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/fsl_etsec/etsec.c | 11 ++- hw/net/fsl_etsec/etsec.h | 17 - hw/net/fsl_etsec/miim.c | 5 +++-- include/hw/net/mii.h | 1 + 4 files change

[PATCH v5 09/29] e1000: Use memcpy to intialize registers

2023-01-31 Thread Akihiko Odaki
Use memcpy instead of memmove to initialize registers. The initial register templates and register table instances will never overlap. Signed-off-by: Akihiko Odaki --- hw/net/e1000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index d9d

[PATCH v5 02/29] hw/net: Add more MII definitions

2023-01-31 Thread Akihiko Odaki
The definitions will be used by igb. Signed-off-by: Akihiko Odaki --- include/hw/net/mii.h | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/hw/net/mii.h b/include/hw/net/mii.h index 4ae4dcce7e..c6a767a49a 100644 --- a/include/hw/net/mii.h +++ b/include/hw

[PATCH v5 00/29] e1000x cleanups (preliminary for IGB)

2023-01-31 Thread Akihiko Odaki
We are adding a new device named igb, yet another Intel NIC. As the new implementation derives from e1000e, overhaul e1000e implementation first. e1000 has many commonalities with e1000e so we also apply the corresponding changes to the device if possible. This was spun off from: https://patchew.o

Re: Emulating device configuration / max_virtqueue_pairs in vhost-vdpa and vhost-user

2023-01-31 Thread Jason Wang
On Wed, Feb 1, 2023 at 3:11 AM Eugenio Perez Martin wrote: > > On Tue, Jan 31, 2023 at 8:10 PM Eugenio Perez Martin > wrote: > > > > Hi, > > > > The current approach of offering an emulated CVQ to the guest and map > > the commands to vhost-user is not scaling well: > > * Some devices already off

Re: Emulating device configuration / max_virtqueue_pairs in vhost-vdpa and vhost-user

2023-01-31 Thread Jason Wang
On Wed, Feb 1, 2023 at 3:10 AM Eugenio Perez Martin wrote: > > Hi, > > The current approach of offering an emulated CVQ to the guest and map > the commands to vhost-user is not scaling well: > * Some devices already offer it, so the transformation is redundant. > * There is no support for commands

accel/tcg/translator.c question about translator_access

2023-01-31 Thread Sid Manning
There is an assert in translator_access that I hit while running on a version of QEMU integrated into a Virtual Platform. Since this function can return null anyway I tried the following experiment: --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -172,7 +172,9 @@ static void *transl

Re: [QEMU][PATCH v5 04/10] xen-hvm: reorganize xen-hvm and move common function to xen-hvm-common

2023-01-31 Thread Stefano Stabellini
On Tue, 31 Jan 2023, Vikram Garhwal wrote: > From: Stefano Stabellini > > This patch does following: > 1. creates arch_handle_ioreq() and arch_xen_set_memory(). This is done in > preparation for moving most of xen-hvm code to an arch-neutral location, > move the x86-specific portion of xe

Re: [QEMU][PATCH v5 09/10] hw/arm: introduce xenpvh machine

2023-01-31 Thread Stefano Stabellini
On Tue, 31 Jan 2023, Vikram Garhwal wrote: > Add a new machine xenpvh which creates a IOREQ server to register/connect with > Xen Hypervisor. > > Optional: When CONFIG_TPM is enabled, it also creates a tpm-tis-device, adds a > TPM emulator and connects to swtpm running on host machine via chardev

Re: [PULL 16/22] tcg/aarch64: Reorg goto_tb implementation

2023-01-31 Thread Zenghui Yu via
On 2023/1/18 7:10, Richard Henderson wrote: +void tb_target_set_jmp_target(const TranslationBlock *tb, int n, + uintptr_t jmp_rx, uintptr_t jmp_rw) +{ +uintptr_t d_addr = tb->jmp_target_addr[n]; +ptrdiff_t d_offset = d_addr - jmp_rx; +tcg_insn_unit insn; +

[PATCH 1/4] cpus: Make {start,end}_exclusive() recursive

2023-01-31 Thread Ilya Leoshkevich
Currently dying to one of the core_dump_signal()s deadlocks, because dump_core_and_abort() calls start_exclusive() two times: first via stop_all_tasks(), and then via preexit_cleanup() -> qemu_plugin_user_exit(). There are a number of ways to solve this: resume after dumping core; check cpu_in_exc

[PATCH 3/4] linux-user/sparc: Handle "ta 5"

2023-01-31 Thread Ilya Leoshkevich
GCC lowers __builtin_trap() to "ta 5", which in turn generates trap 0x105. Follow what kernel's bad_trap() is doing there. Signed-off-by: Ilya Leoshkevich --- linux-user/sparc/cpu_loop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loo

[PATCH 2/4] linux-user/microblaze: Handle privileged exception

2023-01-31 Thread Ilya Leoshkevich
Follow what kernel's full_exception() is doing. Signed-off-by: Ilya Leoshkevich --- linux-user/microblaze/cpu_loop.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/linux-user/microblaze/cpu_loop.c b/linux-user/microblaze/cpu_loop.c index 5ccf9e942ea..212e62d0a62 1

[PATCH 0/4] Fix deadlock when dying because of a signal

2023-01-31 Thread Ilya Leoshkevich
Hi, wasmtime testsuite found a deadlock in qemu_plugin_user_exit(). I tracked it down to one of my earlier patches, which introduced cleanup in dump_core_and_abort(). Patch 1 fixes the issue, patches 2 and 3 fix __builtin_trap() handling in microblaze and sparc - which is needed for patch 4, that

[PATCH 4/4] tests/tcg/linux-test: Add linux-fork-trap test

2023-01-31 Thread Ilya Leoshkevich
Check that dying due to a signal does not deadlock. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/linux/linux-fork-trap.c | 48 + 1 file changed, 48 insertions(+) create mode 100644 tests/tcg/multiarch/linux/linux-fork-trap.c diff --git a/tests/tcg/multiarch/linux

Re: [PATCH v9 1/3] hw/riscv: clear kernel_entry higher bits from load_elf_ram_sym()

2023-01-31 Thread Alistair Francis
On Fri, Jan 20, 2023 at 7:38 AM Daniel Henrique Barboza wrote: > > load_elf_ram_sym() will sign-extend 32 bit addresses. If a 32 bit > QEMU guest happens to be running in a hypervisor that are using 64 > bits to encode its address, kernel_entry can be padded with '1's > and create problems [1]. >

Re: [PATCH v2 11/20] hw/isa/lpc_ich9: Reuse memory and io address space of PCI bus

2023-01-31 Thread Bernhard Beschow
Am 31. Januar 2023 11:53:17 UTC schrieb Bernhard Beschow : >In pc_q35.c the PCI host bridge's io and memory space is initialized >with get_system_memory() and get_system_io() respectively. Therefore, >using pci_address_space() and pci_address_space_io() is equivalent. Self-NACK: pci_address_spa

RE: [PATCH] target/hexagon/idef-parser: Remove unused code paths

2023-01-31 Thread Taylor Simpson
> -Original Message- > From: Anton Johansson > Sent: Tuesday, January 31, 2023 4:32 PM > To: qemu-devel@nongnu.org > Cc: a...@rev.ng; Taylor Simpson ; Brian Cain > ; Michael Lambert > Subject: [PATCH] target/hexagon/idef-parser: Remove unused code paths > > Removes code paths used by

Re: [PATCH 01/18] vfio/migration: Add VFIO migration pre-copy support

2023-01-31 Thread Jason Gunthorpe
On Tue, Jan 31, 2023 at 03:43:01PM -0700, Alex Williamson wrote: > How does this affect our path towards supported migration? I'm > thinking about a user experience where QEMU supports migration if > device A OR device B are attached, but not devices A and B attached to > the same VM. We might h

Re: [PULL 10/56] x86: don't let decompressed kernel image clobber setup_data

2023-01-31 Thread Jason A. Donenfeld
On Mon, Jan 30, 2023 at 03:19:59PM -0500, Michael S. Tsirkin wrote: > From: "Jason A. Donenfeld" > > The setup_data links are appended to the compressed kernel image. Since > the kernel image is typically loaded at 0x10, setup_data lives at > `0x10 + compressed_size`, which does not get r

Re: [RFC v3 16/18] vfio/iommufd: Implement the iommufd backend

2023-01-31 Thread Jason Gunthorpe
On Tue, Jan 31, 2023 at 09:53:03PM +0100, Eric Auger wrote: > From: Yi Liu > > Add the iommufd backend. The IOMMUFD container class is implemented > based on the new /dev/iommu user API. This backend obviously depends > on CONFIG_IOMMUFD. > > So far, the iommufd backend doesn't support live migr

Re: [PATCH v3 0/9] virtio-gpu: Support Venus Vulkan driver

2023-01-31 Thread Dmitry Osipenko
Hello, On 1/30/23 20:00, Alex Bennée wrote: > > Antonio Caggiano writes: > >> This series of patches enables support for the Venus VirtIO-GPU Vulkan >> driver by adding some features required by the driver: >> >> - CONTEXT_INIT >> - HOSTMEM >> - RESOURCE_UUID >> - BLOB_RESOURCES >> >> In additi

[PATCH v5 04/14] Hexagon (target/hexagon) Add overrides for dealloc-return instructions

2023-01-31 Thread Taylor Simpson
These instructions perform a deallocframe+return (jumpr r31) Add overrides for L4_return SL2_return L4_return_t L4_return_f L4_return_tnew_pt L4_return_fnew_pt L4_return_tnew_pnt L4_return_fnew_pnt SL2_return_t SL2_return_f SL2_return_tnew SL2_return

[PATCH v5 07/14] Hexagon (target/hexagon) Analyze packet for HVX

2023-01-31 Thread Taylor Simpson
Extend the analyze_ functions for HVX vector and predicate writes Remove calls to ctx_log_vreg_write[_pair] from gen_tcg_funcs.py During gen_start_packet, reload the predicated HVX registers into fugure_VRegs and tmp_VRegs Signed-off-by: Taylor Simpson --- target/hexagon/translate.h

[PATCH v5 01/14] Hexagon (target/hexagon) Add overrides for jumpr31 instructions

2023-01-31 Thread Taylor Simpson
Add overrides for SL2_jumpr31Unconditional SL2_jumpr31_t Predicated true (old value) SL2_jumpr31_f Predicated false (old value) SL2_jumpr31_tnew Predicated true (new value) SL2_jumpr31_fnew Predicated false (new value) Signed-off-by: Ta

[PATCH v5 08/14] Hexagon (tests/tcg/hexagon) Update preg_alias.c

2023-01-31 Thread Taylor Simpson
Add control registers (c4, c5) to clobbers list Made possible by new toolchain container Signed-off-by: Taylor Simpson --- tests/tcg/hexagon/preg_alias.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/tcg/hexagon/preg_alias.c b/tests/tcg/hexagon/preg_alias.c

[PATCH v5 11/14] Hexagon (target/hexagon) Change subtract from zero to change sign

2023-01-31 Thread Taylor Simpson
The F2_sffms instruction [r0 -= sfmpy(r1, r2)] doesn't properly handle -0. Previously we would negate the input operand by subtracting from zero. Instead, we negate by changing the sign bit. Test case added to tests/tcg/hexagon/fpstuff.c Signed-off-by: Taylor Simpson --- target/hexagon/op_hel

  1   2   3   4   >