From: "Jürgen Groß" <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "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>,
"H. Peter Anvin" <hpa@zytor.com>,
xen-devel@lists.xenproject.org,
"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH 5/5] xen: tolerate ACPI NVS memory overlapping with Xen allocated memory
Date: Thu, 8 Aug 2024 16:42:53 +0200 [thread overview]
Message-ID: <5389eb85-873c-4ae2-a916-6fdd0e5b496d@suse.com> (raw)
In-Reply-To: <90d67e10-6e35-487e-a9e7-611a0fa3b00b@suse.com>
On 07.08.24 14:05, Jan Beulich wrote:
> On 07.08.2024 12:41, Juergen Gross wrote:
>> In order to minimize required special handling for running as Xen PV
>> dom0, the memory layout is modified to match that of the host. This
>> requires to have only RAM at the locations where Xen allocated memory
>> is living. Unfortunately there seem to be some machines, where ACPI
>> NVS is located at 64 MB, resulting in a conflict with the loaded
>> kernel or the initial page tables built by Xen.
>>
>> As ACPI NVS needs to be accessed by the kernel only for saving and
>> restoring it across suspend operations, it can be relocated in the
>> dom0's memory map by swapping it with unused RAM (this is possible
>> via modification of the dom0 P2M map).
>
> While the kernel may not (directly) need to access it for other purposes,
> what about AML accessing it? As you can't advertise the movement to ACPI,
> and as non-RAM mappings are carried out by drivers/acpi/osl.c:acpi_map()
> using acpi_os_ioremap(), phys-to-machine translations won't cover for
> that (unless I'm overlooking something, which unfortunately seems like I
> might be).
Seems I need to hook into acpi_os_ioremap() in order to handle that case.
> Even without that I wonder in how far tools (kexec?) may be misguided by
> relocating non-RAM memory ranges. Even more so when stuff traditionally
> living below the 4G boundary suddenly moves far beyond that.
I don't think kexec is working in PV mode.
Other tools: time will tell, I guess. I prefer a generally working system
with maybe some tools failing over one not booting at all.
The only other general solution I could think of would be something similar
to vmlinuz on bare metal: a "small" boot code looking for an appropriate
location for the kernel and then relocating the "real" kernel accordingly.
This would require quite some effort, though, as the boot code would need
to create the related page tables and p2m table, too. I'd like to avoid
that.
Juergen
next prev parent reply other threads:[~2024-08-08 14:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 10:41 [PATCH 0/5] xen: fix dom0 PV boot on some AMD machines Juergen Gross
2024-08-07 10:41 ` [PATCH 1/5] xen: use correct end address of kernel for conflict checking Juergen Gross
2024-08-07 10:41 ` [PATCH 2/5] xen: introduce generic helper checking for memory map conflicts Juergen Gross
2024-08-07 10:41 ` [PATCH 3/5] xen: move checks for e820 conflicts further up Juergen Gross
2024-08-07 10:41 ` [PATCH 4/5] xen: move max_pfn in xen_memory_setup() out of function scope Juergen Gross
2024-08-07 10:41 ` [PATCH 5/5] xen: tolerate ACPI NVS memory overlapping with Xen allocated memory Juergen Gross
2024-08-07 12:05 ` Jan Beulich
2024-08-08 14:42 ` Jürgen Groß [this message]
2024-08-08 15:03 ` Jan Beulich
2024-08-09 9:45 ` Jan Beulich
2024-08-09 10:46 ` Jürgen Groß
-- strict thread matches above, loose matches on Subject: below --
2024-08-07 10:33 [PATCH 0/5] xen: fix dom0 PV boot on some AMD machines Juergen Gross
2024-08-07 10:33 ` [PATCH 5/5] xen: tolerate ACPI NVS memory overlapping with Xen allocated memory Juergen Gross
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=5389eb85-873c-4ae2-a916-6fdd0e5b496d@suse.com \
--to=jgross@suse.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=linux-kernel@vger.kernel.org \
--cc=marmarek@invisiblethingslab.com \
--cc=mingo@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®