Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5920563imd; Wed, 31 Oct 2018 04:17:14 -0700 (PDT) X-Google-Smtp-Source: AJdET5fQJaXzj1ok9bE2Os7ZIPbv7tgsL0+Z0h+YgU8zUimYKxRfl18V7XYw3nkJLwaNZs4kavdK X-Received: by 2002:a63:66c1:: with SMTP id a184-v6mr2822477pgc.26.1540984634874; Wed, 31 Oct 2018 04:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540984634; cv=none; d=google.com; s=arc-20160816; b=NRWoNXrGojU0HY2vICFrQM4QXIhB1WZSwbfWqARo4nepxjPRlypELoUza1I6PdNp2n Pgzi4fTSXR2soQ/QDebfTxkmYz7yOr9PZDJU4KZ7edoq1Ib1ut6dLdVyUiPQg48QZuAY RMd6agD37Zq0tQCos5Z7fS0Qe+F2UQ7xpmtE8YMLSO9t+ZWtgj8cJyxFxqMCZncji0Yf bVJHwKoYGv+OkuWUEviV4uGYMigWBibpiWya/wqMyz7VfeLWVmrYo1dEXO7m4sZRS2n3 0wGKxzN8hWW5pKkui0sAByc9dxMcxELwRCKW6dWNAcnFr44NbcA7FQVfDrZuEdLBwCcW pM2g== 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=7vQvy5KLwqrDn7EUCo/8EmVFC5IwBb3hk8HLIvk7rnU=; b=LkIiWF4IRsrTr9NI5cir9KxX/OTg7c0FpSVQ7klkn2fP2QPw1wl18Fh3NsBsGL+R0M gyn1DYb4N0t0AYrxhNh+TBqJPTOpjqqbNFthF3lR1x2HhQjrVAYERv1gGfrK0T/USsPq HejqPzJISKa/mMHvaT1CrrQmC2XvibCPxY1gX7zvv5pTpss9pOo2xWo3c2E0wz9cZWB+ woFMDmBAJoG8bcJONzO4fJnKYe47cYSaoQ9agBJ7R63klh4OQPitvQRZ8nyrMcQSqT3q J5XN+6piYg4tYOr2B77bPzNiss0uaipcTw8k6Wzq401PjL6Lz7DYhL2vMIfYpkUSijOI RSow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=ysz4Sgkd; 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 e92-v6si26727532pld.45.2018.10.31.04.16.59; Wed, 31 Oct 2018 04:17:14 -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=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=ysz4Sgkd; 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 S1728588AbeJaUOB (ORCPT + 99 others); Wed, 31 Oct 2018 16:14:01 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:33491 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725831AbeJaUOB (ORCPT ); Wed, 31 Oct 2018 16:14:01 -0400 Received: by mail-wm1-f67.google.com with SMTP id y140-v6so985151wmd.0 for ; Wed, 31 Oct 2018 04:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7vQvy5KLwqrDn7EUCo/8EmVFC5IwBb3hk8HLIvk7rnU=; b=ysz4SgkdjfFcFixMYBOz5KUEUklcvWIU6ajJ1JuDQjuxGeymuXouKrClLdFTJCDI61 fqQSsVykHVcvdsVQc5FI3mkEYM7p94y2qFM2bvikJUsuSGyhcLSX3aLlGDimBYFn+Ivo wOvUZ5hAFaJ0vlZlRogMCZ+SSuZ4EBnwU+ltDRI2SilKMXmLE184joVL1K4jk6OhMoSg xRn2asexGTKWstpdyKmWXpyBcD6gpLcLmxUwKgazLBcmXlyi2lvpJDb2zH2aph7pEY8s OF1Lr1sK+9h71iO4dD5TjRd8iQFXX3bWqMtjEycWpuyY6bZ+oZBStRH57IVc39d+mbKj sdLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7vQvy5KLwqrDn7EUCo/8EmVFC5IwBb3hk8HLIvk7rnU=; b=ZZmHPaWxBix/R7Q7L7VJPyQg9jSCaxdZLFnavXT8kL5eOroTfDPsYccp/dgZKAkkm5 Uc9u8Kx+go/kLbUjIxjyunvm9I4/BOsnrGx8uWHS9ZTuCpamDwXSG2+2c8KefNnQ47ZE 2r4L1qQbD3Ntlea4YVCMA4G7cI5+augk1Rvtrontiy41wVuuuLyBQMY4MpavMv+Q+Nxl WSntREE4qDBZ+Up73YUQFN7DnsZ6EpAW+JKWhDr/MBQJYkiePNmvZBX7AxW6GZvIMb8d 8IXecc6+6ACHhZznEAeJvQ1jSsXvMyCORcNqm7DkNyoRr0vxCrrMnI3iLeGCOXf5V4r3 74jA== X-Gm-Message-State: AGRZ1gIqo4cEA3ZN8eSyuwCDpv+ymhy2lR75KFDEgfr7asSbiP7oUfL1 y37MS76NFfXuthToVfWS2zJatCyoCCW5YdUaqpC1DQ== X-Received: by 2002:a1c:cf08:: with SMTP id f8-v6mr2003559wmg.56.1540984581673; Wed, 31 Oct 2018 04:16:21 -0700 (PDT) MIME-Version: 1.0 References: <1540982130-28248-1-git-send-email-vincentc@andestech.com> In-Reply-To: <1540982130-28248-1-git-send-email-vincentc@andestech.com> From: Anup Patel Date: Wed, 31 Oct 2018 16:46:10 +0530 Message-ID: Subject: Re: [RFC 0/2] RISC-V: A proposal to add vendor-specific code To: vincentc@andestech.com Cc: Palmer Dabbelt , Albert Ou , Zong Li , Arnd Bergmann , 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 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. We should have runtime probing for compatible vendor-specific ISA extension. Also, it should be possible to link multiple vendor-specific SA extensions to same kernel image. This way we can have a single kernel image (along with various vendor-specific ISA extensions) which works on variety of targets/hosts. As an example or runtime probing you can look at how IRQCHIP or CLOCKSOURCE drivers are probed. The vendor-specific ISA extension hooks should called in similar fashion. Regards, Anup