Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2142784ybe; Sat, 14 Sep 2019 08:36:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVBCQ0WPRm2FNN5bqIhWwa9GZ+QIPMA+kik10HucYVCPNnl8NnWyrWwxzU3eUlvXLpSc8f X-Received: by 2002:a17:906:4d0f:: with SMTP id r15mr9588922eju.147.1568475384312; Sat, 14 Sep 2019 08:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568475384; cv=none; d=google.com; s=arc-20160816; b=PhRi0P4Zc+lh5zXol6jYc1C2lnjiDNqAzb40mh6AbH+4X/WGwzRDetdjLpVP2/Z3IF HmMIQ2wH80dmszfOdCQYGlkOKIqZx+1khV+oMpYpedLfiDOkf1s5S6LlDPdTSzUIcB9R nzdsWfzbyuxeCtcwGAGevH+DXzNsAsJgXpzhkc6d0dln2jcEYA/wZQAKX0a4RAHw113U Nk1Y6ZYV7hrMe1CX8vniqEnZJugxUeieX3kglk7PHq1FsNQeFsQq/1I+1NyzYH6gSUmU vUO0Z3tldLSgs8+co5sHZjqBixFFJ0U71/g34cVHK8CnEE3Bs1VbFCocuZL+SBvWlKce rbGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=2ByQMo5I4Ykp1fHcw54/m3RV/m/DnHZSG5rtJTWxjNI=; b=tYO54LNZXRXI1JGOAwpYRofycffTq4taQZp4X7I2VGo0Sj/zB58X/iAf7duiMukPeH bV1CywfF1C7OBtI9hp5qnD9JEAADXMRnUmfK3eW/ljxo9JQIkp05tPbs3fTUu69guc1N vuZq1MhV4TBlVm6cKUlO6jjQl8R3FjTXbeRZsEstSsudT11V55OJvB4OP994m3ye2v4L OUbsV9d/dAT5CtGl+H8xf5RULSr3xJn1ZZ+uMGsng5x3jldpAJr9Up1FlJ7K5SbyK4YV 1wb3e0U6ihslhMUBi48dSRbLGAXf8LzzbQ0VuOs/lGt+rmHoxYq0CdrdOS0jMHfd+OV9 hBfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NvC0HAkb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j3si7191979edj.448.2019.09.14.08.36.00; Sat, 14 Sep 2019 08:36:24 -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; dkim=pass header.i=@kernel.org header.s=default header.b=NvC0HAkb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727644AbfINIt4 (ORCPT + 99 others); Sat, 14 Sep 2019 04:49:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:33382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727481AbfINIt4 (ORCPT ); Sat, 14 Sep 2019 04:49:56 -0400 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D1529214AE for ; Sat, 14 Sep 2019 08:49:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568450995; bh=J9o3/Ce1+YLaWOJS+1y9FmaoiXDLsFcat/B4OJD07xQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=NvC0HAkbO+X0R/hUr5ElgQAkn9X+DlHgQCaI+WUT3QaLpkyww7ouKYCiu+gLQdPnN Zt2iNLvAcaA/7M7mBWG5GC72IVnUlLTjmJnBCwL8Gs+y4/DomRNvqSFSk4OlGnDjoe Dtl/nAegdQl/qfiWPrj/maTEs4oYOJwLv1kg+bio= Received: by mail-wr1-f54.google.com with SMTP id h7so33183776wrw.8 for ; Sat, 14 Sep 2019 01:49:54 -0700 (PDT) X-Gm-Message-State: APjAAAXL4ES9vmkPCU9QSCvU1NGXsCh9sXKGi7o0DZ/soVqn0XviDIAs In0ILWQIl/OF8Mna9SUHYjC9QM29Y1XwUFpdrKY= X-Received: by 2002:adf:fe0f:: with SMTP id n15mr5204507wrr.343.1568450992705; Sat, 14 Sep 2019 01:49:52 -0700 (PDT) MIME-Version: 1.0 References: <20190321163623.20219-12-julien.grall@arm.com> <0dfe120b-066a-2ac8-13bc-3f5a29e2caa3@arm.com> <20190619091219.GB7767@fuggles.cambridge.arm.com> <20190619123939.GF7767@fuggles.cambridge.arm.com> <20190624104006.lvm32nahemaqklxc@willie-the-truck> <20190912140256.fwbutgmadpjbjnab@willie-the-truck> In-Reply-To: From: Guo Ren Date: Sat, 14 Sep 2019 16:49:40 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC 11/14] arm64: Move the ASID allocator code in a separate file To: Will Deacon Cc: Will Deacon , julien.thierry@arm.com, aou@eecs.berkeley.edu, james.morse@arm.com, Arnd Bergmann , suzuki.poulose@arm.com, Marc Zyngier , Catalin Marinas , Anup Patel , Linux Kernel Mailing List , Mike Rapoport , Christoph Hellwig , Atish Patra , Julien Grall , Palmer Dabbelt , gary@garyguo.net, Paul Walmsley , christoffer.dall@arm.com, linux-riscv@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Here is the presentation, any comments is welcome. https://docs.google.com/presentation/d/1sc295JznVAfDIPieAqzjcyUkcHnNFQsK8FF= qdoCY854/edit?usp=3Dsharing On Fri, Sep 13, 2019 at 3:13 PM Guo Ren wrote: > > Another idea is seperate remote TLB invalidate into two instructions: > > - sfence.vma.b.asyc > - sfence.vma.b.barrier // wait all async TLB invalidate operations finis= hed for all harts. > > (I remember who mentioned me separate them into two instructions after se= ssion. Anup? Is the idea right ?) > > Actually, I never consider asyc TLB invalidate before, because current ou= r light iommu did not need it. > > Thx all people attend the session :) Let's continue the talk. > > > Guo Ren =E4=BA=8E 2019=E5=B9=B49=E6=9C=8812=E6=97=A5= =E5=91=A8=E5=9B=9B 22:59=E5=86=99=E9=81=93=EF=BC=9A >> >> Thx Will for reply. >> >> On Thu, Sep 12, 2019 at 3:03 PM Will Deacon wrote: >> > >> > On Sun, Sep 08, 2019 at 07:52:55AM +0800, Guo Ren wrote: >> > > On Mon, Jun 24, 2019 at 6:40 PM Will Deacon wrote: >> > > > > I'll keep my system use the same ASID for SMP + IOMMU :P >> > > > >> > > > You will want a separate allocator for that: >> > > > >> > > > https://lkml.kernel.org/r/20190610184714.6786-2-jean-philippe.bruc= ker@arm.com >> > > >> > > Yes, it is hard to maintain ASID between IOMMU and CPUMMU or differe= nt >> > > system, because it's difficult to synchronize the IO_ASID when the C= PU >> > > ASID is rollover. >> > > But we could still use hardware broadcast TLB invalidation instructi= on >> > > to uniformly manage the ASID and IO_ASID, or OTHER_ASID in our IOMMU= . >> > >> > That's probably a bad idea, because you'll likely stall execution on t= he >> > CPU until the IOTLB has completed invalidation. In the case of ATS, I = think >> > an endpoint ATC is permitted to take over a minute to respond. In real= ity, I >> > suspect the worst you'll ever see would be in the msec range, but that= 's >> > still an unacceptable period of time to hold a CPU. >> Just as I've said in the session that IOTLB invalidate delay is >> another topic, My main proposal is to introduce stage1.pgd and >> stage2.pgd as address space identifiers between different TLB systems >> based on vmid, asid. My last part of sildes will show you how to >> translate stage1/2.pgd to as/vmid in PCI ATS system and the method >> could work with SMMU-v3 and intel Vt-d. (It's regret for me there is >> no time to show you the whole slides.) >> >> In our light IOMMU implementation, there's no IOTLB invalidate delay >> problem. Becasue IOMMU is very close to CPU MMU and interconnect's >> delay is the same with SMP CPUs MMU (no PCI, VM supported). >> >> To solve the problem, we could define a async mode in sfence.vma.b to >> slove the problem and finished with per_cpu_irq/exception. >> >> -- >> Best Regards >> Guo Ren >> >> ML: https://lore.kernel.org/linux-csky/ --=20 Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/