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: <20250710175858.GB1870174@ziepe.ca>
Date: Thu, 10 Jul 2025 14:58:58 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Alexey Kardashevskiy <aik@....com>
Cc: Vishal Annapurve <vannapurve@...gle.com>, Fuad Tabba <tabba@...gle.com>,
	Ackerley Tng <ackerleytng@...gle.com>, kvm@...r.kernel.org,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org, x86@...nel.org,
	linux-fsdevel@...r.kernel.org, ajones@...tanamicro.com,
	akpm@...ux-foundation.org, amoorthy@...gle.com,
	anthony.yznaga@...cle.com, anup@...infault.org,
	aou@...s.berkeley.edu, bfoster@...hat.com,
	binbin.wu@...ux.intel.com, brauner@...nel.org,
	catalin.marinas@....com, chao.p.peng@...el.com,
	chenhuacai@...nel.org, dave.hansen@...el.com, david@...hat.com,
	dmatlack@...gle.com, dwmw@...zon.co.uk, erdemaktas@...gle.com,
	fan.du@...el.com, fvdl@...gle.com, graf@...zon.com,
	haibo1.xu@...el.com, hch@...radead.org, hughd@...gle.com,
	ira.weiny@...el.com, isaku.yamahata@...el.com, jack@...e.cz,
	james.morse@....com, jarkko@...nel.org, jgowans@...zon.com,
	jhubbard@...dia.com, jroedel@...e.de, jthoughton@...gle.com,
	jun.miao@...el.com, kai.huang@...el.com, keirf@...gle.com,
	kent.overstreet@...ux.dev, kirill.shutemov@...el.com,
	liam.merwick@...cle.com, maciej.wieczor-retman@...el.com,
	mail@...iej.szmigiero.name, maz@...nel.org, mic@...ikod.net,
	michael.roth@....com, mpe@...erman.id.au, muchun.song@...ux.dev,
	nikunj@....com, nsaenz@...zon.es, oliver.upton@...ux.dev,
	palmer@...belt.com, pankaj.gupta@....com, paul.walmsley@...ive.com,
	pbonzini@...hat.com, pdurrant@...zon.co.uk, peterx@...hat.com,
	pgonda@...gle.com, pvorel@...e.cz, qperret@...gle.com,
	quic_cvanscha@...cinc.com, quic_eberman@...cinc.com,
	quic_mnalajal@...cinc.com, quic_pderrin@...cinc.com,
	quic_pheragu@...cinc.com, quic_svaddagi@...cinc.com,
	quic_tsoni@...cinc.com, richard.weiyang@...il.com,
	rick.p.edgecombe@...el.com, rientjes@...gle.com,
	roypat@...zon.co.uk, rppt@...nel.org, seanjc@...gle.com,
	shuah@...nel.org, steven.price@....com, steven.sistare@...cle.com,
	suzuki.poulose@....com, thomas.lendacky@....com,
	usama.arif@...edance.com, vbabka@...e.cz, viro@...iv.linux.org.uk,
	vkuznets@...hat.com, wei.w.wang@...el.com, will@...nel.org,
	willy@...radead.org, xiaoyao.li@...el.com, yan.y.zhao@...el.com,
	yilun.xu@...el.com, yuzenghui@...wei.com, zhiquan1.li@...el.com
Subject: Re: [RFC PATCH v2 04/51] KVM: guest_memfd: Introduce
 KVM_GMEM_CONVERT_SHARED/PRIVATE ioctls

On Thu, Jul 10, 2025 at 04:57:25PM +1000, Alexey Kardashevskiy wrote:

> Currently I handle this from the KVM with a hack to get IOPDE from
> AMD IOMMU so both 2MB RMP entry and IOPDE entries are smashed in one
> go in one of many firmwares running on EPYC, and atm this is too
> hacky to be posted even as an RFC. This likely needs to move to
> IOMMUFD then (via some callbacks) which could call AMD IOMMU which
> then would call that firmware (called "TMPM" and it is not the PSP
> which is "TSM), probably. Thanks,

Wasn't the issue with the iommu that it needed to have a PTE break
whenever the shared/private changed in the RMP? Because the HW can't
handle an IOPTE that crosses more than one RMP entry? Or do I
misunderstand the problem?

If this is the problem I was expecting the page table code that
translates the guest memfd into the iommu PTEs would respect the
shared/private conversion boundaries and break up the PTEs
automatically.

I had thought there were three versions of of how to copy from guest
memfd into the IOPTEs:
 - HW must never have a private physaddr in an IOPTE
 - HW must have IOPTEs entirely private or shared
 - HW handles everything and IOPTEs should be maximally sized

Is this right? Is AMD #2?

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ