linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Borislav Petkov <bp@suse.de>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Jiri Kosina <jikos@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	Greg KH <greg@kroah.com>
Subject: Re: [PATCH] x86/mm: Unbreak modules that rely on external PAGE_KERNEL availability
Date: Wed, 8 Nov 2017 13:46:24 -0800	[thread overview]
Message-ID: <CA+55aFxik=Z+aSvQd8jqy3uO58G_2X+kWV_DWH1jgRGveOkz3Q@mail.gmail.com> (raw)
In-Reply-To: <CA+55aFwNgm9qkptXTwVbN6Krwki+zvJD1M9UiGppX+Eb1yvfoQ@mail.gmail.com>

On Wed, Nov 8, 2017 at 1:23 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> So _this_ is the underlying 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.

Hmm. It's not an entirely new problem. We have that
"cachemode2protval()" thing, which causes he exact same thing, except
it accesses the __cachemode2pte_tbl[] array instead.

Which we also EXPORT_SYMBOL().

So I guess _PAGE_ENC isn't any worse than what we already had.

Of course, that at least doesn't trigger for the simple cases - only
_PAGE_CACHE_WP and _PAGE_NOCACHE end up triggering that
"cachemode2protval()" case.

I do wonder if we could perhaps at least try to unify these things a
bit, and export just one thing.

And maybe avoid accessing two completely different memory locasions
every time we use _PAGE_KERNEL or whatever.

But it all looks rather nasty, so for 4.14 clearly I should just apply
that trivial one-liner patch for now.

           Linus

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      parent reply	other threads:[~2017-11-08 21:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 20:18 Jiri Kosina
2017-11-08 20:47 ` Thomas Gleixner
2017-11-08 21:09   ` Linus Torvalds
2017-11-08 21:15     ` Borislav Petkov
2017-11-08 21:23       ` Linus Torvalds
2017-11-08 21:36         ` Tom Lendacky
2017-11-08 21:45         ` Borislav Petkov
2017-11-08 22:04           ` Tom Lendacky
2017-11-08 21:46         ` Linus Torvalds [this message]

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='CA+55aFxik=Z+aSvQd8jqy3uO58G_2X+kWV_DWH1jgRGveOkz3Q@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=bp@suse.de \
    --cc=greg@kroah.com \
    --cc=hpa@zytor.com \
    --cc=jikos@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --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