Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp17272pxv; Wed, 21 Jul 2021 14:12:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5kR2svvicM59JmTKKr8P58T7m+hGFf2+NYZFtMZMlEQI9MbnbcA2uMf5A/nhTMFcGjmHM X-Received: by 2002:a05:6e02:120e:: with SMTP id a14mr26512466ilq.88.1626901529342; Wed, 21 Jul 2021 14:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626901529; cv=none; d=google.com; s=arc-20160816; b=ZHUCs7Jie93+nbYaRqXEVIUTO1trsCzxKYWpt62us/h37Ln8g/Cq+0BbPLgyS1bpQh kdypZ6z9fORpIx4vXINrd1H4YkZKVfVSw0Ai4mLtc2MREBvNbcL8MAo+URQi/uPxIw9G kb0LC4TzoTdd7jmLy0DEU+SVoRhgoaKZMUPxo7+fOUateGoOTHKn/j6/PIxKQSoNcooi OvPiPRVcuNHi9JSKejDxb0dlzOmbsO9OJ0JiQ8TcRtxGmr0s+wR1RkbjODixFh3m1UUd 6QjeKdQu4nWxBhZiV+0L1JWdXSTvNZqMooT/BEmcfulFj26fv48QtQowXgyAzQdvNheP h+FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oM+Zz2MkzME3H9DquvEm8RUpKo7Whxr3cjfyw8H5FJw=; b=BfQn101sO/eTC/Diq0oWqAJ13VaRbmgEUIQ5XQa3rZr0rN8WBVO2zlZrbSUpPhtGXw 2RdByFVCg0J8LdOlw/YXJUyJbRMNSUGt27nIahHN4sz1rxSCsFGuge1lwl29H1ppR1PR LhL3n+2eBPRlOuJBUck+42Dcj0AFlMER9fBMMpBc0+ACo2QwFesJ9PceraFywx9mEhhK TmGGWfLNe6FnSHq8IVZZyD51l3hPhet86GFzpKg/Hg2FohyNRw22PdE7c2oC63ilz8Ji 1rKmIVqKurmP+SouJ9jZCoPD85VOcUMgJWj5tDGDenrR/5e+1JLN3CnOgscfBx3ZIEQv 4wNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Fa72YtYX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t3si29384297ile.109.2021.07.21.14.05.16; Wed, 21 Jul 2021 14:05:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Fa72YtYX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240385AbhGUT3D (ORCPT + 99 others); Wed, 21 Jul 2021 15:29:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240353AbhGUT3C (ORCPT ); Wed, 21 Jul 2021 15:29:02 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0D7FC061575 for ; Wed, 21 Jul 2021 13:09:37 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id p4-20020a17090a9304b029016f3020d867so1984223pjo.3 for ; Wed, 21 Jul 2021 13:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=oM+Zz2MkzME3H9DquvEm8RUpKo7Whxr3cjfyw8H5FJw=; b=Fa72YtYX6wm5mklDeZx/CmpLqOe3xyeUmm/EmFn8RGnRKSJuzaIaj9B6/Mdzu1Qjvj hXa3UcbjV+KFv7zwlPe5MMOM5CAgcd5uZlc08MGDdy61oyuX9CquyW7fE51bHCbmhhcl +TMdq4XOai+h1J7XOx11PZhXcVD20wfIuHS5TmAgT7922Lygki/0z9WrZA8yJHEIa2hU O3QmMPtucbUDrv2j34ARsToLa+7kk1nxMsHC11G2mo4irGjSwikwhs53e+cEO+i12chK UwDlSXk/KbPZMcfqIg74AQUx2jBlmrj176ToSjnFupuIGeKwJJI3MFc/EDCiOYW4Hjdv 4H7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=oM+Zz2MkzME3H9DquvEm8RUpKo7Whxr3cjfyw8H5FJw=; b=SsLjsLWXC8BILI47AXlNT2OOtVtaqkN5nYI3fS3lWM8Npityej+LCjK3mCAjcNVkM4 XRd8Lo2QH6dPllJ8OCSpYIL1vQpvG8UXw+5XpT6i0hn6cfdNYy3nVJwAcMUN/EzWEGCy 2nCv4kbqirQi5m0v//b97XUaQgxJxabRtmuzqs8uqBCLGdAdwyl8VEEkh06zY2bkhtAw n+Yb1AbJKq2DMuMzujnAInV7kULyuEkZ2EV+5x6QcM6R+ueGM5IRC4Pk2Ridz73mIHKU BE4T+YN1Ui6woW/9kcSoCthQjKO06+dhHyphmNOGJFHdkM2iihwl3e+Yp6SNbulkONwA JqXA== X-Gm-Message-State: AOAM532KWoXVCCalVOz5Adn+Uh1XZRKyfGbkLRQj9oumjtoGnxKrdLK9 +BaI7x/ht0E3vih7FVhXpIKptgMZHupm3w== X-Received: by 2002:a05:6a00:1786:b029:32c:c315:7348 with SMTP id s6-20020a056a001786b029032cc3157348mr38507563pfg.42.1626898177298; Wed, 21 Jul 2021 13:09:37 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id w16sm31310000pgi.41.2021.07.21.13.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 13:09:36 -0700 (PDT) Date: Wed, 21 Jul 2021 20:09:33 +0000 From: Sean Christopherson To: Vitaly Kuznetsov Cc: Tom Lendacky , Peter Gonda , kvm list , linux-kernel@vger.kernel.org, x86@kernel.org, Paolo Bonzini , Jim Mattson , Joerg Roedel , Wanpeng Li , Borislav Petkov , Ingo Molnar , Thomas Gleixner , Brijesh Singh Subject: Re: [PATCH] KVM: SVM: Do not terminate SEV-ES guests on GHCB validation failure Message-ID: References: <324d9228-03e9-0fe2-59c0-5e41e449211b@amd.com> <468cee77-aa0a-cf4a-39cf-71b5bfb3575e@amd.com> <8735s7sv8e.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8735s7sv8e.fsf@vitty.brq.redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 21, 2021, Vitaly Kuznetsov wrote: > Sean Christopherson writes: > > > On Thu, May 20, 2021, Tom Lendacky wrote: > >> On 5/20/21 2:16 PM, Sean Christopherson wrote: > >> > On Mon, May 17, 2021, Tom Lendacky wrote: > >> >> On 5/14/21 6:06 PM, Peter Gonda wrote: > >> >>> On Fri, May 14, 2021 at 1:22 PM Tom Lendacky wrote: > >> >>>> > >> >>>> Currently, an SEV-ES guest is terminated if the validation of the VMGEXIT > >> >>>> exit code and parameters fail. Since the VMGEXIT instruction can be issued > >> >>>> from userspace, even though userspace (likely) can't update the GHCB, > >> >>>> don't allow userspace to be able to kill the guest. > >> >>>> > >> >>>> Return a #GP request through the GHCB when validation fails, rather than > >> >>>> terminating the guest. > >> >>> > >> >>> Is this a gap in the spec? I don't see anything that details what > >> >>> should happen if the correct fields for NAE are not set in the first > >> >>> couple paragraphs of section 4 'GHCB Protocol'. > >> >> > >> >> No, I don't think the spec needs to spell out everything like this. The > >> >> hypervisor is free to determine its course of action in this case. > >> > > >> > The hypervisor can decide whether to inject/return an error or kill the guest, > >> > but what errors can be returned and how they're returned absolutely needs to be > >> > ABI between guest and host, and to make the ABI vendor agnostic the GHCB spec > >> > is the logical place to define said ABI. > >> > >> For now, that is all we have for versions 1 and 2 of the spec. We can > >> certainly extend it in future versions if that is desired. > >> > >> I would suggest starting a thread on what we would like to see in the next > >> version of the GHCB spec on the amd-sev-snp mailing list: > >> > >> amd-sev-snp@lists.suse.com > > > > Will do, but in the meantime, I don't think we should merge a fix of any kind > > until there is consensus on what the VMM behavior will be. IMO, fixing this in > > upstream is not urgent; I highly doubt anyone is deploying SEV-ES in production > > using a bleeding edge KVM. > > Sorry for resurrecting this old thread but were there any deveopments > here? I may have missed something but last time I've checked a single > "rep; vmmcall" from userspace was still crashing the guest. I don't think it went anywhere, I completely forgot about this. I'll bump this back to the top of my todo list, unless someone else wants the honors :-) > The issue, however, doesn't seem to reproduce with Vmware ESXi which probably > means they're just skipping the instruction and not even injecting #GP > (AFAIR, I don't have an environment to re-test handy).