Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4570376ybe; Mon, 16 Sep 2019 14:39:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNpjrHVoaei7EHFzs2pUjURG78ror/ZGSeefL7ZeVQJNZaCZ+5CkVHNkBYh4aHvSBLRTkB X-Received: by 2002:a17:906:3446:: with SMTP id d6mr1978640ejb.244.1568669992577; Mon, 16 Sep 2019 14:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568669992; cv=none; d=google.com; s=arc-20160816; b=TT574USiBMdiR0h7eHfvw9/ybEq/ZXN0ZKYDTlDXxdwrQ3RL1mKxVaFcmAmuocDRK2 XnNuZxvBh8Xn+UUl3aevqPaL0YC6SzHi5HW6a4UkTp1ohzlJwjlZOe2oGgFRXLh1G2lY 8Fb2o6DJUlzlI8u1MSjr6iBPC+wI7WqysW+pB8b8nQB7cjR8Umk1LgbFFKfIjualcQw/ RA31jaSnhgAhMkbZxw+Tujm6s4vowq1DOl0V13hgKNmmnO7NQmAcYjGGVBDpIJrE72EE M8XZTlGTbF/Ecs7LdwFYU0i9XN6brp26Z36iyDGyQ+KpWJVnudcC3tzSL4TP+mevDzQm F1zw== 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:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=Jp6I/WhdjgXBrLm8XFTV/W2CbBlPUTPrifY9W91dfHI=; b=odLjCboTZ59OX1ulBg1w6FlNdD0jlcIHsF6CvwhFQs1L7cJjEyHtjdAjWIFRs/QkFo lUFxA6+N0azY64mGJevl/OVjzejToqK+XJnRapOWjXEMQJtTV6Z+pAI+XjsytdNy9yTc FpWjXAUEjwjRJo0tItgkXIXBmLzF8ESWver+ek7dGtwXUP4P0aYjoQtHl65IwuOnaXXi ndCaNj1zum11tiAaKItzFR+LXWdyGMfGT83wjMLpv3Am+XHfvQL48/rW+szwpWJgfmIw eNPhqLXxNIgrrOURFV5UITLITOAaBVPtjRRiYDHKTuM2b9PFUIxlc6PKxa6vO97+iFbD MZLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=SgPNHmHU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z15si172894edd.431.2019.09.16.14.39.29; Mon, 16 Sep 2019 14:39:52 -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=@sifive.com header.s=google header.b=SgPNHmHU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390354AbfIPS3A (ORCPT + 99 others); Mon, 16 Sep 2019 14:29:00 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:35982 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726648AbfIPS3A (ORCPT ); Mon, 16 Sep 2019 14:29:00 -0400 Received: by mail-pl1-f194.google.com with SMTP id f19so280312plr.3 for ; Mon, 16 Sep 2019 11:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=Jp6I/WhdjgXBrLm8XFTV/W2CbBlPUTPrifY9W91dfHI=; b=SgPNHmHUI3s6Y5U+Q0BVqT7wuZAahYN9Sp7bvK/WkhmSDCYSm5A+2HKPWAwtkqtGXp 9J3gPqcUCHFjkPsRUuU3/KOZR1hYBqyd/MNpI1ipdxi9pUvmGf4l8CrTHsTBzP2tIBQ8 hFmy5Ft2frUue4ny34BBNvYMvx8XYRjMj04QJzEGKwueGRY2SpndnAROT9qoBFdw5EJm pmSgIzCOb60ekhNb5wLkLoTTOYA6xXYpqBLK5btuPldjQ2T2RWcShbymrS2g+P20jTDk J+EEppal95vaxj+HdoxekXNZMooOdG9AHCiBegMOADmYTE4Cj6LN4ZjAIM8hUT2YUY+H p7Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=Jp6I/WhdjgXBrLm8XFTV/W2CbBlPUTPrifY9W91dfHI=; b=YoHkkPPF83LhpSpJS3M1mGJHUZj8uA6C0cVqVOCMOyeDkCd+eU652g+ekG617JCop7 isGAA8dLnO9IDyeRh+CDVn3foLA7mQssSEIr1f2lVb4oIrEI2iPgXbDmmuBTgfD4F23o ZPTJ6VQXC2h1W0p/DIFLqOeAvzDhnyJ+j6Eul5rpyIlbBAtOaFvnyJI3cZ206cEkKzyn d8xADaJwdVzVD2ec+HheVPdMD+/KurQDIog973fxLo9WLmSAxTQHTTspvtUdhb99hJ2H 41djr3fY4htv3oMggLy7zjZILIPEUiiAYVIC/ocu04j2FW2/MgAI9f7ngT7Biifc2GOJ xIVQ== X-Gm-Message-State: APjAAAWmy2cWz0wbYhSHnlhdsSLtQvUeKctwKru0+bA0hKSZMB9I5XOo sEEAB/IXL4JWjY3xZ+Tf6y280Q== X-Received: by 2002:a17:902:5a44:: with SMTP id f4mr1093510plm.31.1568658539014; Mon, 16 Sep 2019 11:28:59 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id a4sm12595350pfn.110.2019.09.16.11.28.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 11:28:58 -0700 (PDT) Date: Mon, 16 Sep 2019 11:28:58 -0700 (PDT) X-Google-Original-Date: Mon, 16 Sep 2019 11:28:52 PDT (-0700) Subject: Re: [PATCH RFC 11/14] arm64: Move the ASID allocator code in a separate file In-Reply-To: <20190916181800.7lfpt3t627byoomt@willie-the-truck> CC: Anup Patel , guoren@kernel.org, Will Deacon , julien.thierry@arm.com, aou@eecs.berkeley.edu, james.morse@arm.com, Arnd Bergmann , suzuki.poulose@arm.com, marc.zyngier@arm.com, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, rppt@linux.ibm.com, Christoph Hellwig , Atish Patra , julien.grall@arm.com, 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 From: Palmer Dabbelt To: will@kernel.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Sep 2019 11:18:00 PDT (-0700), will@kernel.org wrote: > On Sun, Sep 15, 2019 at 05:03:38AM +0000, Anup Patel wrote: >> >> >> > -----Original Message----- >> > From: linux-kernel-owner@vger.kernel.org > > owner@vger.kernel.org> On Behalf Of Palmer Dabbelt >> > Sent: Saturday, September 14, 2019 7:31 PM >> > To: will@kernel.org >> > Cc: guoren@kernel.org; Will Deacon ; >> > julien.thierry@arm.com; aou@eecs.berkeley.edu; james.morse@arm.com; >> > Arnd Bergmann ; suzuki.poulose@arm.com; >> > marc.zyngier@arm.com; catalin.marinas@arm.com; Anup Patel >> > ; linux-kernel@vger.kernel.org; >> > rppt@linux.ibm.com; Christoph Hellwig ; Atish Patra >> > ; julien.grall@arm.com; 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 >> > Subject: Re: [PATCH RFC 11/14] arm64: Move the ASID allocator code in a >> > separate file >> > >> > On Thu, 12 Sep 2019 07:02:56 PDT (-0700), will@kernel.org 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.bruck >> > >> > er@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. >> > > >> > >> Welcome to join our disscusion: >> > >> "Introduce an implementation of IOMMU in linux-riscv" >> > >> 9 Sep 2019, 10:45 Jade-room-I&II (Corinthia Hotel Lisbon) RISC-V MC >> > > >> > > I attended this session, but it unfortunately raised many more >> > > questions than it answered. >> > >> > Ya, we're a long way from figuring this out. >> >> For everyone's reference, here is our first attempt at RISC-V ASID allocator: >> http://archive.lwn.net:8080/linux-kernel/20190329045111.14040-1-anup.patel@wdc.com/T/#u > > With a reply stating that the patch "absolutely does not work" ;) > > What exactly do you want people to do with that? It's an awful lot of effort > to review this sort of stuff and given that Guo Ren is talking about sharing > page tables between the CPU and an accelerator, maybe you're better off > stabilising Linux for the platforms that you can actually test rather than > getting so far ahead of yourselves that you end up with a bunch of wasted > work on patches that probably won't get merged any time soon. > > Seriously, they say "walk before you can run", but this is more "crawl > before you can fly". What's the rush? I agree, and I think I've been pretty clear here: we're not merging this ASID stuff until we have a platform we can test on, particularly as the platforms we have now already need some wacky hacks around TLB flushing that we haven't gotten to the bottom of. > Will