Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp626396ybi; Wed, 19 Jun 2019 05:18:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8RFoZrtXpy1s0ItPZC2+vjL9dUeVqKowm4jJtJDE83ArVzMQx3gBI5q6XPILS/Y1zbCcR X-Received: by 2002:a63:35c7:: with SMTP id c190mr1278221pga.445.1560946724449; Wed, 19 Jun 2019 05:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560946724; cv=none; d=google.com; s=arc-20160816; b=WxKc934cwsWV72SFO1HME1lHMeIp2/IFZsMU/iwDunVlwMowEqK9g9wcbfvbVzgnQf PC56VVxEeve7zkRfB+cqGdcmvgUlaBWOL0nAhu+IYGV8qSQaTsOKO9L77hP0BMyWOVcw 3qJmSdy3Kwu4fzGJqOyWxaJc98rhMl4xkUtsDIhANGchmwQjykrwvdKzgqC9J1fJED3K wOsk4rkxgdgNnuRwrP20qjZ93vC5ahSgFWysPMOIbGLx184+zSSY0Sj8cCHEYUCiO2XX mOWkZsutUBOcOmPmMBMq1upUpc8ldqpUevQMaLgYpLXDudUVSY5kX7Zl+OHxkFelH3Zy aFCw== 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=yhxv7AgwzvhlNQSVBLS6wZ1SselhU4cEOOFs1fJpxDY=; b=KBrzETRRJoa3IJTUr1r1RcpzdyUCprqY66LJGmYpOUMAvgN6KY30NACpvA+KwYYjbx kMBCHqqOTH2hV9uigxDMdsCICadHzwCCHHXIzvZlrtzAlNs2/AlSDsGJ2/6KphYZzv2U yq8Oegd/SYfAVhHG89Z0f4KGkTzXgElBwFWr+v+Tc0Zc3kDL3cNPc5IeD0VhSblsmQPV kffImZ//9po6w8ndw9DDEXgUxxmQ6nVb7ksqZxg/x01HiwGLdyo9qDa2J6311/nQuW6S 66fhot5KIq1tF7npOroDoKJle0kbPaM0WpP32aYzB6aX3VXgHkkkE+0AYB9xsNlNLu6z A+bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZMiqI8mC; 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 t11si528417pgn.369.2019.06.19.05.18.29; Wed, 19 Jun 2019 05:18:44 -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=ZMiqI8mC; 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 S1731423AbfFSMST (ORCPT + 99 others); Wed, 19 Jun 2019 08:18:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:51468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726246AbfFSMSS (ORCPT ); Wed, 19 Jun 2019 08:18:18 -0400 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 4859C21743 for ; Wed, 19 Jun 2019 12:18:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560946697; bh=yhxv7AgwzvhlNQSVBLS6wZ1SselhU4cEOOFs1fJpxDY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZMiqI8mCi4evJQcYbolWFw0wyCpQPmy2G+Hb5PKLNhNmRtNecRI+6q89w5OJsc8qc 0uIZ37uH9jzLWnIN0Amvcwyx6Uh8a3/6gfMVMF3B6gI70L1a/+0tTyniMwP/Zdbra7 V9JB0No19qxSDpgkuWn3j35uD4TnLbqjkoH21P3E= Received: by mail-wr1-f43.google.com with SMTP id c2so3140496wrm.8 for ; Wed, 19 Jun 2019 05:18:17 -0700 (PDT) X-Gm-Message-State: APjAAAX37wPBYElEC+2HDpIyt4MMdxxOt6d3lU9R7qn/WwLrO8k9TEcm 86E5HnRVVLarpIoAcB3f1R3EsWqghyYpxhHfvM4= X-Received: by 2002:adf:9bd3:: with SMTP id e19mr8408054wrc.38.1560946695784; Wed, 19 Jun 2019 05:18:15 -0700 (PDT) MIME-Version: 1.0 References: <20190321163623.20219-1-julien.grall@arm.com> <20190321163623.20219-12-julien.grall@arm.com> <0dfe120b-066a-2ac8-13bc-3f5a29e2caa3@arm.com> <20190619091219.GB7767@fuggles.cambridge.arm.com> In-Reply-To: <20190619091219.GB7767@fuggles.cambridge.arm.com> From: Guo Ren Date: Wed, 19 Jun 2019 20:18:04 +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: Arnd Bergmann , Will Deacon Cc: linux-kernel@vger.kernel.org, Julien Grall , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, aou@eecs.berkeley.edu, gary@garyguo.net, Atish.Patra@wdc.com, hch@infradead.org, paul.walmsley@sifive.com, rppt@linux.ibm.com, linux-riscv@lists.infradead.org, Anup Patel , Palmer Dabbelt , suzuki.poulose@arm.com, Marc Zyngier , catalin.marinas@arm.com, julien.thierry@arm.com, christoffer.dall@arm.com, james.morse@arm.com 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 On Wed, Jun 19, 2019 at 5:12 PM Will Deacon wrote: > > On Wed, Jun 19, 2019 at 09:54:21AM +0100, Julien Grall wrote: > > On 6/19/19 9:07 AM, Guo Ren wrote: > > > You forgot CCing C-SKY folks :P > > > > I wasn't aware you could be interested :). > > > > > Move arm asid allocator code in a generic one is a agood idea, I've > > > made a patchset for C-SKY and test is on processing, See: > > > https://lore.kernel.org/linux-csky/1560930553-26502-1-git-send-email-guoren@kernel.org/ > > > > > > If you plan to seperate it into generic one, I could co-work with you. > > > > Was the ASID allocator work out of box on C-Sky? If so, I can easily move > > the code in a generic place (maybe lib/asid.c). > > This is one place where I'd actually prefer not to go down the route of > making the code generic. Context-switching and low-level TLB management > is deeply architecture-specific and I worry that by trying to make this > code common, we run the real risk of introducing subtle bugs on some > architecture every time it is changed. "Add generic asid code" and "move arm's into generic" are two things. We could do first and let architecture's maintainer to choose. > Furthermore, the algorithm we use > on arm64 is designed to scale to large systems using DVM and may well be > too complex and/or sub-optimal for architectures with different system > topologies or TLB invalidation mechanisms. It's just a asid algorithm not very complex and there is a callback for architecture to define their own local hart tlb flush. Seems it has nothing with DVM or tlb broadcast mechanism. > > It's not a lot of code, so I don't see that it's a big deal to keep it > under arch/arm64. Yes, I think that's ok for arm64. Hi Arnd, What do you think about adding generic asid code for arch selection? Best Regards Guo Ren