Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2335658ybe; Thu, 12 Sep 2019 08:02:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQlNIEs7fKamOE7XO/vHd+/09zNkqscdBYBmQMBQxCERD4EEDW+ypjkvL/P5dbqXvYb62r X-Received: by 2002:a17:906:d922:: with SMTP id rn2mr34411324ejb.169.1568300554582; Thu, 12 Sep 2019 08:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568300554; cv=none; d=google.com; s=arc-20160816; b=E232qtt+I6jM2WVN1hSSThbFRBFSp4C61ccp42K4lvrLTnyWan12D5/53kPZWAvt+N eZRsupE4xkrevCt5QmE9bMBH5zsjlYk8cx87sFXrBBSuixlWdnBRqjS5nWu1z/uIhr5a 9DrId1lEea+E6ttt/ity031+opqD3ntmtU/te+x0XNTCEdh2LnJhTQtRRd51UBJCScwz AEg8QAaiiwmp1VSjvJF/cI6aJwL4q0/AplE6pRsdniQSVq/4z8H95c/hyRwARPJ8dZea Avo36XHljDHbvsBBLtsTVu+bVbYPScdNQQyRQx7ShIbVr8rkdANNFBMjiiypeg7U9fro 7ucw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bbku6qThJqV4sn2Vkw1SI8jv5rF56KfEZvuVbOWshF0=; b=iWHPcljKLspvK7f0uhSoXVjhSNy8pNBd7bBSdeoIs5tw14bWYHGHRAiKLp3dTbNoqx mSH3U4tTjwUkMDAYdukWaWNfqVEeiWAbZNCOwaYS8BnznU19CDVf2alcXfNgwGz6VdWh sv3VF5JXZNJaH+0nlptWBKqTsEokSxu3cOqke2FO7gVrABBKu0kZReE6jXH4823mDy88 N6GqDym+RdzoiMNOEqo0BAW2ugSMHzSCMapxdjHaQT/OS2NImT17+Kz4FEZJGcUrCDh6 F1uSAB/T+U8PPu4BQ1nEyOBrtWaw9zY/qfdeqvHdSuuQ95gDfiVm4IMPKRy2Q2uFPKIK Lzhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Mp8tMCnH; 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 y5si5030666edm.73.2019.09.12.08.02.09; Thu, 12 Sep 2019 08:02:34 -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=Mp8tMCnH; 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 S1732845AbfILO76 (ORCPT + 99 others); Thu, 12 Sep 2019 10:59:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:33286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732444AbfILO76 (ORCPT ); Thu, 12 Sep 2019 10:59:58 -0400 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 E362F20856 for ; Thu, 12 Sep 2019 14:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568300397; bh=RK47i9JzV2o8zYa+doB7UiayI/FwXMaWv5Ml8LccsgY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Mp8tMCnHBMtri7nKuvpjSoNW3SBhD9Q2PQQus+HoDhqqsO2hfh5+kB+09qrWUHo06 Xg50YZM1a8zDvFIJJv0CI/EvakHiQne0lhgmu9mtHuf7+l8qkR8L3fuEBxSzlzY4/S /qPsvdajQdsWoOvQTd8Ut5MEZxBU2HYNYlaTeYNs= Received: by mail-wr1-f42.google.com with SMTP id k6so16676822wrn.11 for ; Thu, 12 Sep 2019 07:59:56 -0700 (PDT) X-Gm-Message-State: APjAAAUN8G3NAXB6G2kaGAQv/QpbQmaJRrxp06n/+Od23v1/kaqikAgw fqcxwD/3S3uVEYK6d68kHH9uSWEb7Wuax80YsaM= X-Received: by 2002:a5d:6b49:: with SMTP id x9mr12703438wrw.80.1568300395358; Thu, 12 Sep 2019 07:59:55 -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: <20190912140256.fwbutgmadpjbjnab@willie-the-truck> From: Guo Ren Date: Thu, 12 Sep 2019 15:59:43 +0100 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.brucker@arm.com > > > > Yes, it is hard to maintain ASID between IOMMU and CPUMMU or different > > system, because it's difficult to synchronize the IO_ASID when the CPU > > ASID is rollover. > > But we could still use hardware broadcast TLB invalidation instruction > > 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 the > 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 reality, 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/