Received: by 2002:a19:651b:0:0:0:0:0 with SMTP id z27csp3748410lfb; Mon, 9 May 2022 03:16:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc+ymFvRQ+wQ9W9z5lGWROmoMzAmFY4zQBEBEa/BtB3HxmG+PQSeG+jF6Aoe1VowfTg+Ze X-Received: by 2002:a17:90a:a58c:b0:1c9:bc35:6ed9 with SMTP id b12-20020a17090aa58c00b001c9bc356ed9mr17151587pjq.146.1652091383866; Mon, 09 May 2022 03:16:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652091383; cv=none; d=google.com; s=arc-20160816; b=SCS8QYOH8UhruQtWWJa5bKo580Aj7XwHEst1V7Y75P7hCRKj99R0i1s09gqZWthuAW nNuUXPXR90qPPjmBRfPnRqykKH/IuC7v9mSUlXG/inwbuWjhi3vFm7jUHX4gHaogmwyb hDGv2sRDdTxfK6YbsZhYBdp0ZQm3OBC26IdEyS1ocnnH/ATkmpnBjKrybmlY4M7HMY3Q R6XFnyNZi1OJaoVO3QdWs1/GYmyqY8llRPdgZqNuCVtx9I8Ap73CgXpcwx4Rlb/shmVT k0Bchn/GF3Pm9tXCjR6YfQalsVbyzYcmddMufUKHtnCtfj3E/DikebEFD3TgKOM/y+M1 k7/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=aKrZMpxFUMNno8Jh7HqKHOK472I1VR5XCqdBYMIHb10=; b=gemyRWK1KuCJWuphNyInT7jeTbS/Ucr56k6EXq5wBb6FteM+Pl/dzOBNo5tMV+7/6y wDcnfc1f2u5WSd2QYeqn3JPEX95zvezs7o2Hb3iN5dup2S3VzJqR66REGfEeHUeqhh6O Meo0ohsKZgXgJVGXf98IaYduEAjvG+V8eFHIIwDW1mKAoeaXP1KRGU3x9wJrabjEn2Um percW7wYlsqnC2SaQgHLkidDHtdWeMrGXXLXOLpcroMIBOz9Bv16PoCiJbotcdA9QAzn wGd9hRGK6+V2YNbrS74Lr89Fetgw8TWT6TIx7PTtKFMnH9iYkKU4X2LxHkhwP5t/XzXs CADA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d15-20020a056a0024cf00b005105f9aeed4si12575733pfv.107.2022.05.09.03.16.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 03:16:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7957310115A; Mon, 9 May 2022 02:53:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231422AbiEIGTn (ORCPT + 99 others); Mon, 9 May 2022 02:19:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234700AbiEIGSg (ORCPT ); Mon, 9 May 2022 02:18:36 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 58C4BEABA6 for ; Sun, 8 May 2022 23:14:43 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id D8E8D1E80D70; Mon, 9 May 2022 14:09:34 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BwKUcw5aKpyv; Mon, 9 May 2022 14:09:32 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: zhounan@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 1B6711E80D6B; Mon, 9 May 2022 14:09:32 +0800 (CST) From: Zhou nan To: pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com Cc: linux-kernel@vger.kernel.org, Zhou nan Subject: [PATCH] x86: It seems possible to optimize the code format Date: Mon, 9 May 2022 14:14:09 +0800 Message-Id: <20220509061409.29083-1-zhounan@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It seems possible to optimize the code format Signed-off-by: Zhou nan --- arch/x86/kvm/mmu/tdp_mmu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c index 922b06bf4b94..a4ab6aee4db2 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.c +++ b/arch/x86/kvm/mmu/tdp_mmu.c @@ -743,6 +743,7 @@ static u64 __tdp_mmu_set_spte(struct kvm *kvm, int as_id, tdp_ptep_t sptep, if (record_acc_track) handle_changed_spte_acc_track(old_spte, new_spte, level); + if (record_dirty_log) handle_changed_spte_dirty_log(kvm, as_id, gfn, old_spte, new_spte, level); @@ -1149,8 +1150,10 @@ static int tdp_mmu_link_sp(struct kvm *kvm, struct tdp_iter *iter, spin_lock(&kvm->arch.tdp_mmu_pages_lock); list_add(&sp->link, &kvm->arch.tdp_mmu_pages); + if (account_nx) account_huge_nx_page(kvm, sp); + spin_unlock(&kvm->arch.tdp_mmu_pages_lock); return 0; -- 2.18.2