From patchwork Wed Mar 2 10:24:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 12765729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A456C433F5 for ; Wed, 2 Mar 2022 10:25:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240973AbiCBK0a (ORCPT ); Wed, 2 Mar 2022 05:26:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236253AbiCBK0a (ORCPT ); Wed, 2 Mar 2022 05:26:30 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6A8ABAD11C for ; Wed, 2 Mar 2022 02:25:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646216746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=fSrRNDpTZsFhlMpsmENClsaKs1lidW/Xhq22SIV8IOg=; b=SGucAioKE2xe2otWSekWafpbw6mtwfHrybJUpLFrF/6qH0YgrELrE7AUO8GJfhEOr1ScXl Jjlf+JsON4qzB57Nr926SVoHcMqIG6jVMDtuzCeL1+jRNpiZfMZpcSZ2qiDJ/b1y7dDlys 5ApX39ma5qY89AgnN4x6KyzyNKtq+us= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-96-_QMKm25sPWiww5mBf2CnDQ-1; Wed, 02 Mar 2022 05:25:43 -0500 X-MC-Unique: _QMKm25sPWiww5mBf2CnDQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E96DA1006AA6; Wed, 2 Mar 2022 10:25:40 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7AEA77B6F3; Wed, 2 Mar 2022 10:24:58 +0000 (UTC) From: Maxim Levitsky To: kvm@vger.kernel.org Cc: Joerg Roedel , x86@kernel.org, Jim Mattson , linux-kernel@vger.kernel.org, Wanpeng Li , Paolo Bonzini , Borislav Petkov , Sean Christopherson , Ingo Molnar , Dave Hansen , Vitaly Kuznetsov , Thomas Gleixner , "H. Peter Anvin" , Maxim Levitsky Subject: [PATCH] KVM: x86: mmu: trace kvm_mmu_set_spte after the new SPTE was set Date: Wed, 2 Mar 2022 12:24:57 +0200 Message-Id: <20220302102457.588450-1-mlevitsk@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org It makes more sense to print new SPTE value than the old value. Signed-off-by: Maxim Levitsky Reviewed-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 94f077722b290..0e209f0b2e1d2 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -2690,8 +2690,8 @@ static int mmu_set_spte(struct kvm_vcpu *vcpu, struct kvm_memory_slot *slot, if (*sptep == spte) { ret = RET_PF_SPURIOUS; } else { - trace_kvm_mmu_set_spte(level, gfn, sptep); flush |= mmu_spte_update(sptep, spte); + trace_kvm_mmu_set_spte(level, gfn, sptep); } if (wrprot) {