From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33C06C63777 for ; Mon, 30 Nov 2020 19:40:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF07520709 for ; Mon, 30 Nov 2020 19:40:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="pqHlgGMi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729983AbgK3TkV (ORCPT ); Mon, 30 Nov 2020 14:40:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729979AbgK3TkU (ORCPT ); Mon, 30 Nov 2020 14:40:20 -0500 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C79A3C061A4A for ; Mon, 30 Nov 2020 11:39:29 -0800 (PST) Received: by mail-pl1-x641.google.com with SMTP id b23so7051043pls.11 for ; Mon, 30 Nov 2020 11:39:29 -0800 (PST) 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=o6rtmKPTOe3MI6LpooTnqzq594FdWbZHfm2j9oryTcE=; b=pqHlgGMiEu/p0dKcFRIJepFYNmoKCvWk9svkXrglrSRAR/UqIpTJpbEu2FbJJOjZ2r EENBGawkuvGUryYSHiS3NgAA8t5nnDT8E9BGZHdynRvNH4Riz5OQgIXScY1ZvsJQAkQY G3Td1KM4MxUZtvJ6l8WRrlUG7+evwRBmuMquo8MThVsBAQDVmwOkiC7WjerKor54HV3h ykK3TFYa4ZPxx5E2nXwhnKsv1YWpx5AYiAcqBAC8ePhwAVbIOwnR7ScbQbCFi1HGtk96 pVaJeguMZlwI/7EanFKZqmVl95AaH16KIm7TjlO0C0HKwgKwcqtnmxL7LQ54qhpZVVPR 5GUQ== 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=o6rtmKPTOe3MI6LpooTnqzq594FdWbZHfm2j9oryTcE=; b=qfb8WTJ1zpY0cZu7Vzgjb8F3tMu1mBwRfnjg5rYuYXnv2Oo32MVsX5IejFBQD+8W8e CD5awnzxWvKXFZyIy7QQdAyQtv2py2/dZrHHoz7b+XSN5WksHljnqzZlPqki9C8NaGut Y/hUrUBdBAmJ3LNARWyTeIUfybGBMMZxXfK5c6TAptpuveYKvkN3Wj3fUgounvv0AeMt pOPTs8JVStduv1+8OPiQaB2lfvQe648Q8V+nYbxv9XCUsmmXFEQOARbBI6coWnVSq5Mh ckVy6sm7PZwEVjb5Qe0aCvtG2etd12sKkBSvIogA0paSHo0r9nCgbKOOaXKZ1hS6pA6b tUSA== X-Gm-Message-State: AOAM531MCzQ9BtM8Nr4gzUBklZXq70A9NzJ2sDGdT1mhesWjAkupyMsp +uMSOnntoUHHt5Iur3JzU1sxMQ== X-Google-Smtp-Source: ABdhPJyBPOj+BUOCDMsjX7h8TcafuKx02gSTxE7xTOAMupSoP4OnMeBtT6gqcJSdzXh51dADt+q6rw== X-Received: by 2002:a17:90a:7022:: with SMTP id f31mr405610pjk.213.1606765169152; Mon, 30 Nov 2020 11:39:29 -0800 (PST) Received: from google.com (242.67.247.35.bc.googleusercontent.com. [35.247.67.242]) by smtp.gmail.com with ESMTPSA id z11sm17647793pfk.52.2020.11.30.11.39.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 11:39:28 -0800 (PST) Date: Mon, 30 Nov 2020 19:39:24 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: Tom Lendacky , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Jim Mattson , Joerg Roedel , Vitaly Kuznetsov , Wanpeng Li , Borislav Petkov , Ingo Molnar , Thomas Gleixner , Brijesh Singh Subject: Re: [RFC PATCH 25/35] KVM: x86: Update __get_sregs() / __set_sregs() to support SEV-ES Message-ID: References: <20200914213708.GC7192@sjchrist-ice> <7fa6b074-6a62-3f8e-f047-c63851ebf7c9@amd.com> <20200915163342.GC8420@sjchrist-ice> <6486b1f3-35e2-bcb0-9860-1df56017c85f@amd.com> <20200915224410.GI8420@sjchrist-ice> <3f5bd68d-7b2f-8b1f-49b9-0e59587513c8@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3f5bd68d-7b2f-8b1f-49b9-0e59587513c8@redhat.com> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Nov 30, 2020, Paolo Bonzini wrote: > On 16/09/20 00:44, Sean Christopherson wrote: > > > KVM doesn't have control of them. They are part of the guest's encrypted > > > state and that is what the guest uses. KVM can't alter the value that the > > > guest is using for them once the VMSA is encrypted. However, KVM makes > > > some decisions based on the values it thinks it knows. For example, early > > > on I remember the async PF support failing because the CR0 that KVM > > > thought the guest had didn't have the PE bit set, even though the guest > > > was in protected mode. So KVM didn't include the error code in the > > > exception it injected (is_protmode() was false) and things failed. Without > > > syncing these values after live migration, things also fail (probably for > > > the same reason). So the idea is to just keep KVM apprised of the values > > > that the guest has. > > > > Ah, gotcha. Migrating tracked state through the VMSA would probably be ideal. > > The semantics of __set_sregs() kinda setting state but not reaaaally setting > > state would be weird. > > How would that work with TDX? Can you elaborate? I.e. how would what work with TDX?