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]
Date: Wed, 15 May 2024 20:32:50 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "seanjc@...gle.com" <seanjc@...gle.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"sagis@...gle.com" <sagis@...gle.com>, "isaku.yamahata@...il.com"
	<isaku.yamahata@...il.com>, "Aktas, Erdem" <erdemaktas@...gle.com>, "Zhao,
 Yan Y" <yan.y.zhao@...el.com>, "pbonzini@...hat.com" <pbonzini@...hat.com>,
	"kvm@...r.kernel.org" <kvm@...r.kernel.org>, "dmatlack@...gle.com"
	<dmatlack@...gle.com>
Subject: Re: [PATCH 08/16] KVM: x86/mmu: Bug the VM if kvm_zap_gfn_range() is
 called for TDX

On Wed, 2024-05-15 at 12:48 -0700, Sean Christopherson wrote:
> > It's just another little quirk in an already complicated solution. They
> > third
> > thing we discussed was somehow rejecting or not supporting non-coherent DMA.
> > This seemed simpler than that.
> 
> Again, huh?  This has _nothing_ to do with non-coherent DMA.  Devices can't
> DMA
> into TDX private memory.

Hmm... I'm confused how you are confused... :)

For normal VMs (after that change you linked), guests will honor guest PAT on
newer HW. On older HW it will only honor guest PAT if non-coherent DMA is
attached.

For TDX we can't honor guest PAT for private memory. So we can either have:
1. Have shared honor PAT and private not.
2. Have private and shared both not honor PAT and be consistent. Unless non-
coherent DMA is attached. In that case KVM could zap shared only and switch to
1.

The only benefit of 2 is that in normal conditions the guest will have
consistent cache behavior between private and shared.

FWIW, there was at one time a use for private uncacheable memory proposed. It
was for keeping non-performance sensitive secret data protected from speculative
access. (not for TDX, a general kernel thing). This isn't a real thing today,
but it's an example of how the private/shared split is quirky, when you ask "do
TDs support PAT?".

1 is a little quirky, but 2 is too complex and also quirky. 1 is the best
option.


If it's obvious we can trim down the log. There was a bit of hand wringing on
this one, so seemed relevant to discussion. The other point was to describe why
we don't need to support kvm_zap_gfn_range(). I think that point is worth
review. The KVM_BUG_ON() is not super critical so we could even drop the patch
if its all settled.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ