mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: x86@kernel.org, dave.hansen@intel.com,
	linux-kernel@vger.kernel.org, oliver.sang@intel.com
Subject: Re: [PATCH 1/4] x86/mm: Add a few comments
Date: Fri, 11 Nov 2022 12:50:47 +0100	[thread overview]
Message-ID: <Y243F+zR58pO0vCE@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <Y208t7Lw9n+3CNz3@hirez.programming.kicks-ass.net>

On Thu, Nov 10, 2022 at 07:02:31PM +0100, Peter Zijlstra wrote:

> > Do we need any of those alias passes at all for pure protection bit
> > changes? I thought we only did these because things like cacheability
> > bits have to be in sync due to machine checks etc?
> > 
> > Or am I missing some case where writability matters too?
> 
> I _think_, but I'm not actually sure, that it matters in exactly that
> case dhansen mentions, where we do a physical to virtual address
> translation and expect access to match whatever alias we originally came
> from.

That of course only covers the directmap; for giggles I did the below
patch on top of these and the testcase at hand boots and finishes just
fine...

So yeah, no sodding clue why we do that :/

diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c
index f275605892df..c63e6117221a 100644
--- a/arch/x86/mm/pat/set_memory.c
+++ b/arch/x86/mm/pat/set_memory.c
@@ -1656,7 +1676,7 @@ static int cpa_process_alias(struct cpa_data *cpa)
 			return ret;
 	}
 
-#ifdef CONFIG_X86_64
+#if 0 // def CONFIG_X86_64
 	/*
 	 * If the primary call didn't touch the high mapping already
 	 * and the physical address is inside the kernel map, we need


  reply	other threads:[~2022-11-11 11:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10 12:52 [PATCH 0/4] x86/mm: Fix set_memory_rox() Peter Zijlstra
2022-11-10 12:52 ` [PATCH 1/4] x86/mm: Add a few comments Peter Zijlstra
2022-11-10 16:22   ` Linus Torvalds
2022-11-10 18:02     ` Peter Zijlstra
2022-11-11 11:50       ` Peter Zijlstra [this message]
2022-11-10 12:52 ` [PATCH 2/4] x86/mm: Untangle __change_page_attr_set_clr(.checkalias) Peter Zijlstra
2022-11-10 12:52 ` [PATCH 3/4] x86/mm: Inhibit _PAGE_NX changes from cpa_process_alias() Peter Zijlstra
2022-11-14 16:08   ` Dave Hansen
2022-11-10 12:52 ` [PATCH 4/4] x86/mm: Rename __change_page_attr_set_clr(.checkalias) Peter Zijlstra

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=Y243F+zR58pO0vCE@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=dave.hansen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver.sang@intel.com \
    --cc=torvalds@linux-foundation.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®