From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Jan Beulich" <jbeulich@suse.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Juergen Gross" <jgross@suse.com>,
Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v6 06/11] tools/libacpi: Use LUT of APIC IDs rather than function pointer
Date: Fri, 11 Oct 2024 17:17:51 +0100 [thread overview]
Message-ID: <D4T423OR4IAU.D5ZUN0WIO0UK@cloud.com> (raw)
In-Reply-To: <28e07993-9463-49a5-ba75-e012056e5ab2@suse.com>
On Wed Oct 9, 2024 at 3:25 PM BST, Jan Beulich wrote:
> On 01.10.2024 14:38, Alejandro Vallejo wrote:
> > @@ -148,7 +148,7 @@ static struct acpi_20_madt *construct_madt(struct acpi_ctxt *ctxt,
> > lapic->length = sizeof(*lapic);
> > /* Processor ID must match processor-object IDs in the DSDT. */
> > lapic->acpi_processor_id = i;
> > - lapic->apic_id = config->lapic_id(i);
> > + lapic->apic_id = config->cpu_to_apicid[i];
>
> Perhaps assert (like you do in an earlier patch) that the ID is small
> enough?
Actually, I just remembered why I didn't. libacpi is pulled into libxl, which
is integrated into libvirt. A failed assert here would kill the application,
which is not very nice.
HVM is already protected by the mp tables assert, so I'm not terribly worried
about it and, while PVH is not, it would crash pretty quickly due to the
corruption.
I'd rather have the domain crashing rather than virt-manager.
>
> > --- a/tools/libacpi/libacpi.h
> > +++ b/tools/libacpi/libacpi.h
> > @@ -84,7 +84,7 @@ struct acpi_config {
> > unsigned long rsdp;
> >
> > /* x86-specific parameters */
> > - uint32_t (*lapic_id)(unsigned cpu);
> > + uint32_t *cpu_to_apicid; /* LUT mapping cpu id to (x2)APIC ID */
>
> const uint32_t *?
>
> > --- a/tools/libs/light/libxl_dom.c
> > +++ b/tools/libs/light/libxl_dom.c
> > @@ -1082,6 +1082,11 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
> >
> > dom->container_type = XC_DOM_HVM_CONTAINER;
> >
> > +#if defined(__i386__) || defined(__x86_64__)
> > + for ( uint32_t i = 0; i < info->max_vcpus; i++ )
>
> Plain unsigned int?
>
> Jan
Sigh... and this didn't have the libxl style either.
I really hate this style mix we have :/
Cheers,
Alejandro
next prev parent reply other threads:[~2024-10-11 16:18 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-01 12:37 [PATCH v6 00/11] x86: Expose consistent topology to guests Alejandro Vallejo
2024-10-01 12:37 ` [PATCH v6 01/11] lib/x86: Relax checks about policy compatibility Alejandro Vallejo
2024-10-09 9:40 ` Jan Beulich
2024-10-09 15:57 ` Alejandro Vallejo
2024-10-10 7:37 ` Jan Beulich
2024-10-09 21:58 ` Andrew Cooper
2024-10-01 12:37 ` [PATCH v6 02/11] x86/vlapic: Move lapic migration checks to the check hooks Alejandro Vallejo
2024-10-08 15:41 ` Jan Beulich
2024-10-09 16:11 ` Alejandro Vallejo
2024-10-01 12:37 ` [PATCH v6 03/11] xen/x86: Add initial x2APIC ID to the per-vLAPIC save area Alejandro Vallejo
2024-10-09 13:12 ` Jan Beulich
2024-10-09 16:39 ` Alejandro Vallejo
2024-10-01 12:38 ` [PATCH v6 04/11] xen/x86: Add supporting code for uploading LAPIC contexts during domain create Alejandro Vallejo
2024-10-09 13:28 ` Jan Beulich
2024-10-09 16:44 ` Alejandro Vallejo
2024-10-10 7:46 ` Jan Beulich
2024-10-01 12:38 ` [PATCH v6 05/11] tools/hvmloader: Retrieve (x2)APIC IDs from the APs themselves Alejandro Vallejo
2024-10-09 14:03 ` Jan Beulich
2024-10-09 17:19 ` Alejandro Vallejo
2024-10-10 7:49 ` Jan Beulich
2024-10-01 12:38 ` [PATCH v6 06/11] tools/libacpi: Use LUT of APIC IDs rather than function pointer Alejandro Vallejo
2024-10-09 14:25 ` Jan Beulich
2024-10-09 17:20 ` Alejandro Vallejo
2024-10-11 16:17 ` Alejandro Vallejo [this message]
2024-10-14 6:26 ` Jan Beulich
2024-10-01 12:38 ` [PATCH v6 07/11] tools/libguest: Always set vCPU context in vcpu_hvm() Alejandro Vallejo
2024-10-01 12:38 ` [PATCH v6 08/11] xen/lib: Add topology generator for x86 Alejandro Vallejo
2024-10-09 14:45 ` Jan Beulich
2024-10-09 17:57 ` Alejandro Vallejo
2024-10-10 7:54 ` Jan Beulich
2024-10-15 13:08 ` Alejandro Vallejo
2024-10-01 12:38 ` [PATCH v6 09/11] xen/x86: Derive topologically correct x2APIC IDs from the policy Alejandro Vallejo
2024-10-09 14:53 ` Jan Beulich
2024-10-09 17:29 ` Alejandro Vallejo
2024-10-10 7:55 ` Jan Beulich
2024-10-01 12:38 ` [PATCH v6 10/11] tools/libguest: Set distinct x2APIC IDs for each vCPU Alejandro Vallejo
2024-10-01 12:38 ` [PATCH v6 11/11] tools/x86: Synthesise domain topologies Alejandro Vallejo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D4T423OR4IAU.D5ZUN0WIO0UK@cloud.com \
--to=alejandro.vallejo@cloud.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.