public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Vit Kabele <vit@kabele.me>
Cc: platform-driver-x86@vger.kernel.org, r.marek@assembler.cz,
	x86@kernel.org, linux-kernel@vger.kernel.org, rafael@kernel.org,
	mingo@redhat.com
Subject: Re: [PATCH v2] arch/x86: Check validity of EBDA pointer in mpparse.c
Date: Tue, 17 May 2022 21:21:57 +0200	[thread overview]
Message-ID: <YoP11ZNZv2/Z7B0g@zn.tnic> (raw)
In-Reply-To: <YoIc1AHLK4pfR4AI@czspare1-lap.sysgo.cz>

On Mon, May 16, 2022 at 11:43:48AM +0200, Vit Kabele wrote:
>  And the valid upper bound of the EBDA pointer is also different
> for these two use-cases. (The mpparse.c usage is interested in EBDA
> pointer only if it ends 1KiB before the end of low memory, while the
> ebda.c accepts even the values in the last KiB below 640KiB).

And I still don't know why this difference in the upper bounds is really
relevant and why you can't simply use the code in reserve_bios_regions()
after carving it out in a helper?

The latter considers ebda_start valid when it is between BIOS_START_MIN
and bios_start, after having sanitized that bios_start to 640K if "out
of bounds".

Why can't default_find_smp_config() simply scan the last KiB below
640KiB twice for the sake of simpler code?

I.e., there needs to be a single get_bios_ebda() - the current one can
be renamed to __get_bios_ebda() - and that get_bios_ebda() should give
either a sane EBDA address or 0 if the checks don't pass. And all code
should use that.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2022-05-17 19:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAJZ5v0gBbdzUO9MRxbKESEnaeaNAu-+3oP6ADMretch=iHPNJA@mail.gmail.com>
2022-04-08  8:46 ` [PATCH v2] arch/x86: Check validity of EBDA pointer in mpparse.c Vit Kabele
2022-05-03 17:36   ` Borislav Petkov
2022-05-16  9:43     ` Vit Kabele
2022-05-17 19:21       ` Borislav Petkov [this message]
2022-07-21 15:38         ` Vit Kabele

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=YoP11ZNZv2/Z7B0g@zn.tnic \
    --to=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=r.marek@assembler.cz \
    --cc=rafael@kernel.org \
    --cc=vit@kabele.me \
    --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