[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Xen 4.7.0 boot PANIC on kernel 4.7.0-4 + UEFI ?



>>> On 01.08.16 at 22:11, <lists@xxxxxxxxxxxx> wrote:
> On Fri, Jul 29, 2016, at 09:03 AM, Konrad Rzeszutek Wilk wrote:
>> It may very well be added.
>> 
>> But having extra test-confirmation is always good.
> 
> looking at the patch
> 
>       diff --git a/include/linux/efi.h b/include/linux/efi.h
>       index c2db3ca..f196dd0 100644
>       --- a/include/linux/efi.h
>       +++ b/include/linux/efi.h
>       @@ -1005,7 +1005,7 @@  extern int efi_memattr_apply_permissions(struct 
> mm_struct *mm,
>        /* Iterate through an efi_memory_map */
>        #define for_each_efi_memory_desc_in_map(m, md)                         
>    \
>               for ((md) = (m)->map;                                           
>    \
>       -            (md) <= (efi_memory_desc_t *)((m)->map_end - 
> (m)->desc_size); \
>       +            ((void *)(md) + (m)->desc_size) <= (m)->map_end;           
>    \
>                    (md) = (void *)(md) + (m)->desc_size)
> 
>        /**
> 
> and in the source used in the distro build
> 
>       wget 
> https://build.opensuse.org/source/Kernel:stable/kernel-default/linux-4.7.tar.
> xz?rev=88182fafc706b2366e0251692bd4b7e7
>       tar zxf linux-4.7.tar.xz
>       cd linux-4.7/include/linux/
>       edit efi.h
> 
> it looks like the patch is in there already
> 
>       1005    /* Iterate through an efi_memory_map */
>                       #define for_each_efi_memory_desc_in_map(m, md)          
>                    \
>                               for ((md) = (m)->map;                           
>                    \
>>>>                                 ((void *)(md) + (m)->desc_size) <= 
>>>> (m)->map_end;              \
>                                    (md) = (void *)(md) + (m)->desc_size)
> 
> even if it's not mentioned in the changelog.

Obviously it's not mentioned, as it's in the base tarball.

But said patch is likely insufficient for the Xen case: I suspect
efi.memmap.desc_size never gets set in this case, and hence
the <= above will always be true, despite md being NULL. Can
you try

                             ((void *)(md) + (m)->desc_size - 1) < 
(m)->map_end;                   \

instead? But in the end no memory map related function should
ever be called in the kernel in the first place when running under
Xen - one of the many weaknesses of the upstream pv-ops
approach: Problems like this need to be found actively instead of
getting detected at build time.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.