All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Dave Young <dyoung@redhat.com>,
	linux-efi <linux-efi@vger.kernel.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Matt Fleming <matt@codeblueprint.co.uk>,
	kexec@lists.infradead.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Jean Delvare <jdelvare@suse.de>
Subject: Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Date: Tue, 21 Jan 2020 00:31:47 +0200	[thread overview]
Message-ID: <CAHp75VdjwWfqHtJ3n-UK_n5nzpgcpERbM+_9-Z3FrjJx7nHQzQ@mail.gmail.com> (raw)
In-Reply-To: <87a76i9ksr.fsf@x220.int.ebiederm.org>

On Mon, Jan 20, 2020 at 9:28 PM Eric W. Biederman <ebiederm@xmission.com> wrote:
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> writes:
> > On Sat, Dec 17, 2016 at 06:57:21PM +0800, Dave Young wrote:
> >> Ccing efi people.
> >>
> >> On 12/16/16 at 02:33pm, Jean Delvare wrote:
> >> > On Fri, 16 Dec 2016 14:18:58 +0200, Andy Shevchenko wrote:
> >> > > On Fri, 2016-12-16 at 10:32 +0800, Dave Young wrote:
> >> > > > On 12/15/16 at 12:28pm, Jean Delvare wrote:
> >> > > > > I am no kexec expert but this confuses me. Shouldn't the second
> >> > > > > kernel have access to the EFI systab as the first kernel does? It
> >> > > > > includes many more pointers than just ACPI and DMI tables, and it
> >> > > > > would seem inconvenient to have to pass all these addresses
> >> > > > > individually explicitly.
> >> > > >
> >> > > > Yes, in modern linux kernel, kexec has the support for EFI, I think it
> >> > > > should work naturally at least in x86_64.
> >> > >
> >> > > Thanks for this good news!
> >> > >
> >> > > Unfortunately Intel Galileo is 32-bit platform.
> >> >
> >> > If it was done for X86_64 then maybe it can be generalized to X86?
> >>
> >> For X86_64, we have a new way for efi runtime memmory mapping, in i386
> >> code it still use old ioremap way. It is impossible to use same way as
> >> the X86_64 since the virtual address space is limited.
> >>
> >> But maybe for 32bit, kexec kernel can run in physical mode, but I'm not
> >> sure, I would suggest Andy to do a test first with efi=noruntime for
> >> kexec 2nd kernel.
> >
> > Guys, it was quite a long no hear from you. As I told you the proposed work
> > around didn't help. Today I found that Microsoft Surface 3 also affected
> > by this.
> >
> > Can we apply these patches for now until you will find better
> > solution?
>
> Not a chance.  The patches don't apply to any kernel in the git history.
>
> Which may be part of your problem.  You are or at least were running
> with code that has not been merged upstream.

It's done against linux-next.
Applied clearly. (Not the version in this more than yearly old series
of course, that's why I told I can resend)

> > P.S. I may resend them rebased on recent vanilla.
>
> Second.  I looked at your test results and they don't directly make
> sense.  dmidecode bypasses the kernel completely or it did last time
> I looked so I don't know why you would be using that to test if
> something in the kernel is working.
>
> However dmidecode failing suggests that the actual problem is something
> in the first kernel is stomping the dmi tables.

See below.

> Adding a command line option won't fix stomped tables.

It provides a mechanism, which seems to be absent, to the second
kernel to know where to look for SMBIOS tables.

> So what I would suggest is:
> a) Verify that dmidecode works before kexec.

Yes, it does.

> b) Test to see if dmidecode works after kexec.

No, it doesn't.

> c) Once (a) shows that dmidecode works and (b) shows that dmidecode
>    fails figure out what is stomping your dmi tables during or before
>    kexec and that is what should get fixed.

The problem here as I can see it that EFI and kexec protocols are not
friendly to each other.
I'm not an expert in either. That's why I'm asking for possible
solutions. And this needs to be done in kernel to allow drivers to
work.

Does the

commit 4996c02306a25def1d352ec8e8f48895bbc7dea9
Author: Takao Indoh <indou.takao@jp.fujitsu.com>
Date:   Thu Jul 14 18:05:21 2011 -0400

    ACPI: introduce "acpi_rsdp=" parameter for kdump

description shed a light on this?

> Now using a non-efi method of dmi detection relies on the
> tables being between 0xF0000 and 0x10000. AKA the last 64K
> of the first 1MiB of memory.  You might check to see if your
> dmi tables are in that address range.

# dmidecode --no-sysfs
# dmidecode 3.2
Scanning /dev/mem for entry point.
# No SMBIOS nor DMI entry point found, sorry.

=== with patch applied ===
# dmidecode
...
        Release Date: 03/10/2015
...

>
> Otherwise I suspect the good solution is to give efi it's own page
> tables in the kernel and switch to it whenever efi functions are called.
>

> But on 32bit the Linux kernel has historically been just fine directly
> accessing the hardware, and ignoring efi and all of the other BIOS's.

It seems not only for 32-bit Linux kernel anymore. MS Surface 3 runs
64-bit code.

> So if that doesn't work on Intel Galileo that is probably a firmware
> problem.

It's not only about Galileo anymore.

-- 
With Best Regards,
Andy Shevchenko

  parent reply	other threads:[~2020-01-20 22:32 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 19:54 [PATCH v1 0/2] firmware: dmi_scan: Make it work in kexec'ed kernel Andy Shevchenko
2016-12-02 19:54 ` [PATCH v1 1/2] firmware: dmi_scan: Split out dmi_get_entry_point() helper Andy Shevchenko
2016-12-15 11:13   ` Jean Delvare
2016-12-02 19:54 ` [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel Andy Shevchenko
2016-12-15 11:28   ` Jean Delvare
2016-12-15 11:28     ` Jean Delvare
2016-12-16  2:32     ` Dave Young
2016-12-16  2:32       ` Dave Young
2016-12-16 12:18       ` Andy Shevchenko
2016-12-16 12:18         ` Andy Shevchenko
2016-12-16 13:33         ` Jean Delvare
2016-12-16 13:33           ` Jean Delvare
2016-12-17 10:57           ` Dave Young
2016-12-17 10:57             ` Dave Young
2019-09-06 19:00             ` Andy Shevchenko
2019-09-06 19:00               ` Andy Shevchenko
2020-01-20 12:19             ` Andy Shevchenko
2020-01-20 16:04               ` Eric W. Biederman
2020-01-20 21:42                 ` Jean Delvare
2020-01-20 21:55                   ` Andy Shevchenko
2020-01-21  9:03                     ` Jean Delvare
2020-01-21 16:29                       ` Eric W. Biederman
2020-01-21 17:24                         ` Andy Shevchenko
2020-01-20 22:31                 ` Andy Shevchenko [this message]
2020-01-20 23:18                   ` Ard Biesheuvel
2020-01-21 15:37                     ` Andy Shevchenko
2020-01-21 17:17                       ` Eric W. Biederman
2020-05-21 17:39                         ` Andy Shevchenko
2020-05-21 17:39                           ` Andy Shevchenko
2021-06-02  8:37                     ` Andy Shevchenko
2021-06-02  8:37                       ` Andy Shevchenko
2021-06-02  8:53                       ` Andy Shevchenko
2021-06-02  8:53                         ` Andy Shevchenko
2016-12-17 10:50         ` Dave Young
2016-12-17 10:50           ` Dave Young
2020-01-20 12:16 ` [PATCH v1 0/2] firmware: dmi_scan: Make it work in " Andy Shevchenko
2020-05-21 15:53   ` Andy Shevchenko
2020-05-21 15:59     ` Andy Shevchenko
2021-06-02  8:42 ` Andy Shevchenko
2021-06-02  8:42   ` Andy Shevchenko
2021-06-02  8:53   ` Andy Shevchenko
2021-06-02  8:53     ` Andy Shevchenko
2021-06-05  7:51     ` Dave Young
2021-06-05  7:51       ` Dave Young
2021-06-07 16:22       ` Andy Shevchenko
2021-06-07 16:22         ` Andy Shevchenko
2021-06-07 17:18         ` Andy Shevchenko
2021-06-07 17:18           ` Andy Shevchenko
2021-06-08 12:25           ` Dave Young
2021-06-08 12:25             ` Dave Young
2021-06-08 12:38             ` Andy Shevchenko
2021-06-08 12:38               ` Andy Shevchenko
2021-06-09 11:55               ` Dave Young
2021-06-09 11:55                 ` Dave Young
2021-06-12  4:40                 ` Dave Young
2021-06-12  4:40                   ` Dave Young
2021-06-14 15:38                   ` Andy Shevchenko
2021-06-14 15:38                     ` Andy Shevchenko
2021-06-14 17:07                     ` Andy Shevchenko
2021-06-14 17:07                       ` Andy Shevchenko
2021-06-14 17:27                       ` Andy Shevchenko
2021-06-14 17:27                         ` Andy Shevchenko
2021-07-19  7:53                         ` Ard Biesheuvel
2021-07-19  7:53                           ` Ard Biesheuvel
2021-07-19  8:25                           ` Andy Shevchenko
2021-07-19  8:25                             ` Andy Shevchenko
2021-10-06 16:28                         ` Andy Shevchenko
2021-10-06 16:28                           ` Andy Shevchenko
2021-10-07  7:20                           ` Ard Biesheuvel
2021-10-07  7:20                             ` Ard Biesheuvel
2021-10-07  7:23                             ` Andy Shevchenko
2021-10-07  7:23                               ` Andy Shevchenko
2021-10-17 13:31                               ` Ard Biesheuvel
2021-10-17 13:31                                 ` Ard Biesheuvel

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=CAHp75VdjwWfqHtJ3n-UK_n5nzpgcpERbM+_9-Z3FrjJx7nHQzQ@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dyoung@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=jdelvare@suse.de \
    --cc=kexec@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=mika.westerberg@linux.intel.com \
    /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.