lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260113172548.GH812923@nvidia.com>
Date: Tue, 13 Jan 2026 13:25:48 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: Kommula Shiva Shankar <kshankar@...vell.com>, jasowang@...hat.com,
	virtualization@...ts.linux.dev, eperezma@...hat.com,
	kvm@...r.kernel.org, netdev@...r.kernel.org, jerinj@...vell.com,
	ndabilpuram@...vell.com, schalla@...vell.com, dtatulea@...dia.com
Subject: Re: [PATCH] vhost: fix caching attributes of MMIO regions by setting
 them explicitly

On Tue, Jan 13, 2026 at 02:30:13AM -0500, Michael S. Tsirkin wrote:
> > Signed-off-by: Kommula Shiva Shankar <kshankar@...vell.com>
> > Acked-by: Jason Wang <jasowang@...hat.com>
> 
> I also worry a bit about regressing on other hardware.
> Cc nvidia guys.

> > +	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
> >  	vm_flags_set(vma, VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP);

This is definitely required and correct if notify.addr comes from a
PCI BAR address.

You need to trace the origin of that memory in all the drivers to
determine if it is OK or not.

For instance mlx5 is:

	kick_addr = mdev->bar_addr + offset;
	res->phys_kick_addr = kick_addr;
[..]
	addr = (phys_addr_t)ndev->mvdev.res.phys_kick_addr;

"bar_addr" is PCI memory so this patch is correct and required for
mlx5.

ifcvf:
                        hw->notify_base_pa = pci_resource_start(pdev, cap.bar) +
                                        le32_to_cpu(cap.offset);
[..]
                hw->vring[i].notify_pa = hw->notify_base_pa +
                        notify_off * hw->notify_off_multiplier;
[..]
	area.addr = vf->vring[idx].notify_pa;

octep:

                        oct_hw->notify_base_pa = pci_resource_start(pdev, cap.bar) +
                                                 le32_to_cpu(cap.offset);
[..]
                oct_hw->vqs[i].notify_pa = oct_hw->notify_base_pa +
                        notify_off * oct_hw->notify_off_multiplier;
[..]
	area.addr = oct_hw->vqs[idx].notify_pa;

pds:
 No idea, it is messed up though:
	area.addr = pdsv->vqs[qid].notify_pa;
    struct pds_vdpa_vq_info {
	dma_addr_t notify_pa;
 Can't cast dma_addr_t to phys_addr_t!

virtio_pci:
 Also messed up:
  	notify.addr = vp_vdpa->vring[qid].notify_pa;
    struct vp_vring {
	resource_size_t notify_pa;
 phys_addr is not a resource_size_t

Guessing pds and virtio_pci are also both fine, even if I gave up trying to
figure out where notify_pa gets set from in the end.

So the patch is OK

Reviewed-by: Jason Gunthorpe <jgg@...dia.com>

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ