Re: [RFC Part1 PATCH 06/13] x86/compressed: rescinds and validate the memory used for the GHCB

2021-04-08 Thread Tom Lendacky
On 4/7/21 2:45 PM, Borislav Petkov wrote: > On Wed, Apr 07, 2021 at 01:25:55PM +0200, Borislav Petkov wrote: >> On Tue, Apr 06, 2021 at 02:42:43PM -0500, Tom Lendacky wrote: >>> The GHCB spec only defines the "0" reason code set. We could provide Linux >>> it's own reason code set with some more

Re: [RFC Part1 PATCH 06/13] x86/compressed: rescinds and validate the memory used for the GHCB

2021-04-07 Thread Borislav Petkov
On Wed, Apr 07, 2021 at 01:25:55PM +0200, Borislav Petkov wrote: > On Tue, Apr 06, 2021 at 02:42:43PM -0500, Tom Lendacky wrote: > > The GHCB spec only defines the "0" reason code set. We could provide Linux > > it's own reason code set with some more specific reason codes for > > failures, if

Re: [RFC Part1 PATCH 06/13] x86/compressed: rescinds and validate the memory used for the GHCB

2021-04-07 Thread Brijesh Singh
On 4/7/21 9:21 AM, Tom Lendacky wrote: > On 4/7/21 8:35 AM, Brijesh Singh wrote: >> On 4/7/21 6:16 AM, Borislav Petkov wrote: >>> On Tue, Apr 06, 2021 at 10:47:18AM -0500, Brijesh Singh wrote: Before the GHCB is established the caller does not need to save and restore MSRs. The

Re: [RFC Part1 PATCH 06/13] x86/compressed: rescinds and validate the memory used for the GHCB

2021-04-07 Thread Tom Lendacky
On 4/7/21 8:35 AM, Brijesh Singh wrote: > > On 4/7/21 6:16 AM, Borislav Petkov wrote: >> On Tue, Apr 06, 2021 at 10:47:18AM -0500, Brijesh Singh wrote: >>> Before the GHCB is established the caller does not need to save and >>> restore MSRs. The page_state_change() uses the GHCB MSR protocol and

Re: [RFC Part1 PATCH 06/13] x86/compressed: rescinds and validate the memory used for the GHCB

2021-04-07 Thread Brijesh Singh
On 4/7/21 6:16 AM, Borislav Petkov wrote: > On Tue, Apr 06, 2021 at 10:47:18AM -0500, Brijesh Singh wrote: >> Before the GHCB is established the caller does not need to save and >> restore MSRs. The page_state_change() uses the GHCB MSR protocol and it >> can be called before and after the GHCB

Re: [RFC Part1 PATCH 06/13] x86/compressed: rescinds and validate the memory used for the GHCB

2021-04-07 Thread Borislav Petkov
On Tue, Apr 06, 2021 at 02:42:43PM -0500, Tom Lendacky wrote: > The GHCB spec only defines the "0" reason code set. We could provide Linux > it's own reason code set with some more specific reason codes for > failures, if that is needed. Why Linux only? Don't we want to have a generalized set of

Re: [RFC Part1 PATCH 06/13] x86/compressed: rescinds and validate the memory used for the GHCB

2021-04-07 Thread Borislav Petkov
On Tue, Apr 06, 2021 at 10:47:18AM -0500, Brijesh Singh wrote: > Before the GHCB is established the caller does not need to save and > restore MSRs. The page_state_change() uses the GHCB MSR protocol and it > can be called before and after the GHCB is established hence I am saving > and restoring

Re: [RFC Part1 PATCH 06/13] x86/compressed: rescinds and validate the memory used for the GHCB

2021-04-06 Thread Tom Lendacky
On 4/6/21 10:47 AM, Brijesh Singh wrote: > > On 4/6/21 5:33 AM, Borislav Petkov wrote: >> On Wed, Mar 24, 2021 at 11:44:17AM -0500, Brijesh Singh wrote: >> ... >> *Any* and *all* page state changes which fail immediately terminate a >> guest? Why? > > > The hypervisor uses the RMPUPDATE

Re: [RFC Part1 PATCH 06/13] x86/compressed: rescinds and validate the memory used for the GHCB

2021-04-06 Thread Brijesh Singh
On 4/6/21 5:33 AM, Borislav Petkov wrote: > On Wed, Mar 24, 2021 at 11:44:17AM -0500, Brijesh Singh wrote: >> Many of the integrity guarantees of SEV-SNP are enforced through the >> Reverse Map Table (RMP). Each RMP entry contains the GPA at which a >> particular page of DRAM should be mapped.

Re: [RFC Part1 PATCH 06/13] x86/compressed: rescinds and validate the memory used for the GHCB

2021-04-06 Thread Borislav Petkov
On Wed, Mar 24, 2021 at 11:44:17AM -0500, Brijesh Singh wrote: > Many of the integrity guarantees of SEV-SNP are enforced through the > Reverse Map Table (RMP). Each RMP entry contains the GPA at which a > particular page of DRAM should be mapped. The VMs can request the > hypervisor to add pages

[RFC Part1 PATCH 06/13] x86/compressed: rescinds and validate the memory used for the GHCB

2021-03-24 Thread Brijesh Singh
Many of the integrity guarantees of SEV-SNP are enforced through the Reverse Map Table (RMP). Each RMP entry contains the GPA at which a particular page of DRAM should be mapped. The VMs can request the hypervisor to add pages in the RMP table via the Page State Change VMGEXIT defined in the GHCB