Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp210477imw; Fri, 15 Jul 2022 01:21:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sFQwHpiKMSxEZy6Y+of06hfeSrkYGeDr2zVm0wI/u8EtKoa+jiTzKdc9iqz4muxJUhT7nK X-Received: by 2002:a05:6402:50d0:b0:43a:df6d:6f4d with SMTP id h16-20020a05640250d000b0043adf6d6f4dmr17307199edb.72.1657873282403; Fri, 15 Jul 2022 01:21:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657873282; cv=none; d=google.com; s=arc-20160816; b=AmZlxg8q4F/5GCAxQe1xZLYA5GA5BiAQKpRMNPlY01X+ySTKrz1bvWKAS/cmVREn7N 4RQOSkGUwLCEm31Mwy2tboYTSTvuSrANgOo+Cg55mtWONwvEdE2PJGKtXZ33wVgT86cR kIwstNSO4eHDUfDrCCHA4VhXbKIsFgIWAmECZWDIYLLkzpALhGUg6FAQw1P/+B+e8DEd uxnUsOeJtBpFMSNFgCK586Wxk9olWi1pKGXGlGZLcowagb5jMhkK124+rQoQ8nx7hBKQ f7tPAp2CAaiipAg5h6hEU0Qh2e6j/ofwJwTUfCygqbkPZ/deAGIDtBMQ0MWji8dF1p7D PEHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=JbVpr0R59qtPw7baWfpBEgK5+t95ngcNjWBuGYLeZHA=; b=qYuTuzJxmk+of3UxnUK4HN2UufB2vOP3ED7YcS5306wF2jMNgEvKE8uM9Zv4AvFPM7 89f0RbFVQW+/QmCNKnhXj/aZCk4TNbX0tFP623V7u+PooTyT2HHGtFiJ2J+S3CebjAz5 a9GWNXEZ+44yL5m6gzqjyYFMt5pFsV1W3o3R2+NNYBZKIOUJgPag3fBgiLA4zmgQup9U l0r6c4mo2DYcK6RlvBniCwNq89AJDQkavAeDYmLILopW3gMpskMDGbWh1TTZD8j2frbr mQwZdDRAgskgkMSz/FE9e/9AszbtnF6k+tGAQz7wWx5dFX+yCPuepo7XFb1GuwikRwIQ xODA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p24-20020a056402501800b0043a2691292dsi4914447eda.314.2022.07.15.01.20.57; Fri, 15 Jul 2022 01:21:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231356AbiGOHsQ (ORCPT + 99 others); Fri, 15 Jul 2022 03:48:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230151AbiGOHsO (ORCPT ); Fri, 15 Jul 2022 03:48:14 -0400 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88AC677A6B for ; Fri, 15 Jul 2022 00:48:13 -0700 (PDT) Received: by mail-qt1-f174.google.com with SMTP id c20so3210797qtw.8 for ; Fri, 15 Jul 2022 00:48:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JbVpr0R59qtPw7baWfpBEgK5+t95ngcNjWBuGYLeZHA=; b=h82sFSY7nRFpsFdG3qNI1H42MXw5pvnOvB38hLiHFEDHaLfuzUJXmz8S5lpjusayYS YD+GUBy07LcOzqEcQArsxmM2onFO9KwsV9ycmV+0v6YRpCxO6YR8l5TmZFkl5evZq+KX LWn+lELhoL2YChRB9XdET+4tUZygBw84i3mylzHkyxI+/t+Ue1AYV+MFWabeNZtndnwE O/hCFzcBRANJzdV1Vqfkb9q0HgGibt5NG2RcdK2jXHzJF2h0MKWD5BrTP+7MaOkxuik4 mwJ1fbdgx0SxipZ2r93lT7d6yh/rLqeSi8oo8n7IMS/iTAIk4i/VzqN1nlllXft40mZJ VYCg== X-Gm-Message-State: AJIora8peWf4LwTlZt0lhM26JkHiPFp+Bg/5Pb8DwC3qgvZJmRc7sh96 9Wsy72axBCOZdLYk59oJpQ+uqRQqw9XT3Q== X-Received: by 2002:a05:622a:1301:b0:31e:b67a:e3e9 with SMTP id v1-20020a05622a130100b0031eb67ae3e9mr11237368qtk.335.1657871292320; Fri, 15 Jul 2022 00:48:12 -0700 (PDT) Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com. [209.85.219.176]) by smtp.gmail.com with ESMTPSA id v6-20020ae9e306000000b006b58fce19dasm3347176qkf.20.2022.07.15.00.48.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Jul 2022 00:48:11 -0700 (PDT) Received: by mail-yb1-f176.google.com with SMTP id y195so7288671yby.0 for ; Fri, 15 Jul 2022 00:48:11 -0700 (PDT) X-Received: by 2002:a25:2b48:0:b0:668:3b7d:326c with SMTP id r69-20020a252b48000000b006683b7d326cmr12451089ybr.380.1657871291234; Fri, 15 Jul 2022 00:48:11 -0700 (PDT) MIME-Version: 1.0 References: <20220521193356.26562-1-palmer@rivosinc.com> In-Reply-To: <20220521193356.26562-1-palmer@rivosinc.com> From: Geert Uytterhoeven Date: Fri, 15 Jul 2022 09:47:58 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] RISC-V: Add CONFIG_{NON,}PORTABLE To: Palmer Dabbelt Cc: linux-riscv , Paul Walmsley , Palmer Dabbelt , Albert Ou , Randy Dunlap , Arnd Bergmann , Anup Patel , Alexandre Ghiti , Damien Le Moal , Atish Patra , Jens Axboe , Guo Ren , mchitale@ventanamicro.com, Linux Kernel Mailing List , linux@rivosinc.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Palmer, On Sat, May 21, 2022 at 10:49 PM Palmer Dabbelt wrote: > From: Palmer Dabbelt > > The RISC-V port has collected a handful of options that are > fundamentally non-portable. To prevent users from shooting themselves > in the foot, hide them all behind a config entry that explicitly calls > out that non-portable binaries may be produced. > > Signed-off-by: Palmer Dabbelt > Reviewed-by: Arnd Bergmann > Signed-off-by: Palmer Dabbelt Thanks for your patch, which is now commit 44c1e84a38a03175 ("RISC-V: Add CONFIG_{NON,}PORTABLE") in riscv/for-next > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -222,6 +222,21 @@ source "arch/riscv/Kconfig.erratas" > > menu "Platform type" > > +config NONPORTABLE > + bool "Allow configurations that result in non-portable kernels" > + help > + RISC-V kernel binaries are compatible between all known systems > + whenever possible, but there are some use cases that can only be > + satisfied by configurations that result in kernel binaries that are > + not portable between systems. > + > + Selecting N does not guarantee kernels will be portable to all known > + systems. Selecting any of the options guarded by NONPORTABLE will > + result in kernel binaries that are unlikely to be portable between > + systems. > + > + If unsure, say N. Doing it this way means allmodconfig will enable NONPORTABLE, which may not be what we want? > + > choice > prompt "Base ISA" > default ARCH_RV64I > @@ -554,7 +571,7 @@ config PHYS_RAM_BASE > > config XIP_KERNEL > bool "Kernel Execute-In-Place from ROM" > - depends on MMU && SPARSEMEM > + depends on MMU && SPARSEMEM && NONPORTABLE Nice! Would we get something like this on arm32 past rmk? > # This prevents XIP from being enabled by all{yes,mod}config, which > # fail to build since XIP doesn't support large kernels. > depends on !COMPILE_TEST > @@ -594,9 +611,16 @@ endmenu > > config BUILTIN_DTB > bool > - depends on OF > + depends on OF && NONPORTABLE > default y if XIP_KERNEL > > +config PORTABLE > + bool > + default !NONPORTABLE > + select EFI > + select OF > + select MMU > + > menu "Power management options" > Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds