public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roman Kisel <romank@linux.microsoft.com>
To: "H. Peter Anvin" <hpa@zytor.com>,
	akpm@linux-foundation.org, bhe@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, kai.huang@intel.com,
	kirill.shutemov@linux.intel.com, mingo@redhat.com,
	pbonzini@redhat.com, tglx@linutronix.de, x86@kernel.org,
	linux-kernel@vger.kernel.org
Cc: apais@microsoft.com, benhill@microsoft.com,
	ssengar@microsoft.com, sunilmut@microsoft.com, vdso@hexbites.dev
Subject: Re: [PATCH] x86/reboot: Don't corrupt memory on non-BIOS systems
Date: Fri, 10 Jan 2025 13:05:55 -0800	[thread overview]
Message-ID: <b144d36f-9039-48bf-8053-66fec8a27ae1@linux.microsoft.com> (raw)
In-Reply-To: <9766201A-7C6B-4E80-A6A9-3593780F68F0@zytor.com>



On 1/9/2025 7:25 PM, H. Peter Anvin wrote:
> On January 9, 2025 12:43:52 PM PST, Roman Kisel <romank@linux.microsoft.com> wrote:

[...]

> 
> I should say: this patch is unambiguously *wrong*. It conflates the invocation mechanism with the desired post state, and they are not coupled. Calling the BIOS reboot entry point is not the normal way to reboot even on BIOS systems.

Thank you very much for taking time to review and for the chance to
learn from you!

Would you like me to propose another patch where the line of

*((unsigned short *)__va(0x472)) = mode;

receives a comment for posterity why that it is okay to write at that
address? Perhaps,

/*
  * The common practice for the firmware is to report 0x0..0x1000
  * as reserved in the RAM map. The value written to the address of
  * 0x472 may be used by the firmware to perform the cold or the warm
  * boot.
  */

might be a good addition to the code.

I've looked at the UEFI+ACPI spec and couldn't find any mentions of that
magical address, and the code writes at that address even in the UEFI
case. If you have time to recommend normative documents where that might
be explained, I'd greatly appreciate that!


-- 
Thank you,
Roman


  reply	other threads:[~2025-01-10 21:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09 20:43 [PATCH] x86/reboot: Don't corrupt memory on non-BIOS systems Roman Kisel
2025-01-10  3:23 ` H. Peter Anvin
2025-01-10 20:51   ` Roman Kisel
2025-01-10  3:25 ` H. Peter Anvin
2025-01-10 21:05   ` Roman Kisel [this message]
2025-02-25 20:25 ` Ingo Molnar
2025-02-25 20:28   ` H. Peter Anvin
2025-02-25 20:39     ` Ingo Molnar
2025-02-25 20:46       ` H. Peter Anvin

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=b144d36f-9039-48bf-8053-66fec8a27ae1@linux.microsoft.com \
    --to=romank@linux.microsoft.com \
    --cc=akpm@linux-foundation.org \
    --cc=apais@microsoft.com \
    --cc=benhill@microsoft.com \
    --cc=bhe@redhat.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kai.huang@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=ssengar@microsoft.com \
    --cc=sunilmut@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=vdso@hexbites.dev \
    --cc=x86@kernel.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