Re: [PATCH 1/2] i386/xen: Move KVM_XEN_HVM_CONFIG ioctl to kvm_xen_init_vcpu()

2025-02-07 Thread David Woodhouse
On 7 February 2025 15:37:40 GMT, Sean Christopherson wrote: >On Fri, Feb 07, 2025, David Woodhouse wrote: >> From: David Woodhouse >> >> At the time kvm_xen_init() is called, hyperv_enabled() doesn't yet work, so >> the correct MSR index to use for the hypercall

[PATCH 1/2] i386/xen: Move KVM_XEN_HVM_CONFIG ioctl to kvm_xen_init_vcpu()

2025-02-07 Thread David Woodhouse
From: David Woodhouse At the time kvm_xen_init() is called, hyperv_enabled() doesn't yet work, so the correct MSR index to use for the hypercall page isn't known. Rather than setting it to the default and then shifting it later for the Hyper-V case with a confusing second call to kv

[PATCH 2/2] hw/xen: Add "mode" parameter to xen-block devices

2025-02-07 Thread David Woodhouse
From: David Woodhouse Block devices don't work in PV Grub (0.9x) if there is no mode specified. It complains: "Error ENOENT when reading the mode" Signed-off-by: David Woodhouse --- hw/block/xen-block.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/block/xen-block.c

[PULL 1/8] hw/xen: Add xs_node_read() helper function

2025-01-16 Thread David Woodhouse
From: David Woodhouse This returns the full contents of the node, having created the node path from the printf-style format string provided in its arguments. This will save various callers from having to do so for themselves (and from using xs_node_scanf() with the non-portable %ms format

[PULL 0/8] Xen regression fixes and cleanups

2025-01-16 Thread David Woodhouse
From: David Woodhouse The following changes since commit 7433709a147706ad7d1956b15669279933d0f82b: Merge tag 'hw-misc-20250113' of https://github.com/philmd/qemu into staging (2025-01-14 12:46:56 -0500) are available in the Git repository at: git://git.infradead.org/users/dwmw

[PULL 5/8] hw/xen: Use xs_node_read() from xen_netdev_get_name()

2025-01-16 Thread David Woodhouse
From: David Woodhouse Now that xs_node_read() can construct a node path, no need to open-code it. Signed-off-by: David Woodhouse Reviewed-by: Anthony PERARD Acked-by: Roger Pau Monné --- hw/net/xen_nic.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw

[PULL 8/8] system/runstate: Fix regression, clarify BQL status of exit notifiers

2025-01-16 Thread David Woodhouse
}_exit_notifier() declarations. Fixes: f5ab12caba4f ("ui & main loop: Redesign of system-specific main thread event handling") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2771 Reported-by: David Woodhouse Signed-off-by: Phil Dennis-Jordan Tested-by: David Woodhouse Signed

[PULL 4/8] hw/xen: Use xs_node_read() from xen_console_get_name()

2025-01-16 Thread David Woodhouse
From: David Woodhouse Now that xs_node_read() can construct a node path, no need to open-code it. Signed-off-by: David Woodhouse Reviewed-by: Anthony PERARD Acked-by: Roger Pau Monné --- hw/char/xen_console.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff

[PULL 6/8] hw/xen: Use xs_node_read() from xenstore_read_str() instead of open-coding it

2025-01-16 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Anthony PERARD Acked-by: Roger Pau Monné --- hw/xen/xen_pvdev.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index c5ad71e8dc..c9143ba259 100644 --- a/hw/xen

[PULL 2/8] xen: do not use '%ms' scanf specifier

2025-01-16 Thread David Woodhouse
le allocation of the same string. Instead use xs_node_read() to read the whole xenstore node. Fixes: a783f8ad4ec9 ('xen: add a mechanism to automatically create XenDevice-s...') Fixes: 9b7737469080 ('hw/xen: update Xen console to XenDevice model') Signed-off-by: Roger Pau Mo

[PULL 3/8] hw/xen: Use xs_node_read() from xs_node_vscanf()

2025-01-16 Thread David Woodhouse
From: David Woodhouse Reduce some duplication. Signed-off-by: David Woodhouse Reviewed-by: Anthony PERARD Acked-by: Roger Pau Monné --- hw/xen/trace-events | 1 - hw/xen/xen-bus-helper.c | 15 ++- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/hw/xen/trace

[PULL 7/8] hw/xen: Fix errp handling in xen_console

2025-01-16 Thread David Woodhouse
From: David Woodhouse When attempting to read the 'output' node, interpret any error *other* than ENOENT as a fatal error. For ENOENT, fall back to serial_hd() to find a character device, or create a null device. Do not attempt to prepend to errp when serial_hd() fails; the error isn&

Re: [PATCH v3 7/7] hw/xen: Fix errp handling in xen_console

2025-01-15 Thread David Woodhouse
h now looks like this: From 8b44a3e39f36540818d99ef8cf79e64bba1ed9c3 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Wed, 15 Jan 2025 15:46:06 + Subject: [PATCH] hw/xen: Fix errp handling in xen_console When attempting to read the 'output' node, interpret any error *other* th

[PATCH v3 3/7] hw/xen: Use xs_node_read() from xs_node_vscanf()

2025-01-15 Thread David Woodhouse
From: David Woodhouse Reduce some duplication. Signed-off-by: David Woodhouse Reviewed-by: Anthony PERARD Acked-by: Roger Pau Monné --- hw/xen/trace-events | 1 - hw/xen/xen-bus-helper.c | 15 ++- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/hw/xen/trace

[PATCH v3 2/7] xen: do not use '%ms' scanf specifier

2025-01-15 Thread David Woodhouse
le allocation of the same string. Instead use xs_node_read() to read the whole xenstore node. Fixes: a783f8ad4ec9 ('xen: add a mechanism to automatically create XenDevice-s...') Fixes: 9b7737469080 ('hw/xen: update Xen console to XenDevice model') Signed-off-by: Roger Pau M

[PATCH v3 1/7] xen: error handling and FreeBSD compatibility fixes

2025-01-15 Thread David Woodhouse
_read(). • Clean up errp handling for xen-console 'output' node. • Improve comment for xs_node_read(). v2: • Add xs_node_read() helper. • Also fix usage of %ms in xen-block.c David Woodhouse (6): hw/xen: Add xs_node_read() helper function hw/xen: Use xs_node_read() from

[PATCH v3 6/7] hw/xen: Use xs_node_read() from xenstore_read_str() instead of open-coding it

2025-01-15 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Anthony PERARD Acked-by: Roger Pau Monné --- hw/xen/xen_pvdev.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index c5ad71e8dc..c9143ba259 100644 --- a/hw/xen

[PATCH v3 4/7] hw/xen: Use xs_node_read() from xen_console_get_name()

2025-01-15 Thread David Woodhouse
From: David Woodhouse Now that xs_node_read() can construct a node path, no need to open-code it. Signed-off-by: David Woodhouse Reviewed-by: Anthony PERARD Acked-by: Roger Pau Monné --- hw/char/xen_console.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff

[PATCH v3 7/7] hw/xen: Fix errp handling in xen_console

2025-01-15 Thread David Woodhouse
From: David Woodhouse When attempting to read the 'output' node, interpret any error *other* than ENOENT as a fatal error. For ENOENT, fall back to serial_hd() to find a character device, or create a null device. Do not attempt to prepend to errp when serial_hd() fails; the error isn&

[PATCH v3 5/7] hw/xen: Use xs_node_read() from xen_netdev_get_name()

2025-01-15 Thread David Woodhouse
From: David Woodhouse Now that xs_node_read() can construct a node path, no need to open-code it. Signed-off-by: David Woodhouse Reviewed-by: Anthony PERARD Acked-by: Roger Pau Monné --- hw/net/xen_nic.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw

[PATCH v3 1/7] hw/xen: Add xs_node_read() helper function

2025-01-15 Thread David Woodhouse
From: David Woodhouse This returns the full contents of the node, having created the node path from the printf-style format string provided in its arguments. This will save various callers from having to do so for themselves (and from using xs_node_scanf() with the non-portable %ms format

Re: [PATCH v2 2/2] xen: do not use '%ms' scanf specifier

2025-01-15 Thread David Woodhouse
ore path > as error_setg() will not set `errp` again. > > Could you keep ignoring errors from xs_node_read() like it was done with > xs_node_scanf() (I mean pass `NULL` instead of `errp`)? And we will need > another patch to fix the wrong use of `error_prepend()` and use > `error_setg` i

Re: [PATCH v2 0/2] xen: error handling and FreeBSD compatibility fixes

2025-01-15 Thread David Woodhouse
On Wed, 2025-01-15 at 15:34 +0100, Roger Pau Monné wrote: > On Fri, Jan 10, 2025 at 10:02:53AM +0000, David Woodhouse wrote: > > On Fri, 2025-01-10 at 10:35 +0100, Roger Pau Monne wrote: > > > Hello, > > > > > > First patch from David introduces a new helper

[PATCH 3/4] hw/xen: Use xs_node_read() from xen_netdev_get_name()

2025-01-10 Thread David Woodhouse
From: David Woodhouse Now that xs_node_read() can construct a node path, no need to open-code it. Signed-off-by: David Woodhouse --- hw/net/xen_nic.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c index 97ebd9fa30

[PATCH 1/4] hw/xen: Use xs_node_read() from xs_node_vscanf()

2025-01-10 Thread David Woodhouse
From: David Woodhouse Reduce some duplication. Signed-off-by: David Woodhouse --- hw/xen/trace-events | 1 - hw/xen/xen-bus-helper.c | 15 ++- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/hw/xen/trace-events b/hw/xen/trace-events index 461dee7b23

[PATCH 2/4] hw/xen: Use xs_node_read() from xen_console_get_name()

2025-01-10 Thread David Woodhouse
From: David Woodhouse Now that xs_node_read() can construct a node path, no need to open-code it. Signed-off-by: David Woodhouse --- hw/char/xen_console.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c index

[PATCH 4/4] hw/xen: Use xs_node_read() from xenstore_read_str() instead of open-coding it

2025-01-10 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/xen/xen_pvdev.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index c5ad71e8dc..c9143ba259 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -22,6 +22,7

Re: [PATCH v2 0/2] xen: error handling and FreeBSD compatibility fixes

2025-01-10 Thread David Woodhouse
rted by the FreeBSD scanf libc > implementation. > > Thanks, Roger. Thanks. I've got a handful of non-bugfix cleanups to use the new xs_node_read in my tree at https://git.infradead.org/users/dwmw2/qemu.git/shortlog/refs/heads/xs_node_read David Woodhouse (4): hw/xen: Use xs_node_re

Re: [PATCH v2 2/2] xen: do not use '%ms' scanf specifier

2025-01-10 Thread David Woodhouse
('hw/xen: update Xen console to XenDevice model') > Signed-off-by: Roger Pau Monné Reviewed-by: David Woodhouse Thanks. smime.p7s Description: S/MIME cryptographic signature

Re: [PATCH 2/2] xen: do not use '%ms' scanf specifier

2025-01-10 Thread David Woodhouse
On Fri, 2025-01-10 at 09:16 +0100, Philippe Mathieu-Daudé wrote: > On 10/1/25 09:08, David Woodhouse wrote: > > On Thu, 2025-01-09 at 17:55 +0100, Roger Pau Monné wrote: > > > On Thu, Jan 09, 2025 at 11:25:13AM +0000, David Woodhouse wrote: > > > > On Thu, 2025-01-09

Re: [PATCH 2/2] xen: do not use '%ms' scanf specifier

2025-01-10 Thread David Woodhouse
On Thu, 2025-01-09 at 17:55 +0100, Roger Pau Monné wrote: > On Thu, Jan 09, 2025 at 11:25:13AM +0000, David Woodhouse wrote: > > On Thu, 2025-01-09 at 11:59 +0100, Anthony PERARD wrote: > > > > > > >   char label[32]; > > > >   XenDevice *xe

Re: [PATCH 2/2] xen: do not use '%ms' scanf specifier

2025-01-09 Thread David Woodhouse
On Thu, 2025-01-09 at 11:59 +0100, Anthony PERARD wrote: > > >   char label[32]; > >   XenDevice *xendev = NULL; > >   XenConsole *con; > > @@ -550,7 +551,10 @@ static void > > xen_console_device_create(XenBackendInstance *backend, > >   goto fail; > >   } > >   > > -   

Re: Xen Security Advisory 466 v3 (CVE-2024-53241) - Xen hypercall page unsafe against speculative attacks

2025-01-07 Thread David Woodhouse
On Tue, 2025-01-07 at 09:20 +0100, Jan Beulich wrote: > > How about we adjust the behavior in Xen instead: We could latch the size > on every hypercall, making sure to invoke update_domain_wallclock_time() > only when the size actually changed (to not incur the extra overhead), > unless originatin

Re: Xen Security Advisory 466 v3 (CVE-2024-53241) - Xen hypercall page unsafe against speculative attacks

2025-01-06 Thread David Woodhouse
On Thu, 2025-01-02 at 15:16 +0100, Jürgen Groß wrote: > On 02.01.25 15:06, David Woodhouse wrote: > > On Thu, 2025-01-02 at 15:02 +0100, Jürgen Groß wrote: > > > > Are you suggesting that you're able to enable the CPU-specific CFI > > > > protections before

Re: Xen Security Advisory 466 v3 (CVE-2024-53241) - Xen hypercall page unsafe against speculative attacks

2025-01-02 Thread David Woodhouse
On Thu, 2025-01-02 at 15:16 +0100, Jürgen Groß wrote: > On 02.01.25 15:06, David Woodhouse wrote: > > On Thu, 2025-01-02 at 15:02 +0100, Jürgen Groß wrote: > > > > Are you suggesting that you're able to enable the CPU-specific CFI > > > > protections before

Re: Xen Security Advisory 466 v3 (CVE-2024-53241) - Xen hypercall page unsafe against speculative attacks

2025-01-02 Thread David Woodhouse
On Thu, 2025-01-02 at 15:02 +0100, Jürgen Groß wrote: > > Are you suggesting that you're able to enable the CPU-specific CFI > > protections before you even know whether it's an Intel or AMD CPU? > > Not before that, but maybe rather soon afterwards. And the hypercall page > needs to be decommissi

Re: Xen Security Advisory 466 v3 (CVE-2024-53241) - Xen hypercall page unsafe against speculative attacks

2025-01-02 Thread David Woodhouse
On Thu, 2025-01-02 at 14:38 +0100, Jürgen Groß wrote: > On 02.01.25 13:53, David Woodhouse wrote: > > On Thu, 2025-01-02 at 13:07 +0100, Jürgen Groß wrote: > > > On 23.12.24 15:24, David Woodhouse wrote: > > > > On Tue, 2024-12-17 at 12:18 +000

Re: Xen Security Advisory 466 v3 (CVE-2024-53241) - Xen hypercall page unsafe against speculative attacks

2025-01-02 Thread David Woodhouse
On Thu, 2025-01-02 at 13:07 +0100, Jürgen Groß wrote: > On 23.12.24 15:24, David Woodhouse wrote: > > On Tue, 2024-12-17 at 12:18 +, Xen.org security team wrote: > > >   Xen Security Advisory CVE-2024-53241 / XSA-466 > > >    

Re: Xen Security Advisory 466 v3 (CVE-2024-53241) - Xen hypercall page unsafe against speculative attacks

2024-12-23 Thread David Woodhouse
On Tue, 2024-12-17 at 12:18 +, Xen.org security team wrote: > Xen Security Advisory CVE-2024-53241 / XSA-466 >     version 3 > > Xen hypercall page unsafe against speculative attacks > > UPDATES IN VERSION 3 > > > Update

Re: [PATCH] x86/io-apic: fix directed EOI when using AMd-Vi interrupt remapping

2024-10-21 Thread David Woodhouse
On Mon, 2024-10-21 at 15:51 +0100, Andrew Cooper wrote: > On 21/10/2024 3:06 pm, Roger Pau Monné wrote: > > On Mon, Oct 21, 2024 at 12:34:37PM +0100, David Woodhouse wrote: > > > On Fri, 2024-10-18 at 10:08 +0200, Roger Pau Monne wrote: > > > > When using AMD-VI

Re: [EXTERNAL] [PATCH] x86/io-apic: fix directed EOI when using AMd-Vi interrupt remapping

2024-10-21 Thread David Woodhouse
On Mon, 2024-10-21 at 12:53 +0100, Andrew Cooper wrote: > > > I don't quite follow how you need a sentinel value. How could you ever > > *not* know it, given that you have to write it to the RTE? > > > > (And you should *also* just use the pin# like Linux does, as I said). > > Because Xen is ins

Re: [EXTERNAL] [PATCH] x86/io-apic: fix directed EOI when using AMd-Vi interrupt remapping

2024-10-21 Thread David Woodhouse
On Mon, 2024-10-21 at 12:38 +0100, Andrew Cooper wrote: > On 21/10/2024 12:10 pm, Andrew Cooper wrote: > > On 18/10/2024 9:08 am, Roger Pau Monne wrote: > > > > > > > > +/* > > > + * Store the EOI handle when using interrupt remapping. > > > + * > > > + * If using AMD-Vi interrupt remapping the I

Re: [PATCH] x86/io-apic: fix directed EOI when using AMd-Vi interrupt remapping

2024-10-21 Thread David Woodhouse
rictly it would > only be required for AMD-Vi. > > Reported-by: Willi Junga > Suggested-by: David Woodhouse > Fixes: 2ca9fbd739b8 ('AMD IOMMU: allocate IRTE entries instead of using a > static mapping') > Signed-off-by: Roger Pau Monné Hm, couldn't we just have used

Re: [PATCH] x86/io-apic: fix directed EOI when using AMd-Vi interrupt remapping

2024-10-21 Thread David Woodhouse
On Mon, 2024-10-21 at 10:55 +0100, Alejandro Vallejo wrote: > On Fri Oct 18, 2024 at 9:08 AM BST, Roger Pau Monne wrote: > > When using AMD-VI interrupt remapping the vector field in the IO-APIC RTE is > > repurposed to contain part of the offset into the remapping table.  > > Previous to > > For

Re: [BUG]i2c_hid_acpi broken with 4.17.2 on Framework Laptop 13 AMD

2024-10-10 Thread David Woodhouse
On Thu, 2024-03-07 at 09:39 +0100, Jan Beulich wrote: > On 06.03.2024 18:28, Sébastien Chaumat wrote: > > Reasoning backward  (using a  kernel without the pinctrl_amd driver to > > > ensure xen only is at stake) : > > >  checking the diff in IOAPIC  between bare metal and xen  (IRQ7 is on > > > pin

Re: [RFC PATCH-for-9.0 v2 09/19] hw/block/xen_blkif: Align structs with QEMU_ALIGNED() instead of #pragma

2024-03-27 Thread David Woodhouse
On 27 March 2024 13:31:52 GMT, Anthony PERARD wrote: >On Tue, Nov 14, 2023 at 03:38:05PM +0100, Philippe Mathieu-Daudé wrote: >> Except imported source files, QEMU code base uses >> the QEMU_ALIGNED() macro to align its structures. > >This patch only convert the alignment, but discard pack. We nee

Re: Nullifying Recently Introduced Xen Headers Check

2024-02-02 Thread David Woodhouse
On Thu, 2024-02-01 at 18:39 +, John L. Poole wrote: > > While the Xen Project "make" works, the Gentoo emerge > of app-emulation/xen-tools does not unless the three lines are > removed to simulate prior 4.17.3 and earlier code.  > > I suspect the Gentoo approach > of building tools first co

Re: Nullifying Recently Introduced Xen Headers Check

2024-02-01 Thread David Woodhouse
(Thanks Andy for the explicit cc) On Thu, 2024-02-01 at 00:05 +, John L. Poole wrote: > > cause Gentoo's build to error out.  See line 24790: > >     5 | #error In Xen native files, include xen_native.h before other Xen > headers > > at > https://salemdata.us/xen/xen_tools_20240128_Sun_174

Re: [PATCH v2 10/23] target/i386: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-27 Thread David Woodhouse
On Fri, 2024-01-26 at 23:03 +0100, Philippe Mathieu-Daudé wrote: > Mechanical patch produced running the command documented > in scripts/coccinelle/cpu_env.cocci_template header. > > Signed-off-by: Philippe Mathieu-Daudé > --- For the KVM/Xen parts Acked-by: David Woodhou

[PATCH v4 32/47] hw/m68k/mcf5208: use qemu_create_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/m68k/mcf5208.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index d22d8536db..0cfb806c20 100644 --- a/hw/m68k/mcf5208.c +++ b

[PATCH v4 00/47] Rework matching of network devices to -nic options

2024-01-26 Thread David Woodhouse
error handling in hw/i386/pc.c. Document new functions better in include/net/net.h. v3: Rebase to 8.2 v2: Some build fixes after better coverage testing, revert the Xen fix in this series because I'm putting the less invasive hack into 8.2 (hopefully). David W

[PATCH v4 35/47] hw/mips/mipssim: use qemu_create_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse The MIPS SIM platform instantiates its NIC only if a corresponding configuration exists for it. Use qemu_create_nic_device() function for that. Signed-off-by: David Woodhouse --- hw/mips/mipssim.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff

[PATCH v4 36/47] hw/mips/jazz: use qemu_find_nic_info()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/mips/jazz.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index 0d2348aa5a..5bf3e328db 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -119,15 +119,19 @@ static

[PATCH v4 46/47] net: remove qemu_show_nic_models(), qemu_find_nic_model()

2024-01-26 Thread David Woodhouse
From: David Woodhouse These old functions can be removed now too. Let net_param_nic() print the full set of network devices directly, and also make it note that a list more specific to this platform/config will be available by using '-nic model=help' instead. Signed-off-by: David

[PATCH v4 41/47] hw/s390x/s390-virtio-ccw: use qemu_create_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Acked-by: Thomas Huth --- hw/s390x/s390-virtio-ccw.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index c99682b07d..62804cc228 100644 --- a/hw/s390x

[PATCH v4 25/47] hw/net/smc91c111: use qemu_configure_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Some callers instantiate the device unconditionally, others will do so only if there is a NICInfo to go with it. This appears to be fairly random, but preserve the existing behaviour of each caller for now. Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw

[PATCH v4 34/47] hw/microblaze: use qemu_configure_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/microblaze/petalogix_ml605_mmu.c | 3 +-- hw/microblaze/petalogix_s3adsp1800_mmu.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw

[PATCH v4 27/47] hw/arm/highbank: use qemu_create_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/arm/highbank.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index c21e18d08f..6a0e20e58d 100644 --- a/hw/arm/highbank.c +++ b/hw/arm

[PATCH v4 06/47] hw/xen: use qemu_create_nic_bus_devices() to instantiate Xen NICs

2024-01-26 Thread David Woodhouse
From: David Woodhouse When instantiating XenBus itself, for each NIC which is configured with either the model unspecified, or set to to "xen" or "xen-net-device", create a corresponding xen-net-device for it. Now we can revert the previous more hackish version which relied

[PATCH v4 13/47] hw/mips/malta: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse The Malta board setup code would previously place the first NIC into PCI slot 11 if was a PCNet card, and the rest (including the first if it was anything other than a PCNet card) would be dynamically assigned. Now it will place any PCNet NIC into slot 11, and then

[PATCH v4 40/47] hw/riscv: use qemu_configure_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/riscv/microchip_pfsoc.c | 14 ++ hw/riscv/sifive_u.c| 7 +-- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/hw/riscv/microchip_pfsoc.c b/hw/riscv/microchip_pfsoc.c

[PATCH v4 43/47] hw/xtensa/xtfpga: use qemu_create_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/xtensa/xtfpga.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index fbad1c83a3..f49e6591dc 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw

[PATCH v4 15/47] hw/ppc/prep: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Previously, the first PCI NIC would be placed in PCI slot 3 and the rest would be dynamically assigned. Even if the user overrode the default NIC type and made it something other than PCNet. Now, the first PCNet NIC (that is, anything not explicitly specified to be

[PATCH v4 14/47] hw/mips/loongson3_virt: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/mips/loongson3_virt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index 33eae01eca..caedde2df0 100644 --- a/hw/mips

[PATCH v4 05/47] hw/i386/pc: use qemu_get_nic_info() and pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Eliminate direct access to nd_table[] and nb_nics by processing the the Xen and ISA NICs first and then calling pci_init_nic_devices() for the rest. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/pc.c| 31

[PATCH v4 42/47] hw/sparc/sun4m: use qemu_find_nic_info()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Obtain the MAC address from the NIC configuration if there is one, or generate one explicitly so that it can be placed in the PROM. Signed-off-by: David Woodhouse --- hw/sparc/sun4m.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git

[PATCH v4 12/47] hw/mips/fuloong2e: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse The previous behaviour was: *if* the first NIC specified on the command line was an RTL8139 (or unspecified model) then it gets assigned to PCI slot 7, which is where the Fuloong board had an RTL8139. All other devices (including the first, if it was specified as anything

[PATCH v4 26/47] hw/net/lan9118: use qemu_configure_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Some callers instantiate the device unconditionally, others will do so only if there is a NICInfo to go with it. This appears to be fairly random, but preseve the existing behaviour for now. Signed-off-by: David Woodhouse --- hw/arm/kzm.c | 4 ++-- hw/arm

[PATCH v4 01/47] net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Most code which directly accesses nd_table[] and nb_nics uses them for one of two things. Either "I have created a NIC device and I'd like a configuration for it", or "I will create a NIC device *if* there is a configuration for it". With some var

[PATCH v4 37/47] hw/net/lasi_i82596: Re-enable build

2024-01-26 Thread David Woodhouse
From: David Woodhouse When converting to the shiny build-system-du-jour, a typo prevented the last_i82596 driver from being built. Correct the config option name to re-enable the build. And include "sysemu/sysemu.h" so it actually builds. Fixes: b1419fa66558 ("meson: convert hw/n

[PATCH v4 02/47] net: report list of available models according to platform

2024-01-26 Thread David Woodhouse
From: David Woodhouse By noting the models for which a configuration was requested, we can give the user an accurate list of which NIC models were actually available on the platform/configuration that was otherwise chosen. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- net

[PATCH v4 18/47] hw/sh4/r2d: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Previously, the first PCI NIC would be assigned to slot 2 even if the user override the model and made it something other than an rtl8139 which is the default. Everything else would be dynamically assigned. Now, the first rtl8139 gets slot 2 and everything else is dynamic

[PATCH v4 30/47] hw/arm: use qemu_configure_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/arm/mps2-tz.c | 8 ++-- hw/arm/msf2-soc.c| 6 +- hw/arm/musicpal.c| 3 +-- hw/arm/xilinx_zynq.c | 11 --- hw/arm/xlnx-versal.c | 7 +-- hw/arm/xlnx-zynqmp.c | 8 +--- 6 files changed, 10

[PATCH v4 28/47] hw/arm/npcm7xx: use qemu_configure_nic_device, allow emc0/emc1 as aliases

2024-01-26 Thread David Woodhouse
From: David Woodhouse Also update the test to specify which device to attach the test socket to, and remove the comment lamenting the fact that we can't do so. Signed-off-by: David Woodhouse --- hw/arm/npcm7xx.c | 16 +--- tests/qtest/npcm7xx_emc-test.c

[PATCH v4 24/47] hw/arm/fsl: use qemu_configure_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/arm/fsl-imx25.c | 2 +- hw/arm/fsl-imx6.c | 2 +- hw/arm/fsl-imx6ul.c | 2 +- hw/arm/fsl-imx7.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl

[PATCH v4 20/47] hw/xtensa/virt: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/xtensa/virt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/xtensa/virt.c b/hw/xtensa/virt.c index a6cf646e99..5310a88861 100644 --- a/hw/xtensa/virt.c +++ b/hw/xtensa/virt.c

[PATCH v4 09/47] hw/arm/virt: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/arm/virt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 5cbc69dff8..ad8e7edb8c 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1454,9 +1454,7

[PATCH v4 23/47] hw/arm/exynos4: use qemu_create_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/arm/exynos4_boards.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c index b0e13eb4f0..003992189b 100644 --- a/hw/arm

[PATCH v4 17/47] hw/ppc: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/ppc/e500.c | 4 +--- hw/ppc/mac_newworld.c | 4 +--- hw/ppc/mac_oldworld.c | 4 +--- hw/ppc/ppc440_bamboo.c | 14 +- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a

[PATCH v4 29/47] hw/arm/stellaris: use qemu_find_nic_info()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Rather than just using qemu_configure_nic_device(), populate the MAC address in the system-registers device by peeking at the NICInfo before it's assigned to the device. Generate the MAC address early, if there is no matching -nic option. Otherwise the MAC address wou

[PATCH v4 39/47] hw/openrisc/openrisc_sim: use qemu_create_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/openrisc/openrisc_sim.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c index 35da123aef..bffd6f721f 100644 --- a/hw/openrisc

[PATCH v4 03/47] net: add qemu_create_nic_bus_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse This will instantiate any NICs which live on a given bus type. Each bus is allowed *one* substitution (for PCI it's virtio → virtio-net-pci, for Xen it's xen → xen-net-device; no point in overengineering it unless we actually want more). Signed-off-by: David

[PATCH v4 04/47] hw/pci: add pci_init_nic_devices(), pci_init_nic_in_slot()

2024-01-26 Thread David Woodhouse
From: David Woodhouse The loop over nd_table[] to add PCI NICs is repeated in quite a few places. Add a helper function to do it. Some platforms also try to instantiate a specific model in a specific slot, to match the real hardware. Add pci_init_nic_in_slot() for that purpose. Signed-off-by

[PATCH v4 21/47] hw/arm/allwinner: use qemu_configure_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/arm/allwinner-a10.c | 6 +- hw/arm/allwinner-h3.c | 6 +- hw/arm/allwinner-r40.c | 27 ++- 3 files changed, 4 insertions(+), 35 deletions(-) diff --git a/hw/arm/allwinner

[PATCH v4 38/47] hw/net/lasi_i82596: use qemu_create_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Create the device only if there is a corresponding NIC config for it. Remove the explicit check on nd_table[0].used from hw/hppa/machine.c which (since commit d8a3220005d7) tries to do the same thing. The lasi_82596 support has been disabled since it was first introduced

[PATCH v4 11/47] hw/loongarch: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Song Gao --- hw/loongarch/virt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index c9a680e61a..0ad7d8c887 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch

[PATCH v4 33/47] hw/m68k/q800: use qemu_find_nic_info()

2024-01-26 Thread David Woodhouse
From: David Woodhouse If a corresponding NIC configuration was found, it will have a MAC address already assigned, so use that. Else, generate and assign a default one. Using qemu_find_nic_info() is simpler than the alternative of using qemu_configure_nic_device() and then having to fetch the

[PATCH v4 10/47] hw/hppa: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/hppa/machine.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 9e611620cc..a1045b48cc 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa

[PATCH v4 47/47] net: make nb_nics and nd_table[] static in net/net.c

2024-01-26 Thread David Woodhouse
From: David Woodhouse Also remove the stale declaration of host_net_devices; the actual definition was removed long ago in commit 7cc28cb06104 ("net: Remove the deprecated 'host_net_add' and 'host_net_remove' HMP commands") Signed-off-by: David Woodhouse Reviewed

[PATCH v4 19/47] hw/sparc64/sun4u: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse The first sunhme NIC gets placed a function 1 on slot 1 of PCI bus A, and the rest are dynamically assigned on PCI bus B. Previously, any PCI NIC would get the special treatment purely by virtue of being first in the list. Signed-off-by: David Woodhouse Reviewed-by

[PATCH v4 08/47] hw/arm/sbsa-ref: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Leif Lindholm --- hw/arm/sbsa-ref.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 477dca0637..f0171176ea 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa

[PATCH v4 31/47] hw/net/etraxfs-eth: use qemu_configure_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/cris/axis_dev88.c | 9 - hw/net/etraxfs_eth.c | 5 ++--- include/hw/cris/etraxfs.h | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/hw/cris/axis_dev88.c b/hw/cris

[PATCH v4 44/47] net: remove qemu_check_nic_model()

2024-01-26 Thread David Woodhouse
From: David Woodhouse There are no callers of this function any more, as they have all been converted to qemu_{create,configure}_nic_device(). Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- include/net/net.h | 1 - net/net.c | 13 - 2 files changed, 14

[PATCH v4 16/47] hw/ppc/spapr: use qemu_get_nic_info() and pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Avoid directly referencing nd_table[] by first instantiating any spapr-vlan devices using a qemu_get_nic_info() loop, then calling pci_init_nic_devices() to do the rest. No functional change intended. Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/ppc

[PATCH v4 45/47] hw/pci: remove pci_nic_init_nofail()

2024-01-26 Thread David Woodhouse
From: David Woodhouse This function is no longer used, as all its callers have been converted to use pci_init_nic_devices() instead. Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/pci/pci.c | 72 include/hw/pci/pci.h | 3

[PATCH v4 07/47] hw/alpha/dp264: use pci_init_nic_devices()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/alpha/dp264.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 03495e1e60..52a1fa310b 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c

[PATCH v4 22/47] hw/arm/aspeed: use qemu_configure_nic_device()

2024-01-26 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Acked-by: Cédric Le Goater --- hw/arm/aspeed.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index cc59176563..bed5e4f40b 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c

Re: [PATCH v3 45/46] net: remove qemu_show_nic_models(), qemu_find_nic_model()

2024-01-26 Thread David Woodhouse
On Fri, 2024-01-26 at 17:49 +0100, Thomas Huth wrote: > > Can we please keep "Available" instead of "Supported" ? ... since not each > NIC is supported on each machine type... Done, thanks. smime.p7s Description: S/MIME cryptographic signature

Re: [PATCH v3 01/46] net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info()

2024-01-26 Thread David Woodhouse
On Fri, 2024-01-26 at 15:33 +, Peter Maydell wrote: > On Fri, 26 Jan 2024 at 15:20, David Woodhouse wrote: > > > > On Fri, 2024-01-26 at 14:43 +, Peter Maydell wrote: > > > > > > > +NICInfo *qemu_find_nic_info(cons

Re: [PATCH v3 01/46] net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info()

2024-01-26 Thread David Woodhouse
On Fri, 2024-01-26 at 14:43 +, Peter Maydell wrote: > > > +NICInfo *qemu_find_nic_info(const char *typename, bool match_default, > > +    const char *alias); > > +bool qemu_configure_nic_device(DeviceState *dev, bool match_default, > > +   co

  1   2   3   4   5   6   7   8   9   10   >