Re: [PATCH v7] crypto: scompress: remove memcpy if sg_nents is 1 and pages are lowmem

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

 



On Mon, Mar 18, 2024 at 8:14 AM Guenter Roeck <linux@xxxxxxxxxxxx> wrote:
>
> On 3/17/24 16:48, Barry Song wrote:
> > On Mon, Mar 18, 2024 at 7:13 AM Guenter Roeck <linux@xxxxxxxxxxxx> wrote:
> >>
> >> Hi,
> >>
> >> On Sat, Mar 02, 2024 at 08:27:45AM +1300, Barry Song wrote:
> >> [ ... ]
> >>> @@ -152,8 +165,17 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
> >>>                        ret = -ENOSPC;
> >>>                        goto out;
> >>>                }
> >>> -             scatterwalk_map_and_copy(scratch->dst, req->dst, 0, req->dlen,
> >>> -                                      1);
> >>> +             if (dst == scratch->dst) {
> >>> +                     scatterwalk_map_and_copy(scratch->dst, req->dst, 0,
> >>> +                                              req->dlen, 1);
> >>> +             } else {
> >>> +                     int nr_pages = DIV_ROUND_UP(req->dst->offset + req->dlen, PAGE_SIZE);
> >>> +                     int i;
> >>> +                     struct page *dst_page = sg_page(req->dst);
> >>> +
> >>> +                     for (i = 0; i < nr_pages; i++)
> >>> +                             flush_dcache_page(dst_page + i);
> >>
> >> flush_dcache_page() is an empty macro on some architectures
> >> such as xtensa. This results in
> >
> > Hi Guenter,
> >
> > this is a bug of xtensa, could you test the patch:
>
> Thanks for the update.
>
> > https://lore.kernel.org/all/20240313045036.51065-1-21cnbao@xxxxxxxxx/
> >
>
> That doesn't build for me.
>
>    CC      arch/xtensa/kernel/asm-offsets.s
> In file included from ./include/linux/highmem.h:8,
>                   from ./include/linux/bvec.h:10,
>                   from ./include/linux/blk_types.h:10,
>                   from ./include/linux/writeback.h:13,
>                   from ./include/linux/memcontrol.h:23,
>                   from ./include/linux/swap.h:9,
>                   from ./include/linux/suspend.h:5,
>                   from arch/xtensa/kernel/asm-offsets.c:24:
> ./include/linux/cacheflush.h:9:5: error: "ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE" is not defined, evaluates to 0 [-Werror=undef]
>      9 | #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
>
> A similar works for loongarch, so I don't know what is wrong.
> Maybe some context patch is missing.

this is weird as include/asm-generic/cacheflush.h will define it to 0

 #ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
 static inline void flush_dcache_page(struct page *page)
 {
 }

 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
 #endif

Maybe somewhere else also needs to be fixed.
Can you tell me your toolchain version and toolchain name? and defconfig name?

>
> Guenter

Thanks
Barry





[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux