[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <76cf8b94-6f71-9f8c-0fc9-07ad4aded3be@citrix.com>
Date: Fri, 10 Jan 2020 11:46:45 +0000
From: Sergey Dyasli <sergey.dyasli@...rix.com>
To: Boris Ostrovsky <boris.ostrovsky@...cle.com>,
<xen-devel@...ts.xen.org>, <kasan-dev@...glegroups.com>,
<linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
CC: Andrey Ryabinin <aryabinin@...tuozzo.com>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Juergen Gross <jgross@...e.com>,
Stefano Stabellini <sstabellini@...nel.org>,
George Dunlap <george.dunlap@...rix.com>,
Ross Lagerwall <ross.lagerwall@...rix.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"sergey.dyasli@...rix.com >> Sergey Dyasli"
<sergey.dyasli@...rix.com>
Subject: Re: [PATCH v1 2/4] x86/xen: add basic KASAN support for PV kernel
On 09/01/2020 23:27, Boris Ostrovsky wrote:
>
>
> On 1/8/20 10:20 AM, Sergey Dyasli wrote:
>> @@ -1943,6 +1973,15 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
>> if (i && i < pgd_index(__START_KERNEL_map))
>> init_top_pgt[i] = ((pgd_t *)xen_start_info->pt_base)[i];
>> +#ifdef CONFIG_KASAN
>> + /*
>> + * Copy KASAN mappings
>> + * ffffec0000000000 - fffffbffffffffff (=44 bits) kasan shadow memory (16TB)
>> + */
>> + for (i = 0xec0 >> 3; i < 0xfc0 >> 3; i++)
>
> Are you referring here to KASAN_SHADOW_START and KASAN_SHADOW_END? If so, can you use them instead?
Indeed, the following macros make the code neater:
#ifdef CONFIG_KASAN
/* Copy KASAN mappings */
for (i = pgd_index(KASAN_SHADOW_START);
i < pgd_index(KASAN_SHADOW_END);
i++)
init_top_pgt[i] = ((pgd_t *)xen_start_info->pt_base)[i];
#endif /* ifdef CONFIG_KASAN */
--
Thanks,
Sergey
Powered by blists - more mailing lists