Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4329472ybe; Mon, 9 Sep 2019 07:47:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzA40zdZrdw3StLqyAMThJ+xDg4/DCFb6eGDTS2Bn1XJD/014jF8i0bVvtPi7N5EH0sBfv5 X-Received: by 2002:a17:906:944c:: with SMTP id z12mr19781070ejx.223.1568040441295; Mon, 09 Sep 2019 07:47:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568040441; cv=none; d=google.com; s=arc-20160816; b=FITdGKhz3DxrjTt5zxcMs9pXa63E90SoOPTIoqZQFppvdIOQ/jR6KSd004Jjsmms57 172k9gTqSosIhuZ67BhFa2Z3ZUgDcMCYxnsKGO5waSImGilP4XfnD/BLsXwWy1T6BLOl 3G+z6hMmQTVqBxVMC6v5ecFhovNa+NT4peeoMK19RqCycTjGlWb659bKcn/bqvIp68Sj /VC2MJifjGbFpTUdpE2H2oU7XFo24KcvsKfHt7pySlh7DPIdgT1/LM1qtfrxhJNspsQ4 5gFmCAX5mwDlk0RtG2MhyGY5hLU9fhUb6JreTXhKweSWeEAG2icYZBtLKjaf3nbbNQ4y 0gNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=0OVPV4N2P+B2zT4dMTe15INzKifckVM64PuJ65QMPCw=; b=SYJxbiRDA+kDRoOxwLZbhjozyx4gwRYgBH8qx8wblwBvh9cfm4VZEcMcOntZfMI3UA Cdol+PoOwWBuWzI17qwALav0+LK8Zfwh3MDOzSSWvrkQ8d6qp65LSTkSmw2WsN6kdDs7 IE/nN2wIywj3hLV5uv/+FyN0/4GthUrleIVQ/htGIObj/t41IT4G00VCVEcmwLBdwCKo g6aXnMc4K2SM/vez4YnaS3Xh6zjbsH4XIe4cFfobAhcwYoYQTIVrDDWHSrhR0gqmUyWg auH4hv/2RHDmDihX/xHOlSxLUNwkYesjvbfmvIBl6xGjasmbBMHMFIaNaoksIusipHxc bDwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f20si7587531ejq.92.2019.09.09.07.46.57; Mon, 09 Sep 2019 07:47:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388152AbfIIHYI (ORCPT + 99 others); Mon, 9 Sep 2019 03:24:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43180 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727736AbfIIHYI (ORCPT ); Mon, 9 Sep 2019 03:24:08 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E367E18C428C; Mon, 9 Sep 2019 07:24:07 +0000 (UTC) Received: from [10.72.12.61] (ovpn-12-61.pek2.redhat.com [10.72.12.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 970AF1001948; Mon, 9 Sep 2019 07:24:00 +0000 (UTC) Subject: Re: [PATCH 2/2] vhost: re-introducing metadata acceleration through kernel virtual address To: "Michael S. Tsirkin" Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jgg@mellanox.com, aarcange@redhat.com, jglisse@redhat.com, linux-mm@kvack.org, James Bottomley , Christoph Hellwig , David Miller , linux-arm-kernel@lists.infradead.org, linux-parisc@vger.kernel.org References: <20190905122736.19768-1-jasowang@redhat.com> <20190905122736.19768-3-jasowang@redhat.com> <20190908063618-mutt-send-email-mst@kernel.org> <1cb5aa8d-6213-5fce-5a77-fcada572c882@redhat.com> <20190909004504-mutt-send-email-mst@kernel.org> From: Jason Wang Message-ID: <4ee20058-0beb-111c-6750-556965423f04@redhat.com> Date: Mon, 9 Sep 2019 15:23:58 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190909004504-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Mon, 09 Sep 2019 07:24:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/9/9 下午12:45, Michael S. Tsirkin wrote: >>> Since idx can be speculated, I guess we need array_index_nospec here? >> So we have >> >> ACQUIRE(mmu_lock) >> >> get idx >> >> RELEASE(mmu_lock) >> >> ACQUIRE(mmu_lock) >> >> read array[idx] >> >> RELEASE(mmu_lock) >> >> Then I think idx can't be speculated consider we've passed RELEASE + >> ACQUIRE? > I don't think memory barriers have anything to do with speculation, > they are architectural. > Oh right. Let me add array_index_nospec() in next version. Thanks