From patchwork Wed May 3 10:52:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Guangrong X-Patchwork-Id: 9709365 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 891F960351 for ; Wed, 3 May 2017 10:54:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A42C28427 for ; Wed, 3 May 2017 10:54:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DC0A285E9; Wed, 3 May 2017 10:54:06 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham 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 1C1D728427 for ; Wed, 3 May 2017 10:54:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753352AbdECKyD (ORCPT ); Wed, 3 May 2017 06:54:03 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34344 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753637AbdECKxZ (ORCPT ); Wed, 3 May 2017 06:53:25 -0400 Received: by mail-pg0-f67.google.com with SMTP id t7so27786567pgt.1; Wed, 03 May 2017 03:53:24 -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=Uyu1HGrv7EpyYKXZd+0wIZBEfRmPoVJhH7a8qcwNe2U=; b=eeLANSwH5kGp93HKpjztPZBll9Y/7xIJx7SnaqgRNHjELOqRXwfEwSOI+icNHgS3dU cGlGJLuqBlWv5kgo/1RlAyLYN+ipasQQ65PumtsC8/i0mi8xKBBC/OhvSgiwsOl6KfmU kqhzVUWl8qxZQ38b1ZVYsMPKYqduFrLqqW0+lMDR/WnKSLK3w6C2Hj4Ny1h4Wz69vA26 O4CK4wviBDdrwLjh5o9MJVP/RVIA0oRo3cXGQ6KeMOmxcj7sZYOQW7rijkc94CnnHtqz Co/70xANK5iNMmlWWkO7b2smUPsW45WOkO5dJ9ZvGbrO70ouWmkttK0olmzfmDVnqcC0 jWDA== 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=Uyu1HGrv7EpyYKXZd+0wIZBEfRmPoVJhH7a8qcwNe2U=; b=bQAHHUTFqUjtDvT5WWABTN+fkzr94PT+QrZ5yIhfb9r5C3rStjk6lWfKuYNzUxuARK EoihT/NZ0RpNEwGUHsNvG/uJ7/sjIpKQqEy9km44/TLc1hqNoCKOJA8U/KQuofHi0ZWD nC7wuMzEs+vkgEnWH6Bd9lIvRdzRBNPRcYgZe7CVcXZiONJELm3CSL3rN2QaHxweIYDS lgJoI3oHoso8K0sCR73yqc7+5jwV4zxd+7m7yFiVNp8y47gm2VG/xXAR9PZ4oEIqpXGP x/QjwaWW615SN+FumGcSzQGFpUHC410ua/6JfoVzQFwaHxy9QLcO7oEjnVJK+Oemhdhb T+ug== X-Gm-Message-State: AN3rC/7BpBI3o3qM3GxCohg7kmB2O86MfeUg5c0yl29jRx+M4YobLyI0 P1+0fX6sAgtmZw== X-Received: by 10.99.247.83 with SMTP id f19mr38910987pgk.190.1493808804543; Wed, 03 May 2017 03:53:24 -0700 (PDT) Received: from eric.tencent.com ([203.205.141.35]) by smtp.gmail.com with ESMTPSA id d24sm4395561pfb.97.2017.05.03.03.53.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 May 2017 03:53:24 -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 7/7] KVM: MMU: stop using mmu_spte_get_lockless under mmu-lock Date: Wed, 3 May 2017 18:52:24 +0800 Message-Id: <20170503105224.19049-8-xiaoguangrong@tencent.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170503105224.19049-1-xiaoguangrong@tencent.com> References: <20170503105224.19049-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 f6a74e7..a8b91ee 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;