Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: * X-Spam-Status: No, score=1.8 required=3.0 tests=FORGED_MUA_MOZILLA, HEADER_FROM_DIFFERENT_DOMAINS,HTML_IMAGE_ONLY_32,HTML_MESSAGE,INVALID_MSGID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F1ECC072B1 for ; Mon, 20 May 2019 08:23:07 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 2FB3D2081C for ; Mon, 20 May 2019 08:23:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FB3D2081C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=cloudminds.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id C20004A50F; Mon, 20 May 2019 04:23:06 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id do8FhNfknI3F; Mon, 20 May 2019 04:22:58 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 9D6914A51D; Mon, 20 May 2019 04:22:53 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 904A44A49C for ; Mon, 20 May 2019 03:31:52 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id STVXTGUkVR6M for ; Mon, 20 May 2019 03:31:43 -0400 (EDT) Received: from smtpbgeu2.qq.com (smtpbgeu2.qq.com [18.194.254.142]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id B3D194A477 for ; Mon, 20 May 2019 03:31:42 -0400 (EDT) X-QQ-mid: bizesmtp12t1558337493tgxz4cig Received: from [10.11.32.138] (unknown [39.155.168.46]) by esmtp6.qq.com (ESMTP) with id ; Mon, 20 May 2019 15:31:32 +0800 (CST) X-QQ-SSF: 00400000002000B0C414B00A0000000 X-QQ-FEAT: xeo957adDlYf7iMhHS9V/ysP9pI9/RMXs/q8XrXpbO5OgMKDnhpST3espKqzN rHUCljYgQZ/JtFmxppROG98X4DCtXMs1hWW9Ygnn/dRIPuxruyFbIQo5RQtiZ6QCaquCv64 chaAJQzNGD+Lh8U9h1M3LGs6UzqireZ/VIKf+itZVjsR0tpcaoxFK+AR1od3uJnl/6ibnT9 y1je8Bt1N5R7JPst5kAFAM4uv4fymxBhTDxp3mQrC7VbmCdcR1qe3X1QTsJ7Diddfw1JGvC Z+TP0H/xStCDYRGf/BG4ifiuF02iOGxYVdY1sBAEq1zOQ1FHQPWCje1m+NHv7wxiFJtNVrR 1cbaD+QiHYkL+cJ/dLd+JHf2fkKjpbfIOsOORcUfp+QkxeDsQg= X-QQ-GoodBg: 2 Subject: Re: ARM64 kvm cache coherency problem To: Marc Zyngier References: <7c31d3ab-ac30-626e-05be-b2547b558f4a@cloudminds.com> <86v9y57g3k.wl-marc.zyngier@arm.com> From: kevin zhao Message-ID: +A8E7809C801C9670 Date: Mon, 20 May 2019 15:31:32 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <86v9y57g3k.wl-marc.zyngier@arm.com> Content-Type: multipart/mixed; boundary="------------2E9DF8F2858015918D824799" Content-Language: en-US X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:cloudminds.com:qybgforeign:qybgforeign2 X-QQ-Bgrelay: 1 X-Mailman-Approved-At: Mon, 20 May 2019 04:22:52 -0400 Cc: kvmarm@lists.cs.columbia.edu X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu This is a multi-part message in MIME format. --------------2E9DF8F2858015918D824799 Content-Type: multipart/alternative; boundary="------------237D5C8B51BA9A41CFA368BA" --------------237D5C8B51BA9A41CFA368BA Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit It's much more clear to me now. Thanks Marc ! 在 2019/5/20 下午3:14, Marc Zyngier 写道: > Hi Kevin, > > On Mon, 20 May 2019 04:19:50 +0100, > kevin zhao wrote: >> [1 ] >> [1.1 ] >>  Hi, there: >> >>     I have seen some RFC about solving ARM64 kvm cache incoherency >> issue ([1], [2]) in May 2015. I followed a few threads and did not >> know how this arguments ends. > First, let me put things straight: there is no KVM/arm64 cache > coherency problem. The issue is that people expect behaviours that are > specific to x86 (such as coherency between cacheable and non-cacheable > aliases) to work on non-x86 architectures. This isn't a reasonable > expectation, unfortunately. > > The patches you refer to try to workaround the issue by changing > either QEMU's or the kernel's behaviour. I contend that none of these > need to be changed, but instead the guest has to be fixed to properly > behave on the arm64 architecture, which includes things such as not > lying about what is a real device and what is an emulated one. > > I've ranted publicly on this very subject a long while ago[1], with > all the gory details of what fails, why, and what the solutions > are. In the end, KVM/arm64 works remarkably well for what actually > matters, such as PV devices (virtio) and directly assigned devices, > without any cache coherency issue. > >>    Does anybody know how this problem  is solved finally ? > The architecture has gained the ARMv8.4 FWB extension, which solves > some of these problems by allowing Stage-2 to override the guest's > attributes (and a couple of other things that make I$/D$ coherency > much easier). Yes, it would have been nice to have this since day one > (circa 2008), but it involves getting hold of a crystal ball and a > time machine, both of which are out of stock at my local dealer. > > I don't know of any publicly available CPU implementing FWB at this > stage, so this is a moot point... > > Thanks, > > M. > > [1] https://events.static.linuxfound.org/sites/events/files/slides/slides_10.pdf > -- --------------237D5C8B51BA9A41CFA368BA Content-Type: multipart/related; boundary="------------34406AE4D530A0FD99574304" --------------34406AE4D530A0FD99574304 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

It's much more clear to me now.

Thanks Marc !

在 2019/5/20 下午3:14, Marc Zyngier 写道:
Hi Kevin,

On Mon, 20 May 2019 04:19:50 +0100,
kevin zhao <xiaoqiang.zhao@cloudminds.com> wrote:
[1  <multipart/alternative (7bit)>]
[1.1  <text/plain; UTF-8 (8bit)>]
 Hi, there:

    I have seen some RFC about solving ARM64 kvm cache incoherency
issue ([1], [2]) in May 2015. I followed a few threads and did not
know how this arguments ends.
First, let me put things straight: there is no KVM/arm64 cache
coherency problem. The issue is that people expect behaviours that are
specific to x86 (such as coherency between cacheable and non-cacheable
aliases) to work on non-x86 architectures. This isn't a reasonable
expectation, unfortunately.

The patches you refer to try to workaround the issue by changing
either QEMU's or the kernel's behaviour. I contend that none of these
need to be changed, but instead the guest has to be fixed to properly
behave on the arm64 architecture, which includes things such as not
lying about what is a real device and what is an emulated one.

I've ranted publicly on this very subject a long while ago[1], with
all the gory details of what fails, why, and what the solutions
are. In the end, KVM/arm64 works remarkably well for what actually
matters, such as PV devices (virtio) and directly assigned devices,
without any cache coherency issue.

   Does anybody know how this problem  is solved finally ?
The architecture has gained the ARMv8.4 FWB extension, which solves
some of these problems by allowing Stage-2 to override the guest's
attributes (and a couple of other things that make I$/D$ coherency
much easier). Yes, it would have been nice to have this since day one
(circa 2008), but it involves getting hold of a crystal ball and a
time machine, both of which are out of stock at my local dealer.

I don't know of any publicly available CPU implementing FWB at this
stage, so this is a moot point...

Thanks,

	M.

[1] https://events.static.linuxfound.org/sites/events/files/slides/slides_10.pdf

--
--------------34406AE4D530A0FD99574304 Content-Type: image/png; name="CloudMinds Logo_English_Color_Landscape_forEmail116.png" Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: inline; filename="CloudMinds Logo_English_Color_Landscape_forEmail116.png" iVBORw0KGgoAAAANSUhEUgAAAHQAAAAcCAYAAAHHOquGAAAAAXNSR0IArs4c6QAAEDVJREFU aAXtmgl0VdW5gM9wh8zIpAngQx62gJZWCWB5FgmCCRmJQaSTmIKiQhXqsygOEISC1FeWKChq faBvuaSyIHOAMIjCKspUh1JQi0ARCCSIhNzk3nvuPed9/wnncgmB1uVK30sXe61z9z57+Pe/ //nf5yrKtym52dkHnt44/PjTG4Yfz8nJeU5gjR07Vo+GmZaW5op+Lyoq0uTd7rznrWNXDqh7 QBlkVZu5OTnzm5qafsLYNTIBgJWqoqTnZmXdYWnaTtr7d+3YUcrQOBlX8nJzTXnsl2/6w27H vukaG++BUxuSnYUtzxZ1drD9O2VMQYElU/Jycj6FkDvAaB9nHi99tD+S+tsVoN2Rm5ubLlCy s7MzaI/5dhAvvdol8lBeUdHrxL19C1/ZPPyLRQsz5taWPfTf9C8sr6x8OC8vL7GsrOwMiB20 LOthTVVXMd+mFUc+qKpqHP1d2SYEbZa4dH1qKBy+OxwOb4rxeg+HQ6HZqqaNZ04vnveZ10cB +EzB6+g9fVOl7laweIDUnHai1G1aUlNT3S2loE03dKRGNim4/XZbgtpyQzUzM7P30P8Mfh1S wnWyUZOid/nzorik8vLyA/Iup9+8eXOY5qWQUZmnMy/kUEvasj6qiBzYMGzbMK24pu7uyT06 /zTuU3PKo0+cGmys6iWT80ePtkpKS22hGTVqVB+vx7PPDIdf8Hi9D/oDgd6DBg06+Kfdu8MI zs1o7H+w5L8SEhIWsGACFLtCYKwuLlZH5+VZ7FZomeYSuoK2djeFTOXl5/92cvIj009ZYUPm 2sU0zYi5oN14ur7e7fZ4HkQKFd6Du3btWlxaVmYj1dnnW4w0/5GFcsIg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V xb+iHREfLevZvx64Fj6zQ8s1ghN9LgSs3vljzpAhQ2KTkpLkaRC8wa+D7FtSUnIan4rF98Zx Dh97y/29FBXTncSHB/WGG26ojz4b82Pwvedp/Fl6GPhYG24ziOZfcLfY52sbKBt7/I2Nz5N/ 3oekNGCCnsGMvLRu3bqvohcdndj3p7Dv6pTXPl1wVf6iGfDywPHiqSui55x12JNh/mMgH0/A 8xIS/LBcQ0fPu9xuOwpEJFe2QPK8fNb6BRo7E7OXgvNdj7rLBcEFn78dlDBBgwlC5iEQIwhS jmESigzTfD1KEp2pl+t/AgXOY2jL/fAbg9C2p1DpXJhbgxNfgK9YybxxOIXppAFX0V+KTZ+D E9/Vcv3l938+BS7J0Gh0xG/AwN+y4F60Vj7DPCZ/d4+ec7n9f0+B/wXU7O7oKFtptAAAAABJ RU5ErkJggg== --------------34406AE4D530A0FD99574304-- --------------237D5C8B51BA9A41CFA368BA-- --------------2E9DF8F2858015918D824799 Content-Type: text/x-vcard; charset=utf-8; name="xiaoqiang_zhao.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xiaoqiang_zhao.vcf" begin:vcard fn;quoted-printable:=E8=B5=B5 =E5=B0=8F=E5=BC=BA n;quoted-printable;quoted-printable:=E5=B0=8F=E5=BC=BA;=E8=B5=B5 version:2.1 end:vcard --------------2E9DF8F2858015918D824799 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm --------------2E9DF8F2858015918D824799--