Re: [PATCH v3 2/6] xen/x86: Add initial x2APIC ID to the per-vLAPIC save area

2024-05-31 Thread Roger Pau Monné
On Thu, May 30, 2024 at 12:08:26PM +0100, Andrew Cooper wrote: > On 29/05/2024 3:32 pm, Alejandro Vallejo wrote: > > diff --git a/xen/lib/x86/policy.c b/xen/lib/x86/policy.c > > index f033d22785be..b70b22d55fcf 100644 > > --- a/xen/lib/x86/policy.c > > +++ b/xen/lib/x86/policy.c > > @@ -2,6 +2,17

Re: [PATCH for-4.19 3/9] xen/cpu: ensure get_cpu_maps() returns false if CPU operations are underway

2024-05-31 Thread Roger Pau Monné
On Fri, May 31, 2024 at 10:33:58AM +0200, Jan Beulich wrote: > On 31.05.2024 09:31, Roger Pau Monné wrote: > > On Fri, May 31, 2024 at 09:02:20AM +0200, Jan Beulich wrote: > >> On 29.05.2024 18:14, Roger Pau Monné wrote: > >>> On Wed, May 29, 2024 at 05:49

Re: [PATCH for-4.19 4/9] x86/irq: describe how the interrupt CPU movement works

2024-05-31 Thread Roger Pau Monné
On Fri, May 31, 2024 at 09:06:10AM +0200, Jan Beulich wrote: > On 29.05.2024 17:28, Roger Pau Monné wrote: > > On Wed, May 29, 2024 at 03:57:19PM +0200, Jan Beulich wrote: > >> On 29.05.2024 11:01, Roger Pau Monne wrote: > >>> --- a/xen/arch/x86/include/asm/irq.h &g

Re: [PATCH for-4.19 3/9] xen/cpu: ensure get_cpu_maps() returns false if CPU operations are underway

2024-05-31 Thread Roger Pau Monné
On Fri, May 31, 2024 at 09:02:20AM +0200, Jan Beulich wrote: > On 29.05.2024 18:14, Roger Pau Monné wrote: > > On Wed, May 29, 2024 at 05:49:48PM +0200, Jan Beulich wrote: > >> On 29.05.2024 17:03, Roger Pau Monné wrote: > >>> On Wed, May 29, 2024 at 03:35

Re: [PATCH v3 2/6] xen/x86: Add initial x2APIC ID to the per-vLAPIC save area

2024-05-30 Thread Roger Pau Monné
On Thu, May 30, 2024 at 02:48:10PM +0100, Alejandro Vallejo wrote: > I'll try to do that soon-ish. I suspect the pain points are going to be > making it work nicely as well on 1vCPU systems with no APIC (are > those expected to work?). We do not allow creation of PVH/HVM domains without an

Re: CPU_DOWN_FAILED hits ASSERTs in scheduling logic

2024-05-30 Thread Roger Pau Monné
On Thu, May 30, 2024 at 02:45:18PM +0200, Jürgen Groß wrote: > On 29.05.24 18:03, Roger Pau Monné wrote: > > On Wed, May 29, 2024 at 03:08:49PM +0200, Jürgen Groß wrote: > > > On 29.05.24 14:46, Roger Pau Monné wrote: > > > > On Wed, May 29, 2024 at 01:47

Re: [PATCH] tools: (Actually) drop libsystemd as a dependency

2024-05-30 Thread Roger Pau Monné
On Thu, May 30, 2024 at 12:12:19PM +0100, Andrew Cooper wrote: > On 30/05/2024 12:02 pm, Roger Pau Monné wrote: > > On Thu, May 30, 2024 at 11:14:39AM +0100, Andrew Cooper wrote: > >> When reinstating some of systemd.m4 between v1 and v2, I reintroduced a > >> little

Re: [PATCH] tools: (Actually) drop libsystemd as a dependency

2024-05-30 Thread Roger Pau Monné
too. > > Fixes: ae26101f6bfc ("tools: Drop libsystemd as a dependency") > Signed-off-by: Andrew Cooper LGTM, but my knowledge of systemd is very limited. Reviewed-by: Roger Pau Monné Thanks, Roger.

Re: [PATCH v3 2/6] xen/x86: Add initial x2APIC ID to the per-vLAPIC save area

2024-05-30 Thread Roger Pau Monné
tent with the > topology. > > Signed-off-by: Alejandro Vallejo Reviewed-by: Roger Pau Monné Thanks, Roger.

Re: [PATCH v3 1/6] x86/vlapic: Move lapic migration checks to the check hooks

2024-05-30 Thread Roger Pau Monné
On Wed, May 29, 2024 at 03:32:30PM +0100, Alejandro Vallejo wrote: > While doing this, factor out checks common to architectural and hidden state. > > Signed-off-by: Alejandro Vallejo Reviewed-by: Roger PAu Monné With the BUG() possibly replaced with ASSERT_UNREACHABLE(), &

Re: [PATCH v4 2/2] tools/xg: Clean up xend-style overrides for CPU policies

2024-05-30 Thread Roger Pau Monné
sr}_policy() calls. > > Signed-off-by: Alejandro Vallejo Reviewed-by: Roger Pau Monné > --- > v4: > * Indentation adjustment. > * Fix unhandled corner case using bsearch() with MSR and leaf buffers > --- > tools/libs/guest/xg_cpuid_x86.c | 437 ++---

Re: [PATCH] x86/hvm: allow XENMEM_machine_memory_map

2024-05-30 Thread Roger Pau Monné
On Thu, May 30, 2024 at 09:04:08AM +0100, Andrew Cooper wrote: > On 30/05/2024 8:53 am, Roger Pau Monne wrote: > > For HVM based control domains XENMEM_machine_memory_map must be available so > > that the `e820_host` xl.cfg option can be used. > > > > Signed-off-by:

Re: [PATCH for-4.19 3/9] xen/cpu: ensure get_cpu_maps() returns false if CPU operations are underway

2024-05-29 Thread Roger Pau Monné
On Wed, May 29, 2024 at 05:49:48PM +0200, Jan Beulich wrote: > On 29.05.2024 17:03, Roger Pau Monné wrote: > > On Wed, May 29, 2024 at 03:35:04PM +0200, Jan Beulich wrote: > >> On 29.05.2024 11:01, Roger Pau Monne wrote: > >>> Due to the current rwlock logic, if the C

Re: CPU_DOWN_FAILED hits ASSERTs in scheduling logic

2024-05-29 Thread Roger Pau Monné
On Wed, May 29, 2024 at 03:08:49PM +0200, Jürgen Groß wrote: > On 29.05.24 14:46, Roger Pau Monné wrote: > > On Wed, May 29, 2024 at 01:47:09PM +0200, Jürgen Groß wrote: > > > On 28.05.24 13:22, Roger Pau Monné wrote: > > > > Hello, > > > > > >

Re: [PATCH for-4.19 2/9] xen/cpu: do not get the CPU map in stop_machine_run()

2024-05-29 Thread Roger Pau Monné
On Wed, May 29, 2024 at 05:31:02PM +0200, Jan Beulich wrote: > On 29.05.2024 17:20, Roger Pau Monné wrote: > > On Wed, May 29, 2024 at 03:04:13PM +0200, Jan Beulich wrote: > >> On 29.05.2024 11:01, Roger Pau Monne wrote: > >>> The current callers of stop_machine_run(

Re: [PATCH for-4.19 1/9] x86/irq: remove offline CPUs from old CPU mask when adjusting move_cleanup_count

2024-05-29 Thread Roger Pau Monné
On Wed, May 29, 2024 at 05:27:06PM +0200, Jan Beulich wrote: > On 29.05.2024 17:15, Roger Pau Monné wrote: > > On Wed, May 29, 2024 at 02:40:51PM +0200, Jan Beulich wrote: > >> On 29.05.2024 11:01, Roger Pau Monne wrote: > >>> When adjusting move_cleanup_count to acc

Re: [PATCH for-4.19 4/9] x86/irq: describe how the interrupt CPU movement works

2024-05-29 Thread Roger Pau Monné
On Wed, May 29, 2024 at 03:57:19PM +0200, Jan Beulich wrote: > On 29.05.2024 11:01, Roger Pau Monne wrote: > > --- a/xen/arch/x86/include/asm/irq.h > > +++ b/xen/arch/x86/include/asm/irq.h > > @@ -28,6 +28,32 @@ typedef struct { > > > > struct irq_desc; > > > > +/* > > + * Xen logic for

Re: [PATCH for-4.19 2/9] xen/cpu: do not get the CPU map in stop_machine_run()

2024-05-29 Thread Roger Pau Monné
On Wed, May 29, 2024 at 03:04:13PM +0200, Jan Beulich wrote: > On 29.05.2024 11:01, Roger Pau Monne wrote: > > The current callers of stop_machine_run() outside of init code already have > > the > > CPU maps locked, and hence there's no reason for stop_machine_run() to > > attempt > > to lock

Re: [PATCH for-4.19 1/9] x86/irq: remove offline CPUs from old CPU mask when adjusting move_cleanup_count

2024-05-29 Thread Roger Pau Monné
can lead to further calls to fixup_irqs() subtracting them again and move_cleanup_count possibly underflowing. Would you prefer to write it as: "... could subtract those again and possibly underflow move_cleanup_count." > > Fixes: 472e0b74c5c4 ('x86/IRQ: deal with move cleanup count s

Re: [PATCH for-4.19 3/9] xen/cpu: ensure get_cpu_maps() returns false if CPU operations are underway

2024-05-29 Thread Roger Pau Monné
On Wed, May 29, 2024 at 03:35:04PM +0200, Jan Beulich wrote: > On 29.05.2024 11:01, Roger Pau Monne wrote: > > Due to the current rwlock logic, if the CPU calling get_cpu_maps() does so > > from > > a cpu_hotplug_{begin,done}() region the function will still return success, > > because a CPU

Re: CPU_DOWN_FAILED hits ASSERTs in scheduling logic

2024-05-29 Thread Roger Pau Monné
On Wed, May 29, 2024 at 01:47:09PM +0200, Jürgen Groß wrote: > On 28.05.24 13:22, Roger Pau Monné wrote: > > Hello, > > > > When the stop_machine_run() call in cpu_down() fails and calls the CPU > > notifier CPU_DOWN_FAILED hook the following assert triggers

CPU_DOWN_FAILED hits ASSERTs in scheduling logic

2024-05-28 Thread Roger Pau Monné
Hello, When the stop_machine_run() call in cpu_down() fails and calls the CPU notifier CPU_DOWN_FAILED hook the following assert triggers in the scheduling code: Assertion '!cpumask_test_cpu(cpu, >initialized)' failed at common/sched/cred1 [ Xen-4.19-unstable x86_64 debug=y Tainted: C

Re: [PATCH v16 1/5] arm/vpci: honor access size when returning an error

2024-05-28 Thread Roger Pau Monné
On Mon, May 27, 2024 at 10:14:59PM +0100, Julien Grall wrote: > Hi Roger, > > On 23/05/2024 08:55, Roger Pau Monné wrote: > > On Wed, May 22, 2024 at 06:59:20PM -0400, Stewart Hildebrand wrote: > > > From: Volodymyr Babchuk > > > > > > Guest can try t

Re: [PATCH v2 5/8] tools/hvmloader: Retrieve (x2)APIC IDs from the APs themselves

2024-05-27 Thread Roger Pau Monné
On Fri, May 24, 2024 at 04:16:01PM +0100, Alejandro Vallejo wrote: > On 23/05/2024 17:13, Roger Pau Monné wrote: > > On Wed, May 08, 2024 at 01:39:24PM +0100, Alejandro Vallejo wrote: > >> @@ -86,10 +113,11 @@ static void boot_cpu(unsigned int cpu)

Re: [PATCH v2 5/8] tools/hvmloader: Retrieve (x2)APIC IDs from the APs themselves

2024-05-27 Thread Roger Pau Monné
On Fri, May 24, 2024 at 04:15:34PM +0100, Alejandro Vallejo wrote: > On 24/05/2024 08:21, Roger Pau Monné wrote: > > On Wed, May 08, 2024 at 01:39:24PM +0100, Alejandro Vallejo wrote: > >> Make it so the APs expose their own APIC IDs in a LUT. We can use that LUT > >>

Re: [PATCH v2 8/8] xen/x86: Synthesise domain topologies

2024-05-27 Thread Roger Pau Monné
On Fri, May 24, 2024 at 06:16:01PM +0100, Alejandro Vallejo wrote: > On 24/05/2024 09:58, Roger Pau Monné wrote: > > On Wed, May 08, 2024 at 01:39:27PM +0100, Alejandro Vallejo wrote: > > > >> +rc = x86_topo_from_parts(>policy, threads_per_core, > >&g

Re: [PATCH v2 7/8] xen/x86: Derive topologically correct x2APIC IDs from the policy

2024-05-27 Thread Roger Pau Monné
On Fri, May 24, 2024 at 06:03:22PM +0100, Alejandro Vallejo wrote: > On 24/05/2024 09:39, Roger Pau Monné wrote: > > On Wed, May 08, 2024 at 01:39:26PM +0100, Alejandro Vallejo wrote: > > > > Also you could initialize x2apic_id at definition: > > > > const

Re: [PATCH v16 4/5] xen/arm: translate virtual PCI bus topology for guests

2024-05-27 Thread Roger Pau Monné
On Fri, May 24, 2024 at 02:21:09PM +0100, Julien Grall wrote: > Hi, > > Sorry I didn't notice there was a v16 and posted comments on the v15. The > only one is about the size of the list we iterate. > > On 23/05/2024 08:48, Roger Pau Monné wrote: > > On Wed, May 22,

Re: [PATCH v2 3/8] x86/vlapic: Move lapic_load_hidden migration checks to the check hook

2024-05-24 Thread Roger Pau Monné
On Fri, May 24, 2024 at 12:16:00PM +0100, Alejandro Vallejo wrote: > On 23/05/2024 15:50, Roger Pau Monné wrote: > > On Wed, May 08, 2024 at 01:39:22PM +0100, Alejandro Vallejo wrote: > >> While at it, add a check for the reserved field in the hidden save area. > >> &g

Re: [PATCH v2 1/8] xen/x86: Add initial x2APIC ID to the per-vLAPIC save area

2024-05-24 Thread Roger Pau Monné
On Fri, May 24, 2024 at 11:58:44AM +0100, Alejandro Vallejo wrote: > On 23/05/2024 15:32, Roger Pau Monné wrote: > >> case 0xb: > >> -/* > >> - * In principle, this leaf is Intel-only. In practice, it is > >> tightly > >&g

Re: [PATCH v3 1/2] tools/xg: Streamline cpu policy serialise/deserialise calls

2024-05-24 Thread Roger Pau Monné
On Fri, May 24, 2024 at 11:32:50AM +0100, Alejandro Vallejo wrote: > On 23/05/2024 11:21, Roger Pau Monné wrote: > > On Thu, May 23, 2024 at 10:41:29AM +0100, Alejandro Vallejo wrote: > >> -int xc_cpu_policy_serialise(xc_interface *xch, const

Re: [PATCH v2 8/8] xen/x86: Synthesise domain topologies

2024-05-24 Thread Roger Pau Monné
On Wed, May 08, 2024 at 01:39:27PM +0100, Alejandro Vallejo wrote: > Expose sensible topologies in leaf 0xb. At the moment it synthesises non-HT > systems, in line with the previous code intent. > > Signed-off-by: Alejandro Vallejo > --- > v2: > * Zap the topology leaves of

Re: [PATCH v2 7/8] xen/x86: Derive topologically correct x2APIC IDs from the policy

2024-05-24 Thread Roger Pau Monné
On Wed, May 08, 2024 at 01:39:26PM +0100, Alejandro Vallejo wrote: > Implements the helper for mapping vcpu_id to x2apic_id given a valid > topology in a policy. The algo is written with the intention of extending > it to leaves 0x1f and e26 in the future. Using 0x1f and e26 is kind of confusing.

Re: [PATCH v2 3/8] x86/vlapic: Move lapic_load_hidden migration checks to the check hook

2024-05-24 Thread Roger Pau Monné
On Thu, May 23, 2024 at 07:58:57PM +0100, Andrew Cooper wrote: > On 08/05/2024 1:39 pm, Alejandro Vallejo wrote: > > diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c > > index 8a24419c..2f06bff1b2cc 100644 > > --- a/xen/arch/x86/hvm/vlapic.c > > +++

Re: [PATCH v2 5/8] tools/hvmloader: Retrieve (x2)APIC IDs from the APs themselves

2024-05-24 Thread Roger Pau Monné
On Wed, May 08, 2024 at 01:39:24PM +0100, Alejandro Vallejo wrote: > Make it so the APs expose their own APIC IDs in a LUT. We can use that LUT to > populate the MADT, decoupling the algorithm that relates CPU IDs and APIC IDs > from hvmloader. > > While at this also remove ap_callin, as writing

Re: [PATCH v2 6/8] xen/lib: Add topology generator for x86

2024-05-23 Thread Roger Pau Monné
On Wed, May 08, 2024 at 01:39:25PM +0100, Alejandro Vallejo wrote: > Add a helper to populate topology leaves in the cpu policy from > threads/core and cores/package counts. > > No functional change, as it's not connected to anything yet. There is a functional change in test-cpu-policy.c. Maybe

Re: [PATCH v2 5/8] tools/hvmloader: Retrieve (x2)APIC IDs from the APs themselves

2024-05-23 Thread Roger Pau Monné
On Wed, May 08, 2024 at 01:39:24PM +0100, Alejandro Vallejo wrote: > Make it so the APs expose their own APIC IDs in a LUT. We can use that LUT to > populate the MADT, decoupling the algorithm that relates CPU IDs and APIC IDs > from hvmloader. > > While at this also remove ap_callin, as writing

Re: [PATCH 4.5/8] tools/hvmloader: Further simplify SMP setup

2024-05-23 Thread Roger Pau Monné
the stack. > > While adjusting, rename to cpu_setup(). It's always been used on the BSP, > making the name ap_start() specifically misleading. > > Signed-off-by: Andrew Cooper Reviewed-by: Roger Pau Monné Thanks, Roger.

Re: [PATCH v2 2/8] xen/x86: Simplify header dependencies in x86/hvm

2024-05-23 Thread Roger Pau Monné
On Thu, May 23, 2024 at 04:40:06PM +0200, Jan Beulich wrote: > On 23.05.2024 16:37, Roger Pau Monné wrote: > > On Wed, May 08, 2024 at 01:39:21PM +0100, Alejandro Vallejo wrote: > >> --- a/xen/arch/x86/include/asm/hvm/hvm.h > >> +++ b/xen/arch/x86/include/asm/hvm/h

Re: [PATCH v2 3/8] x86/vlapic: Move lapic_load_hidden migration checks to the check hook

2024-05-23 Thread Roger Pau Monné
On Wed, May 08, 2024 at 01:39:22PM +0100, Alejandro Vallejo wrote: > While at it, add a check for the reserved field in the hidden save area. > > Signed-off-by: Alejandro Vallejo > --- > v2: > * New patch. Addresses the missing check for rsvd_zero in v1. Oh, it would be better if this was

Re: [PATCH v2 2/8] xen/x86: Simplify header dependencies in x86/hvm

2024-05-23 Thread Roger Pau Monné
vely through vpt.h. The ultimate cause is having hvm.h included in any > of the "v*.h" headers, so break the cycle moving the guilty inline into hvm.h. > > No functional change. > > Signed-off-by: Alejandro Vallejo Acked-by: Roger Pau Monné One cosmetic comment below. &g

Re: [PATCH v2 1/8] xen/x86: Add initial x2APIC ID to the per-vLAPIC save area

2024-05-23 Thread Roger Pau Monné
On Wed, May 08, 2024 at 01:39:20PM +0100, Alejandro Vallejo wrote: > This allows the initial x2APIC ID to be sent on the migration stream. The > hardcoded mapping x2apic_id=2*vcpu_id is maintained for the time being. > Given the vlapic data is zero-extended on restore, fix up migrations from >

Re: [PATCH for-4.19 v3 2/3] xen: enable altp2m at create domain domctl

2024-05-23 Thread Roger Pau Monné
xen_domctl_createdomain > instead of xen_arch_domainconfig. > > Signed-off-by: Roger Pau Monné > --- > Changes since v2: > - Introduce a new altp2m field in xen_domctl_createdomain. > > Changes since v1: > - New in this version. > --- > tools/libs/light/libxl_create.

Re: [PATCH v3 2/2] tools/xg: Clean up xend-style overrides for CPU policies

2024-05-23 Thread Roger Pau Monné
On Thu, May 23, 2024 at 10:41:30AM +0100, Alejandro Vallejo wrote: > Factor out policy getters/setters from both (CPUID and MSR) policy override > functions. Additionally, use host policy rather than featureset when > preparing the cur policy, saving one hypercall and several lines of >

Re: [PATCH v3 1/2] tools/xg: Streamline cpu policy serialise/deserialise calls

2024-05-23 Thread Roger Pau Monné
> > Signed-off-by: Alejandro Vallejo Acked-by: Roger Pau Monné Just two comments. > --- > v3: > * Better context scoping in xg_sr_common_x86. > * Can't be const because write_record() takes non-const. > * Adjusted line length of xen-cpuid's print_policy. >

Re: [XEN PATCH] x86/iommu: Conditionally compile platform-specific union entries

2024-05-23 Thread Roger Pau Monné
On Thu, May 23, 2024 at 09:19:53AM +, Teddy Astie wrote: > If some platform driver isn't compiled in, remove its related union > entries as they are not used. > > Signed-off-by Teddy Astie > --- > xen/arch/x86/include/asm/iommu.h | 4 > xen/arch/x86/include/asm/pci.h | 4 > 2

Re: [PATCH v16 5/5] xen/arm: account IO handlers for emulated PCI MSI-X

2024-05-23 Thread Roger Pau Monné
On Wed, May 22, 2024 at 06:59:24PM -0400, Stewart Hildebrand wrote: > From: Oleksandr Andrushchenko > > At the moment, we always allocate an extra 16 slots for IO handlers > (see MAX_IO_HANDLER). So while adding IO trap handlers for the emulated > MSI-X registers we need to explicitly tell that

Re: [PATCH v16 1/5] arm/vpci: honor access size when returning an error

2024-05-23 Thread Roger Pau Monné
On Wed, May 22, 2024 at 06:59:20PM -0400, Stewart Hildebrand wrote: > From: Volodymyr Babchuk > > Guest can try to read config space using different access sizes: 8, > 16, 32, 64 bits. We need to take this into account when we are > returning an error back to MMIO handler, otherwise it is

Re: [PATCH v16 4/5] xen/arm: translate virtual PCI bus topology for guests

2024-05-23 Thread Roger Pau Monné
ed-off-by: Oleksandr Andrushchenko > Signed-off-by: Volodymyr Babchuk > Signed-off-by: Stewart Hildebrand Acked-by: Roger Pau Monné One unrelated question below. > --- > In v15: > - base on top of ("arm/vpci: honor access size when returning an error") >

Re: [PATCH v16 3/5] vpci: add initial support for virtual PCI bus topology

2024-05-23 Thread Roger Pau Monné
uk > Signed-off-by: Stewart Hildebrand > Acked-by: Jan Beulich Acked-by: Roger Pau Monné Thanks, Roger.

Re: [PATCH for-4.19 v3 2/3] xen: enable altp2m at create domain domctl

2024-05-22 Thread Roger Pau Monné
On Wed, May 22, 2024 at 03:34:29PM +0200, Jan Beulich wrote: > On 22.05.2024 15:16, Roger Pau Monné wrote: > > On Tue, May 21, 2024 at 12:30:32PM +0200, Jan Beulich wrote: > >> On 17.05.2024 15:33, Roger Pau Monne wrote: > >>> Enabling it using an HVM param is frag

Re: [PATCH for-4.19 v3 2/3] xen: enable altp2m at create domain domctl

2024-05-22 Thread Roger Pau Monné
be > > implemented > > in other architectures, hence why the field is added to > > xen_domctl_createdomain > > instead of xen_arch_domainconfig. > > > > Signed-off-by: Roger Pau Monné > > Reviewed-by: Jan Beulich # hypervisor > albeit with one qu

Re: [PATCH] x86/shadow: don't leave trace record field uninitialized

2024-05-22 Thread Roger Pau Monné
there also drop the "event" local variable, thus eliminating an > instance of the being phased out u32 type. > > Coverity ID: 1598430 > Fixes: 9a86ac1aa3d2 ("xentrace 5/7: Additional tracing for the shadow code") > Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné Thanks, Roger.

Re: [PATCH v15 3/5] vpci: add initial support for virtual PCI bus topology

2024-05-22 Thread Roger Pau Monné
On Fri, May 17, 2024 at 01:06:13PM -0400, Stewart Hildebrand wrote: > From: Oleksandr Andrushchenko > > Assign SBDF to the PCI devices being passed through with bus 0. > The resulting topology is where PCIe devices reside on the bus 0 of the > root complex itself (embedded endpoints). > This

Re: [PATCH v15 2/5] vpci/header: emulate PCI_COMMAND register for guests

2024-05-22 Thread Roger Pau Monné
le > + * PCI_COMMAND_PARITY, PCI_COMMAND_SERR, and PCI_COMMAND_FAST_BACK. > + */ > +rc = vpci_add_register_mask(pdev->vpci, > +is_hwdom ? vpci_hw_read16 : guest_cmd_read, > +cmd_write, PCI_COMMAND, 2, header, 0, 0, > +PCI_COMMAND_RSVDP_MASK | > +(is_hwdom ? 0 > + : PCI_COMMAND_IO | > +PCI_COMMAND_PARITY | > +PCI_COMMAND_WAIT | > +PCI_COMMAND_SERR | > +PCI_COMMAND_FAST_BACK), We want to allow full access to the hw domain and only apply the PCI_COMMAND_RSVDP_MASK when !is_hwdom in order to keep the current behavior for dom0. I don't think it makes a difference in practice, but we are very lax in explicitly not applying any of such restrictions to dom0. With that fixed: Reviewed-by: Roger Pau Monné Thanks, Roger.

Re: [PATCH v2 05/12] IOMMU: rename and re-type ats_enabled

2024-05-21 Thread Roger Pau Monné
On Tue, May 21, 2024 at 08:21:35AM +0200, Jan Beulich wrote: > On 20.05.2024 12:29, Roger Pau Monné wrote: > > On Wed, May 15, 2024 at 12:07:50PM +0200, Jan Beulich wrote: > >> On 06.05.2024 15:53, Roger Pau Monné wrote: > >>> On Mon, May 06, 2024 at 03:20

Re: [PATCH v3.5 3/4] tools/xen-cpuid: Use automatically generated feature names

2024-05-20 Thread Roger Pau Monné
On Mon, May 20, 2024 at 04:20:37PM +0100, Andrew Cooper wrote: > On 20/05/2024 4:07 pm, Roger Pau Monné wrote: > > On Mon, May 20, 2024 at 03:33:59PM +0100, Andrew Cooper wrote: > >> From: Roger Pau Monné > >> > >> Have gen-cpuid.py write out INIT_FEATUR

Re: [PATCH v3.5 3/4] tools/xen-cpuid: Use automatically generated feature names

2024-05-20 Thread Roger Pau Monné
On Mon, May 20, 2024 at 03:33:59PM +0100, Andrew Cooper wrote: > From: Roger Pau Monné > > Have gen-cpuid.py write out INIT_FEATURE_VAL_TO_NAME, derived from the same > data source as INIT_FEATURE_NAME_TO_VAL, although both aliases of common_1d > are needed. > > In xen-

Re: [PATCH v2 2/2] tools/xg: Clean up xend-style overrides for CPU policies

2024-05-20 Thread Roger Pau Monné
On Fri, May 17, 2024 at 05:08:35PM +0100, Alejandro Vallejo wrote: > Factor out policy getters/setters from both (CPUID and MSR) policy override > functions. Additionally, use host policy rather than featureset when > preparing the cur policy, saving one hypercall and several lines of >

Re: [PATCH v2 1/2] tools/xg: Streamline cpu policy serialise/deserialise calls

2024-05-20 Thread Roger Pau Monné
On Fri, May 17, 2024 at 05:08:34PM +0100, Alejandro Vallejo wrote: > The idea is to use xc_cpu_policy_t as a single object containing both the > serialised and deserialised forms of the policy. Note that we need lengths > for the arrays, as the serialised policies may be shorter than the array >

Re: [PATCH v2 0/3] Clean the policy manipulation path in domain creation

2024-05-20 Thread Roger Pau Monné
On Fri, May 17, 2024 at 05:08:33PM +0100, Alejandro Vallejo wrote: > v2: > * Removed xc_cpu_policy from xenguest.h > * Added accessors for xc_cpu_policy so the serialised form can be extracted. > * Modified xen-cpuid to use accessors. > > Original cover letter > > In the context

Re: [PATCH v2 06/12] VT-d: respect ACPI SATC's ATC_REQUIRED flag

2024-05-20 Thread Roger Pau Monné
On Wed, May 15, 2024 at 12:42:40PM +0200, Jan Beulich wrote: > On 06.05.2024 15:38, Roger Pau Monné wrote: > > On Thu, Feb 15, 2024 at 11:16:11AM +0100, Jan Beulich wrote: > >> When the flag is set, permit Dom0 to control the device (no worse than > >> what we had be

Re: [PATCH v2 05/12] IOMMU: rename and re-type ats_enabled

2024-05-20 Thread Roger Pau Monné
On Wed, May 15, 2024 at 12:07:50PM +0200, Jan Beulich wrote: > On 06.05.2024 15:53, Roger Pau Monné wrote: > > On Mon, May 06, 2024 at 03:20:38PM +0200, Jan Beulich wrote: > >> On 06.05.2024 14:42, Roger Pau Monné wrote: > >>> On Thu, Feb 15, 2024 at 11:15

Re: [PATCH for-4.19? v4 1/6] x86/p2m: Add braces for better code clarity

2024-05-20 Thread Roger Pau Monné
On Sat, May 18, 2024 at 11:02:12AM +, Petr Beneš wrote: > From: Petr Beneš > > No functional change. > > Signed-off-by: Petr Beneš > Reviewed-by: Stefano Stabellini TBH I'm fine without the braces, but if lack of them can cause confusion: Acked-by: Roger Pau Monné C

Re: [PATCH for-4.19? v4 4/6] x86: Make the maximum number of altp2m views configurable

2024-05-20 Thread Roger Pau Monné
On Sat, May 18, 2024 at 11:02:15AM +, Petr Beneš wrote: > From: Petr Beneš > > This commit introduces the ability to configure the maximum number of altp2m > views for the domain during its creation. Previously, the limits were > hardcoded > to a maximum of 10. This change allows for

Re: [PATCH for-4.19?] xen/x86: pretty print interrupt CPU affinity masks

2024-05-17 Thread Roger Pau Monné
On Thu, May 16, 2024 at 06:13:29PM +0100, Andrew Cooper wrote: > On 15/05/2024 4:29 pm, Roger Pau Monne wrote: > > Print the CPU affinity masks as numeric ranges instead of plain hexadecimal > > bitfields. > > > > Signed-off-by: Roger Pau Monné > >

Re: [PATCH for-4.19] xen/x86: limit interrupt movement done by fixup_irqs()

2024-05-16 Thread Roger Pau Monné
On Thu, May 16, 2024 at 06:04:22PM +0200, Jan Beulich wrote: > On 16.05.2024 17:56, Roger Pau Monné wrote: > > On Thu, May 16, 2024 at 05:00:54PM +0200, Jan Beulich wrote: > >> On 16.05.2024 15:22, Roger Pau Monne wrote: > >>> @@ -2576,7 +2576,12 @@ void fixup_ir

Re: [PATCH for-4.19] xen/x86: limit interrupt movement done by fixup_irqs()

2024-05-16 Thread Roger Pau Monné
On Thu, May 16, 2024 at 05:00:54PM +0200, Jan Beulich wrote: > On 16.05.2024 15:22, Roger Pau Monne wrote: > > --- a/xen/arch/x86/irq.c > > +++ b/xen/arch/x86/irq.c > > @@ -2527,7 +2527,7 @@ static int __init cf_check setup_dump_irqs(void) > > } > > __initcall(setup_dump_irqs); > > > > -/*

Re: [PATCH] x86/ucode: Further fixes to identify "ucode already up to date"

2024-05-16 Thread Roger Pau Monné
On Thu, May 16, 2024 at 01:30:21PM +0100, Andrew Cooper wrote: > On 16/05/2024 12:50 pm, Roger Pau Monné wrote: > > On Thu, May 16, 2024 at 12:31:03PM +0100, Andrew Cooper wrote: > >> When the revision in hardware is newer than anything Xen has to hand, > >> 'mi

Re: [PATCH] x86/ucode: Further fixes to identify "ucode already up to date"

2024-05-16 Thread Roger Pau Monné
tionally print the preexisting microcode revision on boot. It's > relevant information which is otherwise unavailable if Xen doesn't find new > microcode to use. > > Fixes: 648db37a155a ("x86/ucode: Distinguish "ucode already up to date"") > Signed-off-by: Andrew Co

Re: [PATCH] tools: Add install/uninstall targets to tests/x86_emulator

2024-05-16 Thread Roger Pau Monné
On Thu, May 16, 2024 at 12:07:10PM +0100, Alejandro Vallejo wrote: > Bring test_x86_emulator in line with other tests by adding > install/uninstall rules. > > Signed-off-by: Alejandro Vallejo > --- > tools/tests/x86_emulator/Makefile | 11 +-- > 1 file changed, 9 insertions(+), 2

Re: [PATCH V3 (resend) 06/19] x86: Add a boot option to enable and disable the direct map

2024-05-16 Thread Roger Pau Monné
On Wed, May 15, 2024 at 03:54:51PM +0200, Jan Beulich wrote: > On 14.05.2024 11:20, Roger Pau Monné wrote: > > On Mon, May 13, 2024 at 01:40:33PM +, Elias El Yandouzi wrote: > >> --- a/docs/misc/xen-command-line.pandoc > >> +++ b/docs/misc/xen-command-line.pa

Re: [PATCH] x86: respect mapcache_domain_init() failing

2024-05-15 Thread Roger Pau Monné
_domain_page() et al") > Signed-off-by: Jan Beulich Acked-by: Roger Pau Monné Thanks, Roger.

Re: [PATCH V3 (resend) 14/19] Rename mfn_to_virt() calls

2024-05-15 Thread Roger Pau Monné
On Tue, May 14, 2024 at 06:22:59PM +0200, Jan Beulich wrote: > On 14.05.2024 17:45, Roger Pau Monné wrote: > > On Mon, May 13, 2024 at 01:40:41PM +, Elias El Yandouzi wrote: > >> Until directmap gets completely removed, we'd still need to > >> keep some calls to mfn_

Re: [PATCH V3 01/19] x86: Create per-domain mapping of guest_root_pt

2024-05-15 Thread Roger Pau Monné
On Tue, May 14, 2024 at 06:15:57PM +0100, Elias El Yandouzi wrote: > Hi Roger, > > On 13/05/2024 16:27, Roger Pau Monné wrote: > > > diff --git a/xen/arch/x86/pv/domain.c b/xen/arch/x86/pv/domain.c > > > index 2a445bb17b..1b025986f7 100644 > > > --- a/xen/arch/

Re: [PATCH V3 (resend) 14/19] Rename mfn_to_virt() calls

2024-05-14 Thread Roger Pau Monné
On Mon, May 13, 2024 at 01:40:41PM +, Elias El Yandouzi wrote: > Until directmap gets completely removed, we'd still need to > keep some calls to mfn_to_virt() for xenheap pages or when the > directmap is enabled. > > Rename the macro to mfn_to_directmap_virt() to flag them and > prevent

Re: [PATCH V3 (resend) 13/19] x86/setup: Do not create valid mappings when directmap=no

2024-05-14 Thread Roger Pau Monné
On Mon, May 13, 2024 at 01:40:40PM +, Elias El Yandouzi wrote: > 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

Re: [PATCH V3 (resend) 12/19] x86/setup: vmap heap nodes when they are outside the direct map

2024-05-14 Thread Roger Pau Monné
On Mon, May 13, 2024 at 01:40:39PM +, Elias El Yandouzi wrote: > 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

Re: [PATCH for-4.19] x86/mtrr: avoid system wide rendezvous when setting AP MTRRs

2024-05-14 Thread Roger Pau Monné
xen-hptool > >> cpu-online` > >> in one Intel Cascade Lake box with 448 CPUs due to the re-setting of the > >> MTRRs > >> on all the CPUs in the system. > >> > >> While there adjust the comment to clarify why the system-wid

Re: [PATCH 3/4] tools/xen-cpuid: Use automatically generated feature names

2024-05-14 Thread Roger Pau Monné
On Tue, May 14, 2024 at 02:05:10PM +0100, Andrew Cooper wrote: > On 14/05/2024 8:53 am, Roger Pau Monné wrote: > > On Fri, May 10, 2024 at 11:40:01PM +0100, Andrew Cooper wrote: > >> diff --git a/tools/misc/xen-cpuid.c b/tools/misc/xen-cpuid.c > >> index 6ee835

Re: [PATCH V3 (resend) 11/19] x86/setup: Leave early boot slightly earlier

2024-05-14 Thread Roger Pau Monné
On Mon, May 13, 2024 at 01:40:38PM +, Elias El Yandouzi wrote: > 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

Re: [PATCH for-4.19] x86/mtrr: avoid system wide rendezvous when setting AP MTRRs

2024-05-14 Thread Roger Pau Monné
On Tue, May 14, 2024 at 01:57:13PM +0200, Jan Beulich wrote: > On 13.05.2024 10:59, Roger Pau Monne wrote: > > --- a/xen/arch/x86/cpu/mtrr/main.c > > +++ b/xen/arch/x86/cpu/mtrr/main.c > > @@ -573,14 +573,15 @@ void mtrr_ap_init(void) > > if (!mtrr_if || hold_mtrr_updates_on_aps) > >

Re: [PATCH V3 (resend) 10/19] xen/page_alloc: Add a path for xenheap when there is no direct map

2024-05-14 Thread Roger Pau Monné
On Mon, May 13, 2024 at 01:40:37PM +, Elias El Yandouzi wrote: > 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

Re: [PATCH V3 (resend) 07/19] xen/x86: Add support for the PMAP

2024-05-14 Thread Roger Pau Monné
On Tue, May 14, 2024 at 12:26:29PM +0200, Jan Beulich wrote: > On 14.05.2024 12:22, Roger Pau Monné wrote: > > On Tue, May 14, 2024 at 11:43:14AM +0200, Jan Beulich wrote: > >> On 14.05.2024 11:40, Roger Pau Monné wrote: > >>> On Mon, May 13, 2024 at 01:40:34PM

Re: [PATCH V3 (resend) 09/19] x86/domain_page: Remove the fast paths when mfn is not in the directmap

2024-05-14 Thread Roger Pau Monné
On Mon, May 13, 2024 at 01:40:36PM +, Elias El Yandouzi wrote: > 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

Re: [PATCH V3 (resend) 07/19] xen/x86: Add support for the PMAP

2024-05-14 Thread Roger Pau Monné
On Tue, May 14, 2024 at 11:43:14AM +0200, Jan Beulich wrote: > On 14.05.2024 11:40, Roger Pau Monné wrote: > > On Mon, May 13, 2024 at 01:40:34PM +, Elias El Yandouzi wrote: > >> @@ -53,6 +55,8 @@ enum fixed_addresses { > >> FIX_PV_CONSOLE, > >>

Re: [PATCH V3 (resend) 06/19] x86: Add a boot option to enable and disable the direct map

2024-05-14 Thread Roger Pau Monné
On Tue, May 14, 2024 at 11:20:21AM +0200, Roger Pau Monné wrote: > On Mon, May 13, 2024 at 01:40:33PM +, Elias El Yandouzi wrote: > > From: Hongyan Xia > > diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h > > index 7561297a75..9d4f1f2d0d 100644 > > --- a/xen

Re: [PATCH V3 (resend) 08/19] xen/x86: Add build assertion for fixmap entries

2024-05-14 Thread Roger Pau Monné
On Mon, May 13, 2024 at 01:40:35PM +, Elias El Yandouzi wrote: > The early fixed addresses must all fit into the static L1 table. > Introduce a build assertion to this end. > > Signed-off-by: Elias El Yandouzi > > > > Changes in v2: > * New patch > > diff --git

Re: [PATCH V3 (resend) 07/19] xen/x86: Add support for the PMAP

2024-05-14 Thread Roger Pau Monné
On Mon, May 13, 2024 at 01:40:34PM +, Elias El Yandouzi wrote: > 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}

Re: [PATCH V3 (resend) 06/19] x86: Add a boot option to enable and disable the direct map

2024-05-14 Thread Roger Pau Monné
On Mon, May 13, 2024 at 01:40:33PM +, Elias El Yandouzi wrote: > From: Hongyan Xia > > Also add a helper function to retrieve it. Change arch_mfns_in_direct_map > to check this option before returning. > > This is added as a Kconfig option as well as a boot command line option. > While

Re: [PATCH V3 (resend) 05/19] x86/mapcache: Initialise the mapcache for the idle domain

2024-05-14 Thread Roger Pau Monné
On Mon, May 13, 2024 at 01:40:32PM +, Elias El Yandouzi wrote: > From: Hongyan Xia > > In order to use the mapcache in the idle domain, we also have to > populate its page tables in the PERDOMAIN region, and we need to move > mapcache_domain_init() earlier in arch_domain_create(). Oh, so

Re: [PATCH V3 (resend) 04/19] x86: Lift mapcache variable to the arch level

2024-05-14 Thread Roger Pau Monné
gt; Signed-off-by: Wei Wang > Signed-off-by: Hongyan Xia > Signed-off-by: Julien Grall Acked-by: Roger Pau Monné Thanks, Roger.

Re: [PATCH 4/4] tools/xen-cpuid: Drop old names

2024-05-14 Thread Roger Pau Monné
On Fri, May 10, 2024 at 11:40:02PM +0100, Andrew Cooper wrote: > From: Roger Pau Monné > > Not used any more. Split out of previous patch to aid legibility. > > Signed-off-by: Roger Pau Monné > Signed-off-by: Andrew Cooper Acked-by: Roger Pau Monné Thanks, Roger.

Re: [PATCH 3/4] tools/xen-cpuid: Use automatically generated feature names

2024-05-14 Thread Roger Pau Monné
On Fri, May 10, 2024 at 11:40:01PM +0100, Andrew Cooper wrote: > From: Roger Pau Monné > > Have gen-cpuid.py write out INIT_FEATURE_VAL_TO_NAME, derived from the same > data source as INIT_FEATURE_NAME_TO_VAL, although both aliases of common_1d > are needed. > >

Re: [PATCH 2/4] tools/xen-cpuid: Rename decodes[] to leaf_info[]

2024-05-14 Thread Roger Pau Monné
On Fri, May 10, 2024 at 11:40:00PM +0100, Andrew Cooper wrote: > From: Roger Pau Monné > > Split out of subsequent patch to aid legibility. Maybe add: "No functional change intended". > > Signed-off-by: Roger Pau Monné > Signed-off-by: Andrew Cooper Reviewed-

Re: [PATCH 1/4] x86/gen-cpuid: Minor cleanup

2024-05-14 Thread Roger Pau Monné
nly, and simply not worth the effort on a script this small. My understanding is that what used to be iteritems() in Python 2 is the behavior of items() in Python 3 (return a generator instead of a copy of the dictionary list). > Signed-off-by: Andrew Cooper Reviewed-by: Roger Pau Monné Thanks, Roger.

Re: [PATCH] x86/pv: Sanity check bytes_per_rep in rep_outs()

2024-05-14 Thread Roger Pau Monné
───┐ > │write of 'uint64_t' (8 bytes) │ > └──┘ > │ │ > │

Re: [PATCH V3 (resend) 03/19] x86/pv: Rewrite how building PV dom0 handles domheap mappings

2024-05-13 Thread Roger Pau Monné
On Mon, May 13, 2024 at 01:40:30PM +, Elias El Yandouzi wrote: > 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

Re: [PATCH V3 (resend) 02/19] x86/pv: Domheap pages should be mapped while relocating initrd

2024-05-13 Thread Roger Pau Monné
On Mon, May 13, 2024 at 01:40:29PM +, Elias El Yandouzi wrote: > From: Wei Liu > > Xen shouldn't use domheap page as if they were xenheap pages. 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

Re: [PATCH V3 01/19] x86: Create per-domain mapping of guest_root_pt

2024-05-13 Thread Roger Pau Monné
On Mon, May 13, 2024 at 11:10:59AM +, Elias El Yandouzi wrote: > From: Hongyan Xia > > Create a per-domain mapping of PV guest_root_pt as direct map is being > removed. > > Note that we do not map and unmap root_pgt for now since it is still a > xenheap page. I'm afraid this needs more

  1   2   3   4   5   6   7   8   9   10   >