On Tue, Mar 24, 2026 at 11:16 PM Michael S. Tsirkin <[email protected]> wrote: > > receive_buf() reads the virtio header through buf before > page_pool_dma_sync_for_cpu() runs in receive_small() or > receive_mergeable(). The header buffer is thus unsynchronized at the > point where flags and, for mergeable buffers, num_buffers are consumed. > > Omar Elghoul reported that on s390x Secure Execution this showed up as > greatly reduced virtio-net performance together with "bad gso" and > "bad csum" messages in dmesg. This is because with SE sync actually > copies data, so the header is uninitialized. > > Move the sync into receive_buf() so the > header is synchronized before any access through buf. > > Tool use: Cursor with GPT-5.4 drafted the initial code move from prompt: > "in drivers/net/virtio_net.c, move page_pool_dma_sync_for_cpu on receive > path to before memory is accessed through buf". > The result and the commit log were reviewed and edited manually. > > Fixes: 168b61da6871 ("virtio_net: add page_pool support for buffer > allocation") > Reported-by: Omar Elghoul <[email protected]> > Tested-by: Srikanth Aithal <[email protected]> > Tested-by: Omar Elghoul <[email protected]> > Link: https://lore.kernel.org/r/[email protected] > Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]> Thanks

