Re: [PATCH for-4.18] tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread

2024-11-11 Thread Andrew Cooper
On 11/11/2024 2:41 pm, Jan Beulich wrote: > On 11.11.2024 15:31, Andrew Cooper wrote: >> This breaks the build with debug active, as main_thread is not an exposed >> symbol. >> >> This is a minimal version of commit bc4fe94a69d4 ("tools/libs/evtchn: replace >> assert()s in stubdom with proper locki

Re: [PATCH for-4.18] tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread

2024-11-11 Thread Jürgen Groß
On 11.11.24 15:41, Jan Beulich wrote: On 11.11.2024 15:31, Andrew Cooper wrote: This breaks the build with debug active, as main_thread is not an exposed symbol. This is a minimal version of commit bc4fe94a69d4 ("tools/libs/evtchn: replace assert()s in stubdom with proper locking"). It leaves

Re: [PATCH for-4.18] tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread

2024-11-11 Thread Andrew Cooper
On 11/11/2024 2:47 pm, Andrew Cooper wrote: > On 11/11/2024 2:41 pm, Jan Beulich wrote: >> On 11.11.2024 15:31, Andrew Cooper wrote: >>> This breaks the build with debug active, as main_thread is not an exposed >>> symbol. >>> >>> This is a minimal version of commit bc4fe94a69d4 ("tools/libs/evtchn

Re: [PATCH v1 2/2] xen/mmu: enable SMMU subsystem only in MMU

2024-11-11 Thread Ayan Kumar Halder
On 11/11/2024 13:45, Julien Grall wrote: Hi Ayan, Hi Julien, On 11/11/2024 13:24, Ayan Kumar Halder wrote: On 11/11/2024 11:12, Julien Grall wrote: Hi, Hi Julien, On 08/11/2024 19:59, Ayan Kumar Halder wrote: From: Penny Zheng In Xen, SMMU subsystem is supported for MMU system only.

Re: [PATCH v6 2/3] xen/pci: introduce PF<->VF links

2024-11-11 Thread Stewart Hildebrand
On 10/28/24 14:41, Roger Pau Monné wrote: > On Fri, Oct 18, 2024 at 04:39:09PM -0400, Stewart Hildebrand wrote: >> Add links between a VF's struct pci_dev and its associated PF struct >> pci_dev. Move the calls to pci_get_pdev()/pci_add_device() down to avoid >> dropping and re-acquiring the pcidev

[PATCH for-4.18] tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread

2024-11-11 Thread Andrew Cooper
This breaks the build with debug active, as main_thread is not an exposed symbol. This is a minimal version of commit bc4fe94a69d4 ("tools/libs/evtchn: replace assert()s in stubdom with proper locking"). It leaves MiniOS no worse off with respect to thread safety. Signed-off-by: Andrew Cooper -

Re: [PATCH v3] x86/boot: Setup correctly fs segment for bogus_real_magic

2024-11-11 Thread Jan Beulich
On 11.11.2024 14:28, Frediano Ziglio wrote: > bogus_real_magic code uses fs segment so it should be initialised. > > Fixes: d8c8fef09054 ("Provide basic Xen PM infrastructure") > Signed-off-by: Frediano Ziglio Reviewed-by: Jan Beulich

Re: [PATCH v1 2/2] xen/mmu: enable SMMU subsystem only in MMU

2024-11-11 Thread Luca Fancellu
Hi Ayan, > On 11 Nov 2024, at 16:00, Ayan Kumar Halder wrote: > > > On 11/11/2024 13:45, Julien Grall wrote: >> Hi Ayan, > Hi Julien, >> >> On 11/11/2024 13:24, Ayan Kumar Halder wrote: >>> On 11/11/2024 11:12, Julien Grall wrote: Hi, >>> Hi Julien, On 08/11/2024 19:59, Ayan K

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

2024-11-11 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 v5 0/3] Setup memory management for RISC-V

2024-11-11 Thread Oleksii Kurochko
Finish initializing the memory subsystem by mapping the direct map and frame table. The frametable_virt_start variable is introduced with substracting of an offest ( taking into account that RAM start could be not 0 ) to save virtual address space of FRAMETABLE. Also it simplifies the calculations

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

2024-11-11 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] drivers/char: rename arm-uart.c to uart-init.c

2024-11-11 Thread Oleksii Kurochko
Rename the file containing uart_init() to enable reuse across other architectures that utilize device trees or SPCR tables to locate UART information. After locating UART data, {acpi}_device_init() is called to initialize the UART. arm_uart_init() is renamed to uart_init() to be reused by other ar

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

2024-11-11 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-V5: - Acked-by: Jan Beulich -

[PATCH] x86/trampoline: Change type of trampoline_phys to uint32_t

2024-11-11 Thread Andrew Cooper
As now documented, this variable holds a page aligned value less than 1M. However, head.S fills it using 4-byte stores, and reloc_trampoline() is compiled for both 32bit and 64bit, where unsigned long is a different size. This happens to work because of the range of the value, but switch to uint3

Re: [PATCH v2 3/8] xen/arm: Add SCMI over SMC calls handling layer

2024-11-11 Thread Julien Grall
Hi, On 01/11/2024 15:22, Grygorii Strashko wrote: Hi I'd be apprcieated if could consider my comments below. On 30.09.24 14:47, Andrei Cherechesu (OSS) wrote: From: Andrei Cherechesu Introduce the SCMI layer to have some basic degree of awareness about SMC calls that are based on the ARM Sy

Re: [PATCH v1 1/2] xen/mpu: Map early uart when earlyprintk on

2024-11-11 Thread Julien Grall
Hi Ayan, On 08/11/2024 20:00, Ayan Kumar Halder wrote: CONFIG_EARLY_UART_SIZE is introduced to let user provide physical size of early UART. Unlike MMU where we map a page in the virtual address space, here we need to know the exact physical size to be mapped. As VA == PA in case of MPU, the mem

Re: [PATCH] x86/wakeup: Fix code generation for bogus_saved_magic

2024-11-11 Thread Andrew Cooper
On 11/11/2024 11:21 am, Frediano Ziglio wrote: sanity sake. Annotate it with ELF metadata while doing so. Fixes: d8c8fef09054 ("Provide basic Xen PM infrastructure") Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné This issue date

Re: [PATCH v7 04/10] tools/hvmloader: Retrieve (x2)APIC IDs from the APs themselves

2024-11-11 Thread Alejandro Vallejo
On Wed Oct 30, 2024 at 11:31 AM GMT, Andrew Cooper wrote: > On 21/10/2024 4:45 pm, Alejandro Vallejo wrote: > > diff --git a/tools/firmware/hvmloader/config.h > > b/tools/firmware/hvmloader/config.h > > index cd716bf39245..04cab1e59f08 100644 > > --- a/tools/firmware/hvmloader/config.h > > +++ b/t

Re: [PATCH 10/10] x86: Delete mach_apic.h

2024-11-11 Thread Andrew Cooper
On 11/11/2024 9:13 am, Jan Beulich wrote: > On 08.11.2024 20:58, Andrew Cooper wrote: >> All useful content has been moved elsewhere. >> >> Clean up the dregs, and remove the entire mach-generic include path. > What's "dregs" here? Oh.  "The leftovers". Surprisingly (to me at least), it's not sla

Re: [XEN PATCH v2 1/2] x86/hvm: introduce config option for ACPI PM timer

2024-11-11 Thread Jan Beulich
On 11.11.2024 12:01, Sergiy Kibrik wrote: > 11.11.24 11:51, Jan Beulich: >> On 06.11.2024 11:14, Sergiy Kibrik wrote: >>> Introduce config option X86_HVM_PMTIMER and make pmtimer emulation driver >>> configurable and possible to disable on systems that don't need it. >>> Option X86_X86_HVM_PMTIMER

[PATCH v2 10/10] x86: Delete mach_apic.h

2024-11-11 Thread Andrew Cooper
All useful content has been moved elsewhere. enable_apic_mode() and multi_timer_check() are empty stubs. Remove their sole callers and drop them. apicid_to_node() and bios_cpu_apicid[] are entirely unused. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné v2: * Adjust co

[PATCH V4 05/15] x86: Add a boot option to enable and disable the direct map

2024-11-11 Thread Elias El Yandouzi
From: Hongyan Xia This is added as a Kconfig option as well as a boot command line option. While being generic, the Kconfig option is only usable for x86 at the moment. Note that there remains some users of the directmap at this point. The option is introduced now as it will be needed in follow-

[PATCH V4 04/15] x86: Initialize mapcache for PV, HVM, and idle domains

2024-11-11 Thread Elias El Yandouzi
From: Wei Liu To support the transition away from the direct map, the mapcache will now be used by HVM and idle domains as well. This patch lifts the `mapcache` to the arch level and moves its initialization earlier in `arch_domain_create()` to cover PV, HVM, and idle domains. For the idle domai

[PATCH V4 01/15] x86: Create per-domain mapping for guest_root_pt

2024-11-11 Thread Elias El Yandouzi
From: Hongyan Xia This patch introduces a per-domain mapping for the `guest_root_pt` in PV guests as part of the effort to remove the direct map in Xen. For the time being, the `root_pgt` is not mapped or unmapped, as it remains a Xenheap page. This will be addressed in subsequent patches. Sign

[PATCH V4 11/15] x86/setup: Do not create valid mappings when directmap=no

2024-11-11 Thread Elias El Yandouzi
From: Hongyan Xia Create empty mappings in the second e820 pass. Also, destroy existing direct map mappings created in the first pass. To make xenheap pages visible in guests, it is necessary to create empty L3 tables in the direct map even when directmap=no, since guest cr3s copy idle domain's

[PATCH V4 09/15] x86/setup: Leave early boot slightly earlier

2024-11-11 Thread Elias El Yandouzi
From: Hongyan Xia When we do not have a direct map, memory for metadata of heap nodes in init_node_heap() is allocated from xenheap, which needs to be mapped and unmapped on demand. However, we cannot just take memory from the boot allocator to create the PTEs while we are passing memory to the h

[PATCH V4 02/15] x86/pv: Use copy_domain_page() to manage domheap pages during initrd relocation

2024-11-11 Thread Elias El Yandouzi
From: Wei Liu Replace the manual copying logic with a call to `copy_domain_page()` while relocating intird which map and unmap pages accordingly. Signed-off-by: Wei Liu Signed-off-by: Wei Wang Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi Changes in V4: * Use

[PATCH V4 10/15] xen/page_alloc: vmap heap nodes when they are outside the direct map

2024-11-11 Thread Elias El Yandouzi
From: Hongyan Xia When we do not have a direct map, archs_mfn_in_direct_map() will always return false, thus init_node_heap() will allocate xenheap pages from an existing node for the metadata of a new node. This means that the metadata of a new node is in a different node, slowing down heap allo

[PATCH V4 13/15] xen/arm64: mm: Use per-pCPU page-tables

2024-11-11 Thread Elias El Yandouzi
From: Julien Grall At the moment, on Arm64, every pCPU is sharing the same page-tables. In a follow-up patch, we will allow the possibility to remove the direct map and therefore it will be necessary to have a mapcache. While we have plenty of spare virtual address space to reserve part for eac

[PATCH V4 07/15] x86/domain_page: Remove the fast paths when mfn is not in the directmap

2024-11-11 Thread Elias El Yandouzi
From: Hongyan Xia When mfn is not in direct map, never use mfn_to_virt for any mappings. We replace mfn_x(mfn) <= PFN_DOWN(__pa(HYPERVISOR_VIRT_END - 1)) with arch_mfns_in_direct_map(mfn, 1) because these two are equivalent. The extra comparison in arch_mfns_in_direct_map() looks different but b

[PATCH V4 08/15] xen/page_alloc: Add a path for xenheap when there is no direct map

2024-11-11 Thread Elias El Yandouzi
From: Hongyan Xia When there is not an always-mapped direct map, xenheap allocations need to be mapped and unmapped on-demand. Signed-off-by: Hongyan Xia Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi I have left the call to map_pages_to_xen() and destroy_xen_mappings

[PATCH V4 15/15] xen/arm64: Allow the admin to enable/disable the directmap

2024-11-11 Thread Elias El Yandouzi
From: Julien Grall Implement the same command line option as x86 to enable/disable the directmap. By default this is kept enabled. Also modify setup_directmap_mappings() to populate the L0 entries related to the directmap area. Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi ---

[PATCH V4 03/15] x86/pv: Rewrite how building PV dom0 handles domheap mappings

2024-11-11 Thread Elias El Yandouzi
From: Hongyan Xia Building a PV dom0 is allocating from the domheap but uses it like the xenheap. Use the pages as they should be. Signed-off-by: Hongyan Xia Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi Changes in V4: * Reduce the scope of l{1,2,4}start_mfn v

[PATCH V4 06/15] xen/x86: Add support for the PMAP

2024-11-11 Thread Elias El Yandouzi
From: Julien Grall PMAP will be used in a follow-up patch to bootstrap map domain page infrastructure -- we need some way to map pages to setup the mapcache without a direct map. The functions pmap_{map, unmap} open code {set, clear}_fixmap to break the loop. Signed-off-by: Julien Grall Signed

[PATCH V4 12/15] xen/arm32: mm: Rename 'first' to 'root' in init_secondary_pagetables()

2024-11-11 Thread Elias El Yandouzi
From: Julien Grall The arm32 version of init_secondary_pagetables() will soon be re-used for arm64 as well where the root table starts at level 0 rather than level 1. So rename 'first' to 'root'. Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi Changelog in v2:

[PATCH V4 00/15] Remove the directmap

2024-11-11 Thread Elias El Yandouzi
Hi all, A few years ago, Wei Liu implemented a PoC to remove the directmap from Xen. The last version was sent by Hongyan Xia [1]. I will start with thanking both Wei and Hongyan for the initial work to upstream the feature. A lot of patches already went in and this is the last few patches missin

[PATCH V4 14/15] xen/arm64: Implement a mapcache for arm64

2024-11-11 Thread Elias El Yandouzi
From: Julien Grall At the moment, on arm64, map_domain_page() is implemented using virt_to_mfn(). Therefore it is relying on the directmap. In a follow-up patch, we will allow the admin to remove the directmap. Therefore we want to implement a mapcache. Thanksfully there is already one for arm3

Re: [PATCH v1 2/2] xen/mmu: enable SMMU subsystem only in MMU

2024-11-11 Thread Ayan Kumar Halder
On 11/11/2024 11:12, Julien Grall wrote: Hi, Hi Julien, On 08/11/2024 19:59, Ayan Kumar Halder wrote: From: Penny Zheng In Xen, SMMU subsystem is supported for MMU system only. The reason being SMMU driver uses the same page tables as MMU. Thus, we make it dependent on CONFIG_MMU. Sign

[PATCH v3] x86/boot: Setup correctly fs segment for bogus_real_magic

2024-11-11 Thread Frediano Ziglio
bogus_real_magic code uses fs segment so it should be initialised. Fixes: d8c8fef09054 ("Provide basic Xen PM infrastructure") Signed-off-by: Frediano Ziglio --- Changes since v1: - added "Fixes" comment; - add initialisation, do not remove old one. Changes since v2: - move initialisation in bog

Re: [PATCH] x86/boot: Setup correctly fs segment for bogus_real_magic

2024-11-11 Thread Jan Beulich
On 11.11.2024 10:17, Frediano Ziglio wrote: > bogus_real_magic code uses fs segment so it should be initialised. Like for Andrew's fix: Fixes: d8c8fef09054 ("Provide basic Xen PM infrastructure") > Signed-off-by: Frediano Ziglio > --- > xen/arch/x86/boot/wakeup.S | 4 ++-- > 1 file changed, 2 i

Re: [XEN PATCH v2 1/2] x86/hvm: introduce config option for ACPI PM timer

2024-11-11 Thread Jan Beulich
On 06.11.2024 11:14, Sergiy Kibrik wrote: > Introduce config option X86_HVM_PMTIMER and make pmtimer emulation driver > configurable and possible to disable on systems that don't need it. > Option X86_X86_HVM_PMTIMER depends on HVM option, because this driver is part > of HVM support code. > > Int

Re: [XEN PATCH v2 2/2] x86/hvm: introduce config option for stdvga emulation

2024-11-11 Thread Jan Beulich
On 06.11.2024 11:16, Sergiy Kibrik wrote: > Introduce config option X86_HVM_STDVGA and make stdvga emulation driver > configurable so it can be disabled on systems that don't need it. > > Suggested-by: Roger Pau Monné > Signed-off-by: Sergiy Kibrik FTAOD - largely the same comments as for patch

[PATCH] x86/boot: Setup correctly fs segment for bogus_real_magic

2024-11-11 Thread Frediano Ziglio
bogus_real_magic code uses fs segment so it should be initialised. Signed-off-by: Frediano Ziglio --- xen/arch/x86/boot/wakeup.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- OT: Seen another similar patch on ML I suppose this part of code is not that tested. Also, considering EF

Re: [PATCH 10/10] x86: Delete mach_apic.h

2024-11-11 Thread Jan Beulich
On 08.11.2024 20:58, Andrew Cooper wrote: > All useful content has been moved elsewhere. > > Clean up the dregs, and remove the entire mach-generic include path. What's "dregs" here? > --- a/xen/arch/x86/include/asm/mach-generic/mach_apic.h > +++ /dev/null > @@ -1,24 +0,0 @@ > -#ifndef __ASM_MAC

Re: [PATCH 3/4] x86: Drop mach-default/bios_ebda.h

2024-11-11 Thread Jan Beulich
On 08.11.2024 21:11, Andrew Cooper wrote: > @@ -734,6 +732,13 @@ static void __init efi_check_config(void) > efi_unmap_mpf(); > } > > +static unsigned int get_bios_ebda(void) > +{ > + unsigned int address = *(unsigned short *)maddr_to_virt(0x40E); Now this is a case where I th

Re: [PATCH 0/4] Untangle mach-default/

2024-11-11 Thread Jan Beulich
On 08.11.2024 21:11, Andrew Cooper wrote: > There are only a few trivial header files left here. Shuffle or drop them, so > we can remove another compiler include path. > > Andrew Cooper (4): > x86: Move mach-default/irq_vectors.h to asm/irq-vectors.h > x86: Move mach-default/io_ports.h to as

Re: [PATCH 4/4] x86: Drop mach_mpspec.h

2024-11-11 Thread Jan Beulich
On 08.11.2024 21:11, Andrew Cooper wrote: > --- a/xen/arch/x86/include/asm/mach-default/mach_mpspec.h > +++ /dev/null > @@ -1,10 +0,0 @@ > -#ifndef __ASM_MACH_MPSPEC_H > -#define __ASM_MACH_MPSPEC_H > - > -#define MAX_IRQ_SOURCES 256 > - > -/* Generic (i.e. installer) kernels need lots of bus entri

Re: [PATCH] x86/wakeup: Fix code generation for bogus_saved_magic

2024-11-11 Thread Jan Beulich
On 09.11.2024 01:36, Andrew Cooper wrote: > bogus_saved_magic() is in a .code64 section but invokved in 32bit mode. This > causes a real encoding difference. > > Before: > 66 c7 04 25 14 80 0b 00 53 0emovw $0xe53,0xb8014(,%eiz,1) > > After: > 66 c7 05 14 80 0b 00 53 0e movw $0x

Re: [PATCH v2 1/4] x86/mm: introduce helpers to detect super page alignment

2024-11-11 Thread Jan Beulich
On 08.11.2024 12:31, Roger Pau Monne wrote: > --- a/xen/arch/x86/mm.c > +++ b/xen/arch/x86/mm.c > @@ -5232,6 +5232,12 @@ int map_pages_to_xen( > } \ > } while (0) > > +/* Check if a (virt, mfn) tuple is aligned for a given slot level. */ > +#define I

Re: [PATCH v2 2/4] x86/mm: skip super-page alignment checks for non-present entries

2024-11-11 Thread Jan Beulich
On 08.11.2024 12:31, Roger Pau Monne wrote: > @@ -5544,7 +5553,8 @@ int map_pages_to_xen( > check_l3: > if ( cpu_has_page1gb && > (flags == PAGE_HYPERVISOR) && > - ((nr_mfns == 0) || IS_L3E_ALIGNED(virt, mfn)) ) > + ((nr_mfns == 0) || !(flags & _PAGE

Re: [PATCH v2] x86/trampoline: Collect other scattered trampoline symbols

2024-11-11 Thread Jan Beulich
On 08.11.2024 15:53, Andrew Cooper wrote: > ... and document them too. > > No functional change. > > Signed-off-by: Andrew Cooper > --- > CC: Jan Beulich > CC: Roger Pau Monné > CC: Frediano Ziglio > CC: Alejandro Vallejo > > v2: > * Rebase As the previously somewhat controversial adjustm

Re: [PATCH 00/10] Untangle mach-generic/

2024-11-11 Thread Jan Beulich
On 08.11.2024 20:58, Andrew Cooper wrote: > There's only one header file left. More than half of it is totally useless, > and the rest has better places to live in the tree. > > This lets us drop a compiler include path. > > Andrew Cooper (10): > VT-d: Drop includes of mach_apic.h > x86: Dro

Re: [PATCH v1] drivers/char: move dt_uart_init() to dt-uart.c

2024-11-11 Thread Julien Grall
Hi Oleksii, On 08/11/2024 14:56, Oleksii Kurochko wrote: The `dt_uart_init()` functions is relocated to a new file `dt-uart.c` to allow for reuse across architectures that utilize the device tree to describe hardware components. RISC-V is going to follow the same approach to UART initialization

Re: [PATCH v1 2/2] xen/mmu: enable SMMU subsystem only in MMU

2024-11-11 Thread Luca Fancellu
> On 8 Nov 2024, at 19:59, Ayan Kumar Halder wrote: > > From: Penny Zheng > > In Xen, SMMU subsystem is supported for MMU system only. The reason being SMMU > driver uses the same page tables as MMU. > Thus, we make it dependent on CONFIG_MMU. > > Signed-off-by: Penny Zheng > Signed-off-by:

Re: [PATCH v1 2/2] xen/mmu: enable SMMU subsystem only in MMU

2024-11-11 Thread Julien Grall
Hi, On 08/11/2024 19:59, Ayan Kumar Halder wrote: From: Penny Zheng In Xen, SMMU subsystem is supported for MMU system only. The reason being SMMU driver uses the same page tables as MMU. Thus, we make it dependent on CONFIG_MMU. Signed-off-by: Penny Zheng Signed-off-by: Ayan Kumar Halder -

Re: [PATCH v1] drivers/char: move dt_uart_init() to dt-uart.c

2024-11-11 Thread oleksii . kurochko
Hi Julien, On Mon, 2024-11-11 at 10:24 +, Julien Grall wrote: > Hi Oleksii, > > On 08/11/2024 14:56, Oleksii Kurochko wrote: > > The `dt_uart_init()` functions is relocated to a new file `dt- > > uart.c` to allow > > for reuse across architectures that utilize the device tree to > > describe

Re: [PATCH v2 10/10] x86: Delete mach_apic.h

2024-11-11 Thread Jan Beulich
On 11.11.2024 13:05, Andrew Cooper wrote: > All useful content has been moved elsewhere. > > enable_apic_mode() and multi_timer_check() are empty stubs. Remove their sole > callers and drop them. > > apicid_to_node() and bios_cpu_apicid[] are entirely unused. > > Signed-off-by: Andrew Cooper

Re: [PATCH] x86/trampoline: Change type of trampoline_phys to uint32_t

2024-11-11 Thread Jan Beulich
On 11.11.2024 11:49, Andrew Cooper wrote: > As now documented, this variable holds a page aligned value less than 1M. > > However, head.S fills it using 4-byte stores, and reloc_trampoline() is > compiled for both 32bit and 64bit, where unsigned long is a different size. > > This happens to work

Re: [PATCH v7 04/10] tools/hvmloader: Retrieve (x2)APIC IDs from the APs themselves

2024-11-11 Thread Jan Beulich
On 11.11.2024 12:20, Alejandro Vallejo wrote: > On Wed Oct 30, 2024 at 11:31 AM GMT, Andrew Cooper wrote: >> On 21/10/2024 4:45 pm, Alejandro Vallejo wrote: >>> diff --git a/tools/firmware/hvmloader/config.h >>> b/tools/firmware/hvmloader/config.h >>> index cd716bf39245..04cab1e59f08 100644 >>> --

Re: [PATCH v2] x86/boot: Setup correctly fs segment for bogus_real_magic

2024-11-11 Thread Jan Beulich
On 11.11.2024 12:18, Frediano Ziglio wrote: > --- a/xen/arch/x86/boot/wakeup.S > +++ b/xen/arch/x86/boot/wakeup.S > @@ -20,6 +20,8 @@ ENTRY(wakeup_start) > movw%ax, %ds > movw%ax, %ss# A stack required for BIOS call > movw$wakesym(wakeup_stack), %sp >

Re: [XEN PATCH] xen/vpci: Fix UB in mask_write

2024-11-11 Thread Mykyta Poturai
On 06.11.24 16:57, Roger Pau Monné wrote: > > Let's try to figure out what causes msi_maxvec to be 0 in your case > and then we can see how to better detect this. If msi_maxvec needs to > be checked it should likely be done in init_msi(). > > Regards, Roger. Hi everyone, So I have done some mor

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

2024-11-11 Thread oleksii . kurochko
On Mon, 2024-11-11 at 11:29 +0100, Jan Beulich wrote: > On 08.11.2024 13:51, Oleksii Kurochko wrote: > > @@ -37,9 +42,9 @@ static inline void *maddr_to_virt(paddr_t ma) > >   */ > >  static inline unsigned long virt_to_maddr(unsigned long va) > >  { > > -    if ((va >= DIRECTMAP_VIRT_START) && > >

[PATCH] mm: adjust _xvrealloc() declaration

2024-11-11 Thread Jan Beulich
... to match its definition parameter-name-wise, to please Misra C:2012 Rule 8.3. Fixes: 9102fcd9579f ("mm: introduce xvmalloc() et al and use for grant table allocations") Reported-by: Andrew Cooper Signed-off-by: Jan Beulich --- While this gets the decl out of sync with _xrealloc(), changing

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

2024-11-11 Thread Jan Beulich
On 11.11.2024 13:51, oleksii.kuroc...@gmail.com wrote: > On Mon, 2024-11-11 at 11:29 +0100, Jan Beulich wrote: >> On 08.11.2024 13:51, Oleksii Kurochko wrote: >>> @@ -37,9 +42,9 @@ static inline void *maddr_to_virt(paddr_t ma) >>>   */ >>>  static inline unsigned long virt_to_maddr(unsigned long va

Re: [PATCH] mm: adjust _xvrealloc() declaration

2024-11-11 Thread Andrew Cooper
On 11/11/2024 12:53 pm, Jan Beulich wrote: > ... to match its definition parameter-name-wise, to please Misra C:2012 > Rule 8.3. > > Fixes: 9102fcd9579f ("mm: introduce xvmalloc() et al and use for grant table > allocations") > Reported-by: Andrew Cooper > Signed-off-by: Jan Beulich Acked-by: A

Re: [XEN PATCH v2 1/2] x86/hvm: introduce config option for ACPI PM timer

2024-11-11 Thread Sergiy Kibrik
11.11.24 11:51, Jan Beulich: On 06.11.2024 11:14, Sergiy Kibrik wrote: Introduce config option X86_HVM_PMTIMER and make pmtimer emulation driver configurable and possible to disable on systems that don't need it. Option X86_X86_HVM_PMTIMER depends on HVM option, because this driver is part of HV

[PATCH v2] x86/boot: Setup correctly fs segment for bogus_real_magic

2024-11-11 Thread Frediano Ziglio
bogus_real_magic code uses fs segment so it should be initialised. Fixes: d8c8fef09054 ("Provide basic Xen PM infrastructure") Signed-off-by: Frediano Ziglio --- Changes since v1: - added "Fixes" comment; - add initialisation, do not remove old one. --- xen/arch/x86/boot/wakeup.S | 2 ++ 1 file

Re: [PATCH] x86/wakeup: Fix code generation for bogus_saved_magic

2024-11-11 Thread Frediano Ziglio
On Mon, Nov 11, 2024 at 11:05 AM Andrew Cooper wrote: > > On 09/11/2024 5:29 pm, Frediano Ziglio wrote: > > On Sat, Nov 9, 2024 at 12:37 AM Andrew Cooper > > wrote: > >> bogus_saved_magic() is in a .code64 section but invokved in 32bit mode. > >> This > > Typo: invoked > > > >> causes a real e

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

2024-11-11 Thread Jan Beulich
On 08.11.2024 13:51, Oleksii Kurochko wrote: > @@ -37,9 +42,9 @@ static inline void *maddr_to_virt(paddr_t ma) > */ > static inline unsigned long virt_to_maddr(unsigned long va) > { > -if ((va >= DIRECTMAP_VIRT_START) && > +if ((va >= directmap_virt_start) && Is this a valid / necessar

Re: [PATCH] x86/wakeup: Fix code generation for bogus_saved_magic

2024-11-11 Thread Andrew Cooper
On 09/11/2024 5:29 pm, Frediano Ziglio wrote: > On Sat, Nov 9, 2024 at 12:37 AM Andrew Cooper > wrote: >> bogus_saved_magic() is in a .code64 section but invokved in 32bit mode. This > Typo: invoked > >> causes a real encoding difference. >> >> Before: >> 66 c7 04 25 14 80 0b 00 53 0emovw

Re: [PATCH v5 1/3] xen/arm: mpu: Create boot-time MPU protection regions

2024-11-11 Thread Luca Fancellu
Hi Ayan, On 7 Nov 2024, at 15:03, Ayan Kumar Halder wrote: Define enable_boot_cpu_mm() for the Armv8-R AArch64. Like boot-time page table in MMU system, we need a boot-time MPU protection region configuration in MPU system so Xen can fetch code and data from normal memory. To do this, Xen maps

Re: [PATCH v1 1/2] xen/mpu: Map early uart when earlyprintk on

2024-11-11 Thread Luca Fancellu
> On 8 Nov 2024, at 20:00, Ayan Kumar Halder wrote: > > CONFIG_EARLY_UART_SIZE is introduced to let user provide physical size of > early UART. Unlike MMU where we map a page in the virtual address space, > here we need to know the exact physical size to be mapped. > As VA == PA in case of MPU,

Re: [PATCH v1 2/2] xen/mmu: enable SMMU subsystem only in MMU

2024-11-11 Thread Julien Grall
Hi Ayan, On 11/11/2024 13:24, Ayan Kumar Halder wrote: On 11/11/2024 11:12, Julien Grall wrote: Hi, Hi Julien, On 08/11/2024 19:59, Ayan Kumar Halder wrote: From: Penny Zheng In Xen, SMMU subsystem is supported for MMU system only. The reason being SMMU driver uses the same page tables

Re: [PATCH v2 1/4] x86/mm: introduce helpers to detect super page alignment

2024-11-11 Thread Jan Beulich
On 08.11.2024 12:31, Roger Pau Monne wrote: > Split the code that detects whether the physical and linear address of a > mapping request are suitable to be used in an L3 or L2 slot. > > No functional change intended. > > Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich with one further

Re: [PATCH] iommu/ipmmu-vmsa: Add Renesas R8A779G0 (R-Car V4H) support

2024-11-11 Thread Julien Grall
Hi, On 07/11/2024 21:14, Stefano Stabellini wrote: On Thu, 7 Nov 2024, gragst.li...@gmail.com wrote: From: Oleksandr Tyshchenko Add Renesas R8A779G0 (R-Car V4H) IPMMU support. Signed-off-by: Oleksandr Tyshchenko Signed-off-by: Grygorii Strashko Assuming it was properly tested: Acked-by:

Re: [PATCH V4 04/15] x86: Initialize mapcache for PV, HVM, and idle domains

2024-11-11 Thread Andrew Cooper
On 11/11/2024 1:11 pm, Elias El Yandouzi wrote: > From: Wei Liu > > To support the transition away from the direct map, the mapcache will now > be used by HVM and idle domains as well. This patch lifts the `mapcache` > to the arch level and moves its initialization earlier in > `arch_domain_create

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

2024-11-11 Thread Stewart Hildebrand
On 11/6/24 01:14, 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 > wrong, because irq is not equal with gsi, they are in

Re: [PATCH V4 00/15] Remove the directmap

2024-11-11 Thread Andrew Cooper
On 11/11/2024 1:11 pm, Elias El Yandouzi wrote: > Hongyan Xia (8): > x86: Create per-domain mapping for guest_root_pt > x86/pv: Rewrite how building PV dom0 handles domheap mappings > x86: Add a boot option to enable and disable the direct map > x86/domain_page: Remove the fast paths when m

[PATCH] xen/arm: Enclose all iommu related access within CONFIG_HAS_PASSTHROUGH

2024-11-11 Thread Ayan Kumar Halder
As CONFIG_HAS_PASSTHROUGH is enabled only for MMU, thus any common code accessing iommu needs to be enclosed within CONFIG_HAS_PASSTHROUGH. Signed-off-by: Ayan Kumar Halder --- xen/arch/arm/Kconfig | 4 ++-- xen/arch/arm/device.c | 2 ++ xen/arch/arm/dom0less-build.c | 6 ++

Re: [PATCH v1 2/2] xen/mmu: enable SMMU subsystem only in MMU

2024-11-11 Thread Ayan Kumar Halder
Hi Luca/Julien, On 11/11/2024 16:33, Luca Fancellu wrote: Hi Ayan, On 11 Nov 2024, at 16:00, Ayan Kumar Halder wrote: On 11/11/2024 13:45, Julien Grall wrote: Hi Ayan, Hi Julien, On 11/11/2024 13:24, Ayan Kumar Halder wrote: On 11/11/2024 11:12, Julien Grall wrote: Hi, Hi Julien, On

Re: [PATCH for-4.18] tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread

2024-11-11 Thread Jan Beulich
On 11.11.2024 15:31, Andrew Cooper wrote: > This breaks the build with debug active, as main_thread is not an exposed > symbol. > > This is a minimal version of commit bc4fe94a69d4 ("tools/libs/evtchn: replace > assert()s in stubdom with proper locking"). It leaves MiniOS no worse off > with resp

Re: [PATCH for-4.18] tools/libs/evtchn: Drop assert()s referencing MiniOS's main_thread

2024-11-11 Thread Andrew Cooper
On 11/11/2024 2:53 pm, Andrew Cooper wrote: > On 11/11/2024 2:47 pm, Andrew Cooper wrote: >> On 11/11/2024 2:41 pm, Jan Beulich wrote: >>> On 11.11.2024 15:31, Andrew Cooper wrote: This breaks the build with debug active, as main_thread is not an exposed symbol. This is a minima

Re: [XEN PATCH 1/3] x86/emul: define pseudo keyword fallthrough

2024-11-11 Thread Stefano Stabellini
On Mon, 11 Nov 2024, Jan Beulich wrote: > On 11.11.2024 03:24, Stefano Stabellini wrote: > > On Wed, 6 Nov 2024, Jan Beulich wrote: > >> On 06.11.2024 10:04, Federico Serafini wrote: > >>> The pseudo keyword fallthrough shall be used to make explicit the > >>> fallthrough intention at the end of a