[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFwNgm9qkptXTwVbN6Krwki+zvJD1M9UiGppX+Eb1yvfoQ@mail.gmail.com>
Date: Wed, 8 Nov 2017 13:23:37 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Borislav Petkov <bp@...e.de>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Jiri Kosina <jikos@...nel.org>, Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Tom Lendacky <thomas.lendacky@....com>,
LKML <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>,
"the arch/x86 maintainers" <x86@...nel.org>,
Greg KH <greg@...ah.com>
Subject: Re: [PATCH] x86/mm: Unbreak modules that rely on external PAGE_KERNEL availability
On Wed, Nov 8, 2017 at 1:15 PM, Borislav Petkov <bp@...e.de> wrote:
>
> Right, AFAIRC, the main reason for this being an export was because if
> we hid it in a function, you'd have all those function calls as part of
> the _PAGE_* macros and that's just crap.
Yes, that would be worse.
I was thinking that maybe we could have a fixed "encrypt" bit in our
PTE, and then replace that "software bit" with whatever the real
hardware mask is (if any).
Because it's nasty to have these constants that _used_ to be
constants, and still _look_ like constants, suddely do stupid memory
reads from random kernel data.
So _this_ is the underflying problem:
#define _PAGE_ENC (_AT(pteval_t, sme_me_mask))
because that is simply not how the _PAGE_xyz macros should work!
So it should have been a fixed bit to begin with, and the dynamic part
should have been elsewhere.
The whole EXPORT_SYMBOL() thing is just a symptom of that fundamental
error. Modules - GPL or not - should _never_ have to know or care
about this _PAGE_ENC bit madness, simply because it shouldn't have
been there.
Linus
Powered by blists - more mailing lists