public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Kairui Song <kasong@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org,
	Junichi Nomura <j-nomura@ce.jp.nec.com>,
	Dave Young <dyoung@redhat.com>,
	Chao Fan <fanc.fnst@cn.fujitsu.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>
Subject: Re: [RFC PATCH] kexec, x86/boot: map systab region in identity mapping before accessing it
Date: Fri, 19 Apr 2019 18:50:14 +0800	[thread overview]
Message-ID: <20190419105014.GE11060@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20190419101733.GA10324@zn.tnic>

On 04/19/19 at 12:17pm, Borislav Petkov wrote:
> Breaking thread because this one got too big.
> 
> On Fri, Apr 19, 2019 at 04:34:58PM +0800, Kairui Song wrote:
> > There are two approach to fix it, detect if the systab is mapped, and
> > avoid reading it if not.
> 
> Ok, so tglx and I discussed this situation which is slowly getting out
> of hand with all the tinkering.
> 
> So, here's what we should do - scream loudly now if some of this doesn't
> make any sense.
> 
> 1. Junichi's patch should get the systab check above added and sent to
> 5.1 so that at least some EFI kexecing can work with 5.1

Talked with Kairui privately just now. Seems Junichi's patch need add
this systab mapping. Since the systab region is not mapped on some
machines. Those machine don't have this issue because they got systab
region luckily coverred by 1 GB page mapping in 1st kernel before
kexec jumping. 

This issue should happen whether it is KASLR kernel or not KASLR kernel.

> 
> 2. Then, the fact whether the kernel has been kexec'ed and which
> addresses it should use early, should all be passed through boot_params
> which is either setup by kexec(1) or by the first kernel itself, in the
> kexec_file_load() case.

Seems no better way to check if it's kexec-ed kernel, except of the
setup data checking of kexec-ed kernel.

It may happen in both kexec_load or kexec_file_load, since we build
ident mapping of kexec for RAM in 1st kernel.

> 
> > the systab region is not mapped by the identity mapping provided by
> > kexec.
> 
> 3. Then that needs to be fixed in the first kernel as it is a
> shortcoming of us starting to parse systab very early. It is the kexec
> setup code's problem not the early compressed stage's problem that the
> EFI systab is not mapped.

Yeah, adding the systab mapping looks good. Kairui put it in
decompressing stage just because he wants to cover the case in which the
old kernel kexec jumping to 2nd kernel. Now it seems not very
reasonable, we also have the new kernel kexec jumping to old 2nd kernel.

Thanks
Baoquan

  reply	other threads:[~2019-04-19 19:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-19 10:17 [RFC PATCH] kexec, x86/boot: map systab region in identity mapping before accessing it Borislav Petkov
2019-04-19 10:50 ` Baoquan He [this message]
2019-04-19 10:55   ` Baoquan He
2019-04-19 11:20   ` Kairui Song
2019-04-19 11:34     ` Borislav Petkov
2019-04-19 11:50       ` Kairui Song
2019-04-19 14:19         ` [PATCH] x86/boot: Disable RSDP parsing temporarily Borislav Petkov
2019-04-22  9:46           ` [tip:x86/urgent] " tip-bot for Borislav Petkov
2019-04-19 11:28   ` [RFC PATCH] kexec, x86/boot: map systab region in identity mapping before accessing it Borislav Petkov
2019-04-19 11:36     ` Borislav Petkov
2019-04-22 14:33       ` Baoquan He
2019-04-22 15:17         ` Borislav Petkov
2019-04-26  9:51           ` Baoquan He
2019-04-26  9:58             ` Borislav Petkov
2019-04-26 10:16               ` Baoquan He
2019-04-19 11:44     ` Baoquan He
  -- strict thread matches above, loose matches on Subject: below --
2019-04-16  9:52 [PATCH] x86/boot: Use efi_setup_data for searching RSDP on kexec-ed kernels Borislav Petkov
2019-04-19  8:34 ` [RFC PATCH] kexec, x86/boot: map systab region in identity mapping before accessing it Kairui Song
2019-04-19  8:58   ` Baoquan He
2019-04-19  9:39     ` Kairui Song

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=20190419105014.GE11060@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=bp@alien8.de \
    --cc=dyoung@redhat.com \
    --cc=fanc.fnst@cn.fujitsu.com \
    --cc=j-nomura@ce.jp.nec.com \
    --cc=kasong@redhat.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --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