From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7E59C31E49 for ; Wed, 19 Jun 2019 12:18:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB85B214AF for ; Wed, 19 Jun 2019 12:18:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560946700; bh=yhxv7AgwzvhlNQSVBLS6wZ1SselhU4cEOOFs1fJpxDY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=VpDRqdr+7rGic5vUam7T7O6UVg+0lMC/os/ArMvQnTiSz3xKckTtFLl4ev5INpDyM RvS/EiuZG072/bQzg9pp+8Onh1wx1EvvjpSwBnNSbfGpCUESq27oPs9cAr9YzrtEU/ nBn9uKpW3LM3UsHISIfVxK0PNYlqCHB9OCtbZk50= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731684AbfFSMST (ORCPT ); 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-Google-Smtp-Source: APXvYqxLToImvuhSDmD1nIS+ES6oreQ4KIoRUvyJ5x3WUN76K0k7xm92MrDOXh+M6q9Y86BgYAoCufZoBHRQw/MmFGQ= 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B9AEC31E49 for ; Wed, 19 Jun 2019 12:18:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 10A2621530 for ; Wed, 19 Jun 2019 12:18:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="B5Pl0Iqo"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZMiqI8mC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 10A2621530 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MraYhUkFNalwpy+0NwBAKkNuhrZwfUqHGQugFt7N5dU=; b=B5Pl0IqoqklOa/ xGb8hyGaHEzAcu60arsSODA7P7QhiZ7oBE8HFs9XQiLURSERIuENVqoLexeR1ux8gaKzD6I7x91ZH LshnPz+jaeURbEJ65liqhLMbcj1+diJ6uC69bLn7+x0KGoOo+4a1odY6vY+vjabTCsoEcbEv7fY4g ZxnbxQ7oNlOrkXN405r44M1tPTTndmJomEdCa6fHgrJrVPifpvjtYFfUOIGmNbz8dGaDPfSV58c15 spll6FUirGCjROckHruvW7Dtra1kUio+82u9Z9BDrKFfovu0H0VQ86GLwsWWSoRLcA6zY5aA0TlUF QJTehMAR56aPdN+h+Ffw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hdZXw-00066A-WF; Wed, 19 Jun 2019 12:18:37 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hdZXd-0005ss-Sw; Wed, 19 Jun 2019 12:18:19 +0000 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 3730821530; 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-f50.google.com with SMTP id r16so3117620wrl.11; Wed, 19 Jun 2019 05:18:17 -0700 (PDT) X-Gm-Message-State: APjAAAU6+WmLdaGQsFHphu0ODDzqbvhKCRSoELsawwb99m6EgKayQhh7 aGNq+2MXFah0lB+xnihAtsvd6FaLt6b85pVidVo= X-Google-Smtp-Source: APXvYqxLToImvuhSDmD1nIS+ES6oreQ4KIoRUvyJ5x3WUN76K0k7xm92MrDOXh+M6q9Y86BgYAoCufZoBHRQw/MmFGQ= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190619_051817_970969_88ED0AA0 X-CRM114-Status: GOOD ( 18.52 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: julien.thierry@arm.com, aou@eecs.berkeley.edu, james.morse@arm.com, suzuki.poulose@arm.com, Marc Zyngier , catalin.marinas@arm.com, Anup Patel , linux-kernel@vger.kernel.org, rppt@linux.ibm.com, hch@infradead.org, Atish.Patra@wdc.com, Julien Grall , Palmer Dabbelt , gary@garyguo.net, paul.walmsley@sifive.com, christoffer.dall@arm.com, linux-riscv@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BF27C31E49 for ; Wed, 19 Jun 2019 12:18:25 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id E7058214AF for ; Wed, 19 Jun 2019 12:18:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZMiqI8mC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7058214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id C035C4A4E5; Wed, 19 Jun 2019 08:18:23 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hZHGmmdZYIlV; Wed, 19 Jun 2019 08:18:21 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E84D44A4BE; Wed, 19 Jun 2019 08:18:21 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id DC3D14A4BE for ; Wed, 19 Jun 2019 08:18:19 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IFC4GQiXbi8L for ; Wed, 19 Jun 2019 08:18:18 -0400 (EDT) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 8CBFF4A3B4 for ; Wed, 19 Jun 2019 08:18:18 -0400 (EDT) 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 4B2FF21783 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-f42.google.com with SMTP id x4so3142556wrt.6 for ; Wed, 19 Jun 2019 05:18:17 -0700 (PDT) X-Gm-Message-State: APjAAAW7/8nGmIpvRP8MUzgrSjV1mXOheIL9eRgHMKJ6J1Wa5Q/iyMGY SqstaeoICS2ZnAmOOqXQYYomsTFg+Li3IbHCVfo= X-Google-Smtp-Source: APXvYqxLToImvuhSDmD1nIS+ES6oreQ4KIoRUvyJ5x3WUN76K0k7xm92MrDOXh+M6q9Y86BgYAoCufZoBHRQw/MmFGQ= 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: aou@eecs.berkeley.edu, Marc Zyngier , catalin.marinas@arm.com, Anup Patel , linux-kernel@vger.kernel.org, rppt@linux.ibm.com, hch@infradead.org, Atish.Patra@wdc.com, Julien Grall , Palmer Dabbelt , gary@garyguo.net, paul.walmsley@sifive.com, linux-riscv@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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 _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EABEEC46477 for ; Wed, 19 Jun 2019 12:18:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD07721530 for ; Wed, 19 Jun 2019 12:18:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LN2mog9Q"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZMiqI8mC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD07721530 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=orNvCN7R3paOCm1bZvL3zsT1h39jD2vctxIB8Uz9OZM=; b=LN2mog9QKgZixF JhNDC56hEQ82rw1rCLHP2zO/N+VZubFn7Fae46W3N/eusk4Xkp1if+AujHQVUlJaUwQ/6Rrtoh9Ms n7wA0JPsZlTXdbXk2e0DmVSWU/XCcBpQn/AHDr+ADYrO+/DoJESFQrIHK+d+Ug82y4RnlsmsmL0ei /EkUgpWcNcmdxV712NMi4j3hK9qBVDsdqWsbJh2Ud1SO3i7lGA42963l5qFHDsyjEiUekFKVvsdhG PvTK/CgQoUvbSv1ZnstYFmNx4tK73EK3Tp+AJH4VMeK8VME3DUI8OfrLeafg+P7cCHhvgcg1sMgAR 1nu5p0Kp+3TkM6VqEJgg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hdZXg-0005tK-Fe; Wed, 19 Jun 2019 12:18:20 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hdZXd-0005ss-Sw; Wed, 19 Jun 2019 12:18:19 +0000 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 3730821530; 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-f50.google.com with SMTP id r16so3117620wrl.11; Wed, 19 Jun 2019 05:18:17 -0700 (PDT) X-Gm-Message-State: APjAAAU6+WmLdaGQsFHphu0ODDzqbvhKCRSoELsawwb99m6EgKayQhh7 aGNq+2MXFah0lB+xnihAtsvd6FaLt6b85pVidVo= X-Google-Smtp-Source: APXvYqxLToImvuhSDmD1nIS+ES6oreQ4KIoRUvyJ5x3WUN76K0k7xm92MrDOXh+M6q9Y86BgYAoCufZoBHRQw/MmFGQ= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190619_051817_970969_88ED0AA0 X-CRM114-Status: GOOD ( 18.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: julien.thierry@arm.com, aou@eecs.berkeley.edu, james.morse@arm.com, suzuki.poulose@arm.com, Marc Zyngier , catalin.marinas@arm.com, Anup Patel , linux-kernel@vger.kernel.org, rppt@linux.ibm.com, hch@infradead.org, Atish.Patra@wdc.com, Julien Grall , Palmer Dabbelt , gary@garyguo.net, paul.walmsley@sifive.com, christoffer.dall@arm.com, linux-riscv@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel