Re: [PATCH v3] xen/x86: On x2APIC mode, derive LDR from APIC ID

2023-11-23 Thread Andrew Cooper
On 23/11/2023 2:03 pm, Roger Pau Monné wrote: > On Thu, Nov 23, 2023 at 12:21:36PM +, Alejandro Vallejo wrote: >> On Thu, Nov 23, 2023 at 10:03:12AM +0100, Roger Pau Monné wrote: >>> On Wed, Nov 22, 2023 at 04:08:17PM +, Alejandro Vallejo wrote: +if ( vlapic_domain(vlapic)->arch.hv

Re: [PATCH v3] xen/x86: On x2APIC mode, derive LDR from APIC ID

2023-11-23 Thread Roger Pau Monné
On Thu, Nov 23, 2023 at 12:21:36PM +, Alejandro Vallejo wrote: > On Thu, Nov 23, 2023 at 10:03:12AM +0100, Roger Pau Monné wrote: > > On Wed, Nov 22, 2023 at 04:08:17PM +, Alejandro Vallejo wrote: > > > +static uint32_t x2apic_ldr_from_id(uint32_t id) > > > +{ > > > +return ((id & ~0xf)

Re: [PATCH v3] xen/x86: On x2APIC mode, derive LDR from APIC ID

2023-11-23 Thread Alejandro Vallejo
On Thu, Nov 23, 2023 at 10:03:12AM +0100, Roger Pau Monné wrote: > On Wed, Nov 22, 2023 at 04:08:17PM +, Alejandro Vallejo wrote: > > Both Intel and AMD manuals agree that on x2APIC mode, the APIC LDR and ID > > registers are derivable from each other through a fixed formula. > > > > Xen uses

Re: [PATCH v3] xen/x86: On x2APIC mode, derive LDR from APIC ID

2023-11-23 Thread Roger Pau Monné
On Wed, Nov 22, 2023 at 04:08:17PM +, Alejandro Vallejo wrote: > Both Intel and AMD manuals agree that on x2APIC mode, the APIC LDR and ID > registers are derivable from each other through a fixed formula. > > Xen uses that formula, but applies it to vCPU IDs (which are sequential) > rather th

Re: [PATCH v3] xen/x86: On x2APIC mode, derive LDR from APIC ID

2023-11-22 Thread Alejandro Vallejo
On Wed, Nov 22, 2023 at 04:08:17PM +, Alejandro Vallejo wrote: > Both Intel and AMD manuals agree that on x2APIC mode, the APIC LDR and ID > registers are derivable from each other through a fixed formula. > > Xen uses that formula, but applies it to vCPU IDs (which are sequential) > rather th

[PATCH v3] xen/x86: On x2APIC mode, derive LDR from APIC ID

2023-11-22 Thread Alejandro Vallejo
Both Intel and AMD manuals agree that on x2APIC mode, the APIC LDR and ID registers are derivable from each other through a fixed formula. Xen uses that formula, but applies it to vCPU IDs (which are sequential) rather than x2APIC IDs (which are not, at the moment). As I understand it, this is an