[for-4.20][PATCH] xen/arm64: Drop relocate_and_switch_ttbr() stub

2025-01-07 Thread Michal Orzel
In the original patch e7a80636f16e ("xen/arm: add cache coloring support for Xen image"), the stub was added under wrong assumption that DCE won't remove the function call if it's not static. This assumption is incorrect as we already rely on DCE for cases like this one. Therefore drop the stub, th

Re: [PATCH v4] vpci: Add resizable bar support

2025-01-07 Thread Roger Pau Monné
On Wed, Jan 08, 2025 at 08:19:55AM +0100, Jan Beulich wrote: > On 07.01.2025 19:19, Roger Pau Monné wrote: > > On Tue, Jan 07, 2025 at 04:58:07PM +0100, Jan Beulich wrote: > >> On 07.01.2025 15:38, Roger Pau Monné wrote: > >>> On Tue, Jan 07, 2025 at 11:06:33AM +0100, Jan Beulich wrote: > On 1

Re: [PATCH v3] docs: fusa: Add dom0less domain configuration requirements

2025-01-07 Thread Bertrand Marquis
Hi Ayan, > On 19 Dec 2024, at 11:56, Ayan Kumar Halder wrote: > > From: Michal Orzel > > Add requirements for dom0less domain creation. > > Signed-off-by: Michal Orzel > Signed-off-by: Ayan Kumar Halder > --- > Changes from - > > v1 - 1. As the dom0less domain creation requirements specifi

Re: [for-4.20] Re: [PATCH v12 12/12] xen/arm: add cache coloring support for Xen image

2025-01-07 Thread Jan Beulich
On 08.01.2025 08:30, Michal Orzel wrote: > > > On 07/01/2025 18:01, Jan Beulich wrote: >> >> >> On 07.01.2025 17:51, Michal Orzel wrote: >>> >>> >>> On 07/01/2025 17:42, Julien Grall wrote: Hi, On 16/12/2024 14:36, Jan Beulich wrote: > On 16.12.2024 15:28, Carlo Nonat

Re: [for-4.20] Re: [PATCH v12 12/12] xen/arm: add cache coloring support for Xen image

2025-01-07 Thread Jan Beulich
On 07.01.2025 18:13, Andrea Bastoni wrote: > On 07/01/2025 18:01, Jan Beulich wrote: >> On 07.01.2025 17:51, Michal Orzel wrote: >>> On 07/01/2025 17:42, Julien Grall wrote: On 16/12/2024 14:36, Jan Beulich wrote: > On 16.12.2024 15:28, Carlo Nonato wrote: >> On Mon, Dec 16, 2024 at 2:

Re: [for-4.20] Re: [PATCH v12 12/12] xen/arm: add cache coloring support for Xen image

2025-01-07 Thread Michal Orzel
On 07/01/2025 18:01, Jan Beulich wrote: > > > On 07.01.2025 17:51, Michal Orzel wrote: >> >> >> On 07/01/2025 17:42, Julien Grall wrote: >>> >>> >>> Hi, >>> >>> On 16/12/2024 14:36, Jan Beulich wrote: On 16.12.2024 15:28, Carlo Nonato wrote: > On Mon, Dec 16, 2024 at 2:56 PM Michal Or

Re: [PATCH v2 20/35] xen/console: introduce console_owner_domid()

2025-01-07 Thread Jan Beulich
On 08.01.2025 00:40, Stefano Stabellini wrote: > On Tue, 7 Jan 2025, Jan Beulich wrote: >> On 06.01.2025 19:48, Stefano Stabellini wrote: >>> On Mon, 6 Jan 2025, Jan Beulich wrote: On 04.01.2025 05:15, Denis Mukhin wrote: > > On Tuesday, December 10th, 2024 at 11:28 PM, Jan Beulich >>

Re: [PATCH v2] xen: update pvcalls_front_accept prototype

2025-01-07 Thread Jan Beulich
On 08.01.2025 00:30, Stefano Stabellini wrote: > On Tue, 7 Jan 2025, Jan Beulich wrote: >> On 06.01.2025 22:36, Stefano Stabellini wrote: >>> xen: update pvcalls_front_accept prototype >>> >>> Signed-off-by: Stefano Stabellini >>> --- >>> >>> Changes in v2: >>> - also update pvcalls-front.c >> >>

Re: [PATCH v4] vpci: Add resizable bar support

2025-01-07 Thread Jan Beulich
On 07.01.2025 19:19, Roger Pau Monné wrote: > On Tue, Jan 07, 2025 at 04:58:07PM +0100, Jan Beulich wrote: >> On 07.01.2025 15:38, Roger Pau Monné wrote: >>> On Tue, Jan 07, 2025 at 11:06:33AM +0100, Jan Beulich wrote: On 19.12.2024 06:21, Jiqian Chen wrote: > --- /dev/null > +++ b/xen

Re: [PATCH v3 2/2] x86: Add Support for Paging-Write Feature

2025-01-07 Thread Jan Beulich
On 07.01.2025 18:18, Petr Beneš wrote: > On Tue, Jan 7, 2025 at 5:46 PM Jan Beulich wrote: >> Hmm ... Instead of you touching the bit in every one of the case blocks, >> I was expecting you to clear the bit ahead of the switch(), accepting a >> double update in the p2m_access_r_pw case. > > I did

Re: [for-4.20][PATCH 2/3] xen/flask: Wire up XEN_DOMCTL_dt_overlay

2025-01-07 Thread Daniel P. Smith
On 1/7/25 04:27, Michal Orzel wrote: Addition of FLASK permission for this hypercall was overlooked in the original patch. Fix it. The only dt overlay operation is attaching that can happen only after the domain is created. Dom0 can attach overlay to itself as well. Fixes: 4c733873b5c2 ("xen/arm

Re: [for-4.20][PATCH 3/3] xen/flask: Wire up XEN_DOMCTL_set_llc_colors

2025-01-07 Thread Daniel P. Smith
On 1/7/25 04:27, Michal Orzel wrote: Addition of FLASK permission for this hypercall was overlooked in the original patch. Fix it. Setting LLC colors is only possible during domain creation. Fixes: 6985aa5e0c3c ("xen: extend domctl interface for cache coloring") Signed-off-by: Michal Orzel Ac

Re: Xen 4.20 Development Update [December]

2025-01-07 Thread Denis Mukhin
On Tuesday, January 7th, 2025 at 9:37 AM, Oleksii Kurochko wrote: > Missed to add one item to x86 about "x86/efi: Fix booting when NX is > disabled". > > Please find some details below. > > > > On 1/7/25 6:31 PM, Oleksii Kurochko wrote: > > > Hello everyone, > > > > This email only tracks

Re: [for-4.20][PATCH 1/3] xen/flask: Wire up XEN_DOMCTL_vuart_op

2025-01-07 Thread Daniel P. Smith
On 1/7/25 04:27, Michal Orzel wrote: Addition of FLASK permission for this hypercall was overlooked in the original patch. Fix it. The only VUART operation is initialization that can occur only during domain creation. Fixes: 86039f2e8c20 ("xen/arm: vpl011: Add a new domctl API to initialize vpl

Re: [PATCH v3] misra: add deviation for MISRA C Rule R11.8.

2025-01-07 Thread Stefano Stabellini
On Tue, 7 Jan 2025, Jan Beulich wrote: > On 07.01.2025 10:10, Alessandro Zucchelli wrote: > > --- a/docs/misra/deviations.rst > > +++ b/docs/misra/deviations.rst > > @@ -353,6 +353,13 @@ Deviations related to MISRA C:2012 Rules: > > Fixing this violation would require to increase code compl

Re: [PATCH v2 20/35] xen/console: introduce console_owner_domid()

2025-01-07 Thread Stefano Stabellini
On Tue, 7 Jan 2025, Jan Beulich wrote: > On 06.01.2025 19:48, Stefano Stabellini wrote: > > On Mon, 6 Jan 2025, Jan Beulich wrote: > >> On 04.01.2025 05:15, Denis Mukhin wrote: > >>> > >>> On Tuesday, December 10th, 2024 at 11:28 PM, Jan Beulich > >>> wrote: > >>> > > > On 06.12.20

Re: [PATCH v2] xen: update pvcalls_front_accept prototype

2025-01-07 Thread Stefano Stabellini
On Tue, 7 Jan 2025, Jan Beulich wrote: > On 06.01.2025 22:36, Stefano Stabellini wrote: > > xen: update pvcalls_front_accept prototype > > > > Signed-off-by: Stefano Stabellini > > --- > > > > Changes in v2: > > - also update pvcalls-front.c > > The patch still gives the impression of being inc

Re: [PATCH] xen/arm: ffa: add changelog entries for FF-A improvements

2025-01-07 Thread Stefano Stabellini
On Tue, 7 Jan 2025, Bertrand Marquis wrote: > Add a CHANGELOG entry for release 4.20 to mention the various > improvements and fixes that have been done in the FF-A support since > 4.19 release. > > Signed-off-by: Bertrand Marquis Acked-by: Stefano Stabellini > --- > CHANGELOG.md | 3 +++ >

Re: [for-4.20] Re: [PATCH v12 12/12] xen/arm: add cache coloring support for Xen image

2025-01-07 Thread Andrea Bastoni
On 07/01/2025 18:13, Andrea Bastoni wrote: > On 07/01/2025 18:01, Jan Beulich wrote: >> On 07.01.2025 17:51, Michal Orzel wrote: >>> >>> >>> On 07/01/2025 17:42, Julien Grall wrote: Hi, On 16/12/2024 14:36, Jan Beulich wrote: > On 16.12.2024 15:28, Carlo Nonato wrote: >

Re: [PATCH v4] vpci: Add resizable bar support

2025-01-07 Thread Roger Pau Monné
On Tue, Jan 07, 2025 at 04:58:07PM +0100, Jan Beulich wrote: > On 07.01.2025 15:38, Roger Pau Monné wrote: > > On Tue, Jan 07, 2025 at 11:06:33AM +0100, Jan Beulich wrote: > >> On 19.12.2024 06:21, Jiqian Chen wrote: > >>> --- /dev/null > >>> +++ b/xen/drivers/vpci/rebar.c > >>> @@ -0,0 +1,131 @@ >

Re: Xen 4.20 Development Update [December]

2025-01-07 Thread Oleksii Kurochko
Missed to add one item to x86 about "x86/efi: Fix booting when NX is disabled". Please find some details below. On 1/7/25 6:31 PM, Oleksii Kurochko wrote: Hello everyone, This email only tracks big items for xen.git tree. Please reply for items you would like to see in 4.20 so that people hav

Re: [PATCH v2 33/35] x86/domain: implement domain_has_vuart()

2025-01-07 Thread Denis Mukhin
On Tuesday, January 7th, 2025 at 7:16 AM, Roger Pau Monné wrote: > > > On Sat, Jan 04, 2025 at 05:19:07AM +, Denis Mukhin wrote: > > > On Friday, December 13th, 2024 at 4:23 AM, Roger Pau Monné > > roger@citrix.com wrote: > > > > > Albeit PVH is kind of HVM. > > > > PVH does not have

Re: [PATCH] xen/arm: ffa: add changelog entries for FF-A improvements

2025-01-07 Thread Oleksii Kurochko
Hi Bertrand, On 1/7/25 10:02 AM, Bertrand Marquis wrote: Add a CHANGELOG entry for release 4.20 to mention the various improvements and fixes that have been done in the FF-A support since 4.19 release. Signed-off-by: Bertrand Marquis Release-Acked-By: Oleksii Kurochko Thanks. ~ Oleksii --

Re: [PATCH v3 2/2] x86: Add Support for Paging-Write Feature

2025-01-07 Thread Petr Beneš
On Tue, Jan 7, 2025 at 5:46 PM Jan Beulich wrote: > Hmm ... Instead of you touching the bit in every one of the case blocks, > I was expecting you to clear the bit ahead of the switch(), accepting a > double update in the p2m_access_r_pw case. I did consider it, but ultimately didn't like the dou

Re: [for-4.20] Re: [PATCH v12 12/12] xen/arm: add cache coloring support for Xen image

2025-01-07 Thread Andrea Bastoni
On 07/01/2025 18:01, Jan Beulich wrote: > On 07.01.2025 17:51, Michal Orzel wrote: >> >> >> On 07/01/2025 17:42, Julien Grall wrote: >>> >>> >>> Hi, >>> >>> On 16/12/2024 14:36, Jan Beulich wrote: On 16.12.2024 15:28, Carlo Nonato wrote: > On Mon, Dec 16, 2024 at 2:56 PM Michal Orzel wrot

Re: [PATCH v6 5/7] xen: add new domctl get_changed_domain

2025-01-07 Thread Juergen Gross
On 07.01.25 18:06, Jan Beulich wrote: On 07.01.2025 17:48, Jürgen Groß wrote: On 07.01.25 17:28, Jan Beulich wrote: On 07.01.2025 11:17, Juergen Gross wrote: --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -185,6 +185,76 @@ static void domain_changed_state(const struct domain *d)

Re: [PATCH v6 5/7] xen: add new domctl get_changed_domain

2025-01-07 Thread Jan Beulich
On 07.01.2025 17:48, Jürgen Groß wrote: > On 07.01.25 17:28, Jan Beulich wrote: >> On 07.01.2025 11:17, Juergen Gross wrote: >>> --- a/xen/common/domain.c >>> +++ b/xen/common/domain.c >>> @@ -185,6 +185,76 @@ static void domain_changed_state(const struct domain >>> *d) >>> unlock_dom_exc_ha

Re: [for-4.20] Re: [PATCH v12 12/12] xen/arm: add cache coloring support for Xen image

2025-01-07 Thread Jan Beulich
On 07.01.2025 17:51, Michal Orzel wrote: > > > On 07/01/2025 17:42, Julien Grall wrote: >> >> >> Hi, >> >> On 16/12/2024 14:36, Jan Beulich wrote: >>> On 16.12.2024 15:28, Carlo Nonato wrote: On Mon, Dec 16, 2024 at 2:56 PM Michal Orzel wrote: > On 13/12/2024 17:28, Carlo Nonato wrote:

Re: [for-4.20] Re: [PATCH v12 12/12] xen/arm: add cache coloring support for Xen image

2025-01-07 Thread Michal Orzel
On 07/01/2025 17:42, Julien Grall wrote: > > > Hi, > > On 16/12/2024 14:36, Jan Beulich wrote: >> On 16.12.2024 15:28, Carlo Nonato wrote: >>> On Mon, Dec 16, 2024 at 2:56 PM Michal Orzel wrote: On 13/12/2024 17:28, Carlo Nonato wrote: > --- a/xen/arch/arm/arm64/mmu/mm.c > +++ b

Re: [PATCH v6 5/7] xen: add new domctl get_changed_domain

2025-01-07 Thread Jürgen Groß
On 07.01.25 17:28, Jan Beulich wrote: On 07.01.2025 11:17, Juergen Gross wrote: --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -185,6 +185,76 @@ static void domain_changed_state(const struct domain *d) unlock_dom_exc_handler(hdl); } +static void set_domain_state_info(struct xe

Re: [PATCH v3 2/2] x86: Add Support for Paging-Write Feature

2025-01-07 Thread Jan Beulich
On 02.01.2025 18:13, Petr Beneš wrote: > --- a/xen/arch/x86/mm/p2m-ept.c > +++ b/xen/arch/x86/mm/p2m-ept.c > @@ -154,27 +154,39 @@ static void ept_p2m_type_to_flags(const struct > p2m_domain *p2m, > case p2m_access_n: > case p2m_access_n2rwx: > entry->r = entry->w =

Re: [PATCH v6 4/7] xen: add bitmap to indicate per-domain state changes

2025-01-07 Thread Jürgen Groß
On 07.01.25 17:14, Jan Beulich wrote: On 07.01.2025 11:17, Juergen Gross wrote: Add a bitmap with one bit per possible domid indicating the respective domain has changed its state (created, deleted, dying, crashed, shutdown). Registering the VIRQ_DOM_EXC event will result in setting the bits fo

[for-4.20] Re: [PATCH v12 12/12] xen/arm: add cache coloring support for Xen image

2025-01-07 Thread Julien Grall
Hi, On 16/12/2024 14:36, Jan Beulich wrote: On 16.12.2024 15:28, Carlo Nonato wrote: On Mon, Dec 16, 2024 at 2:56 PM Michal Orzel wrote: On 13/12/2024 17:28, Carlo Nonato wrote: --- a/xen/arch/arm/arm64/mmu/mm.c +++ b/xen/arch/arm/arm64/mmu/mm.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier:

Re: [PATCH v3 1/2] x86: Rename _rsvd field to pw and move it to the bit 58

2025-01-07 Thread Jan Beulich
On 02.01.2025 18:13, Petr Beneš wrote: > From: Petr Beneš > > The EPT Paging-write feature (when enabled by the > TERTIARY_EXEC_EPT_PAGING_WRITE bit) uses bit 58 of the EPT entry to indicate > that guest paging may update the page, even if the W access is not set. > > This patch is a preparati

Re: [PATCH v6 2/7] xen/events: don't allow binding a global virq from any domain

2025-01-07 Thread Jan Beulich
On 07.01.2025 17:07, Jürgen Groß wrote: > On 07.01.25 16:34, Jan Beulich wrote: >> On 07.01.2025 11:17, Juergen Gross wrote: >>> @@ -479,8 +486,13 @@ int evtchn_bind_virq(evtchn_bind_virq_t *bind, >>> evtchn_port_t port) >>> */ >>> virq = array_index_nospec(virq, ARRAY_SIZE(v->virq_to_

Re: [PATCH v6 5/7] xen: add new domctl get_changed_domain

2025-01-07 Thread Jan Beulich
On 07.01.2025 11:17, Juergen Gross wrote: > --- a/xen/common/domain.c > +++ b/xen/common/domain.c > @@ -185,6 +185,76 @@ static void domain_changed_state(const struct domain *d) > unlock_dom_exc_handler(hdl); > } > > +static void set_domain_state_info(struct xen_domctl_get_domain_state *inf

Re: [PATCH v6 4/7] xen: add bitmap to indicate per-domain state changes

2025-01-07 Thread Jan Beulich
On 07.01.2025 11:17, Juergen Gross wrote: > Add a bitmap with one bit per possible domid indicating the respective > domain has changed its state (created, deleted, dying, crashed, > shutdown). > > Registering the VIRQ_DOM_EXC event will result in setting the bits for > all existing domains and re

Re: [PATCH v6 3/7] xen/events: allow setting of global virq handler only for unbound virqs

2025-01-07 Thread Jürgen Groß
On 07.01.25 16:38, Jan Beulich wrote: On 07.01.2025 11:17, Juergen Gross wrote: XEN_DOMCTL_set_virq_handler will happily steal a global virq from the current domain having bound it and assign it to another domain. The former domain will just never receive any further events for that virq without

Re: [PATCH] x86emul: correct put_fpu()'s segment selector handling

2025-01-07 Thread Andrew Cooper
On 07/01/2025 3:41 pm, Jan Beulich wrote: > On 07.01.2025 16:37, Andrew Cooper wrote: >> On 07/01/2025 2:33 pm, Jan Beulich wrote: >>> All selector fields under ctxt->regs are (normally) poisoned in the HVM >>> case, and the four ones besides CS and SS are potentially stale for PV. >>> Avoid using

Re: [PATCH v6 2/7] xen/events: don't allow binding a global virq from any domain

2025-01-07 Thread Jürgen Groß
On 07.01.25 16:34, Jan Beulich wrote: On 07.01.2025 11:17, Juergen Gross wrote: --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -120,6 +120,13 @@ static uint8_t get_xen_consumer(xen_event_channel_notification_t fn) /* Get the notification function for a given Xen-bound ev

Re: [PATCH v6 1/7] xen/events: fix race with set_global_virq_handler()

2025-01-07 Thread Jan Beulich
On 07.01.2025 16:56, Juergen Gross wrote: > On 07.01.25 16:49, Jan Beulich wrote: >> On 07.01.2025 16:37, Juergen Gross wrote: >>> On 07.01.25 16:23, Jan Beulich wrote: On 07.01.2025 11:17, Juergen Gross wrote: > --- a/xen/common/event_channel.c > +++ b/xen/common/event_channel.c >

Re: [PATCH v4] vpci: Add resizable bar support

2025-01-07 Thread Jan Beulich
On 07.01.2025 15:38, Roger Pau Monné wrote: > On Tue, Jan 07, 2025 at 11:06:33AM +0100, Jan Beulich wrote: >> On 19.12.2024 06:21, Jiqian Chen wrote: >>> --- /dev/null >>> +++ b/xen/drivers/vpci/rebar.c >>> @@ -0,0 +1,131 @@ >>> +/* SPDX-License-Identifier: GPL-2.0-only */ >>> +/* >>> + * Copyright

Re: [PATCH v6 1/7] xen/events: fix race with set_global_virq_handler()

2025-01-07 Thread Juergen Gross
On 07.01.25 16:49, Jan Beulich wrote: On 07.01.2025 16:37, Juergen Gross wrote: On 07.01.25 16:23, Jan Beulich wrote: On 07.01.2025 11:17, Juergen Gross wrote: --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -979,6 +979,7 @@ void send_global_virq(uint32_t virq) int set_

Re: [PATCH v6 1/7] xen/events: fix race with set_global_virq_handler()

2025-01-07 Thread Jan Beulich
On 07.01.2025 16:37, Juergen Gross wrote: > On 07.01.25 16:23, Jan Beulich wrote: >> On 07.01.2025 11:17, Juergen Gross wrote: >>> --- a/xen/common/event_channel.c >>> +++ b/xen/common/event_channel.c >>> @@ -979,6 +979,7 @@ void send_global_virq(uint32_t virq) >>> int set_global_virq_handler(str

Re: [PATCH] x86emul: correct put_fpu()'s segment selector handling

2025-01-07 Thread Jan Beulich
On 07.01.2025 16:37, Andrew Cooper wrote: > On 07/01/2025 2:33 pm, Jan Beulich wrote: >> All selector fields under ctxt->regs are (normally) poisoned in the HVM >> case, and the four ones besides CS and SS are potentially stale for PV. >> Avoid using them in the hypervisor incarnation of the emulat

Re: [PATCH v6 3/7] xen/events: allow setting of global virq handler only for unbound virqs

2025-01-07 Thread Jan Beulich
On 07.01.2025 11:17, Juergen Gross wrote: > XEN_DOMCTL_set_virq_handler will happily steal a global virq from the > current domain having bound it and assign it to another domain. The > former domain will just never receive any further events for that > virq without knowing what happened. Yet - se

Re: [PATCH v6 1/7] xen/events: fix race with set_global_virq_handler()

2025-01-07 Thread Juergen Gross
On 07.01.25 16:23, Jan Beulich wrote: On 07.01.2025 11:17, Juergen Gross wrote: --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -979,6 +979,7 @@ void send_global_virq(uint32_t virq) int set_global_virq_handler(struct domain *d, uint32_t virq) { struct domain *old;

Re: [PATCH] x86emul: correct put_fpu()'s segment selector handling

2025-01-07 Thread Andrew Cooper
On 07/01/2025 2:33 pm, Jan Beulich wrote: > All selector fields under ctxt->regs are (normally) poisoned in the HVM > case, and the four ones besides CS and SS are potentially stale for PV. > Avoid using them in the hypervisor incarnation of the emulator, when > trying to cover for a missing ->read

Re: [PATCH v6 2/7] xen/events: don't allow binding a global virq from any domain

2025-01-07 Thread Jan Beulich
On 07.01.2025 11:17, Juergen Gross wrote: > --- a/xen/common/event_channel.c > +++ b/xen/common/event_channel.c > @@ -120,6 +120,13 @@ static uint8_t > get_xen_consumer(xen_event_channel_notification_t fn) > /* Get the notification function for a given Xen-bound event channel. */ > #define xen_n

Re: [for-4.20][PATCH 0/3] xen/flask: Wire up missing hypercalls

2025-01-07 Thread Oleksii Kurochko
Hi Michal, On 1/7/25 10:27 AM, Michal Orzel wrote: It's been noted by Juergen that recently added XEN_DOMCTL_set_llc_colors is not wired up in FLASK. While preparing a fix, I noticed two other Arm hypercalls from the past that were missing the linking as well. These two are latent bugs while the

Re: [PATCH v6 1/7] xen/events: fix race with set_global_virq_handler()

2025-01-07 Thread Jan Beulich
On 07.01.2025 11:17, Juergen Gross wrote: > --- a/xen/common/event_channel.c > +++ b/xen/common/event_channel.c > @@ -979,6 +979,7 @@ void send_global_virq(uint32_t virq) > int set_global_virq_handler(struct domain *d, uint32_t virq) > { > struct domain *old; > +int rc = 0; > > if

Re: [PATCH v2 33/35] x86/domain: implement domain_has_vuart()

2025-01-07 Thread Roger Pau Monné
On Sat, Jan 04, 2025 at 05:19:07AM +, Denis Mukhin wrote: > On Friday, December 13th, 2024 at 4:23 AM, Roger Pau Monné > wrote: > > Albeit PVH is kind of HVM. > > PVH does not have vPIC so there's some more work to enable vUART > for PVH on x86: emulator currently supports only ISA IRQs. Bu

Re: [PATCH v7] mm/memblock: Add memblock_alloc_or_panic interface

2025-01-07 Thread Alexander Gordeev
On Sun, Dec 22, 2024 at 07:15:37PM +0800, Guo Weikang wrote: Hi Guo, > Before SLUB initialization, various subsystems used memblock_alloc to > allocate memory. In most cases, when memory allocation fails, an immediate > panic is required. To simplify this behavior and reduce repetitive checks, >

Re: [PATCH] x86emul: VCVT{,U}DQ2PD ignores embedded rounding

2025-01-07 Thread Andrew Cooper
On 07/01/2025 2:32 pm, Jan Beulich wrote: > IOW we shouldn't raise #UD in that case. Be on the safe side though and > only encode fully legitimate forms into the stub to be executed. > > Things weren't quite right for VCVT{,U}SI2SD either, in the attempt to > be on the safe side: Clearing EVEX.L'L

Re: [PATCH v4] vpci: Add resizable bar support

2025-01-07 Thread Roger Pau Monné
On Tue, Jan 07, 2025 at 11:06:33AM +0100, Jan Beulich wrote: > On 19.12.2024 06:21, Jiqian Chen wrote: > > --- /dev/null > > +++ b/xen/drivers/vpci/rebar.c > > @@ -0,0 +1,131 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > +/* > > + * Copyright (C) 2024 Advanced Micro Devices, Inc. All Righ

[PATCH] x86emul: correct put_fpu()'s segment selector handling

2025-01-07 Thread Jan Beulich
All selector fields under ctxt->regs are (normally) poisoned in the HVM case, and the four ones besides CS and SS are potentially stale for PV. Avoid using them in the hypervisor incarnation of the emulator, when trying to cover for a missing ->read_segment() hook. To make sure there's always a va

[PATCH] x86emul: VCVT{,U}DQ2PD ignores embedded rounding

2025-01-07 Thread Jan Beulich
IOW we shouldn't raise #UD in that case. Be on the safe side though and only encode fully legitimate forms into the stub to be executed. Things weren't quite right for VCVT{,U}SI2SD either, in the attempt to be on the safe side: Clearing EVEX.L'L isn't useful; it's EVEX.b which primarily needs cle

Re: [RFC PATCH 6/7] accel/hvf: Use CPU_FOREACH_HVF()

2025-01-07 Thread BALATON Zoltan
On Mon, 6 Jan 2025, Philippe Mathieu-Daudé wrote: On 6/1/25 21:33, Daniel Henrique Barboza wrote: On 1/6/25 5:02 PM, Philippe Mathieu-Daudé wrote: Only iterate over HVF vCPUs when running HVF specific code. Signed-off-by: Philippe Mathieu-Daudé ---   include/system/hvf_int.h  | 4   acc

Re: [RFC] docs: FRED support in Xen

2025-01-07 Thread Jan Beulich
On 06.01.2025 17:06, Andrew Cooper wrote: > On 06/01/2025 2:28 pm, Jan Beulich wrote: >> On 03.01.2025 21:47, Andrew Cooper wrote: >>> +There are several uses of the vm86 fields in Xen: >>> + >>> + #. ``struct vcpu`` embeds a ``struct cpu_user_regs`` to hold GPRs/etc when >>> +the vCPU is sched

[PATCH v6 2/7] xen/events: don't allow binding a global virq from any domain

2025-01-07 Thread Juergen Gross
Today Xen will happily allow binding a global virq by a domain which isn't configured to receive it. This won't result in any bad actions, but the bind will appear to have succeeded with no event ever being received by that event channel. Instead of allowing the bind, error out if the domain isn't

[PATCH v6 7/7] tools/xenstored: use new stable interface instead of libxenctrl

2025-01-07 Thread Juergen Gross
Replace the current use of the unstable xc_domain_getinfo_single() interface with the stable domctl XEN_DOMCTL_get_domain_state call via the new libxenmanage library. This will remove the last usage of libxenctrl by Xenstore, so update the library dependencies accordingly. For now only do a direc

[PATCH v6 4/7] xen: add bitmap to indicate per-domain state changes

2025-01-07 Thread Juergen Gross
Add a bitmap with one bit per possible domid indicating the respective domain has changed its state (created, deleted, dying, crashed, shutdown). Registering the VIRQ_DOM_EXC event will result in setting the bits for all existing domains and resetting all other bits. As the usage of this bitmap i

[PATCH v6 6/7] tools/libs: add a new libxenmanage library

2025-01-07 Thread Juergen Gross
In order to have a stable interface in user land for using stable domctl and possibly later sysctl interfaces, add a new library libxenmanage. Signed-off-by: Juergen Gross Reviewed-by: Anthony PERARD --- V1: - new patch V2: - define __XEN_TOOLS__ via Makefile (Anthony PERARD) - use SPDX in heade

[PATCH v6 5/7] xen: add new domctl get_changed_domain

2025-01-07 Thread Juergen Gross
Add a new domctl sub-function to get data of a domain having changed state (this is needed by Xenstore). The returned state just contains the domid, the domain unique id, and some flags (existing, shutdown, dying). In order to enable Xenstore stubdom being built for multiple Xen versions, make th

[PATCH v6 0/7] remove libxenctrl usage from xenstored

2025-01-07 Thread Juergen Gross
Xenstored is using libxenctrl for only one purpose: to get information about state of domains. This patch series is removing that dependency by introducing a new stable interface which can be used by xenstored instead. There was a RFC series sent out 3 years ago, which I have taken as a base and

[PATCH v6 1/7] xen/events: fix race with set_global_virq_handler()

2025-01-07 Thread Juergen Gross
There is a possible race scenario between set_global_virq_handler() and clear_global_virq_handlers() targeting the same domain, which might result in that domain ending as a zombie domain. In case set_global_virq_handler() is being called for a domain which is just dying, it might happen that clea

[PATCH v6 3/7] xen/events: allow setting of global virq handler only for unbound virqs

2025-01-07 Thread Juergen Gross
XEN_DOMCTL_set_virq_handler will happily steal a global virq from the current domain having bound it and assign it to another domain. The former domain will just never receive any further events for that virq without knowing what happened. Change the behavior to allow XEN_DOMCTL_set_virq_handler o

Re: [PATCH v4] vpci: Add resizable bar support

2025-01-07 Thread Jan Beulich
On 19.12.2024 06:21, Jiqian Chen wrote: > --- /dev/null > +++ b/xen/drivers/vpci/rebar.c > @@ -0,0 +1,131 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * Copyright (C) 2024 Advanced Micro Devices, Inc. All Rights Reserved. > + * > + * Author: Jiqian Chen > + */ > + > +#include > +#i

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

2025-01-07 Thread Roger Pau Monne
The 'm' parameter used to request auto-allocation of the destination variable is not supported on FreeBSD, and as such leads to failures to parse. What's more, the current usage of '%ms' with xs_node_scanf() is pointless, as it just leads to a double allocation of the same string. Instead use qem

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

2025-01-07 Thread Roger Pau Monne
Hello, First patch fixes some error handling paths that incorrectly used error_prepend() in the Xen console driver. Second patch removes usage of the 'm' character in scanf directives, as it's not supported on FreeBSD (see usages of "%ms"). Thanks, Roger. Roger Pau Monné (2): xen/console: fix

[PATCH 1/2] xen/console: fix error handling in xen_console_device_create()

2025-01-07 Thread Roger Pau Monne
The usage of error_prepend() in some of the error contexts of xen_console_device_create() is incorrect, as `errp` hasn't been initialized. This leads to the following segmentation fault on error paths resulting from xenstore reads: Program terminated with signal SIGSEGV, Segmentation fault. Addres

[for-4.20][PATCH 2/3] xen/flask: Wire up XEN_DOMCTL_dt_overlay

2025-01-07 Thread Michal Orzel
Addition of FLASK permission for this hypercall was overlooked in the original patch. Fix it. The only dt overlay operation is attaching that can happen only after the domain is created. Dom0 can attach overlay to itself as well. Fixes: 4c733873b5c2 ("xen/arm: Add XEN_DOMCTL_dt_overlay and device

[for-4.20][PATCH 1/3] xen/flask: Wire up XEN_DOMCTL_vuart_op

2025-01-07 Thread Michal Orzel
Addition of FLASK permission for this hypercall was overlooked in the original patch. Fix it. The only VUART operation is initialization that can occur only during domain creation. Fixes: 86039f2e8c20 ("xen/arm: vpl011: Add a new domctl API to initialize vpl011") Signed-off-by: Michal Orzel ---

[for-4.20][PATCH 3/3] xen/flask: Wire up XEN_DOMCTL_set_llc_colors

2025-01-07 Thread Michal Orzel
Addition of FLASK permission for this hypercall was overlooked in the original patch. Fix it. Setting LLC colors is only possible during domain creation. Fixes: 6985aa5e0c3c ("xen: extend domctl interface for cache coloring") Signed-off-by: Michal Orzel --- tools/flask/policy/modules/xen.if |

[for-4.20][PATCH 0/3] xen/flask: Wire up missing hypercalls

2025-01-07 Thread Michal Orzel
It's been noted by Juergen that recently added XEN_DOMCTL_set_llc_colors is not wired up in FLASK. While preparing a fix, I noticed two other Arm hypercalls from the past that were missing the linking as well. These two are latent bugs while the LLC one is a release blocker for 4.20. Michal Orzel

Re: [PATCH v3] misra: add deviation for MISRA C Rule R11.8.

2025-01-07 Thread Jan Beulich
On 07.01.2025 10:10, Alessandro Zucchelli wrote: > --- a/docs/misra/deviations.rst > +++ b/docs/misra/deviations.rst > @@ -353,6 +353,13 @@ Deviations related to MISRA C:2012 Rules: > Fixing this violation would require to increase code complexity and > lower readability. > - Tagged

Re: [PATCH for-4.20? 0/5] xen/perfc: Cleanup, and wire up for RISCV/PPC

2025-01-07 Thread Oleksii Kurochko
On 1/2/25 8:25 PM, Andrew Cooper wrote: This started as just patch 3 fixing a header tangle with FRED on x86, but grew somewhat. It's simple, straight forward, and gets perf counters working uniformly on all architectures, and a net reduction in code. It's low risk, and should be considered f

Re: [PATCH 2/5] xen/perfc: Add perfc_defn.h to asm-generic

2025-01-07 Thread Oleksii Kurochko
On 1/2/25 8:25 PM, Andrew Cooper wrote: ... and hook it up for RISC-V and PPC. On RISC-V at least, no combination of headers pulls in errno.h, so include it explicitly. Guard the hypercalls array declaration based on NR_hypercalls existing. This is sufficient to get PERF_COUNTERS fully worki

[PATCH v3] misra: add deviation for MISRA C Rule R11.8.

2025-01-07 Thread Alessandro Zucchelli
Rule 11.8 states as following: "A cast shall not remove any `const' or `volatile' qualification from the type pointed to by a pointer". Function `__hvm_copy' in `xen/arch/x86/hvm/hvm.c' is a double-use function, where the parameter needs to not be const because it can be set for write or not. As i

[PATCH] xen/arm: ffa: add changelog entries for FF-A improvements

2025-01-07 Thread Bertrand Marquis
Add a CHANGELOG entry for release 4.20 to mention the various improvements and fixes that have been done in the FF-A support since 4.19 release. Signed-off-by: Bertrand Marquis --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8507e6556a56.

Re: [XEN PATCH v1] xen: mem_access: conditionally compile vm_event.c & monitor.c

2025-01-07 Thread Jan Beulich
On 06.01.2025 19:09, Tamas K Lengyel wrote: > On Mon, Jan 6, 2025 at 10:10 AM Jan Beulich wrote: >> >> On 06.01.2025 15:05, Tamas K Lengyel wrote: >>> On Mon, Jan 6, 2025 at 5:16 AM Jan Beulich wrote: On 30.12.2024 07:30, Sergiy Kibrik wrote: > From: Stefano Stabellini > >

Re: [PATCH v2 31/35] x86/hvm: introduce NS8250 UART emulator

2025-01-07 Thread Jan Beulich
On 06.01.2025 21:16, Denis Mukhin wrote: > On Monday, January 6th, 2025 at 1:19 AM, Jan Beulich > wrote: >> On 04.01.2025 06:31, Denis Mukhin wrote: >>> On Monday, December 16th, 2024 at 7:04 AM, Jan Beulich jbeul...@suse.com >>> wrote: On 06.12.2024 05:42, Denis Mukhin via B4 Relay wrote:

Re: [PATCH v2 20/35] xen/console: introduce console_owner_domid()

2025-01-07 Thread Jan Beulich
On 06.01.2025 19:48, Stefano Stabellini wrote: > On Mon, 6 Jan 2025, Jan Beulich wrote: >> On 04.01.2025 05:15, Denis Mukhin wrote: >>> >>> On Tuesday, December 10th, 2024 at 11:28 PM, Jan Beulich >>> wrote: >>> On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: > From:

Re: [PATCH v2 19/35] xen/console: introduce console_set_owner()

2025-01-07 Thread Jan Beulich
On 06.01.2025 21:03, Denis Mukhin wrote: > > On Monday, January 6th, 2025 at 1:58 AM, Jan Beulich > wrote: > >> >> >> On 04.01.2025 04:30, Denis Mukhin wrote: >> >>> On Thursday, December 12th, 2024 at 2:12 AM, Roger Pau Monné >>> roger@citrix.com wrote: >>> On Thu, Dec 05, 2024 at 08

Re: [PATCH for-4.20] public/version: soften wording for deprecated sub-ops

2025-01-07 Thread Jan Beulich
On 06.01.2025 23:01, Stefano Stabellini wrote: > On Mon, 6 Jan 2025, Jan Beulich wrote: >> On 06.01.2025 12:08, Andrew Cooper wrote: >>> On 06/01/2025 11:04 am, Jan Beulich wrote: These interfaces were - afaict - originally introduced this way on the firm assumption that the used array si

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-07 Thread Jan Beulich
On 06.01.2025 18:19, David Woodhouse wrote: > 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 befor