Andrey, I believe that on Xen we should disable kasan, would like confirmation from someone on xen-devel though. Here's the thing though -- if true -- I'd like to do it *properly*, where *properly* means addressing a bit of architecture. A simple Kconfig slap seems rather reactive. I'd like to address a way to properly ensure we don't run into this and other similar issues in the future. The CR4 shadow issue was another recent example issue, also introduced via v4.0 [0]. We can't keep doing this reactively. Let's go down the rabbit hole for a bit. HAVE_ARCH_KASAN will be selected on x86 when: if X86_64 && SPARSEMEM_VMEMMAP Now Xen should not have SPARSEMEM_VMEMMAP but PVOPs' goal is to enable distributions to be able to have a single binary kernels and let the rest be figured out, so we can't just disable SPARSEMEM_VMEMMAP for Xen alone, we want to build Xen.. or part of Xen and perhaps keep SPARSEMEM_VMEMMAP, and only later figure things out. How do we do this cleanly and avoid future reactive measures? If the answer is not upon us, I'd like to at least highlight the issue so that in case we do come up with something its no surprise PVOPs is falling short for that single binary pipe dream right now. [0] https://lkml.org/lkml/2015/2/23/328 Luis
On 03/03/15 09:40, Luis R. Rodriguez wrote:> Andrey, > > I believe that on Xen we should disable kasan, would like confirmationWhy? This is the first of heard of this.> from someone on xen-devel though. Here's the thing though -- if true > -- I'd like to do it *properly*, where *properly* means addressing a > bit of architecture. A simple Kconfig slap seems rather reactive. I'd > like to address a way to properly ensure we don't run into this and > other similar issues in the future. The CR4 shadow issue was another > recent example issue, also introduced via v4.0 [0]. We can't keep > doing this reactively. > > Let's go down the rabbit hole for a bit. HAVE_ARCH_KASAN will be > selected on x86 when: > > if X86_64 && SPARSEMEM_VMEMMAP > > Now Xen should not have SPARSEMEM_VMEMMAP but PVOPs' goal is to enableWhy? Again, this is the first I've heard of this as well. FWIW, all the Xen configs we use have SPARSEMEM_VMEMMAP enabled. David> distributions to be able to have a single binary kernels and let the > rest be figured out, so we can't just disable SPARSEMEM_VMEMMAP for > Xen alone, we want to build Xen.. or part of Xen and perhaps keep > SPARSEMEM_VMEMMAP, and only later figure things out. > > How do we do this cleanly and avoid future reactive measures? If the > answer is not upon us, I'd like to at least highlight the issue so > that in case we do come up with something its no surprise PVOPs is > falling short for that single binary pipe dream right now. > > [0] https://lkml.org/lkml/2015/2/23/328 > > Luis > > _______________________________________________ > Xen-devel mailing list > Xen-devel at lists.xen.org > http://lists.xen.org/xen-devel >
>>> On 03.03.15 at 10:40, <mcgrof at suse.com> wrote: > Let's go down the rabbit hole for a bit. HAVE_ARCH_KASAN will be > selected on x86 when: > > if X86_64 && SPARSEMEM_VMEMMAP > > Now Xen should not have SPARSEMEM_VMEMMAPWhy would that be? Jan
On 03/03/2015 12:40 PM, Luis R. Rodriguez wrote:> Andrey, > > I believe that on Xen we should disable kasan, would like confirmationI guess Xen guests won't work with kasan because Xen guests doesn't setup shadow (kasan_map_early_shadow() is not called in xen guests). Disabling kasan for Xen in Kconfig is undesirable because that will disable kasan for allmodconfig and allyesconfig builds, but I don't see other option for now.> from someone on xen-devel though. Here's the thing though -- if true > -- I'd like to do it *properly*, where *properly* means addressing a > bit of architecture. A simple Kconfig slap seems rather reactive. I'd > like to address a way to properly ensure we don't run into this and > other similar issues in the future. The CR4 shadow issue was another > recent example issue, also introduced via v4.0 [0]. We can't keep > doing this reactively. > > Let's go down the rabbit hole for a bit. HAVE_ARCH_KASAN will be > selected on x86 when: > > if X86_64 && SPARSEMEM_VMEMMAP > > Now Xen should not have SPARSEMEM_VMEMMAP but PVOPs' goal is to enable > distributions to be able to have a single binary kernels and let the > rest be figured out, so we can't just disable SPARSEMEM_VMEMMAP for > Xen alone, we want to build Xen.. or part of Xen and perhaps keep > SPARSEMEM_VMEMMAP, and only later figure things out. > > How do we do this cleanly and avoid future reactive measures? If the > answer is not upon us, I'd like to at least highlight the issue so > that in case we do come up with something its no surprise PVOPs is > falling short for that single binary pipe dream right now. > > [0] https://lkml.org/lkml/2015/2/23/328 > > Luis >
On Tue, Mar 03, 2015 at 04:15:06PM +0300, Andrey Ryabinin wrote:> On 03/03/2015 12:40 PM, Luis R. Rodriguez wrote: > > Andrey, > > > > I believe that on Xen we should disable kasan, would like confirmation > > I guess Xen guests won't work with kasan because Xen guests doesn't setup shadow > (kasan_map_early_shadow() is not called in xen guests). > > Disabling kasan for Xen in Kconfig is undesirable because that will disable kasan > for allmodconfig and allyesconfig builds, but I don't see other option for now.Was there an bug reported for this? It would be good to CC the maintainers of Xen on that sort of thing. Thanks! .. snip..> > [0] https://lkml.org/lkml/2015/2/23/328If you look at the other x86 pulls - you will see that the authors also missed enabling it on 32-bit kernels!> > > > Luis > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel at lists.xen.org > http://lists.xen.org/xen-devel
On Tue, Mar 3, 2015 at 2:06 AM, David Vrabel <david.vrabel at citrix.com> wrote:> On 03/03/15 09:40, Luis R. Rodriguez wrote: >> Andrey, >> >> I believe that on Xen we should disable kasan, would like confirmation > > Why? This is the first of heard of this.Andrey chimed in here confirming this.>> from someone on xen-devel though. Here's the thing though -- if true >> -- I'd like to do it *properly*, where *properly* means addressing a >> bit of architecture. A simple Kconfig slap seems rather reactive. I'd >> like to address a way to properly ensure we don't run into this and >> other similar issues in the future. The CR4 shadow issue was another >> recent example issue, also introduced via v4.0 [0]. We can't keep >> doing this reactively. >> >> Let's go down the rabbit hole for a bit. HAVE_ARCH_KASAN will be >> selected on x86 when: >> >> if X86_64 && SPARSEMEM_VMEMMAP >> >> Now Xen should not have SPARSEMEM_VMEMMAP but PVOPs' goal is to enable > > Why? Again, this is the first I've heard of this as well. FWIW, all > the Xen configs we use have SPARSEMEM_VMEMMAP enabled.Interesting... we have config ARCH_SPARSEMEM_ENABLE depend on !XEN at SUSE. Figured this was a generic issue. The SUSE kernels are based on 3.12 though, but anyway with it enabled I do get compile failures because of redefinition of MAX_PHYSMEM_BITS which we provide on Xen set to 43 for some reason (can't find that justification), so it doesn't use the default 46 that would be used otherwise. But another reason seems to be the lack of forward porting yet PAT support for PV domains -- commit 47591df50 upstream which requires us to still have the union on the pte_t, and I suppose we need ca15f20f as well... If there is nothing else I suppose this just requires fixing up at SUSE's end for SPARSEMEM_VMEMMAP... --- ./arch/x86/include/asm/pgtable_64_types.h 2015-03-02 13:35:49.885257763 -0800 +++ ./arch/x86/include/mach-xen/asm/pgtable_64_types.h 2015-03-02 13:36:25.554259348 -0800 @@ -15,7 +15,7 @@ typedef unsigned long pgdval_t; typedef unsigned long pgprotval_t; -typedef struct { pteval_t pte; } pte_t; +typedef union { pteval_t pte; unsigned int pte_low; } pte_t; #endif /* !__ASSEMBLY__ */ @@ -54,6 +54,7 @@ #define PGDIR_MASK (~(PGDIR_SIZE - 1)) /* See Documentation/x86/x86_64/mm.txt for a description of the memory map. */ +#define MAX_PHYSMEM_BITS 43 #define MAXMEM _AC(__AC(1, UL) << MAX_PHYSMEM_BITS, UL) #define VMALLOC_START _AC(0xffffc90000000000, UL) #define VMALLOC_END _AC(0xffffe8ffffffffff, UL) Luis