* [PATCH net-next ] vdpa: fix caching attributes of MMIO regions by setting them explicitly
@ 2025-12-16 17:59 Kommula Shiva Shankar
2025-12-17 1:22 ` Jason Wang
2025-12-19 9:06 ` Paolo Abeni
0 siblings, 2 replies; 3+ messages in thread
From: Kommula Shiva Shankar @ 2025-12-16 17:59 UTC (permalink / raw)
To: netdev, mst, jasowang
Cc: virtualization, eperezma, kvm, jerinj, ndabilpuram, schalla
Explicitly set non-cached caching attributes for MMIO regions.
Default write-back mode can cause CPU to cache device memory,
causing invalid reads and unpredictable behavior.
Invalid read and write issues were observed on ARM64 when mapping the
notification area to userspace via mmap.
Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
---
drivers/vhost/vdpa.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index 05a481e4c385..b0179e8567ab 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -1527,6 +1527,7 @@ static int vhost_vdpa_mmap(struct file *file, struct vm_area_struct *vma)
if (vma->vm_end - vma->vm_start != notify.size)
return -ENOTSUPP;
+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
vm_flags_set(vma, VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP);
vma->vm_ops = &vhost_vdpa_vm_ops;
return 0;
--
2.48.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next ] vdpa: fix caching attributes of MMIO regions by setting them explicitly
2025-12-16 17:59 [PATCH net-next ] vdpa: fix caching attributes of MMIO regions by setting them explicitly Kommula Shiva Shankar
@ 2025-12-17 1:22 ` Jason Wang
2025-12-19 9:06 ` Paolo Abeni
1 sibling, 0 replies; 3+ messages in thread
From: Jason Wang @ 2025-12-17 1:22 UTC (permalink / raw)
To: Kommula Shiva Shankar
Cc: netdev, mst, virtualization, eperezma, kvm, jerinj, ndabilpuram,
schalla
On Wed, Dec 17, 2025 at 1:59 AM Kommula Shiva Shankar
<kshankar@marvell.com> wrote:
>
> Explicitly set non-cached caching attributes for MMIO regions.
> Default write-back mode can cause CPU to cache device memory,
> causing invalid reads and unpredictable behavior.
>
> Invalid read and write issues were observed on ARM64 when mapping the
> notification area to userspace via mmap.
>
> Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
> ---
Acked-by: Jason Wang <jasowang@redhat.com>
Btw, I think this should go with Michael's vhost tree.
Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next ] vdpa: fix caching attributes of MMIO regions by setting them explicitly
2025-12-16 17:59 [PATCH net-next ] vdpa: fix caching attributes of MMIO regions by setting them explicitly Kommula Shiva Shankar
2025-12-17 1:22 ` Jason Wang
@ 2025-12-19 9:06 ` Paolo Abeni
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Abeni @ 2025-12-19 9:06 UTC (permalink / raw)
To: mst
Cc: virtualization, eperezma, kvm, jerinj, ndabilpuram, schalla,
Kommula Shiva Shankar, netdev, jasowang
On 12/16/25 6:59 PM, Kommula Shiva Shankar wrote:
> Explicitly set non-cached caching attributes for MMIO regions.
> Default write-back mode can cause CPU to cache device memory,
> causing invalid reads and unpredictable behavior.
>
> Invalid read and write issues were observed on ARM64 when mapping the
> notification area to userspace via mmap.
>
> Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
@Micheal: despite the net-next prefix, I assume this patch will go via
your tree, as it looks unrelated from networking.
Cheers,
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-19 9:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-16 17:59 [PATCH net-next ] vdpa: fix caching attributes of MMIO regions by setting them explicitly Kommula Shiva Shankar
2025-12-17 1:22 ` Jason Wang
2025-12-19 9:06 ` Paolo Abeni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).