RE: Bogus struct page layout on 32-bit

2021-04-17 Thread David Laight
From: Grygorii Strashko > Sent: 16 April 2021 10:27 ... > Sry, for delayed reply. > > The TI platforms am3/4/5 (cpsw) and Keystone 2 (netcp) can do only 32bit DMA > even in case of LPAE > (dma-ranges are used). > Originally, as I remember, CONFIG_ARCH_DMA_ADDR_T_64BIT has not been selected >

Re: Bogus struct page layout on 32-bit

2021-04-16 Thread Arnd Bergmann
On Fri, Apr 16, 2021 at 11:27 AM 'Grygorii Strashko' via Clang Built Linux wrote: > On 10/04/2021 11:52, Ilias Apalodimas wrote: > > +CC Grygorii for the cpsw part as Ivan's email is not valid anymore > The TI platforms am3/4/5 (cpsw) and Keystone 2 (netcp) can do only 32bit DMA > even in case

Re: Bogus struct page layout on 32-bit

2021-04-16 Thread Grygorii Strashko
Hi Ilias, All, On 10/04/2021 11:52, Ilias Apalodimas wrote: +CC Grygorii for the cpsw part as Ivan's email is not valid anymore Thanks for catching this. Interesting indeed... On Sat, 10 Apr 2021 at 09:22, Jesper Dangaard Brouer wrote: On Sat, 10 Apr 2021 03:43:13 +0100 Matthew Wilcox

Re: Bogus struct page layout on 32-bit

2021-04-11 Thread Matthew Wilcox
On Sat, Apr 10, 2021 at 09:10:47PM +0200, Arnd Bergmann wrote: > On Sat, Apr 10, 2021 at 4:44 AM Matthew Wilcox wrote: > > + dma_addr_t dma_addr __packed; > > }; > > struct {/* slab, slob and slub */ > > union {

Re: Bogus struct page layout on 32-bit

2021-04-10 Thread Arnd Bergmann
On Sat, Apr 10, 2021 at 4:44 AM Matthew Wilcox wrote: > + dma_addr_t dma_addr __packed; > }; > struct {/* slab, slob and slub */ > union { > > but I don't know if GCC is smart enough to realise that dma_addr is

Re: Bogus struct page layout on 32-bit

2021-04-10 Thread Russell King - ARM Linux admin
On Sat, Apr 10, 2021 at 03:06:52PM +0100, Matthew Wilcox wrote: > How about moving the flags into the union? A bit messy, but we don't > have to play games with __packed__. Yes, that is probably the better solution, avoiding the games to try and get the union appropriately placed on 32-bit

RE: Bogus struct page layout on 32-bit

2021-04-10 Thread David Laight
From: Matthew Wilcox > Sent: 10 April 2021 03:43 > On Sat, Apr 10, 2021 at 06:45:35AM +0800, kernel test robot wrote: > > >> include/linux/mm_types.h:274:1: error: static_assert failed due to > > >> requirement > '__builtin_offsetof(struct page, lru) == __builtin_offsetof(struct folio, > lru)'

Re: Bogus struct page layout on 32-bit

2021-04-10 Thread Matthew Wilcox
How about moving the flags into the union? A bit messy, but we don't have to play games with __packed__. diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 1210a8e41fad..f374d2f06255 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -68,16 +68,22 @@

Re: Bogus struct page layout on 32-bit

2021-04-10 Thread Ilias Apalodimas
+CC Grygorii for the cpsw part as Ivan's email is not valid anymore Thanks for catching this. Interesting indeed... On Sat, 10 Apr 2021 at 09:22, Jesper Dangaard Brouer wrote: > > On Sat, 10 Apr 2021 03:43:13 +0100 > Matthew Wilcox wrote: > > > On Sat, Apr 10, 2021 at 06:45:35AM +0800, kernel

Re: Bogus struct page layout on 32-bit

2021-04-10 Thread Jesper Dangaard Brouer
On Sat, 10 Apr 2021 03:43:13 +0100 Matthew Wilcox wrote: > On Sat, Apr 10, 2021 at 06:45:35AM +0800, kernel test robot wrote: > > >> include/linux/mm_types.h:274:1: error: static_assert failed due to > > >> requirement '__builtin_offsetof(struct page, lru) == > > >> __builtin_offsetof(struct

Bogus struct page layout on 32-bit

2021-04-09 Thread Matthew Wilcox
On Sat, Apr 10, 2021 at 06:45:35AM +0800, kernel test robot wrote: > >> include/linux/mm_types.h:274:1: error: static_assert failed due to > >> requirement '__builtin_offsetof(struct page, lru) == > >> __builtin_offsetof(struct folio, lru)' "offsetof(struct page, lru) == > >> offsetof(struct