Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1093870pxf; Fri, 12 Mar 2021 01:31:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgVIembF4mSxa3DRsjj+2JvWDom63Zlu8sztdQCyTuBoqLmcd9HR1ZLVwgKeNyCJhozf2y X-Received: by 2002:a17:906:4d18:: with SMTP id r24mr7351060eju.493.1615541503663; Fri, 12 Mar 2021 01:31:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615541503; cv=none; d=google.com; s=arc-20160816; b=03vproPr1Uy68wc43qYCBVJlpoWhZWHaoepO5y1Fuqidnkk6UxCw6uMOqeh2xKgNLW 0EgWt4j5K1XKjJLbPTJn2yGXLIygPksh7jVulRINLS3NmqsMcBDTPIoG/wU1mw0Uabq9 tHZNAMN6yrYF3YqTiYina+/noA1y1+354QYSsX60YwG/NBbAAAEUa/XgJfYzFw3Am3Gv XP9aWJtl4VviJlVQRseHZ0E+wDw+zZi/Td6fSeUhnEcJrt0SzXqEATNQ3wu9eJvkMKSw v8ip8+Ebz3xi9FL0gvNHOydMam2FK+BWx9SaWgkuNEmxVGlx6ypn/Da0TkXz+Q0atO1l AxQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=1uQb5Uyf4PP83K2luPZfhKa7p7qLJ1MZ4lXZH8BjcS0=; b=q7VqoP3NqS0Umy9B4wxxLEzaM2o/6gBBZ+Mr5s/BkKF1xY7JH18d+OTcI9k3/bQBT0 NzicsSZaveboCfIKN1Xurg6r+2TqBMdKyRJrUR6xMwSkyzoc0MHr6Ur2YNYGDFkaMgOl f81Z8/mN7SVq2euzjqpTbPOayPeysGMMXvQtOkgIGPsjBzmfdzsCxw/9+HhyRtFVwfM1 M2ILMHcJmpjU9aGWBQ6Ulu2vSrDhDK+N6ojlYaPC93LKHdU42qlgQLExd78WlEA7tWoQ uZ9IOSyvspXh/0lKlE+ztHzxqb46VhDV3kJYmdEam5xgZbrF7lfSkre5cmVyG/NiNa2J tnQA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi7si3795039ejb.754.2021.03.12.01.31.20; Fri, 12 Mar 2021 01:31:43 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232837AbhCLJaI (ORCPT + 99 others); Fri, 12 Mar 2021 04:30:08 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:13883 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232860AbhCLJ3r (ORCPT ); Fri, 12 Mar 2021 04:29:47 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DxgTR1Pjnz8x4g; Fri, 12 Mar 2021 17:27:55 +0800 (CST) Received: from [10.174.184.42] (10.174.184.42) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Fri, 12 Mar 2021 17:29:35 +0800 Subject: Re: [RFC PATCH] kvm: arm64: Try stage2 block mapping for host device MMIO To: Marc Zyngier References: <20210122083650.21812-1-zhukeqian1@huawei.com> <87y2euf5d2.wl-maz@kernel.org> <87o8fog3et.wl-maz@kernel.org> CC: , , , , Will Deacon , Catalin Marinas , Mark Rutland , James Morse , Robin Murphy , Joerg Roedel , Daniel Lezcano , Thomas Gleixner , "Suzuki K Poulose" , Julien Thierry , Andrew Morton , Alexios Zavras , , From: Keqian Zhu Message-ID: Date: Fri, 12 Mar 2021 17:29:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <87o8fog3et.wl-maz@kernel.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.184.42] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On 2021/3/12 16:52, Marc Zyngier wrote: > On Thu, 11 Mar 2021 14:28:17 +0000, > Keqian Zhu wrote: >> >> Hi Marc, >> >> On 2021/3/11 16:43, Marc Zyngier wrote: >>> Digging this patch back from my Inbox... >> Yeah, thanks ;-) >> >>> >>> On Fri, 22 Jan 2021 08:36:50 +0000, >>> Keqian Zhu wrote: >>>> >>>> The MMIO region of a device maybe huge (GB level), try to use block >>>> mapping in stage2 to speedup both map and unmap. [...] >>>> break; >>>> >>>> - pa += PAGE_SIZE; >>>> + pa += pgsize; >>>> } >>>> >>>> kvm_mmu_free_memory_cache(&cache); >>> >>> There is one issue with this patch, which is that it only does half >>> the job. A VM_PFNMAP VMA can definitely be faulted in dynamically, and >>> in that case we force this to be a page mapping. This conflicts with >>> what you are doing here. >> Oh yes, these two paths should keep a same mapping logic. >> >> I try to search the "force_pte" and find out some discussion [1] >> between you and Christoffer. And I failed to get a reason about >> forcing pte mapping for device MMIO region (expect that we want to >> keep a same logic with the eager mapping path). So if you don't >> object to it, I will try to implement block mapping for device MMIO >> in user_mem_abort(). >> >>> >>> There is also the fact that if we can map things on demand, why are we >>> still mapping these MMIO regions ahead of time? >> >> Indeed. Though this provides good *startup* performance for guest >> accessing MMIO, it's hard to keep the two paths in sync. We can keep >> this minor optimization or delete it to avoid hard maintenance, >> which one do you prefer? > > I think we should be able to get rid of the startup path. If we can do > it for memory, I see no reason not to do it for MMIO. OK, I will do. > >> BTW, could you please have a look at my another patch series[2] >> about HW/SW combined dirty log? ;) > > I will eventually, but while I really appreciate your contributions in > terms of features and bug fixes, I would really *love* it if you were > a bit more active on the list when it comes to reviewing other > people's code. > > There is no shortage of patches that really need reviewing, and just > pointing me in the direction of your favourite series doesn't really > help. I have something like 200+ patches that need careful reviewing > in my inbox, and they all deserve the same level of attention. > > To make it short, help me to help you! My apologies, and I can't agree more. I have noticed this, and have reviewed several patches of IOMMU community. For that some patches are with much background knowledge, so it's hard to review. I will dig into them in the future. Thanks for your valuable advice. :) Thanks, Keqian > > Thanks, > > M. >