Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp182857pxb; Wed, 20 Oct 2021 19:33:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGK1OS0Zd6Xy8bzoUKh8Xd9nXTKFCNDDRS/9JP8sIXVDEydEe19BhYm3ddFuQPdsbS6kZT X-Received: by 2002:a17:90a:ae18:: with SMTP id t24mr3208204pjq.92.1634783624768; Wed, 20 Oct 2021 19:33:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634783624; cv=none; d=google.com; s=arc-20160816; b=dAc0sM8KSic3a6FTng/dXV1a8oLvDipqMjYU0MgGV26dryfKnz1pnoKN1S/l488wGj d4y8smDuo5ouPVSzGqzKFies+TWGyJB6b7OPA6HPNgXA5D8G2FHNCv1LgHZmtIHb9MQW PQKJFzZzGP1TuyOEF9OEnNmKf71lGvG8eCnjzQF+UUl/2xO5LPg/FLlPxGpFyMROVgCM P7Y3+WvsXa11L0jjCSYOjG35BLSh1Zwt1f3dl5dnNkrqGrm+B9zKKxgpySHadKoKPMh9 zWq05+metkQUWyVp13X9r0bl9MmiBToL45V3sWL7NCFvCPesU/6j6DIe8PVl52mDszw0 3FxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=ZIBivETk/Wk9T2bWtdNwXjskc9WiBRMCkQrrHTEMlKA=; b=Tq8ZjkDh5zXyOJDlApW8eTTW1XQoE1yx7YuY7Jt09Gqn2gYsiqHeZV5eCTuHmFCuf9 c0bt1KRhISxGLkAFaCkgAfpJkqwf9jE2pdAhyPQeyJokZ/xcZ/3W9v1wWrvh05Sle3ZF nF5pUBdkuK8QYkfSCpvGA3k+A21NH9qj+/e5wrV+sDqK/iKJITcSA6d3C+fJ99jZ0X4y GdSeQBjcr51JjcjHjHcFZiA3NP1xOcyxvE7FwIRUxPbqO+STaJHTvInYX1oIR8WCU6P7 ukJGc4hmx3wACDmPnyxlvp6JGEY6p3gAnwl2Iw2aPYGLHHf/rTFE+5J12pg1DLFviKn5 aS3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si5252946pgq.626.2021.10.20.19.33.31; Wed, 20 Oct 2021 19:33:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230351AbhJUCeu (ORCPT + 99 others); Wed, 20 Oct 2021 22:34:50 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:55915 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229842AbhJUCet (ORCPT ); Wed, 20 Oct 2021 22:34:49 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=laijs@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0Ut5VQir_1634783550; Received: from C02XQCBJJG5H.local(mailfrom:laijs@linux.alibaba.com fp:SMTPD_---0Ut5VQir_1634783550) by smtp.aliyun-inc.com(127.0.0.1); Thu, 21 Oct 2021 10:32:31 +0800 Subject: Re: [PATCH 3/4] KVM: X86: Use smp_rmb() to pair with smp_wmb() in mmu_try_to_unsync_pages() To: Lai Jiangshan , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Junaid Shahid Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" References: <20211019110154.4091-1-jiangshanlai@gmail.com> <20211019110154.4091-4-jiangshanlai@gmail.com> From: Lai Jiangshan Message-ID: <4192556d-8890-d94b-d03d-23922ff1674c@linux.alibaba.com> Date: Thu, 21 Oct 2021 10:32:30 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211019110154.4091-4-jiangshanlai@gmail.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 Hello Junaid Shahid Any comments on the patch? I may have been misunderstanding many things and I have been often. thanks Lai On 2021/10/19 19:01, Lai Jiangshan wrote: > From: Lai Jiangshan > > The commit 578e1c4db2213 ("kvm: x86: Avoid taking MMU lock in > kvm_mmu_sync_roots if no sync is needed") added smp_wmb() in > mmu_try_to_unsync_pages(), but the corresponding smp_load_acquire() > isn't used on the load of SPTE.W which is impossible since the load of > SPTE.W is performed in the CPU's pagetable walking. > > This patch changes to use smp_rmb() instead. This patch fixes nothing > but just comments since smp_rmb() is NOP and compiler barrier() is not > required since the load of SPTE.W is before VMEXIT. > > Cc: Junaid Shahid > Signed-off-by: Lai Jiangshan