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] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <SA1PR12MB7199144BBDA23C9A06DA12F9B046A@SA1PR12MB7199.namprd12.prod.outlook.com>
Date: Mon, 30 Jun 2025 01:56:43 +0000
From: Ankit Agrawal <ankita@...dia.com>
To: Will Deacon <will@...nel.org>
CC: Jason Gunthorpe <jgg@...dia.com>, "maz@...nel.org" <maz@...nel.org>,
	"oliver.upton@...ux.dev" <oliver.upton@...ux.dev>, "joey.gouly@....com"
	<joey.gouly@....com>, "suzuki.poulose@....com" <suzuki.poulose@....com>,
	"yuzenghui@...wei.com" <yuzenghui@...wei.com>, "catalin.marinas@....com"
	<catalin.marinas@....com>, "ryan.roberts@....com" <ryan.roberts@....com>,
	"shahuang@...hat.com" <shahuang@...hat.com>, "lpieralisi@...nel.org"
	<lpieralisi@...nel.org>, "david@...hat.com" <david@...hat.com>,
	"ddutile@...hat.com" <ddutile@...hat.com>, "seanjc@...gle.com"
	<seanjc@...gle.com>, Aniket Agashe <aniketa@...dia.com>, Neo Jia
	<cjia@...dia.com>, Kirti Wankhede <kwankhede@...dia.com>, Krishnakant Jaju
	<kjaju@...dia.com>, "Tarun Gupta (SW-GPU)" <targupta@...dia.com>, Vikram
 Sethi <vsethi@...dia.com>, Andy Currid <acurrid@...dia.com>, Alistair Popple
	<apopple@...dia.com>, John Hubbard <jhubbard@...dia.com>, Dan Williams
	<danw@...dia.com>, Zhi Wang <zhiw@...dia.com>, Matt Ochs <mochs@...dia.com>,
	Uday Dhoke <udhoke@...dia.com>, Dheeraj Nigam <dnigam@...dia.com>,
	"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
	"sebastianene@...gle.com" <sebastianene@...gle.com>, "coltonlewis@...gle.com"
	<coltonlewis@...gle.com>, "kevin.tian@...el.com" <kevin.tian@...el.com>,
	"yi.l.liu@...el.com" <yi.l.liu@...el.com>, "ardb@...nel.org"
	<ardb@...nel.org>, "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"gshan@...hat.com" <gshan@...hat.com>, "linux-mm@...ck.org"
	<linux-mm@...ck.org>, "tabba@...gle.com" <tabba@...gle.com>,
	"qperret@...gle.com" <qperret@...gle.com>, "kvmarm@...ts.linux.dev"
	<kvmarm@...ts.linux.dev>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "maobibo@...ngson.cn"
	<maobibo@...ngson.cn>, "pbonzini@...hat.com" <pbonzini@...hat.com>
Subject: Re: [PATCH v9 3/6] KVM: arm64: Block cacheable PFNMAP mapping

> Sorry for the drive-by comment, but I was looking at this old series from
> Paolo (look at the cover letter and patch 5):
>
> https://lore.kernel.org/r/20250109133817.314401-1-pbonzini@redhat.com
>
> in which he points out that the arm64 get_vma_page_shift() function
> incorrectly assumes that a VM_PFNMAP VMA is physically contiguous, which
> may not be the case if a driver calls remap_pfn_range() to mess around
> with mappings within the VMA. I think that implies that the optimisation
> in 2aa53d68cee6 ("KVM: arm64: Try stage2 block mapping for host device
> MMIO") is unsound.

Hm yeah, that does seem problematic. Perhaps we need a new
vma flag that could help the driver communicate to the KVM that the
mapping is contiguous and it can go ahead with the optimization?
E.g. something similar to VM_ALLOW_ANY_UNCACHED.

> But it got me thinking -- given that remap_pfn_range() also takes a 'prot'
> argument, how do we ensure that this is reflected in the guest? It feels
> a bit dodgy to rely on drivers always passing 'vma->vm_page_prot'.
>
> Will

The driver use the vm_page_prot sent through the VMM VMA and may
update some flags. Is your question that if we can trust the driver doing
the right thing and properly map through remap_pfn_range so as to not
conflict with VMM (vma->vm_page_prot)?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ