Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5951966imd; Wed, 31 Oct 2018 04:47:07 -0700 (PDT) X-Google-Smtp-Source: AJdET5d+O6yB/y5HTm5OYI1DIkq2TXZrBwH4AfvGm1EDja3fzVK4uZuU4Na2Fu0kE+bWAZS/y18S X-Received: by 2002:a62:204a:: with SMTP id g71-v6mr3036330pfg.28.1540986427250; Wed, 31 Oct 2018 04:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540986427; cv=none; d=google.com; s=arc-20160816; b=DCItQfsoJsKs+xMeEXfIAhtoNQCmsbCsliAFZqxnM6h9EtEApM7dDrbuwDz8wUhKo7 YPHV3mu+YsCTkaaTr9F9d5DtrybrsHA+AUAZY7rWRtFQ5pj/kRwg/QQUV1aDI18nOQtc L5ztM2i0plBhLz2ofMcIfi24jr3mL1imIqcyNNfjUGDson/dGUHNScIndKwGNm9dIXC4 ScQEjxW0Y538UDp74+/isz/BseCQkoYi34V6BCPvWRYR+7GwHj0m7p+yAEUbL6onM5yL 7P3O5IKW9gdk8j4/cE2J/kcWkn0ucpWhRCX+7PXy7VgeO0o3V5GZaEuc1SFmLuAxRrXF /x6Q== 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 :references:in-reply-to:mime-version:dkim-signature; bh=+oC7J1e9wI7RTc5L631+Zq2WRCq00Xs6YvFyANbXVDw=; b=frwBrwgR5xaOaVXr/dEvwTQ6DhgNJED3lYsyjAweSfioNHQEwVy1arWhup6543yh11 GsRXcQCJ2ZTQn5itelML/LcTTGmLtAKThJDiuwmAn3qW6gAZ8uPlfjAcggkXKAktu52u 9G1NGCA76E1UCEiIhrcrZRuZuR9q9gH5zfomDg43E1zMEDMGjz0yZOMEUo6hbHF1gl4J RK23WxvfFqvYheQ7pmpoXG5s+dxVUTvwwDld5oRXG2PGWzNlYcrx8eD+Rho5Tg45opEz t3IqxEkh35chfcmz4q/fr0J9uT0FS2CzkpHm1ZDOEz1CTgmUJgZHcNT3JbIps55YEo98 DC3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Zzw8xPuF; 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 e4-v6si27439574pgn.176.2018.10.31.04.46.52; Wed, 31 Oct 2018 04:47:07 -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=fail header.i=@gmail.com header.s=20161025 header.b=Zzw8xPuF; 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 S1728778AbeJaUnb (ORCPT + 99 others); Wed, 31 Oct 2018 16:43:31 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:40437 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbeJaUnb (ORCPT ); Wed, 31 Oct 2018 16:43:31 -0400 Received: by mail-qt1-f194.google.com with SMTP id k12so11369584qtf.7 for ; Wed, 31 Oct 2018 04:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=+oC7J1e9wI7RTc5L631+Zq2WRCq00Xs6YvFyANbXVDw=; b=Zzw8xPuFr4bo3gzt2c4iqucxUf66fjZkPeKoNaoXIfl2dTIkfGtCTXYU6s0iIu4gir q1kZvZz/NHWR+RQ9UEWf6zGwT6bwN9b5X+NEg+FK7VKDjPF5C46/xfxQlQeX3yV2KhtB PUO+tuG6/QHGdr/58yOaj3jO052gFv7FHZcmPTP0Hp+DR3RxlNssNphZHAkHNMVCetCU pzKuUnhGR2ILCdXKM3vIDUvdz/srF27kvxAVDlmlGqP3j+AkFPlAbYV/1P7jRfKl/+Dx LXWFbq3mXOYsIYsrd8uc5zXxEH985QQZVnxHqOPg5eFbOXFDu4ORTFZCYpdmMRvsmlYC QsOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=+oC7J1e9wI7RTc5L631+Zq2WRCq00Xs6YvFyANbXVDw=; b=dt/oEoX66ZqbE1m56+T2WQfdWK4pkN7PrhGlmqwEUrkeUrylb1IsY6X26PGRgs+ajy 6v57hR1k9qfzvatICfQw7aY/Lb4yEsLa52gbghJ1qdz+vmw/7xuRlRMYb07gR8ZEpPbF /kbEoGwHOlhCj+GpW3+wHrTXSw6ibi4/FjHJFqOvsHkvkP4b7WNiV7Hk4EQkkauMTZTq fWp9ApsixXEKFDfnFFmERaFj1UYJdHbPleI74pLqkrPWV2V6cnbuu7TCCB/v1PeS6xdt 0n4oCbT+IPuqVU1FVOd9pozt+MCdj/aH/NFy1AK7Fr/i7mrwvn7BokHd2Gf9ZjriL7+J CWyA== X-Gm-Message-State: AGRZ1gLDtoRWjyKGZgtnY8ZhTpaAS1T9Je3hwGU3LeQJxm2zpPKu5kPe 6r7gyIiLZhfdD60PccCQQKCkDbcbf5UjoRoT2gE= X-Received: by 2002:a0c:d992:: with SMTP id y18mr2308393qvj.161.1540986348246; Wed, 31 Oct 2018 04:45:48 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:988d:0:0:0:0:0 with HTTP; Wed, 31 Oct 2018 04:45:47 -0700 (PDT) In-Reply-To: References: <1540982130-28248-1-git-send-email-vincentc@andestech.com> From: Arnd Bergmann Date: Wed, 31 Oct 2018 12:45:47 +0100 X-Google-Sender-Auth: iGJj1ieP5_77ZVQnSCzEBXI6mEw Message-ID: Subject: Re: [RFC 0/2] RISC-V: A proposal to add vendor-specific code To: Anup Patel Cc: vincentc@andestech.com, Palmer Dabbelt , Albert Ou , Zong Li , alankao@andestech.com, greentime@andestech.com, "linux-kernel@vger.kernel.org List" , linux-riscv@lists.infradead.org, deanbo422@gmail.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 10/31/18, Anup Patel wrote: > On Wed, Oct 31, 2018 at 4:06 PM Vincent Chen > wrote: >> >> RISC-V permits each vendor to develop respective extension ISA based >> on RISC-V standard ISA. This means that these vendor-specific features >> may be compatible to their compiler and CPU. Therefore, each vendor may >> be considered a sub-architecture of RISC-V. Currently, vendors do not >> have the appropriate examples to add these specific features to the >> kernel. In this RFC set, we propose an infrastructure that vendor can >> easily hook their specific features into kernel. The first commit is >> the main body of this infrastructure. In the second commit, we provide >> a solution that allows dma_map_ops() to work without cache coherent >> agent support. Cache coherent agent is unsupported for low-end CPUs in >> the AndeStar RISC-V series. In order for Linux to run on these CPUs, we >> need this solution to overcome the limitation of cache coherent agent >> support. Hence, it also can be used as an example for the first commit. >> >> I am glad to discuss any ideas, so if you have any idea, please give >> me some feedback. >> > > I agree that we need a place for vendor-specific ISA extensions and > having vendor-specific directories is also good. > > What I don't support is the approach of having compile time selection > of vendor-specific ISA extension. Agreed, we did this on arm32 in the past, and it took us a long time to change all the modern platforms (ARMv6/7/8) to be usable in a shared kernel. It's better to avoid that and keep everything together like we did on arm64 from the start. One thing we do on arm32 is to support combinations of different instruction set variants in a combined kernel through callback pointers that turn into direct function calls when the kernel is configured for only a single CPU type. This might be something to add later on riscv, but I probably wouldn't do it right away. Arnd