From: Dave Hansen <dave.hansen@intel.com>
To: "Mike Rapoport" <rppt@kernel.org>, "Jürgen Groß" <jgross@suse.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@alien8.de>,
Ingo Molnar <mingo@kernel.org>, Ingo Molnar <mingo@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/mm/pat: fix effective RW computation in lookup_address_in_pgd_attr()
Date: Thu, 16 Jul 2026 06:27:34 -0700 [thread overview]
Message-ID: <e3e14e3c-1b09-4f20-8087-0c2764d2eb92@intel.com> (raw)
In-Reply-To: <alih-NVItjfaiiuP@kernel.org>
On 7/16/26 02:18, Mike Rapoport wrote:
>> I don't really care how the issue is fixed, but this would result in less
>> code.
> But it will be slower 🙂
What does "slower" mean here?
Does it matter in _practice_? Does it measurably slow down something an
end user might see?
Also, I thought we had tests for this gunk. But maybe we're only testing
the leaf entry permissions or something and not the upper-level
permissions. I guess we don't often muck with those so this is
relatively unlikely to have hidden real bugs.
BTW, my pre-coffee brain struggled with the changelog here:
but _PAGE_RW is bit 1 while *rw only ever holds 0 or 1, so the
Maybe it was a 0 vs. 1 bit thing, but it still took me way too long.
Could we do something like:
_PAGE_RW is 0x2. So consider the accumulation line:
rw &= pXd_flags(*pXd) & _PAGE_RW;
where rw=0x1 and the right side evaluates down to 0x2. It'll end up doing:
rw = 0x1 & 0x2
and rw always ends up 0.
next prev parent reply other threads:[~2026-07-16 13:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 8:10 Mike Rapoport (Microsoft)
2026-07-16 8:37 ` Jürgen Groß
2026-07-16 8:46 ` Juergen Gross
2026-07-16 9:18 ` Mike Rapoport
2026-07-16 12:35 ` David Laight
2026-07-16 12:46 ` Juergen Gross
2026-07-16 12:49 ` David Laight
2026-07-16 12:55 ` Jürgen Groß
2026-07-16 13:27 ` Dave Hansen [this message]
2026-07-16 13:44 ` Mike Rapoport
2026-07-16 13:50 ` Dave Hansen
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=e3e14e3c-1b09-4f20-8087-0c2764d2eb92@intel.com \
--to=dave.hansen@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rppt@kernel.org \
--cc=tglx@kernel.org \
--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
all inboxes | Powered by JetHome®