Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-09 Thread David Hildenbrand
On 09.04.21 16:12, Kirill A. Shutemov wrote: On Fri, Apr 09, 2021 at 03:50:42PM +0200, David Hildenbrand wrote: 3. Allow selected users to still grab the pages (esp. KVM to fault them into the page tables). As long as fault leads to non-present PTEs we are fine. Usespace still may want to mloc

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-09 Thread Kirill A. Shutemov
On Fri, Apr 09, 2021 at 03:50:42PM +0200, David Hildenbrand wrote: > > > 3. Allow selected users to still grab the pages (esp. KVM to fault them > > > into > > > the page tables). > > > > As long as fault leads to non-present PTEs we are fine. Usespace still may > > want to mlock() some of guest

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-09 Thread David Hildenbrand
It looks quite hacky (well, what did I expect from an RFC :) ) you can no longer distinguish actually poisoned pages from "temporarily poisoned" pages. FOLL_ALLOW_POISONED sounds especially nasty and dangerous - "I want to read/write a poisoned page, trust me, I know what I am doing". Storing th

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-09 Thread Kirill A. Shutemov
On Wed, Apr 07, 2021 at 04:55:54PM +0200, David Hildenbrand wrote: > On 02.04.21 17:26, Kirill A. Shutemov wrote: > > TDX architecture aims to provide resiliency against confidentiality and > > integrity attacks. Towards this goal, the TDX architecture helps enforce > > the enabling of memory integ

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-07 Thread Andi Kleen
David Hildenbrand writes: > I have no idea how expensive would be bouncing writes (and reads?) > through the kernel. Did you ever experiment with that/evaluate that? I would expect it to be quite expensive, as in virtio IO performance tanking. -Andi

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-07 Thread David Hildenbrand
On 02.04.21 17:26, Kirill A. Shutemov wrote: TDX architecture aims to provide resiliency against confidentiality and integrity attacks. Towards this goal, the TDX architecture helps enforce the enabling of memory integrity for all TD-private memory. The CPU memory controller computes the integri

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-07 Thread Kirill A. Shutemov
On Wed, Apr 07, 2021 at 04:09:35PM +0200, David Hildenbrand wrote: > On 07.04.21 15:16, Kirill A. Shutemov wrote: > > On Tue, Apr 06, 2021 at 04:57:46PM +0200, David Hildenbrand wrote: > > > On 06.04.21 16:33, Dave Hansen wrote: > > > > On 4/6/21 12:44 AM, David Hildenbrand wrote: > > > > > On 02.0

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-07 Thread David Hildenbrand
On 07.04.21 15:16, Kirill A. Shutemov wrote: On Tue, Apr 06, 2021 at 04:57:46PM +0200, David Hildenbrand wrote: On 06.04.21 16:33, Dave Hansen wrote: On 4/6/21 12:44 AM, David Hildenbrand wrote: On 02.04.21 17:26, Kirill A. Shutemov wrote: TDX architecture aims to provide resiliency against c

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-07 Thread Andi Kleen
Christophe de Dinechin writes: > Is there even a theoretical way to restore an encrypted page e.g. from (host) > swap without breaking the integrity check? Or will that only be possible with > assistance from within the encrypted enclave? Only the later. You would need balloning. It's in princi

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-07 Thread Christophe de Dinechin
> On 7 Apr 2021, at 15:16, Kirill A. Shutemov wrote: > > On Tue, Apr 06, 2021 at 04:57:46PM +0200, David Hildenbrand wrote: >> On 06.04.21 16:33, Dave Hansen wrote: >>> On 4/6/21 12:44 AM, David Hildenbrand wrote: On 02.04.21 17:26, Kirill A. Shutemov wrote: > TDX architecture aims to

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-07 Thread Kirill A. Shutemov
On Tue, Apr 06, 2021 at 04:57:46PM +0200, David Hildenbrand wrote: > On 06.04.21 16:33, Dave Hansen wrote: > > On 4/6/21 12:44 AM, David Hildenbrand wrote: > > > On 02.04.21 17:26, Kirill A. Shutemov wrote: > > > > TDX architecture aims to provide resiliency against confidentiality and > > > > inte

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-06 Thread Tom Lendacky
On 4/6/21 9:33 AM, Dave Hansen wrote: > On 4/6/21 12:44 AM, David Hildenbrand wrote: >> On 02.04.21 17:26, Kirill A. Shutemov wrote: >>> TDX architecture aims to provide resiliency against confidentiality and >>> integrity attacks. Towards this goal, the TDX architecture helps enforce >>> the enabl

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-06 Thread David Hildenbrand
On 06.04.21 16:33, Dave Hansen wrote: On 4/6/21 12:44 AM, David Hildenbrand wrote: On 02.04.21 17:26, Kirill A. Shutemov wrote: TDX architecture aims to provide resiliency against confidentiality and integrity attacks. Towards this goal, the TDX architecture helps enforce the enabling of memory

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-06 Thread Dave Hansen
On 4/6/21 12:44 AM, David Hildenbrand wrote: > On 02.04.21 17:26, Kirill A. Shutemov wrote: >> TDX architecture aims to provide resiliency against confidentiality and >> integrity attacks. Towards this goal, the TDX architecture helps enforce >> the enabling of memory integrity for all TD-private m

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-06 Thread Kirill A. Shutemov
On Tue, Apr 06, 2021 at 09:44:07AM +0200, David Hildenbrand wrote: > On 02.04.21 17:26, Kirill A. Shutemov wrote: > > TDX architecture aims to provide resiliency against confidentiality and > > integrity attacks. Towards this goal, the TDX architecture helps enforce > > the enabling of memory integ

Re: [RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-06 Thread David Hildenbrand
On 02.04.21 17:26, Kirill A. Shutemov wrote: TDX architecture aims to provide resiliency against confidentiality and integrity attacks. Towards this goal, the TDX architecture helps enforce the enabling of memory integrity for all TD-private memory. The CPU memory controller computes the integri

[RFCv1 7/7] KVM: unmap guest memory using poisoned pages

2021-04-02 Thread Kirill A. Shutemov
TDX architecture aims to provide resiliency against confidentiality and integrity attacks. Towards this goal, the TDX architecture helps enforce the enabling of memory integrity for all TD-private memory. The CPU memory controller computes the integrity check value (MAC) for the data (cache line)