All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, jgross@suse.com,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] acpi/processor: fix evaluating _PDC method when running as Xen dom0
Date: Mon, 21 Nov 2022 16:09:32 +0100	[thread overview]
Message-ID: <Y3uUrAJrD/MfZFv5@Air-de-Roger> (raw)
In-Reply-To: <53a21308-0948-66c9-86e0-d576ab884567@suse.com>

On Mon, Nov 21, 2022 at 03:51:58PM +0100, Jan Beulich wrote:
> On 21.11.2022 15:29, Roger Pau Monné wrote:
> > On Mon, Nov 21, 2022 at 03:02:30PM +0100, Jan Beulich wrote:
> >> On 21.11.2022 11:21, Roger Pau Monne wrote:
> >>> @@ -47,6 +49,15 @@ static bool __init processor_physically_present(acpi_handle handle)
> >>>  		return false;
> >>>  	}
> >>>  
> >>> +	if (xen_initial_domain())
> >>> +		/*
> >>> +		 * When running as a Xen dom0 the number of processors Linux
> >>> +		 * sees can be different from the real number of processors on
> >>> +		 * the system, and we still need to execute _PDC for all of
> >>> +		 * them.
> >>> +		 */
> >>> +		return xen_processor_present(acpi_id);
> >>> +
> >>>  	type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0;
> >>>  	cpuid = acpi_get_cpuid(handle, type, acpi_id);
> >>
> >> We had to deal with this in our XenoLinux forward ports as well, but at
> >> the time it appeared upstream I decided to make use of acpi_get_apicid()
> >> (which meanwhile was renamed to acpi_get_phys_id()). Wouldn't than be an
> >> option, eliminating the need for a Xen-specific new function?
> > 
> > While this would work for PV, it won't work on a PVH dom0, since the
> > ACPI MADT table is not the native one in that case, and thus the
> > Processor UIDs in the MADT don't match the ones in the Processor
> > objects/devices.
> 
> I wonder whether we can actually get away with this difference long term.
> I've gone back and looked at the commit introducing the code to build the
> replacement MADT, but there's no mention of either the reason for the
> changed numbering or the reason for limiting MADT entries to just the
> number of CPUs Dom0 will have. (Clearly we need distinct APIC IDs, at
> least until Xen becomes more flexible / correct in this regard. And
> clearly we'd need to "invent" ACPI IDs in case Dom0 had more vCPU-s than
> there are pCPU-s.)

Linux when running in PVH/HVM mode uses the ACPI Processor UID in the
MADT as the vCPU ID, so attempting to re-use the native UIDs doesn't
work.

We could expand the dom0 crafted MADT to make sure all the native ACPI
Processor UIDs are present in the crafted MADT, by adding them as not
present entries, but that seems more like a bodge than a proper
solution.  Even then those X2APIC entries would appear as offline by
the current checks, and thus won't get _PDC evaluated either.

Thanks, Roger.

  reply	other threads:[~2022-11-21 15:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 10:21 [PATCH 0/3] xen: ACPI processor related fixes Roger Pau Monne
2022-11-21 10:21 ` [PATCH 1/3] acpi/processor: fix evaluating _PDC method when running as Xen dom0 Roger Pau Monne
2022-11-21 14:02   ` Jan Beulich
2022-11-21 14:29     ` Roger Pau Monné
2022-11-21 14:51       ` Jan Beulich
2022-11-21 15:09         ` Roger Pau Monné [this message]
2022-11-29 16:01   ` Roger Pau Monné
2022-11-29 17:43   ` Dave Hansen
2022-11-30 15:53     ` Roger Pau Monné
2022-11-30 16:48       ` Dave Hansen
2022-12-02 12:24         ` Roger Pau Monné
2022-12-02 16:17           ` Dave Hansen
2022-12-02 16:37             ` Roger Pau Monné
2022-12-02 17:06               ` Rafael J. Wysocki
2022-12-09 10:12                 ` Roger Pau Monné
2023-01-30  9:21   ` Josef Johansson
2023-02-03  7:05     ` Jan Beulich
2023-02-03 13:58       ` Josef Johansson
2022-11-21 10:21 ` [PATCH 2/3] acpi/processor: sanitize _PDC buffer bits " Roger Pau Monne
2022-11-21 14:10   ` Jan Beulich
2022-11-21 14:13     ` Jan Beulich
2022-11-21 15:03     ` Roger Pau Monné
2023-06-14 19:57       ` Jason Andryuk
2023-06-16 14:39         ` Roger Pau Monné
2022-11-21 10:21 ` [PATCH 3/3] xen/acpi: upload power and performance related data from a PVH dom0 Roger Pau Monne
2023-01-30  9:10   ` Josef Johansson
2023-03-15 11:39     ` Roger Pau Monné
2023-03-16  7:54       ` Josef Johansson
2023-03-16 10:06         ` Roger Pau Monné
2022-11-21 14:20 ` [PATCH 0/3] xen: ACPI processor related fixes Jan Beulich
2022-11-21 16:27   ` Roger Pau Monné

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=Y3uUrAJrD/MfZFv5@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rafael@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --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.