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

2025-04-04 Thread David Woodhouse
On Fri, 2025-02-07 at 14:37 +, 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 page isn't known. > > Rather than setting it to the

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

[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

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

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

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 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 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 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 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 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 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 04/14] hw/core: Introduce TYPE_SHARED_IRQ

2025-01-09 Thread David Woodhouse
On Wed, 2025-01-08 at 14:26 +, Bernhard Beschow wrote: > > > Am 8. Januar 2025 09:25:28 UTC schrieb Bernhard Beschow : > > Signed-off-by: Bernhard Beschow > > --- > > include/hw/core/shared-irq.h | 39 > > hw/core/shared-irq.c | 88

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: [PATCH v4 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it

2024-01-26 Thread David Woodhouse
On Sat, 2023-12-02 at 01:41 +, Volodymyr Babchuk wrote: > From: David Woodhouse > > This allows a XenDevice implementation to know whether it was created > by QEMU, or merely discovered in XenStore after the toolstack created > it. This will allow us to create frontend/bac

Re: [PATCH 2/6] qemu/main-loop: rename QEMU_IOTHREAD_LOCK_GUARD to QEMU_BQL_LOCK_GUARD

2023-11-30 Thread David Woodhouse
On Wed, 2023-11-29 at 16:26 -0500, Stefan Hajnoczi wrote: > The name "iothread" is overloaded. Use the term Big QEMU Lock (BQL) > instead, it is already widely used and unambiguous. > > Signed-off-by: Stefan Hajnoczi Acked-by: David Woodhouse smime.p7s Description

Re: [PATCH 1/6] system/cpus: rename qemu_mutex_lock_iothread() to qemu_bql_lock()

2023-11-30 Thread David Woodhouse
void) > - bool qemu_bql_locked(void) > > There are more APIs with "iothread" in their names. Subsequent patches > will rename them. There are also comments and documentation that will be > updated in later patches. > > Signed-off-by: Stefan Hajnoczi Acked-by: David Woodhouse smime.p7s Description: S/MIME cryptographic signature

Re: [EXTERNAL] [PATCH v3 2/5] xen: backends: don't overwrite XenStore nodes created by toolstack

2023-11-28 Thread David Woodhouse
On Tue, 2023-11-28 at 01:20 +, Volodymyr Babchuk wrote: > Hi David, > > Thank you for the review > > David Woodhouse writes: > > > [[S/MIME Signed Part:Undecided]] > > On Fri, 2023-11-24 at 23:24 +, Volodymyr Babchuk wrote: > > > Xen PV dev

Re: [EXTERNAL] [PATCH v3 2/5] xen: backends: don't overwrite XenStore nodes created by toolstack

2023-11-27 Thread David Woodhouse
stack to decide if it should touch > frontend entries in XenStore. Also, when we need to remove XenStore > entries during device teardown only if they weren't created by Xen > toolstack. If they were created by toolstack, then it is toolstack's > job to do proper clean-up. >

Re: [PATCH v2 2/6] xen: backends: touch some XenStore nodes only if device...

2023-11-22 Thread David Woodhouse
On Wed, 2023-11-22 at 22:49 +, Volodymyr Babchuk wrote: > > > On 21/11/23 23:10, Volodymyr Babchuk wrote: > > > was created by QEMU > > > > Please do not split lines between subject and content. Rewrite the > > full line. Preferably restrict the subject to 72 chars. > > I tried to come with

Re: [PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it

2023-11-22 Thread David Woodhouse
On Wed, 2023-11-22 at 22:56 +, Volodymyr Babchuk wrote: > > > Paul Durrant writes: > > > On 21/11/2023 22:10, Volodymyr Babchuk wrote: > > > From: David Woodhouse > > > This allows a XenDevice implementation to know whether it was > > > c

Re: [PATCH 06/12] hw/xen: add get_frontend_path() method to XenDeviceClass

2023-11-21 Thread David Woodhouse
On Tue, 2023-10-24 at 14:29 +0100, David Woodhouse wrote: > > > > As a general rule (I'll be doing a bombing run on xen-bus once I get my > > > patch queue down into single digits) we should never check 'if (*errp)' > > > to check if a function ha

Re: [PATCH 2/3] vl: disable default serial when xen-console is enabled

2023-11-21 Thread David Woodhouse
On Tue, 2023-11-21 at 14:58 +0400, Marc-André Lureau wrote: > > > Consistent with the rest of the lines (no conditional compilation nor > > driver #define..) > > Reviewed-by: Marc-André Lureau Thanks. > > btw, while quickly testing this (do we have any test for xen-console?): > > > > $ qemu --

[PATCH 1/3] net: do not delete nics in net_cleanup()

2023-11-15 Thread David Woodhouse
From: David Woodhouse In net_cleanup() we only need to delete the netdevs, as those may have state which outlives Qemu when it exits, and thus may actually need to be cleaned up on exit. The nics, on the other hand, are owned by the device which created them. Most devices don't bother to

[PATCH 2/3] vl: disable default serial when xen-console is enabled

2023-11-15 Thread David Woodhouse
From: David Woodhouse If a Xen console is configured on the command line, do not add a default serial port. Signed-off-by: David Woodhouse --- system/vl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/system/vl.c b/system/vl.c index 5af7ced2a1..8109231834 100644 --- a/system/vl.c +++ b

[PATCH 3/3] hw/xen: clean up xen_block_find_free_vdev() to avoid Coverity false positive

2023-11-15 Thread David Woodhouse
From: David Woodhouse Coverity couldn't see that nr_existing was always going to be zero when qemu_xen_xs_directory() returned NULL in the ENOENT case (CID 1523906). Perhaps more to the point, neither could Peter at first glance. Improve the code to hopefully make it clearer to Coverit

[PATCH 0/3] Misc fixes for 8.2

2023-11-15 Thread David Woodhouse
Fix a use-after-free (or double-free) due to net_cleanup() freeing NICs that don't belong to it, fix a newly-introduced launch failure with a documented command line, and clean up code to avoid a Coverity warning. David Woodhouse (3): net: do not delete nics in net_cleanup()

Re: [PATCH v1 1/7] xen-block: Do not write frontend nodes

2023-11-14 Thread David Woodhouse
On Tue, 2023-11-14 at 21:32 +, Volodymyr Babchuk wrote: > > > I think we want to kill the xen_backend_set_device() function and > > instead set the backend as a property of the XenDevice *before* > > realizing it. > > Not sure that I got this. Right now device is property of > XenBackendInsta

Re: [PATCH-for-9.0 v2 06/19] hw/pci/msi: Restrict xen_is_pirq_msi() call to Xen

2023-11-14 Thread David Woodhouse
On Tue, 2023-11-14 at 10:44 -0500, David Woodhouse wrote: > > I believe that if you push your branch to a gitlab tree with the > right CI variables defined, it'll run all the CI? And I *hope* it > fails with this patch. It's precisely the kind of thing I was > *int

Re: [PATCH-for-9.0 v2 06/19] hw/pci/msi: Restrict xen_is_pirq_msi() call to Xen

2023-11-14 Thread David Woodhouse
On Tue, 2023-11-14 at 16:22 +0100, Philippe Mathieu-Daudé wrote: > > If so, possibly few places incorrectly check 'xen_enabled()' > instead of this 'xen_guest()'. Sorry, I meant to respond to that one directly. I don't *think* there are any cases of that. As I added the CONFIG_XEN_EMU support, I

Re: [PATCH-for-9.0 v2 18/19] hw/i386/xen: Compile 'xen-hvm.c' with Xen CPPFLAGS

2023-11-14 Thread David Woodhouse
On 14 November 2023 09:38:14 GMT-05:00, "Philippe Mathieu-Daudé" wrote: >xen-hvm.c calls xc_set_hvm_param() from , >so better compile it with Xen CPPFLAGS. > >Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse

Re: [PATCH-for-9.0 v2 16/19] hw/xen/xen_pt: Add missing license

2023-11-14 Thread David Woodhouse
On 14 November 2023 09:38:12 GMT-05:00, "Philippe Mathieu-Daudé" wrote: >Commit eaab4d60d3 ("Introduce Xen PCI Passthrough, qdevice") >introduced both xen_pt.[ch], but only added the license to >xen_pt.c. Use the same license for xen_pt.h. > >Suggested-

Re: [PATCH-for-9.0 v2 10/19] hw/xen: Rename 'ram_memory' global variable as 'xen_memory'

2023-11-14 Thread David Woodhouse
K, but aren't you going to be coming back later to eliminate global variables which are actually per-VM? Or is that the point, because *then* the conflicting name will actually matter? Reviewed-by: David Woodhouse

Re: [PATCH-for-9.0 v2 06/19] hw/pci/msi: Restrict xen_is_pirq_msi() call to Xen

2023-11-14 Thread David Woodhouse
On 14 November 2023 10:22:23 GMT-05:00, "Philippe Mathieu-Daudé" wrote: >On 14/11/23 16:13, David Woodhouse wrote: >> On 14 November 2023 09:38:02 GMT-05:00, "Philippe Mathieu-Daudé" >> wrote: >>> Similarly to the restriction in hw/pci/

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

2023-11-14 Thread David Woodhouse
On 14 November 2023 09:38:05 GMT-05:00, "Philippe Mathieu-Daudé" wrote: >Except imported source files, QEMU code base uses >the QEMU_ALIGNED() macro to align its structures. > >Signed-off-by: Philippe Mathieu-Daudé Can we have a BUILD_BUG_ON(sizeof==) for these please?

Re: [PATCH-for-9.0 v2 07/19] hw/xen: Remove unnecessary xen_hvm_inject_msi() stub

2023-11-14 Thread David Woodhouse
On 14 November 2023 09:38:03 GMT-05:00, "Philippe Mathieu-Daudé" wrote: >Since commit 04b0de0ee8 ("xen: factor out common functions") >xen_hvm_inject_msi() stub is not required. > >Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse

Re: [PATCH-for-9.0 v2 01/19] tests/avocado: Add 'guest:xen' tag to tests running Xen guest

2023-11-14 Thread David Woodhouse
On 14 November 2023 10:00:09 GMT-05:00, "Philippe Mathieu-Daudé" wrote: >On 14/11/23 15:50, David Woodhouse wrote: >> On 14 November 2023 09:37:57 GMT-05:00, "Philippe Mathieu-Daudé" >> wrote: >>> Add a tag to run all Xen-specific tests using:

Re: [PATCH-for-9.0 v2 06/19] hw/pci/msi: Restrict xen_is_pirq_msi() call to Xen

2023-11-14 Thread David Woodhouse
On 14 November 2023 09:38:02 GMT-05:00, "Philippe Mathieu-Daudé" wrote: >Similarly to the restriction in hw/pci/msix.c (see commit >e1e4bf2252 "msix: fix msix_vector_masked"), restrict the >xen_is_pirq_msi() call in msi_is_masked() to Xen. > >Signed-off-by: Philippe Mathieu-Daudé Hm, we do also

Re: [PATCH-for-9.0 v2 01/19] tests/avocado: Add 'guest:xen' tag to tests running Xen guest

2023-11-14 Thread David Woodhouse
On 14 November 2023 10:13:14 GMT-05:00, "Philippe Mathieu-Daudé" wrote: >On 14/11/23 16:08, David Woodhouse wrote: >> On 14 November 2023 10:00:09 GMT-05:00, "Philippe Mathieu-Daudé" >> wrote: >>> On 14/11/23 15:50, David Woodhouse wrote: >>&g

Re: [PATCH-for-9.0 v2 04/19] system/physmem: Do not include 'hw/xen/xen.h' but 'sysemu/xen.h'

2023-11-14 Thread David Woodhouse
On 14 November 2023 09:38:00 GMT-05:00, "Philippe Mathieu-Daudé" wrote: >physmem.c doesn't use any declaration from "hw/xen/xen.h", >it only requires "sysemu/xen.h" and "system/xen-mapcache.h". > >Suggested-by: David Woodhouse &g

Re: [PATCH-for-9.0 v2 01/19] tests/avocado: Add 'guest:xen' tag to tests running Xen guest

2023-11-14 Thread David Woodhouse
On 14 November 2023 09:37:57 GMT-05:00, "Philippe Mathieu-Daudé" wrote: >Add a tag to run all Xen-specific tests using: > > $ make check-avocado AVOCADO_TAGS='guest:xen' > >Signed-off-by: Philippe Mathieu-Daudé >--- > tests/avocado/boot_xen.py | 3 +++ > tests/avocado/kvm_xen_guest.py | 1 +

Re: [PATCH-for-9.0 04/10] hw/xen: Factor xen_arch_align_ioreq_data() out of handle_ioreq()

2023-11-14 Thread David Woodhouse
On Tue, 2023-11-14 at 08:58 +0100, Philippe Mathieu-Daudé wrote: > > > Reviewing quickly hw/block/dataplane/xen-block.c, this code doesn't > > > seem target specific at all IMHO. Otherwise I'd really expect it to > > > fail compiling. But I don't know much about Xen, so I'll let block & > > > xen e

Re: [PATCH-for-9.0 07/10] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE

2023-11-14 Thread David Woodhouse
On Tue, 2023-11-14 at 13:25 +0100, Philippe Mathieu-Daudé wrote: > > As is CONFIG_XEN. > > Maybe be worth renaming CONFIG_ACCEL_XEN if you think we need > guest hw specific CONFIG_foo_XEN variables. I don't think so. We have CONFIG_XEN_BUS and CONFIG_XEN_EMU (from commit 820c1aba519b) which I th

Re: [PATCH-for-9.0 01/10] sysemu/xen: Forbid using Xen headers in user emulation

2023-11-13 Thread David Woodhouse
On Mon, 2023-11-13 at 16:21 +0100, Philippe Mathieu-Daudé wrote: > Xen is a system specific accelerator, it makes no sense > to include its headers in user emulation. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse smime.p7s Description: S/MIME c

Re: [PATCH-for-9.0 10/10] hw/xen: Have most of Xen files become target-agnostic

2023-11-13 Thread David Woodhouse
On Mon, 2023-11-13 at 16:21 +0100, Philippe Mathieu-Daudé wrote: > Previous commits re-organized the target-specific bits > from Xen files. We can now build the common files once > instead of per-target. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhous

Re: [PATCH-for-9.0 09/10] hw/xen: Extract 'xen_igd.h' from 'xen_pt.h'

2023-11-13 Thread David Woodhouse
that, extract > these methos into a new "hw/xen/xen_igd.h" header. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse > --- > What license for the new "hw/xen/xen_igd.h" header? The existing xen_pt.h came in with xen_pt.c (GPLv2) in

Re: [PATCH-for-9.0 08/10] system/physmem: Only include 'hw/xen/xen.h' when Xen is available

2023-11-13 Thread David Woodhouse
On Mon, 2023-11-13 at 16:21 +0100, Philippe Mathieu-Daudé wrote: > "hw/xen/xen.h" contains declarations for Xen hardware. There is > no point including it when Xen is not available. ... if even when Xen *is* available, AFAICT. Can you just remove the inclusion of hw/xen/xen.h entirely? I think tha

Re: [PATCH-for-9.0 07/10] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE

2023-11-13 Thread David Woodhouse
hilippe Mathieu-Daudé Noting that CONFIG_XEN_IS_POSSIBLE is for Xen accelerator support, and may not be set in all cases when we're hosting Xen-compatible guests, Reviewed-by: David Woodhouse smime.p7s Description: S/MIME cryptographic signature

Re: [PATCH-for-9.0 06/10] hw/xen: Reduce inclusion of 'cpu.h' to target-specific sources

2023-11-13 Thread David Woodhouse
; remove from the "hw/xen/xen-hvm-common.h" *common* header. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse smime.p7s Description: S/MIME cryptographic signature

Re: [PATCH-for-9.0 05/10] hw/xen: Use target-agnostic qemu_target_page_bits()

2023-11-13 Thread David Woodhouse
On Mon, 2023-11-13 at 16:21 +0100, Philippe Mathieu-Daudé wrote: > Instead of the target-specific TARGET_PAGE_BITS definition, > use qemu_target_page_bits() which is target agnostic. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse smime.p7s Descrip

Re: [PATCH-for-9.0 04/10] hw/xen: Factor xen_arch_align_ioreq_data() out of handle_ioreq()

2023-11-13 Thread David Woodhouse
icitly state 'No function change intended', and on that basis: Reviewed-by: David Woodhouse But... > --- a/hw/i386/xen/xen-hvm.c > +++ b/hw/i386/xen/xen-hvm.c > @@ -699,6 +699,14 @@ void xen_arch_set_memory(XenIOState *state, > MemoryRegionSection *section, > } &g

Re: [PATCH-for-9.0 03/10] hw/xen: Merge 'hw/xen/arch_hvm.h' in 'hw/xen/xen-hvm-common.h'

2023-11-13 Thread David Woodhouse
pe Mathieu-Daudé Reviewed-by: David Woodhouse smime.p7s Description: S/MIME cryptographic signature

Re: [PATCH-for-9.0 02/10] hw/xen/xen_arch_hvm: Rename prototypes using 'xen_arch_' prefix

2023-11-13 Thread David Woodhouse
On Mon, 2023-11-13 at 16:21 +0100, Philippe Mathieu-Daudé wrote: > Use a common 'xen_arch_' prefix for architecture-specific functions. > Rename xen_arch_set_memory() and xen_arch_handle_ioreq(). > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse sm

Re: [PATCH-for-9.0 04/10] hw/xen: Factor xen_arch_align_ioreq_data() out of handle_ioreq()

2023-11-13 Thread David Woodhouse
On Mon, 2023-11-13 at 17:09 +0100, Philippe Mathieu-Daudé wrote: > On 13/11/23 16:58, Woodhouse, David wrote: > > On 13 Nov 2023 10:22, Philippe Mathieu-Daudé > > wrote: > > > >     Per commit f17068c1c7 ("xen-hvm: reorganize xen-hvm and move > > common > >     function to xen-hvm-common"), handl

Re: [PATCH v1 1/7] xen-block: Do not write frontend nodes

2023-11-11 Thread David Woodhouse
On 11 November 2023 16:51:22 GMT-05:00, Andrew Cooper wrote: >On 11/11/2023 8:18 pm, David Woodhouse wrote: >> On 11 November 2023 08:43:40 GMT-05:00, Andrew Cooper >> wrote: >>> Furthermore, the control domain doesn't always have the domid of 0. >>> &

Re: [PATCH v1 1/7] xen-block: Do not write frontend nodes

2023-11-11 Thread David Woodhouse
On 11 November 2023 08:43:40 GMT-05:00, Andrew Cooper wrote: >Furthermore, the control domain doesn't always have the domid of 0. > >If qemu wants/needs to make changes like this, the control domain has to >arrange for qemu's domain to have appropriate permissions on the nodes. Right. And that's

Re: [PATCH v1 1/7] xen-block: Do not write frontend nodes

2023-11-11 Thread David Woodhouse
On Fri, 2023-11-10 at 20:42 +, Volodymyr Babchuk wrote: > From: Oleksandr Tyshchenko > > The PV backend running in other than Dom0 domain (non toolstack domain) > is not allowed to write frontend nodes. The more, the backend does not > need to do that at all, this is purely toolstack/xl devd

[PATCH] hw/xen: clean up xen_block_find_free_vdev() to avoid Coverity false positive

2023-11-09 Thread David Woodhouse
From: David Woodhouse Coverity couldn't see that nr_existing was always going to be zero when qemu_xen_xs_directory() returned NULL in the ENOENT case (CID 1523906). Perhaps more to the point, neither could Peter at first glance. Improve the code to hopefully make it clearer to Coverit

Re: [PULL 06/15] hw/xen: automatically assign device index to block devices

2023-11-09 Thread David Woodhouse
On Thu, 2023-11-09 at 14:33 +, Peter Maydell wrote: > On Tue, 7 Nov 2023 at 09:24, David Woodhouse wrote: > > > > From: David Woodhouse > > > > There's no need to force the user to assign a vdev. We can automatically > > assign one, starting at xvda

Re: [PATCH v4 14/17] net: do not delete nics in net_cleanup()

2023-11-07 Thread David Woodhouse
On Mon, 2023-11-06 at 14:35 +, David Woodhouse wrote: > From: David Woodhouse > > In net_cleanup() we only need to delete the netdevs, as those may have > state which outlives Qemu when it exits, and thus may actually need to > be cleaned up on exit. > > The nics, o

Re: [PATCH v4 16/17] doc/sphinx/hxtool.py: add optional label argument to SRST directive

2023-11-07 Thread David Woodhouse
On Mon, 2023-11-06 at 14:35 +, David Woodhouse wrote: > From: David Woodhouse > > We can't just embed labels directly into files like qemu-options.hx which > are included from multiple top-level RST files, because Sphinx sees the > labels as duplicate: https://github.c

[PULL 12/15] hw/xen: update Xen PV NIC to XenDevice model

2023-11-07 Thread David Woodhouse
From: David Woodhouse This allows us to use Xen PV networking with emulated Xen guests, and to add them on the command line or hotplug. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/net/meson.build| 2 +- hw/net/trace-events | 11 + hw/net/xen_nic.c

[PULL 00/15] xenfv.for-upstream queue

2023-11-07 Thread David Woodhouse
ng the opportunity to simplify what it says about q35 by making unplug work for AHCI. Ignore the VCPU_SSHOTTMR_future timer flag, and advertise the 'fixed' per-vCPU upcall vector support, as newer upstream Xen do. ---- Davi

[PULL 09/15] hw/xen: update Xen console to XenDevice model

2023-11-07 Thread David Woodhouse
From: David Woodhouse This allows (non-primary) console devices to be created on the command line and hotplugged. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/char/trace-events| 8 + hw/char/xen_console.c | 532 +++- hw/xen

[PULL 11/15] hw/xen: only remove peers of PCI NICs on unplug

2023-11-07 Thread David Woodhouse
From: David Woodhouse When the Xen guest asks to unplug *emulated* NICs, it's kind of unhelpful also to unplug the peer of the *Xen* PV NIC. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/xen/xen_platform.c | 9 +++-- 1 file changed, 7 insertions(+), 2 dele

[PULL 01/15] i386/xen: Ignore VCPU_SSHOTTMR_future flag in set_singleshot_timer()

2023-11-07 Thread David Woodhouse
From: David Woodhouse Upstream Xen now ignores this flag¹, since the only guest kernel ever to use it was buggy. ¹ https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=19c6cbd909 Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- target/i386/kvm/xen-emu.c | 20

[PULL 07/15] hw/xen: add get_frontend_path() method to XenDeviceClass

2023-11-07 Thread David Woodhouse
From: David Woodhouse The primary Xen console is special. The guest's side is set up for it by the toolstack automatically and not by the standard PV init sequence. Accordingly, its *frontend* doesn't appear in …/device/console/0 either; instead it appears under …/console in t

[PULL 13/15] hw/i386/pc: support '-nic' for xen-net-device

2023-11-07 Thread David Woodhouse
From: David Woodhouse The default NIC creation seems a bit hackish to me. I don't understand why each platform has to call pci_nic_init_nofail() from a point in the code where it actually has a pointer to the PCI bus, and then we have the special cases for things like ne2k_isa

[PULL 14/15] xen-platform: unplug AHCI disks

2023-11-07 Thread David Woodhouse
From: David Woodhouse To support Xen guests using the Q35 chipset, the unplug protocol needs to also remove AHCI disks. Make pci_xen_ide_unplug() more generic, iterating over the children of the PCI device and destroying the "ide-hd" devices. That works the same for both AHCI and ID

[PULL 04/15] i386/xen: advertise XEN_HVM_CPUID_UPCALL_VECTOR in CPUID

2023-11-07 Thread David Woodhouse
From: David Woodhouse This will allow Linux guests (since v6.0) to use the per-vCPU upcall vector delivered as MSI through the local APIC. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- target/i386/kvm/kvm.c | 4 1 file changed, 4 insertions(+) diff --git a/target/i386

[PULL 03/15] include: update Xen public headers to Xen 4.17.2 release

2023-11-07 Thread David Woodhouse
From: David Woodhouse ... in order to advertise the XEN_HVM_CPUID_UPCALL_VECTOR feature, which will come in a subsequent commit. Signed-off-by: David Woodhouse Acked-by: Paul Durrant --- hw/i386/kvm/xen_xenstore.c| 2 +- include/hw/xen/interface/arch-arm.h | 37

[PULL 10/15] hw/xen: add support for Xen primary console in emulated mode

2023-11-07 Thread David Woodhouse
From: David Woodhouse The primary console is special because the toolstack maps a page into the guest for its ring, and also allocates the guest-side event channel. The guest's grant table is even primed to export that page using a known grant ref#. Add support for all that in emulated mod

[PULL 08/15] hw/xen: do not repeatedly try to create a failing backend device

2023-11-07 Thread David Woodhouse
From: David Woodhouse If xen_backend_device_create() fails to instantiate a device, the XenBus code will just keep trying over and over again each time the bus is re-enumerated, as long as the backend appears online and in XenbusStateInitialising. The only thing which prevents the XenBus code

[PULL 05/15] hw/xen: populate store frontend nodes with XenStore PFN/port

2023-11-07 Thread David Woodhouse
From: David Woodhouse This is kind of redundant since without being able to get these through some other method (HVMOP_get_param) the guest wouldn't be able to access XenStore in order to find them. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/xen_xenstore.c

[PULL 02/15] hw/xen: Clean up event channel 'type_val' handling to use union

2023-11-07 Thread David Woodhouse
From: David Woodhouse A previous implementation of this stuff used a 64-bit field for all of the port information (vcpu/type/type_val) and did atomic exchanges on them. When I implemented that in Qemu I regretted my life choices and just kept it simple with locking instead. So there's no

[PULL 06/15] hw/xen: automatically assign device index to block devices

2023-11-07 Thread David Woodhouse
From: David Woodhouse There's no need to force the user to assign a vdev. We can automatically assign one, starting at xvda and searching until we find the first disk name that's unused. This means we can now allow '-drive if=xen,file=xxx' to work without an explicit separ

[PULL 15/15] docs: update Xen-on-KVM documentation

2023-11-07 Thread David Woodhouse
From: David Woodhouse Add notes about console and network support, and how to launch PV guests. Clean up the disk configuration examples now that that's simpler, and remove the comment about IDE unplug on q35/AHCI now that it's fixed. Update the -initrd option documentation to expl

[PATCH v4 15/17] xen-platform: unplug AHCI disks

2023-11-06 Thread David Woodhouse
From: David Woodhouse To support Xen guests using the Q35 chipset, the unplug protocol needs to also remove AHCI disks. Make pci_xen_ide_unplug() more generic, iterating over the children of the PCI device and destroying the "ide-hd" devices. That works the same for both AHCI and ID

[PATCH v4 07/17] hw/xen: add get_frontend_path() method to XenDeviceClass

2023-11-06 Thread David Woodhouse
From: David Woodhouse The primary Xen console is special. The guest's side is set up for it by the toolstack automatically and not by the standard PV init sequence. Accordingly, its *frontend* doesn't appear in …/device/console/0 either; instead it appears under …/console in t

[PATCH v4 17/17] docs: update Xen-on-KVM documentation

2023-11-06 Thread David Woodhouse
From: David Woodhouse Add notes about console and network support, and how to launch PV guests. Clean up the disk configuration examples now that that's simpler, and remove the comment about IDE unplug on q35/AHCI now that it's fixed. Update the -initrd option documentation to expl

[PATCH v4 08/17] hw/xen: do not repeatedly try to create a failing backend device

2023-11-06 Thread David Woodhouse
From: David Woodhouse If xen_backend_device_create() fails to instantiate a device, the XenBus code will just keep trying over and over again each time the bus is re-enumerated, as long as the backend appears online and in XenbusStateInitialising. The only thing which prevents the XenBus code

[PATCH v4 14/17] net: do not delete nics in net_cleanup()

2023-11-06 Thread David Woodhouse
From: David Woodhouse In net_cleanup() we only need to delete the netdevs, as those may have state which outlives Qemu when it exits, and thus may actually need to be cleaned up on exit. The nics, on the other hand, are owned by the device which created them. Most devices don't bother to

  1   2   3   >