Re: [PATCH v2 01/10] xen/arm: ffa: Rework firmware discovery

2024-10-23 Thread Bertrand Marquis
Hi Jens, > On 21 Oct 2024, at 19:03, Jens Wiklander wrote: > > Hi Bertrand, > > On Wed, Oct 16, 2024 at 10:32 AM Bertrand Marquis > wrote: >> >> Rework firmware discovery during probe: >> - move prints into the probe >> - rename ffa_version to ffa_fw_version as the variable identifies the >>

Re: [PATCH v2 02/10] xen/arm: ffa: Rework feature discovery

2024-10-23 Thread Bertrand Marquis
Hi Jens, > On 22 Oct 2024, at 08:30, Jens Wiklander wrote: > > Hi Bertrand, > > On Wed, Oct 16, 2024 at 10:32 AM Bertrand Marquis > wrote: >> >> Store the list of ABI we need in a list and go through the list instead >> of having a list of conditions inside the code. >> >> No functional chan

Re: [PATCH] x86/boot: Fix PVH boot during boot_info transition period

2024-10-23 Thread Andrew Cooper
On 23/10/2024 8:10 am, Alan Robinson wrote: > Hi Andrew, > > A small suggestion for the commit log.. > > On Tue, Oct 22, 2024 at 12:41:14PM +, Andrew Cooper wrote: >> multiboot_fill_boot_info() taking the physical address of the multiboot_info >> structure leads to a subtle use-after-free on th

Re: [QEMU PATCH v8] xen/passthrough: use gsi to map pirq when dom0 is PVH

2024-10-23 Thread Chen, Jiqian
On 2024/10/22 04:55, Stewart Hildebrand wrote: > On 10/16/24 02:28, Jiqian Chen wrote: >> In PVH dom0, when passthrough a device to domU, QEMU code >> xen_pt_realize->xc_physdev_map_pirq wants to use gsi, but in current codes >> the gsi number is got from file /sys/bus/pci/devices//irq, that is >>

Re: [QEMU PATCH v8] xen/passthrough: use gsi to map pirq when dom0 is PVH

2024-10-23 Thread Chen, Jiqian
On 2024/10/23 07:07, Marek Marczykowski-Górecki wrote: > On Wed, Oct 16, 2024 at 02:28:27PM +0800, Jiqian Chen wrote: >> --- a/hw/xen/xen_pt.h >> +++ b/hw/xen/xen_pt.h >> @@ -36,6 +36,7 @@ void xen_pt_log(const PCIDevice *d, const char *f, ...) >> G_GNUC_PRINTF(2, 3); >> # define XEN_PT_LOG_CONF

Re: [PATCH v2 04/10] xen/arm: ffa: Fine granular call support

2024-10-23 Thread Jens Wiklander
Hi Bertrand, On Wed, Oct 16, 2024 at 10:32 AM Bertrand Marquis wrote: > > Create a bitmap to store which feature is supported or not by the > firmware and use it to filter which calls are done to the firmware. > > While there reoder ABI definition by numbers to easily find the min and > max ones.

[PATCH 1/3] x86/boot: Add a temporary module_map pointer to boot_image

2024-10-23 Thread Andrew Cooper
... in order to untangle parameter handling independently from other other logic changes. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Daniel P. Smith --- xen/arch/x86/include/asm/bootinfo.h | 1 + xen/arch/x86/setup.c| 1 + 2 files changed, 2 inser

[PATCH 0/3] x86/boot: Yet more PVH module handling fixes

2024-10-23 Thread Andrew Cooper
It turns out microcode and XSM module handling has been broken ever since PVH boot was introduced. Both appear to have have gone unnoticed because their functionality isn't typically used in PVH guests. https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1508716668 Andrew Cooper (1):

[PATCH 3/3] x86/boot: Fix XSM module handling during PVH boot

2024-10-23 Thread Andrew Cooper
From: "Daniel P. Smith" As detailed in commit 0fe607b2a144 ("x86/boot: Fix PVH boot during boot_info transition period"), the use of __va(mbi->mods_addr) constitutes a use-after-free on the PVH boot path. This pattern has been in use since before PVH support was added. This has most likely gone

[PATCH 2/3] x86/boot: Fix microcode module handling during PVH boot

2024-10-23 Thread Andrew Cooper
From: "Daniel P. Smith" As detailed in commit 0fe607b2a144 ("x86/boot: Fix PVH boot during boot_info transition period"), the use of __va(mbi->mods_addr) constitutes a use-after-free on the PVH boot path. This pattern has been in use since before PVH support was added. Inside a PVH VM, it will

Re: [PATCH] x86/boot: Fix PVH boot during boot_info transition period

2024-10-23 Thread Alan Robinson
Hi Andrew, A small suggestion for the commit log.. On Tue, Oct 22, 2024 at 12:41:14PM +, Andrew Cooper wrote: > > multiboot_fill_boot_info() taking the physical address of the multiboot_info > structure leads to a subtle use-after-free on the PVH path, with rather less > subtle fallout. > >

Re: [PATCH 1/3] x86/boot: Add a temporary module_map pointer to boot_image

2024-10-23 Thread Daniel P. Smith
On 10/23/24 06:57, Andrew Cooper wrote: ... in order to untangle parameter handling independently from other other logic changes. Signed-off-by: Andrew Cooper --- Reviewed-by: Daniel P. Smith

Re: [PATCH 3/3] x86/boot: Fix XSM module handling during PVH boot

2024-10-23 Thread Daniel P. Smith
On 10/23/24 06:57, Andrew Cooper wrote: From: "Daniel P. Smith" As detailed in commit 0fe607b2a144 ("x86/boot: Fix PVH boot during boot_info transition period"), the use of __va(mbi->mods_addr) constitutes a use-after-free on the PVH boot path. This pattern has been in use since before PVH sup

Re: [PATCH 2/3] x86/boot: Fix microcode module handling during PVH boot

2024-10-23 Thread Daniel P. Smith
On 10/23/24 06:57, Andrew Cooper wrote: From: "Daniel P. Smith" As detailed in commit 0fe607b2a144 ("x86/boot: Fix PVH boot during boot_info transition period"), the use of __va(mbi->mods_addr) constitutes a use-after-free on the PVH boot path. This pattern has been in use since before PVH sup

Re: [PATCH v2 05/10] xen/arm: ffa: Rework partition info get

2024-10-23 Thread Jens Wiklander
Hi Bertrand, On Wed, Oct 16, 2024 at 10:32 AM Bertrand Marquis wrote: > > Rework the partition info get implementation to use the correct size of > structure depending on the version of the protocol and simplifies the > structure copy to use only memcpy and prevent recreating the structure > each

[PATCH] x86/ucode: Explain what microcode_set_module() does

2024-10-23 Thread Andrew Cooper
Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné I found this hiding in other microcode changes, and decided it was high time it got included. --- xen/arch/x86/cpu/microcode/core.c | 4 1 file changed, 4 insertions(+) diff --git a/xen/arch/x86/cpu/microcode/core.c b/

Re: [PATCH 4/3] x86/boot: Remove the mbi_p parameter from __start_xen()

2024-10-23 Thread Andrew Cooper
On 23/10/2024 3:58 pm, Daniel P. Smith wrote: > On 10/23/24 10:44, Andrew Cooper wrote: >> The use of physical addresses in __start_xen() has proved to be >> fertile soure >> of bugs. >> >> The MB1/2 path stashes the MBI pointer in multiboot_ptr (a setup.c >> variable >> even), then re-loads it imm

Re: [PATCH v3 5/6] xen/arm: mpu: Enable MPU

2024-10-23 Thread Julien Grall
On 23/10/2024 17:18, Julien Grall wrote: On 23/10/2024 17:13, Julien Grall wrote: On 23/10/2024 17:06, Ayan Kumar Halder wrote: Hi Luca/Julien, On 22/10/2024 17:31, Luca Fancellu wrote: Hi Julien, On 22 Oct 2024, at 14:13, Julien Grall wrote: On 22/10/2024 10:56, Luca Fancellu wr

Re: [PATCH 02/13] ALSA: hda_intel: Use always-managed version of pcim_intx()

2024-10-23 Thread Philipp Stanner
On Tue, 2024-10-22 at 16:08 +0200, Takashi Iwai wrote: > On Tue, 15 Oct 2024 20:51:12 +0200, > Philipp Stanner wrote: > > > > pci_intx() is a hybrid function which can sometimes be managed > > through > > devres. To remove this hybrid nature from pci_intx(), it is > > necessary to > > port users t

Re: [PATCH] x86/ucode: Explain what microcode_set_module() does

2024-10-23 Thread Alejandro Vallejo
On Wed Oct 23, 2024 at 1:28 PM BST, Andrew Cooper wrote: > Signed-off-by: Andrew Cooper Reviewed-by: Alejandro Vallejo With a single nit that I don't care much about, but... > --- > CC: Jan Beulich > CC: Roger Pau Monné > > I found this hiding in other microcode changes, and decided it was

Re: [PATCH 1/6] xen: add a domain unique id to each domain

2024-10-23 Thread Alejandro Vallejo
On Wed Oct 23, 2024 at 2:10 PM BST, Juergen Gross wrote: > Xenstore is referencing domains by their domid, but reuse of a domid > can lead to the situation that Xenstore can't tell whether a domain > with that domid has been deleted and created again without Xenstore > noticing the domain is a new

Re: [PATCH v3 5/6] xen/arm: mpu: Enable MPU

2024-10-23 Thread Ayan Kumar Halder
Hi Luca/Julien, On 22/10/2024 17:31, Luca Fancellu wrote: Hi Julien, On 22 Oct 2024, at 14:13, Julien Grall wrote: On 22/10/2024 10:56, Luca Fancellu wrote: On 22 Oct 2024, at 10:47, Julien Grall wrote: Hi Luca, On 22/10/2024 10:41, Luca Fancellu wrote: On 21 Oct 2024, at 17:27, Julie

Re: [PATCH v3 5/6] xen/arm: mpu: Enable MPU

2024-10-23 Thread Julien Grall
On 23/10/2024 17:06, Ayan Kumar Halder wrote: Hi Luca/Julien, On 22/10/2024 17:31, Luca Fancellu wrote: Hi Julien, On 22 Oct 2024, at 14:13, Julien Grall wrote: On 22/10/2024 10:56, Luca Fancellu wrote: On 22 Oct 2024, at 10:47, Julien Grall wrote: Hi Luca, On 22/10/2024 10:41, Luc

Re: [PATCH 3/6] xen: add new domctl get_changed_domain

2024-10-23 Thread Daniel P. Smith
On 10/23/24 09:10, Juergen Gross wrote: 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 bein

Re: [PATCH 2/3] x86/boot: Fix microcode module handling during PVH boot

2024-10-23 Thread Andrew Cooper
On 23/10/2024 6:01 pm, Roger Pau Monné wrote: > On Wed, Oct 23, 2024 at 11:57:55AM +0100, Andrew Cooper wrote: >> From: "Daniel P. Smith" >> >> As detailed in commit 0fe607b2a144 ("x86/boot: Fix PVH boot during boot_info >> transition period"), the use of __va(mbi->mods_addr) constitutes a >> use-

Re: [PATCH v2 06/10] xen/arm: ffa: Use bit 15 convention for SPs

2024-10-23 Thread Jens Wiklander
Hi Bertrand, On Wed, Oct 16, 2024 at 10:32 AM Bertrand Marquis wrote: > > Make use and required to have bit 15 convention respected by secure > world (having bit 15 of IDs set for secure endpoints and non-set for > non-secure ones). > If any secure partition has an ID with bit 15 not set, it will

[MINI-OS PATCH] config: add support for libxenmanage

2024-10-23 Thread Juergen Gross
Add CONFIG_LIBXENMANAGE support. Signed-off-by: Juergen Gross --- Please note that this patch should be committed only after the related Xen patch "tools/libs: add a new libxenmanage library" has been Acked, as otherwise it should either be dropped (in case the approach of adding a new library is

Re: [PATCH 4/3] x86/boot: Remove the mbi_p parameter from __start_xen()

2024-10-23 Thread Daniel P. Smith
On 10/23/24 10:44, Andrew Cooper wrote: The use of physical addresses in __start_xen() has proved to be fertile soure of bugs. The MB1/2 path stashes the MBI pointer in multiboot_ptr (a setup.c variable even), then re-loads it immediately before calling __start_xen(). For this, we can just drop

[PATCH v2 1/3] xen/riscv: introduce setup_mm()

2024-10-23 Thread Oleksii Kurochko
Introduce the implementation of setup_mm(), which includes: 1. Adding all free regions to the boot allocator, as memory is needed to allocate page tables used for frame table mapping. 2. Calculating RAM size and the RAM end address. 3. Setting up direct map mappings from each RAM bank and initia

[PATCH v2 3/3] xen/riscv: finalize boot allocator and transition to boot state

2024-10-23 Thread Oleksii Kurochko
Add a call to end_boot_allocator() in start_xen() to finalize the boot memory allocator, moving free pages to the domain sub-allocator. After initializing the memory subsystem, update `system_state` from `SYS_STATE_early_boot` to `SYS_STATE_boot`, signifying the end of the early boot phase. Signe

[PATCH v2 0/3] Setup memory management for RISC-V

2024-10-23 Thread Oleksii Kurochko
Finish initializing the memory subsystem by mapping the direct map and frame table. In the case of RISC-V 64, which has a large virtual address space (the minimum supported MMU mode is Sv39, providing TB of VA space), so frame table is mapped starting from physical address 0 to ram_end. This simpli

[PATCH 3/6] xen: add new domctl get_changed_domain

2024-10-23 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 5/6] tools: add a dedicated header file for barrier definitions

2024-10-23 Thread Juergen Gross
Instead of having to include xenctrl.h for getting definitions of cpu barriers, add a dedicated header for that purpose. Switch the xen-9pfsd daemon to use the new header instead of xenctrl.h. This is in preparation of making Xenstore independent from libxenctrl. Signed-off-by: Juergen Gross --

[PATCH 1/6] xen: add a domain unique id to each domain

2024-10-23 Thread Juergen Gross
Xenstore is referencing domains by their domid, but reuse of a domid can lead to the situation that Xenstore can't tell whether a domain with that domid has been deleted and created again without Xenstore noticing the domain is a new one now. Add a global domain creation unique id which is updated

[PATCH 2/6] xen: add bitmap to indicate per-domain state changes

2024-10-23 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. Resetting a bit will be done

[PATCH 0/6] remove libxenctrl usage from xenstored

2024-10-23 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 4/6] tools/libs: add a new libxenmanage library

2024-10-23 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 --- V1: - new patch --- tools/include/xenmanage.h | 98 + tools/libs/Makefile| 1

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

2024-10-23 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

Re: [PATCH 1/6] xen: add a domain unique id to each domain

2024-10-23 Thread Juergen Gross
On 23.10.24 16:08, Alejandro Vallejo wrote: On Wed Oct 23, 2024 at 2:10 PM BST, Juergen Gross wrote: Xenstore is referencing domains by their domid, but reuse of a domid can lead to the situation that Xenstore can't tell whether a domain with that domid has been deleted and created again without

Re: [PATCH v2 07/10] xen/arm: ffa: Transmit RXTX buffers to the SPMC

2024-10-23 Thread Jens Wiklander
Hi Bertrand, On Wed, Oct 16, 2024 at 10:32 AM Bertrand Marquis wrote: > > When an RXTX buffer is mapped by a VM transmit it to the SPMC when it > supports RX_ACQUIRE. > As a consequence of that, we must acquire the RX buffer of a VM from the > SPMC when we want to use it: > - create a generic acq

[PATCH 4/3] x86/boot: Remove the mbi_p parameter from __start_xen()

2024-10-23 Thread Andrew Cooper
The use of physical addresses in __start_xen() has proved to be fertile soure of bugs. The MB1/2 path stashes the MBI pointer in multiboot_ptr (a setup.c variable even), then re-loads it immediately before calling __start_xen(). For this, we can just drop the function parameter and read multiboot

Re: [PATCH 02/13] ALSA: hda_intel: Use always-managed version of pcim_intx()

2024-10-23 Thread Takashi Iwai
On Wed, 23 Oct 2024 15:50:09 +0200, Philipp Stanner wrote: > > On Tue, 2024-10-22 at 16:08 +0200, Takashi Iwai wrote: > > On Tue, 15 Oct 2024 20:51:12 +0200, > > Philipp Stanner wrote: > > > > > > pci_intx() is a hybrid function which can sometimes be managed > > > through > > > devres. To remove

Goodbye to our Xen Project Colo

2024-10-23 Thread Kelly Choi
Hi all, A while back, the Xen Project was notified by the data centre facility hosting the physical hardware for OSSTest and some of the GitLab runners, were due to be shut down. Since then we have had extensive discussions and explored multiple options to mitigate the impact of this on our proje

Re: [MINI-OS PATCH] config: add support for libxenmanage

2024-10-23 Thread Samuel Thibault
Juergen Gross, le mer. 23 oct. 2024 15:10:48 +0200, a ecrit: > Add CONFIG_LIBXENMANAGE support. > > Signed-off-by: Juergen Gross > --- > Please note that this patch should be committed only after the related > Xen patch "tools/libs: add a new libxenmanage library" has been Acked, > as otherwise i

Re: [PATCH 3/3] x86/boot: Fix XSM module handling during PVH boot

2024-10-23 Thread Roger Pau Monné
On Wed, Oct 23, 2024 at 11:57:56AM +0100, Andrew Cooper wrote: > From: "Daniel P. Smith" > > As detailed in commit 0fe607b2a144 ("x86/boot: Fix PVH boot during boot_info > transition period"), the use of __va(mbi->mods_addr) constitutes a > use-after-free on the PVH boot path. > > This pattern h

Re: [PATCH v3 5/6] xen/arm: mpu: Enable MPU

2024-10-23 Thread Julien Grall
On 23/10/2024 17:13, Julien Grall wrote: On 23/10/2024 17:06, Ayan Kumar Halder wrote: Hi Luca/Julien, On 22/10/2024 17:31, Luca Fancellu wrote: Hi Julien, On 22 Oct 2024, at 14:13, Julien Grall wrote: On 22/10/2024 10:56, Luca Fancellu wrote: On 22 Oct 2024, at 10:47, Julien Grall

Re: [PATCH 2/3] x86/boot: Fix microcode module handling during PVH boot

2024-10-23 Thread Roger Pau Monné
On Wed, Oct 23, 2024 at 11:57:55AM +0100, Andrew Cooper wrote: > From: "Daniel P. Smith" > > As detailed in commit 0fe607b2a144 ("x86/boot: Fix PVH boot during boot_info > transition period"), the use of __va(mbi->mods_addr) constitutes a > use-after-free on the PVH boot path. > > This pattern h

[PATCH v2 2/3] xen/riscv: initialize the VMAP_DEFAULT virtual range

2024-10-23 Thread Oleksii Kurochko
Call vm_init() to initialize the VMAP_DEFAULT virtual range. To support this, introduce the populate_pt_range() and arch_vmap_virt_end() functions, which are used by vm_init()->vm_init_type(). Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Change in V2: - Acked-by: Jan Beulich ---