Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3909979pxf; Tue, 16 Mar 2021 00:21:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxA/OUBWUQqeJA+8csLzA478aEMjsXR63G3egO6DT2rn6uE3F4tAjUGrBlk2UwIup5hUA// X-Received: by 2002:a05:6402:51cd:: with SMTP id r13mr34674772edd.116.1615879309743; Tue, 16 Mar 2021 00:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615879309; cv=none; d=google.com; s=arc-20160816; b=m84aKlQKiUC9R6UNzH8sLZM+6pIC4ERNRl2mou6T6KwwtZqIobqnW4cNX+NxtStdqu u8pHjPDWq7JrMdo4+qCDmyQ0QJC+OTz/mY172dNX6n5og1TH3L8U5w90lESXjg7sLzZ9 VuEMS+t9LH4XvaegPoxuO6+4BH5X89jrO8Wb1sgN3tZRdPz/TopXJsWqzqIRv7AGa/kf 2MSM/o1ZEGSQBJMf7ZRwfvmqrqn3ocybOWv4BhfqU0zoZ2BG2u/d4+Rcd/QT6Em7ljZb ZlD/CCZyCOsok/AowqEB9o45S9dSg3eP+dIC7EAfMlL8gXPNFSDaUXXhXGb8PvCesJrR e0YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=tNuOMYKAbtgbN4y0jwAya24taT3tWOIjsTpKu/WQnd0=; b=uwdToxZir4N8y95IxSpJKuSC41I2mwmm7ZI/GWJwJ/hT4I78Znyv1+df2c/02VdjH+ U2Ez6FyFRUwlgXGSAew9RYYymeHfxm9O5isfFn8genk2YGQjltz4DEWgzbBgwhhy0+oh 1VqPBbW9YNWaK7+rVaLpyXW8UKKmSlhnmXfocTOCIwTrJjtMFkoqgReTRuFbllQgrqdR DbL3ekUjkE80lSpEvkPqNbXs36xNiPq8ddSUnSzqnsLEdqnTh7wlm67+6naIvUHDMI+Q SkkcfS6ZzEuVgzJcief1tOTlghZEjylsnWHB/BC0sqGk+u12md8T0ErOghMlBuau1saZ VTMg== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u19si13055258edo.410.2021.03.16.00.21.27; Tue, 16 Mar 2021 00:21:49 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234523AbhCPCQY (ORCPT + 99 others); Mon, 15 Mar 2021 22:16:24 -0400 Received: from mga06.intel.com ([134.134.136.31]:26012 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230080AbhCPCPz (ORCPT ); Mon, 15 Mar 2021 22:15:55 -0400 IronPort-SDR: g/oOyX9GElpCtkKe1HaS/o7G3xOnkHEChrM/Lf3N0/fKAQhqSg/MVTx9xYbE/UC7Ac/vPGcvY7 n9Dbm1MIMVaQ== X-IronPort-AV: E=McAfee;i="6000,8403,9924"; a="250550829" X-IronPort-AV: E=Sophos;i="5.81,251,1610438400"; d="scan'208";a="250550829" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2021 19:15:54 -0700 IronPort-SDR: oTD9KtMZ1jjPn6HxxlOF7zsOZemh5Z32NM5g4Up6ZSwF7Ji3sjGKsLHH8syDq4M9M9HH0NvotD zELrdGYi2vyQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,251,1610438400"; d="scan'208";a="432855368" Received: from unknown (HELO [10.239.154.55]) ([10.239.154.55]) by fmsmga004.fm.intel.com with ESMTP; 15 Mar 2021 19:15:49 -0700 Subject: Re: [PATCH v7] i2c: virtio: add a virtio i2c frontend driver To: Arnd Bergmann Cc: Jason Wang , Linux I2C , virtualization@lists.linux-foundation.org, "linux-kernel@vger.kernel.org" , "Michael S. Tsirkin" , Wolfram Sang , Wolfram Sang , Andy Shevchenko , conghui.chen@intel.com, kblaiech@mellanox.com, jarkko.nikula@linux.intel.com, Sergey Semin , Mike Rapoport , loic.poulain@linaro.org, Tali Perry , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Bjorn Andersson , yu1.wang@intel.com, shuo.a.liu@intel.com, Viresh Kumar , Stefan Hajnoczi , Paolo Bonzini References: <8070f03d-8233-636b-5ea9-395e723f7a2c@intel.com> <503b88c9-1e82-a3a3-0536-d710ddc834a5@redhat.com> From: Jie Deng Message-ID: <770332a7-f34d-fe26-f708-830b587a98d5@intel.com> Date: Tue, 16 Mar 2021 10:15:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/3/15 15:52, Arnd Bergmann wrote: > On Mon, Mar 15, 2021 at 6:54 AM Jie Deng wrote: >> On 2021/3/15 11:13, Jason Wang wrote: >>> On 2021/3/15 9:14 上午, Jie Deng wrote: >>>> On 2021/3/12 16:58, Arnd Bergmann wrote: >> Then do you think it is necessary to mark the virtio bufs with >> ____cacheline_aligned ? > I think so, yes. > >> I haven't seen any virtio interface being marked yet. If this is a >> problem, I believe it should be common for all virtio devices, right ? > Yes, but it's not a problem if the buffers are allocated separately > because kmalloc provinces a cachelinen aligned buffer on architectures > that need it. > > It's only a problem here because there is a single allocation for three > objects that have different ownership states during the DMA (device > owned to-device, cpu-owned, device owned to-cpu). > > Arnd I'm not sure if this will actually cause a problem. But I'm OK to mark the items in struct virtio_i2c_req with  ____cacheline_aligned to avoid potential problem as you said. Thank you.