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: <9827da0a-1d35-79b2-f613-9922a3cba64c@oracle.com>
Date:   Thu, 19 Oct 2023 13:20:28 +0100
From:   Liam Merwick <liam.merwick@...cle.com>
To:     Michael Roth <michael.roth@....com>, kvm@...r.kernel.org
Cc:     linux-coco@...ts.linux.dev, linux-mm@...ck.org,
        linux-crypto@...r.kernel.org, x86@...nel.org,
        linux-kernel@...r.kernel.org, tglx@...utronix.de, mingo@...hat.com,
        jroedel@...e.de, thomas.lendacky@....com, hpa@...or.com,
        ardb@...nel.org, pbonzini@...hat.com, seanjc@...gle.com,
        vkuznets@...hat.com, jmattson@...gle.com, luto@...nel.org,
        dave.hansen@...ux.intel.com, slp@...hat.com, pgonda@...gle.com,
        peterz@...radead.org, srinivas.pandruvada@...ux.intel.com,
        rientjes@...gle.com, dovmurik@...ux.ibm.com, tobin@....com,
        bp@...en8.de, vbabka@...e.cz, kirill@...temov.name,
        ak@...ux.intel.com, tony.luck@...el.com, marcorr@...gle.com,
        sathyanarayanan.kuppuswamy@...ux.intel.com, alpergun@...gle.com,
        jarkko@...nel.org, ashish.kalra@....com, nikunj.dadhania@....com,
        pankaj.gupta@....com, zhi.a.wang@...el.com,
        Liam Merwick <liam.merwick@...cle.com>
Subject: Re: [PATCH v10 38/50] KVM: SEV: Add support for GHCB-based
 termination requests

On 16/10/2023 14:28, Michael Roth wrote:
> GHCB version 2 adds support for a GHCB-based termination request that
> a guest can issue when it reaches an error state and wishes to inform
> the hypervisor that it should be terminated. Implement support for that
> similarly to GHCB MSR-based termination requests that are already
> available to SEV-ES guests via earlier versions of the GHCB protocol.


Maybe add

See 'Termination Request' in the 'Invoking VMGEXIT' section of AMD's 
GHCB spec for more details.

> 
> Signed-off-by: Michael Roth <michael.roth@....com>
> ---
>   arch/x86/kvm/svm/sev.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> index e547adddacfa..9c38fe796e00 100644
> --- a/arch/x86/kvm/svm/sev.c
> +++ b/arch/x86/kvm/svm/sev.c
> @@ -3094,6 +3094,7 @@ static int sev_es_validate_vmgexit(struct vcpu_svm *svm)
>   	case SVM_VMGEXIT_UNSUPPORTED_EVENT:
>   	case SVM_VMGEXIT_HV_FEATURES:
>   	case SVM_VMGEXIT_PSC:
> +	case SVM_VMGEXIT_TERM_REQUEST:
>   		break;
>   	default:
>   		reason = GHCB_ERR_INVALID_EVENT;
> @@ -3762,6 +3763,14 @@ int sev_handle_vmgexit(struct kvm_vcpu *vcpu)
>   
>   		ret = 1;
>   		break;
> +	case SVM_VMGEXIT_TERM_REQUEST:
> +		pr_info("SEV-ES guess requested termination: reason %#llx info %#llx\n",
> +			control->exit_info_1, control->exit_info_1);

typo: "guess" -> "guest"
It prints exit_info_1 twice - was one of those meant to be exit_info_2?

Otherwise
Reviewed-by: Liam Merwick <liam.merwick@...cle.com>


> +		vcpu->run->exit_reason = KVM_EXIT_SYSTEM_EVENT;
> +		vcpu->run->system_event.type = KVM_SYSTEM_EVENT_SEV_TERM;
> +		vcpu->run->system_event.ndata = 1;
> +		vcpu->run->system_event.data[0] = control->ghcb_gpa;
> +		break;
>   	case SVM_VMGEXIT_UNSUPPORTED_EVENT:
>   		vcpu_unimpl(vcpu,
>   			    "vmgexit: unsupported event - exit_info_1=%#llx, exit_info_2=%#llx\n",

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ