[PATCH v9 08/17] msi: Omit errp for pci_add_capability

2022-11-01 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. A caller of msi_init(), which calls pci_add_capability() in turn, is expected to ensure that will not happen. Signed-off-by: Akihiko Odaki --- hw/pci/msi.c | 9 + 1 file changed, 1 insertion(+), 8

[PATCH v8 06/17] eepro100: Omit errp for pci_add_capability

2022-11-01 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. This behavior is appropriate here because all of the capabilities set in this device are defined in the program and their overlap should not happen unless there is a programming error. Signed-off-by: Akihiko Odaki

[PATCH v9 06/17] eepro100: Omit errp for pci_add_capability

2022-11-01 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. This behavior is appropriate here because all of the capabilities set in this device are defined in the program and their overlap should not happen unless there is a programming error. Signed-off-by: Akihiko Odaki

[PATCH v9 16/17] virtio-pci: Omit errp for pci_add_capability

2022-11-01 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. This behavior is appropriate here because all of the capabilities set in this device are defined in the program and their overlap should not happen unless there is a programming error. Signed-off-by: Akihiko Odaki

[PATCH v9 09/17] hw/pci/pci_bridge: Omit errp for pci_add_capability

2022-11-01 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. A caller of pci_bridge_ssvid_init(), which calls pci_add_capability() in turn, is expected to ensure that will not happen. Signed-off-by: Akihiko Odaki --- include/hw/pci/pci_bridge.h| 5 ++--- hw/pci

[PATCH v8 09/17] hw/pci/pci_bridge: Omit errp for pci_add_capability

2022-11-01 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. A caller of pci_bridge_ssvid_init(), which calls pci_add_capability() in turn, is expected to ensure that will not happen. Signed-off-by: Akihiko Odaki --- hw/pci-bridge/i82801b11.c | 14

[PATCH v8 13/17] pci/slotid: Omit errp for pci_add_capability

2022-11-01 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. A caller of slotid_cap_init(), which calls pci_add_capability() in turn, is expected to ensure that will not happen. Signed-off-by: Akihiko Odaki --- hw/pci/slotid_cap.c | 8 ++-- 1 file changed, 2 insertions

[PATCH v6 10/17] pcie: Omit errp for pci_add_capability

2022-10-31 Thread Akihiko Odaki
Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. A caller of a PCIe function which calls pci_add_capability() in turn is expected to ensure that will not happen. Signed-off-by: Akihiko Odaki Acked-by: Jonathan Cameron (for CXL parts) --- docs/pcie_sriov.txt

[PATCH] e1000e: Introduce e1000_rx_desc_union

2022-12-25 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

Re: [PATCH 0/5] hw/net/igb: emulated network device with SR-IOV

2022-12-28 Thread Akihiko Odaki
mit it once it is ready, and you can apply changes in Sriram's series on top it. I'd like to hear which is more convenient for you, or another idea if you have. Regards, Akihiko Odaki

[PATCH v2] e1000e: Introduce e1000_rx_desc_union

2023-01-07 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

[PATCH] net: Strip virtio-net header when dumping

2023-01-13 Thread Akihiko Odaki
-off-by: Akihiko Odaki --- include/net/net.h | 6 ++ net/dump.c| 11 +++ net/net.c | 18 ++ net/netmap.c | 1 + net/tap.c | 16 5 files changed, 48 insertions(+), 4 deletions(-) diff --git a/include/net/net.h b/include/net

[PATCH 22/31] igb: Copy e1000e code

2023-01-12 Thread Akihiko Odaki
Start off igb implementation by copying e1000e code first as igb resembles e1000e. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki --- MAINTAINERS |5 + hw/net/igb.c| 726 + hw/net/igb_common.h | 104 ++ hw/net/igb_core.c

[PATCH 21/31] e1000: Split header files

2023-01-12 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 --- hw/net/e1000.c | 2 +- hw/net/e1000_common.h | 104 + hw

[PATCH 27/31] tests/qtest/libqos/e1000e: Export macreg functions

2023-01-12 Thread Akihiko Odaki
They will be useful for igb testing. Signed-off-by: Akihiko Odaki --- 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/libqos/e1000e.c index

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

2023-01-12 Thread Akihiko Odaki
hw/net/mii.h provides common definitions for MII. Signed-off-by: Akihiko Odaki --- 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 changed, 10 insertions(+), 24 deletions

[PATCH 11/31] e1000e: Remove pending interrupt flags

2023-01-12 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

[PATCH 26/31] tests/qtest/e1000e-test: Fabricate ethernet header

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

[PATCH 16/31] e1000e: Set MII_ANER_NWAY

2023-01-12 Thread Akihiko Odaki
mismatch. > ACTION: Configure the link partner for auto-negotiation. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index d8c17baf8f..736708407c 100644 --- a/hw/net/e1000e_

[PATCH 17/31] tests/qtest/e1000e-test: Fix the code style

2023-01-12 Thread Akihiko Odaki
igb implementation first starts off by copying e1000e code. Correct the code style before that. Signed-off-by: Akihiko Odaki --- tests/qtest/e1000e-test.c | 2 +- tests/qtest/libqos/e1000e.c | 6 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/qtest/e1000e-test.c b

[PATCH 23/31] igb: Rename identifiers

2023-01-12 Thread Akihiko Odaki
Rename identifiers of definitions which will be modified later for igb. This will also allow to build igb along with e1000e. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki --- hw/net/igb.c| 368 +- hw/net/igb_common.h |6 +- hw/net

[PATCH 28/31] tests/qtest/libqos/igb: Copy e1000e code

2023-01-12 Thread Akihiko Odaki
Start off igb test implementation by copying e1000e code first as igb resembles e1000e. Signed-off-by: Akihiko Odaki --- MAINTAINERS | 2 + tests/qtest/igb-test.c | 242 +++ tests/qtest/libqos/igb.c | 226

[PATCH 20/31] pcie: Introduce pcie_sriov_num_vfs

2023-01-12 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 --- hw/pci/pcie_sriov.c | 5 + include/hw/pci/pcie_sriov.h | 3 +++ 2 files

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

2023-01-12 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

[PATCH 13/31] e1000: Configure ResettableClass

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

[PATCH 19/31] hw/net/net_tx_pkt: Introduce net_tx_pkt_get_eth_hdr

2023-01-12 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

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

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

[PATCH 05/31] e1000: Mask registers when writing

2023-01-12 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 01/31] e1000e: Fix the code style

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

[PATCH 15/31] e1000e: Introduce e1000_rx_desc_union

2023-01-12 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

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

2023-01-12 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

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

2023-01-12 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

[PATCH 14/31] e1000e: Configure ResettableClass

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

[PATCH 06/31] e1000e: Mask registers when writing

2023-01-12 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 24/31] igb: Build igb

2023-01-12 Thread Akihiko Odaki
Currently igb functions identically with e1000e. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki --- hw/net/Kconfig | 5 + hw/net/meson.build | 2 ++ 2 files changed, 7 insertions(+) diff --git a/hw/net/Kconfig b/hw/net/Kconfig index 1cc1c5775e

[PATCH 08/31] e1000e: Use more constant definitions

2023-01-12 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 30/31] tests/avocado: Add igb test

2023-01-12 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

[PATCH 18/31] tests/qtest/libqos/e1000e: Remove duplicate register definitions

2023-01-12 Thread Akihiko Odaki
The register definitions in tests/qtest/libqos/e1000e.h had names different from hw/net/e1000_regs.h, which made it hard to understand what test codes corresponds to the implementation. Use hw/net/e1000_regs.h from tests/qtest/libqos/e1000e.c to remove these duplications. Signed-off-by: Akihiko

[PATCH 12/31] e1000e: Improve software reset

2023-01-12 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

[PATCH 00/31] Introduce igb

2023-01-12 Thread Akihiko Odaki
/20221201100113.64387-1-akihiko.od...@daynix.com/ 15: https://patchew.org/QEMU/20230107143328.102534-1-akihiko.od...@daynix.com/ Akihiko Odaki (31): e1000e: Fix the code style hw/net: Add more MII definitions fsl_etsec: Use hw/net/mii.h e1000: Use hw/net/mii.h e1000: Mask registers when writing

[PATCH 29/31] tests/qtest/libqos/igb: Transform to igb tests

2023-01-12 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- tests/qtest/fuzz/generic_fuzz_configs.h | 5 + tests/qtest/igb-test.c | 67 ++-- tests/qtest/libqos/igb.c| 139 +--- tests/qtest/libqos/meson.build | 1 + tests/qtest/meson.build

[PATCH 31/31] docs/system/devices/igb: Add igb documentation

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

[PATCH 07/31] e1000: Use more constant definitions

2023-01-12 Thread Akihiko Odaki
, E1000_MC_TBL_SIZE, and E1000_VLAN_FILTER_TBL_SIZE 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#n707 Signed-off-by: Akihiko Odaki --- hw/net/e1000.c | 50 +++--- hw

Re: UI layer threading and locking strategy; memory_region_snapshot_and_clear_dirty() races

2022-11-22 Thread Akihiko Odaki
rence happens after memory_region_snapshot_and_clear_dirty(). Even if you make memory_region_snapshot_and_clear_dirty() asynchronous, the bug will remain if you keep the stale reference of the DisplaySurface and pass it to the asynchronous callback. Regards, Akihiko Odaki Paolo: what (if

[PATCH] e1000e: Mask registers when writing

2022-11-18 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] e1000e: Define E1000_SWSM_SMBI

2022-11-18 Thread Akihiko Odaki
Define yet another magic number. The definition was 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 | 2 +- 2

[PATCH] e1000: Mask registers when writing

2022-11-18 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 v2] e1000e: Configure ResettableClass

2022-11-25 Thread Akihiko Odaki
This is part of recent efforts of refactoring e1000 and e1000e. DeviceClass's reset member is deprecated so migrate to ResettableClass. Thre is no behavioral difference. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell --- hw/net/e1000e.c | 10 ++ hw/net/trace-events | 2

[PATCH] e1000e: Configure ResettableClass

2022-11-25 Thread Akihiko Odaki
This is part of recent efforts of refactoring e1000 and e1000e. DeviceClass's reset member is deprecated so migrate to ResettableClass. Thre is no behavioral difference. Signed-off-by: Akihiko Odaki --- hw/net/e1000e.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git

[PATCH] e1000: Configure ResettableClass

2022-11-25 Thread Akihiko Odaki
This is part of recent efforts of refactoring e1000 and e1000e. DeviceClass's reset member is deprecated so migrate to ResettableClass. Thre is no behavioral difference. Signed-off-by: Akihiko Odaki --- hw/net/e1000.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git

[PATCH v2] e1000: Use hw/net/mii.h

2022-11-25 Thread Akihiko Odaki
hw/net/mii.h provides common definitions for MII. Signed-off-by: Akihiko Odaki --- hw/net/e1000_regs.h| 46 hw/net/e1000x_common.h | 8 ++-- hw/net/e1000.c | 86 ++-- hw/net/e1000e.c| 1 + hw/net/e1000e_core.c | 99

[PATCH v2] e1000: Configure ResettableClass

2022-11-25 Thread Akihiko Odaki
This is part of recent efforts of refactoring e1000 and e1000e. DeviceClass's reset member is deprecated so migrate to ResettableClass. Thre is no behavioral difference. Signed-off-by: Akihiko Odaki --- hw/net/e1000.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff

[PATCH] e1000e: Use memcpy to intialize registers

2022-11-25 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

[PATCH] docs/devel/reset.rst: Correct function names

2022-11-25 Thread Akihiko Odaki
resettable_class_set_parent_phases() was mistakenly called resettable_class_set_parent_reset_phases() in some places. Signed-off-by: Akihiko Odaki --- docs/devel/reset.rst | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/devel/reset.rst b/docs/devel

[PATCH] e1000e: Remove pending interrupt flags

2022-11-25 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_core.h | 2 -- hw/net/e1000e.c | 3 --- hw/net/e1000e_core.c | 19 +++ hw

[PATCH v2] e1000e: Remove pending interrupt flags

2022-11-25 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_core.h | 2 -- hw/net/e1000e.c | 5 ++--- hw/net/e1000e_core.c | 19

[PATCH v3] e1000: Configure ResettableClass

2022-12-01 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] target/arm: Propagate errno when writing list

2022-12-01 Thread Akihiko Odaki
and fail early anyway. So let write_kvmstate_to_list() and write_list_to_kvmstate() fail early too. This will allow to propagate errno to the callers and log it if appropriate. Signed-off-by: Akihiko Odaki --- target/arm/kvm-stub.c | 4 ++-- target/arm/kvm.c | 27

Re: [PATCH] accel/kvm/kvm-all: Handle register access errors

2022-12-01 Thread Akihiko Odaki
On 2022/12/01 19:40, Peter Maydell wrote: On Thu, 1 Dec 2022 at 10:27, Akihiko Odaki wrote: A register access error typically means something seriously wrong happened so that anything bad can happen after that and recovery is impossible. Even failing one register access is catastorophic

[PATCH] accel/kvm/kvm-all: Handle register access errors

2022-12-01 Thread Akihiko Odaki
stop and nothing worse happens if such an error occurs. Signed-off-by: Akihiko Odaki --- accel/kvm/kvm-all.c | 32 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index f99b0becd8..9e848f750e 100644

[PATCH v3] e1000e: Configure ResettableClass

2022-12-01 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

Re: Display update issue on M1 Macs

2023-01-13 Thread Akihiko Odaki
by memory_region_snapshot_and_clear_dirty()? For now, to workaround the issue, I think you can create another mutex and make the entire sm501_2d_engine_write() and sm501_update_display() critical sections. Regards, Akihiko Odaki

[PATCH v2] net: Strip virtio-net header when dumping

2023-01-13 Thread Akihiko Odaki
-off-by: Akihiko Odaki --- include/net/net.h | 6 ++ net/dump.c| 11 +++ net/net.c | 18 ++ net/tap.c | 16 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index dc20b31e9f

Re: [PATCH] net: Strip virtio-net header when dumping

2023-01-13 Thread Akihiko Odaki
On 2023/01/13 22:40, Philippe Mathieu-Daudé wrote: On 13/1/23 14:08, Akihiko Odaki wrote: 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

[PATCH 12/19] e1000e: Improve software reset

2023-01-13 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

Re: [PATCH] accel/kvm: Specify default IPA size for arm64

2023-01-13 Thread Akihiko Odaki
On 2023/01/14 14:23, Richard Henderson wrote: On 1/8/23 22:22, Akihiko Odaki wrote: libvirt uses "none" machine type to test KVM availability. Before this change, QEMU used to pass 0 as machine type when calling KVM_CREATE_VM. The kernel documentation says: On arm64, the physical ad

[PATCH v2 05/13] igb: Rename identifiers

2023-01-13 Thread Akihiko Odaki
Rename identifiers of definitions which will be modified later for igb. This will also allow to build igb along with e1000e. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki --- hw/net/igb.c| 368 +- hw/net/igb_common.h |6 +- hw/net

[PATCH 19/19] tests/qtest/libqos/e1000e: Remove duplicate register definitions

2023-01-13 Thread Akihiko Odaki
The register definitions in tests/qtest/libqos/e1000e.h had names different from hw/net/e1000_regs.h, which made it hard to understand what test codes corresponds to the implementation. Use hw/net/e1000_regs.h from tests/qtest/libqos/e1000e.c to remove these duplications. Signed-off-by: Akihiko

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

2023-01-13 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

[PATCH 08/19] e1000e: Use more constant definitions

2023-01-13 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 06/19] e1000e: Mask registers when writing

2023-01-13 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 00/19] e1000x cleanups (preliminary for IGB)

2023-01-13 Thread Akihiko Odaki
aynix.com/ 15: https://patchew.org/QEMU/20230107143328.102534-1-akihiko.od...@daynix.com/ Akihiko Odaki (19): e1000e: Fix the code style hw/net: Add more MII definitions fsl_etsec: Use hw/net/mii.h e1000: Use hw/net/mii.h e1000: Mask registers when writing e1000e: Mask registers when writing e100

[PATCH v2 04/13] igb: Copy e1000e code

2023-01-13 Thread Akihiko Odaki
Start off igb implementation by copying e1000e code first as igb resembles e1000e. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki --- MAINTAINERS |5 + hw/net/igb.c| 727 + hw/net/igb_common.h | 102 ++ hw/net/igb_core.c

[PATCH 15/19] e1000e: Introduce e1000_rx_desc_union

2023-01-13 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

[PATCH 16/19] e1000e: Set MII_ANER_NWAY

2023-01-13 Thread Akihiko Odaki
mismatch. > ACTION: Configure the link partner for auto-negotiation. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000e_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index d8c17baf8f

[PATCH 13/19] e1000: Configure ResettableClass

2023-01-13 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 18/19] tests/qtest/e1000e-test: Fix the code style

2023-01-13 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é --- tests/qtest/e1000e-test.c | 2 +- tests/qtest/libqos/e1000e.c | 6 -- 2 files changed, 5 insertions(+), 3 deletions

[PATCH v2 02/13] pcie: Introduce pcie_sriov_num_vfs

2023-01-13 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

[PATCH v2 10/13] tests/qtest/libqos/igb: Copy e1000e code

2023-01-13 Thread Akihiko Odaki
Start off igb test implementation by copying e1000e code first as igb resembles e1000e. Signed-off-by: Akihiko Odaki --- MAINTAINERS | 2 + tests/qtest/igb-test.c | 242 +++ tests/qtest/libqos/igb.c | 226

[PATCH v2 12/13] tests/avocado: Add igb test

2023-01-13 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

[PATCH v2 11/13] tests/qtest/libqos/igb: Transform to igb tests

2023-01-13 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- tests/qtest/fuzz/generic_fuzz_configs.h | 5 + tests/qtest/igb-test.c | 67 ++-- tests/qtest/libqos/igb.c| 139 +--- tests/qtest/libqos/meson.build | 1 + tests/qtest/meson.build

[PATCH 14/19] e1000e: Configure ResettableClass

2023-01-13 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 v2 08/13] tests/qtest/e1000e-test: Fabricate ethernet header

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

[PATCH v2 09/13] tests/qtest/libqos/e1000e: Export macreg functions

2023-01-13 Thread Akihiko Odaki
They will be useful for igb testing. Signed-off-by: Akihiko Odaki --- 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/libqos/e1000e.c index

[PATCH v2 03/13] e1000: Split header files

2023-01-13 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

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

2023-01-13 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

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

2023-01-13 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 01/19] e1000e: Fix the code style

2023-01-13 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 02/19] hw/net: Add more MII definitions

2023-01-13 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

[PATCH 05/19] e1000: Mask registers when writing

2023-01-13 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 17/19] e1000e: Remove extra pointer indirection

2023-01-13 Thread Akihiko Odaki
pointer indirection. Signed-off-by: Akihiko Odaki --- hw/net/e1000e_core.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 736708407c..d143f2ae6f 100644 --- a/hw/net/e1000e_core.c +++ b

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

2023-01-13 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

[PATCH v2 13/13] docs/system/devices/igb: Add igb documentation

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

[PATCH v2 06/13] igb: Build igb

2023-01-13 Thread Akihiko Odaki
Currently igb functions identically with e1000e. Signed-off-by: Gal Hammer Signed-off-by: Marcel Apfelbaum Signed-off-by: Akihiko Odaki --- hw/net/Kconfig | 5 + hw/net/meson.build | 2 ++ 2 files changed, 7 insertions(+) diff --git a/hw/net/Kconfig b/hw/net/Kconfig index 1cc1c5775e

[PATCH v2 01/13] hw/net/net_tx_pkt: Introduce net_tx_pkt_get_eth_hdr

2023-01-13 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

[PATCH v2 00/13] Introduce igb

2023-01-13 Thread Akihiko Odaki
think there are several different ways to get the changes into the mainline. I'm open to any options. V1 -> V2: - Spun off e1000e general improvements to a distinct series. - Restored vnet_hdr offload as there seems nothing preventing from that. Akihiko Odaki (13): hw/net/net_tx_pkt:

[PATCH 07/19] e1000: Use more constant definitions

2023-01-13 Thread Akihiko Odaki
, E1000_MC_TBL_SIZE, and E1000_VLAN_FILTER_TBL_SIZE 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#n707 Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/net/e1000.c | 50

[PATCH 11/19] e1000e: Remove pending interrupt flags

2023-01-13 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

Re: Display update issue on M1 Macs

2023-01-19 Thread Akihiko Odaki
On 2023/01/15 3:11, BALATON Zoltan wrote: On Sat, 14 Jan 2023, Akihiko Odaki wrote: On 2023/01/13 22:43, BALATON Zoltan wrote: On Thu, 5 Jan 2023, BALATON Zoltan wrote: Hello, I got reports from several users trying to run AmigaOS4 on sam460ex on Apple silicon Macs that they get missing

[PATCH v2 00/26] e1000x cleanups (preliminary for IGB)

2023-01-23 Thread Akihiko Odaki
1000e: Perform software segmentation for loopback". - Added "hw/net/net_tx_pkt: Implement TCP segmentation" - Added "MAINTAINERS: Add Akihiko Odaki as a e1000e reviewer". - Added "MAINTAINERS: Add e1000e test files". Akihiko Odaki (26): e1000e: Fix the code style

<    8   9   10   11   12   13   14   15   16   17   >