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=-12.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham 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 38607C433E6 for ; Mon, 25 Jan 2021 17:25:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D920B221EB for ; Mon, 25 Jan 2021 17:25:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730972AbhAYRYt (ORCPT ); Mon, 25 Jan 2021 12:24:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55695 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730704AbhAYRYC (ORCPT ); Mon, 25 Jan 2021 12:24:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611595354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LMaj7CkNnEbxNARZFdcDZTjqCgJ7QYeYI1k3Xem58ag=; b=YSLE7f+Ppb4s4qo2C1FQqpt/aZvB/ZsNLGpD64HJ3/nCNUEjveDNWrErBLRD0Ydvb1OkCP J/iIilpCNVHONtNsVBgcwpvymUc88E09tXQy/93PXMfG7Ez8Refr8fHMtZw1cawuF+eq9+ VaDsNnWrVtZIoAa/99G4Qpoun5m1+YM= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-467-tDhxpdm4MZS0wBXrvdqVSg-1; Mon, 25 Jan 2021 12:22:31 -0500 X-MC-Unique: tDhxpdm4MZS0wBXrvdqVSg-1 Received: by mail-ej1-f71.google.com with SMTP id j14so4078684eja.15 for ; Mon, 25 Jan 2021 09:22:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=LMaj7CkNnEbxNARZFdcDZTjqCgJ7QYeYI1k3Xem58ag=; b=hIANSotzPCTZQ8OpqbA0OtV67PpZGq0JuafeoJfgDaBLKo1zXL1jLBsZtd2u3Tpfi3 QWlP1YstkGf+RQjuGagoFAhkuyOTMWF/CyTUqFo8HfrjET48thDFDvgA36pGa1l3VPy/ i0eBy2lkEo3nDI72WKRTuE6zklID5jTqIBVEwSMbBzdEoib4kKP05WjNecPQKEjWU6R+ fmbC040jHZ7+FARvpcAHOe3F1ow1Mpgtyqijxv0QOb+eLllFTpdShLXvD0CPe0g8bBBi LQlRIERFq5vaXi6QeQb1r2r4FsL5KdY8/HTfpd/GPsMRK7y7bXVNmyh1CoWhmrLcBZuj VpqQ== X-Gm-Message-State: AOAM533jNvlldhr/aka34AhpGni9/awuv3tfnZb1fG8/DyqTXkAForx/ 5X2FMztzEFp0hDNuKKHdV6+uO3afcAcO12Nun1ye1L/i0HLMtLbLp6De8TmIY0twHu/KY+l+d+L efKY6mHaiW3GdLNmiZc+WnGIa X-Received: by 2002:a17:906:5958:: with SMTP id g24mr990734ejr.377.1611595349952; Mon, 25 Jan 2021 09:22:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwv5l+Mrc2U9qE+MMYwbCngwX6psPudgBFrDAPGxTNqASvvq3z5peNzORmDfO5fmo9ni1FAEg== X-Received: by 2002:a17:906:5958:: with SMTP id g24mr990721ejr.377.1611595349417; Mon, 25 Jan 2021 09:22:29 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id zg7sm8669806ejb.31.2021.01.25.09.22.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Jan 2021 09:22:28 -0800 (PST) Subject: Re: [PATCH 0/3] KVM: x86: Revert dirty tracking for GPRs To: Sean Christopherson Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Brijesh Singh , Tom Lendacky References: <20210122235049.3107620-1-seanjc@google.com> From: Paolo Bonzini Message-ID: Date: Mon, 25 Jan 2021 18:22:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210122235049.3107620-1-seanjc@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/01/21 00:50, Sean Christopherson wrote: > This is effectively belated feedback on the SEV-ES series. My primary > interest is to revert the GPR dirty/available tracking, as it's pure > overhead for non-SEV-ES VMs, and even for SEV-ES I suspect the dirty > tracking is at best lost in the noise, and possibly even a net negative. > > My original plan was to submit patches 1+3 as patch 1, taking a few > creative liberties with the GHCB spec to justify writing the GHCB GPRs > after every VMGEXIT. But, since KVM is effectively writing the GHCB GPRs > on every VMRUN, I feel confident in saying that my interpretation of the > spec has already been proven correct. > > The SEV-ES changes are effectively compile tested only, but unless I've > overlooked a code path, patch 1 is a nop. Patch 3 definitely needs > testing. > > Paolo, I'd really like to get patches 1 and 2 into 5.11, the code cost of > the dirty/available tracking is not trivial. > > Sean Christopherson (3): > KVM: SVM: Unconditionally sync GPRs to GHCB on VMRUN of SEV-ES guest > KVM: x86: Revert "KVM: x86: Mark GPRs dirty when written" > KVM: SVM: Sync GPRs to the GHCB only after VMGEXIT > > arch/x86/kvm/kvm_cache_regs.h | 51 +++++++++++++++++------------------ > arch/x86/kvm/svm/sev.c | 14 +++++----- > arch/x86/kvm/svm/svm.h | 1 + > 3 files changed, 34 insertions(+), 32 deletions(-) > Queued 1-2, thanks! Yes, these should be in 5.11. Paolo