lkml.org 
[lkml]   [2022]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 1/4] x86/mm: Add a few comments
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
\
 
 \ /
  Last update: 2022-11-11 12:51    [W:0.083 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site