Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6036244rwl; Wed, 22 Mar 2023 05:51:58 -0700 (PDT) X-Google-Smtp-Source: AK7set8Lmr4JMfbNIU5FsxOcATWM1OHamxWRX+5TpkrtgeJlN4TYjq3LvwgHf14Fl1liqOz5mi3Z X-Received: by 2002:a05:6a20:6697:b0:db:38ea:6de6 with SMTP id o23-20020a056a20669700b000db38ea6de6mr2268591pzh.55.1679489518184; Wed, 22 Mar 2023 05:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679489518; cv=none; d=google.com; s=arc-20160816; b=ywbhJtWBn3c7YfJHoH/TApFeicReKns3u9mMMMNaGAQd4O3IcyVM96db5PtyiR9r6c pTT/Y1QoPKJvaEx5O5wQGua0SimRhZ14S8XLCi7X0niGE5WfU6pnJPXV3OBDy/MCpzs3 2pcG1E6A/HiFXfYaEmuZphjbxbQgLTsSLMUnwy7Qtytt9qOKpvTd6OVSMtUy8WEZelIc 0k/I3gTWpbWY9jdXxPjjZrnQQ0KcYj5eXWlQKLxYuXjC0BtSZh9KG9RGKOjcvjrdIvcz PZ/WdLzLPwdIZKCtsSgrQsT2iCCiWP9UfIVFbMpL5CzSVZZ3+UUxEfHe01RgQTc1WRob zWzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=W5zKbHjfhgxF54RZN2uMVwaO/XV5lTFGogMg3VcS9Gw=; b=qsdwf0w8Mui9MUmADGz/xaQuqE6fy4cY+FuTzn3HzvnfcI0+F0Hh0CXtEGoG8hm4fd RWdY/4OtWniyfcqjG5whHoTJQS0lDxG/fhoXvRyBJahaZRN2zetqhbnDxFyz+pYkir+b 1xrJXaZYZWY4WiJC4y8lnBcWT0iXhYyn+l/DqDJZozZz+ZldOsuhZEfyFCd3AlJmOpii MOEHTu9O5BvjsdCb5ILLgrMqCckQcSiEa4u2mjtFox3rJUuzQ/DGuOpgR3vFQA9kPcnw hdK2gd1eBoHGkomkRtuiy7yKv+YkAKNdbFpiRQsIRz6G1n9yrC8sh7yCTV1rTNkpYqup xJzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=AeU+V10i; 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 u17-20020a056a00125100b00593ac87bbadsi15678625pfi.202.2023.03.22.05.51.47; Wed, 22 Mar 2023 05:51:58 -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; dkim=pass header.i=@ventanamicro.com header.s=google header.b=AeU+V10i; 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 S230346AbjCVMrB (ORCPT + 99 others); Wed, 22 Mar 2023 08:47:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbjCVMrA (ORCPT ); Wed, 22 Mar 2023 08:47:00 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6EE34FF12 for ; Wed, 22 Mar 2023 05:46:34 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id cn12so26779243edb.4 for ; Wed, 22 Mar 2023 05:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1679489193; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=W5zKbHjfhgxF54RZN2uMVwaO/XV5lTFGogMg3VcS9Gw=; b=AeU+V10ihje21KzHVT78gOrQJ9YQxfOvj599aKQERL00BRKdGiTV8EFqv73faU5f45 Fykh774S7V9G71lAC4TEFQ3HxDIx1EQ0Bqm7flYXZj5iFo/nVULYw3meaxbOoELkiojq x6V2dlejM6itF7F200uRTOvDwFd2eADEDVVJQOGEDaaATvRx85pcmbviAKnRrBPTx/uB AOeK7cGNMBKW8ICWJsqaSKxaLc9PvuyaYQwOUVTTIsqorPS2qGnQzXmY9wNn92vowMA3 VTqRv2AOet1xNuUY4essauv5cZLbIYJmk2Tv9HaJt7ImatZVWYQ3DaircOALrij8nlol 2Vfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679489193; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=W5zKbHjfhgxF54RZN2uMVwaO/XV5lTFGogMg3VcS9Gw=; b=OIv/S/49t7wotHevcVZx1detcBXoxDRl+pPCIlX5A2gnDtjDVs9GWowTAf+snG1Dby BFHIfDl3Vvuh3qNOTw02uh4cGafZZmzuf8eopyFp1xPJAJ/dpighTEV8N2YxHgpwqKpc rlX+3b2hCn9glgvf3I2R93Fw+0K0VqCXa0M69LeXP4zdWhTlh7AOJ0HT6dlJYZ4MafEa Z2+1U/LDEjTsSbDaNRImX2EsoWwgq1Q2eBSmEGXFgIUk9kN+l1iqgRbVDQLpYHcsz2mR tPOFimQALFjC03N4FZxz/qrYhuc65FpvHmfhOncQTRsNm3RM+BXrHTf/IWdNDFcszSER estA== X-Gm-Message-State: AO0yUKXCJrB7JrwNuIGoxpOqUR5qDF2Mzv/BidA7d0vINORVUbYZccsB t2Bnyhr3RCKuChSMm3s52CT6Ew== X-Received: by 2002:a05:6402:48c:b0:4fa:ad62:b1a0 with SMTP id k12-20020a056402048c00b004faad62b1a0mr5882545edv.41.1679489193201; Wed, 22 Mar 2023 05:46:33 -0700 (PDT) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id c25-20020a50f619000000b004bd6e3ed196sm7761962edn.86.2023.03.22.05.46.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 05:46:32 -0700 (PDT) Date: Wed, 22 Mar 2023 13:46:31 +0100 From: Andrew Jones To: "Jason A. Donenfeld" Cc: Jisheng Zhang , Palmer Dabbelt , Paul Walmsley , Albert Ou , Anup Patel , Atish Patra , Heiko Stuebner , Conor Dooley , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, regressions@leemhuis.info, regressions@lists.linux.dev Subject: Re: [PATCH] riscv: require alternatives framework when selecting FPU support Message-ID: <20230322124631.7p67thzeblrawsqj@orel> References: <20230322120907.2968494-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230322120907.2968494-1-Jason@zx2c4.com> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable 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 On Wed, Mar 22, 2023 at 01:09:07PM +0100, Jason A. Donenfeld wrote: > When moving switch_to's has_fpu() over to using riscv_has_extension_ > likely() rather than static branchs, the FPU code gained a dependency on > the alternatives framework. If CONFIG_RISCV_ALTERNATIVE isn't selected > when CONFIG_FPU is, then has_fpu() returns false, and switch_to does not > work as intended. So select CONFIG_RISCV_ALTERNATIVE when CONFIG_FPU is > selected. > > Fixes: 702e64550b12 ("riscv: fpu: switch has_fpu() to riscv_has_extension_likely()") > Link: https://lore.kernel.org/all/ZBruFRwt3rUVngPu@zx2c4.com/ > Cc: Jisheng Zhang > Cc: Andrew Jones > Cc: Heiko Stuebner > Cc: Conor Dooley > Signed-off-by: Jason A. Donenfeld > --- > arch/riscv/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index c5e42cc37604..0f59350c699d 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -467,6 +467,7 @@ config TOOLCHAIN_HAS_ZIHINTPAUSE > config FPU > bool "FPU support" > default y > + select RISCV_ALTERNATIVE > help > Say N here if you want to disable all floating-point related procedure > in the kernel. > -- > 2.40.0 > Reviewed-by: Andrew Jones I took a look to see if we missed anything else and see that we should do the same patch for KVM. I'll send one. (It's tempting to just select RISCV_ALTERNATIVE from RISCV, but maybe we can defer that wedding a bit longer.) Thanks, drew