[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <896ea559-8fe5-9b2a-e763-407fae55cc01@intel.com>
Date: Tue, 24 Jul 2018 08:46:06 -0700
From: Dave Jiang <dave.jiang@...el.com>
To: Ingo Molnar <mingo@...nel.org>,
Dan Williams <dan.j.williams@...el.com>
Cc: Tony Luck <tony.luck@...el.com>, linux-nvdimm@...ts.01.org,
x86@...nel.org, linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, linux-fsdevel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>, hch@....de,
linux-edac@...r.kernel.org
Subject: Re: [PATCH v6 11/13] x86/mm/pat: Prepare {reserve, free}_memtype()
for "decoy" addresses
On 07/24/2018 12:36 AM, Ingo Molnar wrote:
>
> * Dan Williams <dan.j.williams@...el.com> wrote:
>
>> In preparation for using set_memory_uc() instead set_memory_np() for
>> isolating poison from speculation, teach the memtype code to sanitize
>> physical addresses vs __PHYSICAL_MASK.
>>
>> The motivation for using set_memory_uc() for this case is to allow
>> ongoing access to persistent memory pages via the pmem-driver +
>> memcpy_mcsafe() until the poison is repaired.
>>
>> Cc: Thomas Gleixner <tglx@...utronix.de>
>> Cc: Ingo Molnar <mingo@...hat.com>
>> Cc: "H. Peter Anvin" <hpa@...or.com>
>> Cc: Tony Luck <tony.luck@...el.com>
>> Cc: Borislav Petkov <bp@...en8.de>
>> Cc: <linux-edac@...r.kernel.org>
>> Cc: <x86@...nel.org>
>> Signed-off-by: Dan Williams <dan.j.williams@...el.com>
>> ---
>> arch/x86/mm/pat.c | 16 ++++++++++++++++
>> 1 file changed, 16 insertions(+)
>>
>> diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
>> index 1555bd7d3449..6788ffa990f8 100644
>> --- a/arch/x86/mm/pat.c
>> +++ b/arch/x86/mm/pat.c
>> @@ -512,6 +512,17 @@ static int free_ram_pages_type(u64 start, u64 end)
>> return 0;
>> }
>>
>> +static u64 sanitize_phys(u64 address)
>> +{
>> + /*
>> + * When changing the memtype for pages containing poison allow
>> + * for a "decoy" virtual address (bit 63 clear) passed to
>> + * set_memory_X(). __pa() on a "decoy" address results in a
>> + * physical address with it 63 set.
>> + */
>> + return address & __PHYSICAL_MASK;
>
> s/it/bit
Thanks Ingo! I'll update when I pull in the patch.
>
> Thanks,
>
> Ingo
> _______________________________________________
> Linux-nvdimm mailing list
> Linux-nvdimm@...ts.01.org
> https://lists.01.org/mailman/listinfo/linux-nvdimm
>
Powered by blists - more mailing lists