Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2927798imu; Wed, 7 Nov 2018 01:51:49 -0800 (PST) X-Google-Smtp-Source: AJdET5eEEmcqsBpNAlEm7pjHuJFC5ycwXTds70/QPUiwUFQ0LO1fkiAufsrqeZ4y1JOhBY6VZvXY X-Received: by 2002:a62:1693:: with SMTP id 141-v6mr1191811pfw.183.1541584309157; Wed, 07 Nov 2018 01:51:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541584309; cv=none; d=google.com; s=arc-20160816; b=NUfc5ggtV80OVdQDhh29XJvL2S7C39qPAKLOC5x0haSlyGl+je73MWqgUtPNDzfyVF 1tQIYWcOptrTxw2O0aWvWIMA2Q1k9NCr5Ljz0tVNNdX/ROm2QxhlZscJ8+atwxl/RwjK B/tIFydfDUjFPBSLvOppkSVIzYhEUN0YIswW5orHucJryJO0RS0grU5tqkBZqnzf6Yzl Gpz2F6aQC+/lcEDYxED1Pz/bEFTLxlJO26sfux+414j8mJ37DFV+hMvpuSZsASx3mIMd 3pCq0HC0nuZLzrzNlVE7s62mmziE1/3T4r7+EL9E+8/TPKvnvBPUPDG7mjXIyEcys2YD 8Y7Q== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature; bh=BJq84/a5/nkl9JGGExc2GPSH9U5Gl2mha1VX6NO2L/w=; b=IPH8fvaRDyVOavYoRoqx7LeUQCsBydEkNIMgKBVMoubE9cLphJT1mA2NHySghuQzPB D8Dpv3I8UupmgP0v51QOLidwgkTgAvp6ju+CkKc4aZd+mhaA5uxb9I3RqdVQTanHg2Qm Ng6pDreFSO1LSzKczPLgTgx1ynCL3OA/edgz1cpO2AZX0eT+/7FcUwDoeEEnRL+peqRH Po4YiObOEW51kBNujAoc/b0pM7uPdmGpqgrzQRdjVTUlnO23Z7IflOb3wj58admXOQlE TYG8mFoqz3ZsBrp0nFsqNLKXWjigy2kr5l21qCWq/7Yb6dg850fgiwux3HmpJUiwrqg1 xbZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=TAV1Alqa; 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 u23-v6si153124plk.47.2018.11.07.01.51.33; Wed, 07 Nov 2018 01:51:49 -0800 (PST) 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=TAV1Alqa; 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 S1726385AbeKGTUt (ORCPT + 99 others); Wed, 7 Nov 2018 14:20:49 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:41739 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726223AbeKGTUs (ORCPT ); Wed, 7 Nov 2018 14:20:48 -0500 Received: by mail-qk1-f196.google.com with SMTP id 189so20164400qkj.8 for ; Wed, 07 Nov 2018 01:51:12 -0800 (PST) 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:content-transfer-encoding; bh=BJq84/a5/nkl9JGGExc2GPSH9U5Gl2mha1VX6NO2L/w=; b=TAV1AlqaVMHwg/Znw/UHeL6gRqNkTUmfRxzmOq3vs1+ngjUDYo1uTnmAnjTzc2Bolm BnOjTkqQla/cL0XXWp17S0rPAEwhB+MvwXzCcYP0FAFYMVt7pPJb0zVbiGUizI5EaXoj 9xLE9vfTHCR0F6OLRZd1xLoAy5n9HyrpcLDXh42VnGV+FijlCDuHekCyHA6c6nuNPpZU a2dwWwIU5NnXtcK1tm3rRrmKjmemD5EQv0vEPDqJQaLT8L/n4MrlKxfsmtzT6mkLfTif cz0lQlpRtizdSl1fBoRX1SoLes7uEfX/NwOHMYGLWwL1bmcvGZ91OhVXgDHM3suVFM8r qauA== 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:content-transfer-encoding; bh=BJq84/a5/nkl9JGGExc2GPSH9U5Gl2mha1VX6NO2L/w=; b=rPFHLZlTJV4eywMVtx8N04pof2P69qRqH5Pu7DUi7RpaF3xsB4MpVCyQpcxGzbYAjs 0KeFpI/mCZdXlf8LSF4EUjzDRXCdbrSdTFcNy+E41i7sivgFq68AdN73UPjQ5JlOHUlQ A8teatqHMcHFHjE8qK32Rm4NglQVk/sz/pgzMv7O/WHJA/IbZvqNLoWe4AI+HiCbqlAi +t/3d4J0gGgaVXJyhQQNNrg63pLV9A/lDmH8YDc2M1ZBvxT5/HsvyAKLugCanlHWnylW TxtHugqoPDzZsqzt6z9qeitaH5TC1GqElFe7obghxHp7PXgNJCNlsL7cNitaDC86HZYF 3k9g== X-Gm-Message-State: AGRZ1gLSjWW9uwMY2oK7iNsccTtlbYWQJroL5RP21diYBs3ftaneMkJl 1CTexhnBd3sa5doXwQhCwhY5u+UlIgC4y+F7fSk= X-Received: by 2002:a37:324a:: with SMTP id y71mr916649qky.291.1541584271725; Wed, 07 Nov 2018 01:51:11 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a0c:9881:0:0:0:0:0 with HTTP; Wed, 7 Nov 2018 01:51:11 -0800 (PST) In-Reply-To: References: From: Arnd Bergmann Date: Wed, 7 Nov 2018 10:51:11 +0100 X-Google-Sender-Auth: HIqzNzdoQ7BmDvG7NETbjR9Vl-w Message-ID: Subject: Re: [RFC 0/2] RISC-V: A proposal to add vendor-specific code To: Palmer Dabbelt Cc: Christoph Hellwig , vincentc@andestech.com, aou@eecs.berkeley.edu, alankao@andestech.com, greentime@andestech.com, linux-kernel@vger.kernel.org, zong@andestech.com, kito@andestech.com, linux-riscv@lists.infradead.org, deanbo422@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/7/18, Palmer Dabbelt wrote: > On Mon, 05 Nov 2018 00:52:52 PST (-0800), Arnd Bergmann wrote: >> On 11/5/18, Christoph Hellwig wrote: >>> On Mon, Nov 05, 2018 at 02:58:07PM +0800, Vincent Chen wrote: >>>> Many thanks for kinds of comments. I quickly synthesize the comments >>>> and >>>> list them as below. >>>> 1. The kernel image shall include all vendor-specific code. >>> >>> I fundamentally disagree with this=E2=80=A6 and think it should be the = contrary. >>> >>> 1. The kernel shall support no vendor specific instructions whatsoever, >>> period. >> >> I think what was meant above is >> >> 1. If a vendor extension requires kernel support, that support >> must be able to be built into a kernel image without breaking support >> for CPUs that do not have that extension, to allow building a single >> kernel image that works on all CPUs. > > Yes. I don't want anything that won't compile with upstream GCC, but I a= lso > > don't want to have a Kconfig that says "make the kernel only work on > $VENDOR's implementation". I think this can be achieved, at least for t= he > cases I've seen so far. I think over time, the implementations will diverge. Ignoring the question of vendor extensions for the moment, you will definitely have to deal with combinations of (future) standard extensions. I can see two ways of doing that: Either each extension is a separate Kconfig option and you have to know which one to enable or disable for a particular target, or you list each platform separately with one Kconfig option, and have Kconfig/Kbuild work out which features to enable or disable based on that to get the fastest and most featureful kernel that still works on all enabled platforms. Arnd