From patchwork Tue Jun 20 09:15:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Guangrong X-Patchwork-Id: 9798905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6FA4F601BC for ; Tue, 20 Jun 2017 09:16:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66D5326CFC for ; Tue, 20 Jun 2017 09:16:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B2592847A; Tue, 20 Jun 2017 09:16:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBFB627968 for ; Tue, 20 Jun 2017 09:16:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752880AbdFTJQG (ORCPT ); Tue, 20 Jun 2017 05:16:06 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:34408 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752175AbdFTJQC (ORCPT ); Tue, 20 Jun 2017 05:16:02 -0400 Received: by mail-pg0-f68.google.com with SMTP id j186so20090130pge.1; Tue, 20 Jun 2017 02:16:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=R8FZpu7zOv7rdtW+NtJ9S/Q8p4eKfZ0wR1eID0LUwI8=; b=RVA1io95E9yt1E0C83s5dGlrS/ZHvjBnnxxt+juXiey69G6bjCvaVWnPTRA9QsgORV Xoq63Wx0tZPXcjVwrHJyshHWK3bM4Wrvm4GlCg3G9TlUKIhMRAVHvr30ZpOh/uVNJX18 5Y0oNvLnW4eWQ48VfxzBZEi1s2LPfOWV/KAnGqfKREQOkM/VPSuNqVEfqZnezIAIOukN Xe9oZDRzqaU55P6LgsRFBWtSCDAas35GvjuwTrofsXrapCOfnkcDk1zcPagI93GJ2kfS QIR1mqyldMtsQlhtAeE03q+AWrKeqhxnaN5u5W9Ex0cwOzELXXs9iQPkXHe3D9d4oY3g /Tdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=R8FZpu7zOv7rdtW+NtJ9S/Q8p4eKfZ0wR1eID0LUwI8=; b=p76G42ra7mp5hCteWKAUNRtvTYr7cbLDW+mRczYwN7/0dfmkTetFNglCMDYdn70kEp Oe51Qb6xNB2gbMlOn8cWpLGlVHzMQgnJwCCbaBxZoulWmaFiZ5s/SzqVXgIrdPv1yiB6 ZSt/RyaS6yPuJzmfKHfTUAiRI/ws8OtyN++I8uRk9PiNj/gLJrxp3QswjCdIJOIwRE9G zpX3wvO1D94Y+/+T0cKIX5OTlgOm3LpeXp9ZN4KQu564/U84Eue34l7r8oi73XbPV0vn Wjs+Icczy2jiCs2xXyt4+ddjiZdXrD+dX6O8DVgSWTKB8HGeHf65WL3NuE6z15EVWsx7 aL6g== X-Gm-Message-State: AKS2vOwLL/InTnw6LAX7VBTdOYPJphqM8LyiSQFl5sSU4bKTKKju2bB4 JdQLXgTkT6S9ug== X-Received: by 10.101.91.7 with SMTP id y7mr30398646pgq.226.1497950161891; Tue, 20 Jun 2017 02:16:01 -0700 (PDT) Received: from eric.tencent.com ([203.205.141.35]) by smtp.gmail.com with ESMTPSA id o12sm26343810pfi.9.2017.06.20.02.15.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 02:16:01 -0700 (PDT) From: guangrong.xiao@gmail.com X-Google-Original-From: xiaoguangrong@tencent.com To: pbonzini@redhat.com, mtosatti@redhat.com, avi.kivity@gmail.com, rkrcmar@redhat.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, qemu-devel@nongnu.org, Xiao Guangrong Subject: [PATCH v2 7/7] KVM: MMU: stop using mmu_spte_get_lockless under mmu-lock Date: Tue, 20 Jun 2017 17:15:26 +0800 Message-Id: <20170620091526.4287-8-xiaoguangrong@tencent.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170620091526.4287-1-xiaoguangrong@tencent.com> References: <20170620091526.4287-1-xiaoguangrong@tencent.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Xiao Guangrong mmu_spte_age() is under the protection of mmu-lock, no reason to use mmu_spte_get_lockless() Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 7711953..dc00c32 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -852,7 +852,7 @@ static u64 restore_acc_track_spte(u64 spte) /* Returns the Accessed status of the PTE and resets it at the same time. */ static bool mmu_spte_age(u64 *sptep) { - u64 spte = mmu_spte_get_lockless(sptep); + u64 spte = *sptep; if (!is_accessed_spte(spte)) return false;