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

Philippe Mathieu-Daudé posted 10 patches 1 year ago
Maintainers: Stefano Stabellini <sstabellini@kernel.org>, Anthony Perard <anthony.perard@citrix.com>, Paul Durrant <paul@xen.org>, Peter Maydell <peter.maydell@linaro.org>, Stefan Hajnoczi <stefanha@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Peter Xu <peterx@redhat.com>, David Hildenbrand <david@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
There is a newer version of this series
[PATCH-for-9.0 07/10] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE
Posted by Philippe Mathieu-Daudé 1 year ago
"sysemu/xen.h" defines CONFIG_XEN_IS_POSSIBLE as a target-agnostic
version of CONFIG_XEN. Use it in order to use "sysemu/xen-mapcache.h"
in target-agnostic files.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/sysemu/xen-mapcache.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/sysemu/xen-mapcache.h b/include/sysemu/xen-mapcache.h
index c8e7c2f6cf..10c2e3082a 100644
--- a/include/sysemu/xen-mapcache.h
+++ b/include/sysemu/xen-mapcache.h
@@ -10,10 +10,11 @@
 #define XEN_MAPCACHE_H
 
 #include "exec/cpu-common.h"
+#include "sysemu/xen.h"
 
 typedef hwaddr (*phys_offset_to_gaddr_t)(hwaddr phys_offset,
                                          ram_addr_t size);
-#ifdef CONFIG_XEN
+#ifdef CONFIG_XEN_IS_POSSIBLE
 
 void xen_map_cache_init(phys_offset_to_gaddr_t f,
                         void *opaque);
-- 
2.41.0


Re: [PATCH-for-9.0 07/10] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE
Posted by David Woodhouse 1 year ago
On Mon, 2023-11-13 at 16:21 +0100, Philippe Mathieu-Daudé wrote:
> "sysemu/xen.h" defines CONFIG_XEN_IS_POSSIBLE as a target-agnostic
> version of CONFIG_XEN. Use it in order to use "sysemu/xen-mapcache.h"
> in target-agnostic files.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

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 <dwmw@amazon.co.uk>
Re: [PATCH-for-9.0 07/10] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE
Posted by Philippe Mathieu-Daudé 1 year ago
On 13/11/23 20:52, David Woodhouse wrote:
> On Mon, 2023-11-13 at 16:21 +0100, Philippe Mathieu-Daudé wrote:
>> "sysemu/xen.h" defines CONFIG_XEN_IS_POSSIBLE as a target-agnostic
>> version of CONFIG_XEN. Use it in order to use "sysemu/xen-mapcache.h"
>> in target-agnostic files.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> 
> 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,

As is CONFIG_XEN.

Maybe be worth renaming CONFIG_ACCEL_XEN if you think we need
guest hw specific CONFIG_foo_XEN variables.

> Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>

Thanks!

Re: [PATCH-for-9.0 07/10] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE
Posted by Philippe Mathieu-Daudé 1 year ago
Cc'ing Paolo

On 14/11/23 13:25, Philippe Mathieu-Daudé wrote:
> On 13/11/23 20:52, David Woodhouse wrote:
>> On Mon, 2023-11-13 at 16:21 +0100, Philippe Mathieu-Daudé wrote:
>>> "sysemu/xen.h" defines CONFIG_XEN_IS_POSSIBLE as a target-agnostic
>>> version of CONFIG_XEN. Use it in order to use "sysemu/xen-mapcache.h"
>>> in target-agnostic files.
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>
>> 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,
> 
> As is CONFIG_XEN.

Actually we have:

- host Xen support
   . CONFIG_XEN_BACKEND

- QEMU Xen accelerator
   . CONFIG_XEN

- HW models
   . CONFIG_XEN (old / generic models)
   . CONFIG_XEN_BUS
   . XEN_IGD_PASSTHROUGH (PCI stuff)
   . CONFIG_XEN_EMU (Xen on KVM)

Paolo, David, is that correct?

When can we have CONFIG_XEN without CONFIG_XEN_BACKEND
(and vice-et-versa)?

So for clarity CONFIG_XEN could be split as:
  - CONFIG_ACCEL_XEN
  - CONFIG_XEN_MACHINE_FV (Fully-virtualized)
  - CONFIG_XEN_MACHINE_PV (Para-virtualized)

> Maybe be worth renaming CONFIG_ACCEL_XEN if you think we need
> guest hw specific CONFIG_foo_XEN variables.
> 
>> Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
> 
> Thanks!


Re: [PATCH-for-9.0 07/10] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE
Posted by David Woodhouse 1 year ago
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 think are all we need.

Thanks.