Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6583257rwl; Wed, 22 Mar 2023 12:31:26 -0700 (PDT) X-Google-Smtp-Source: AK7set8TTibI3Vazbbj4H3ry8glavIS3ib9zKJN2FGyH0OQ5T+H1yMjqHac6XSHJFnnxoezbaFk8 X-Received: by 2002:a17:902:f542:b0:1a1:bcaa:aaea with SMTP id h2-20020a170902f54200b001a1bcaaaaeamr4686946plf.3.1679513486013; Wed, 22 Mar 2023 12:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679513485; cv=none; d=google.com; s=arc-20160816; b=ralBCygEdUvoNayl4a5vDj/dZ1eXXy336jvtRujGT9Ukdi6QjzcVNpMa2tnLnRf8Mt YugcIjwGMioAY4W5lfSCrP37sgcfW36atqEsMg5USXJxJvTh/m5iBE2mm2YfQgJDUMZo Ne9ft9wH/RGLWOqGNDj0fAG1RZwWWpZ6kBROAY1Ex/7hPuoeGbR8PBBNsyPJYg7tdDN6 CTWvhXqapHqKpbrERlN4h2cbz7D25Y/RwFa/wITugsVvaRW43pXdm8JfGwzpyb88Ywum 5diecrebRABV3VKZjb5dO7yERr9mKiJnrNddWQzHuiCPlsrhN6i3VIUEHL32FSqzyfAl TzEw== 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=TC6eNLv6iVcM+dLqVd9h+kHjsMmIK0cHmLbQH5XvCQ4=; b=Y5MNMlJFJ3MOUnv9T4A21ba9BWN5uaXaTRw1rNDDQODnRplZRLD6Dl8qI+V7z43kmQ yWCLaJoIxFjevZ9nt3A65rOi22GTQH3SbB59eq90zd6MfceA5OKvWdJxj7ThgWUWjUgt YXLrwJTxy25pX4+XxuVJ4ZJUltYMtKXg1bHSe1lGQO9otuRwm0ZExs1r7w9WpBaNh4YJ WVXUCvnR1rBUBAfmmWl1bobFOIYJYWuKxiq+HEnV1w/z58xXp8K2o6X+Tw7KOM3Oeiua OVIwBepN0h1xG94aKUxAUYfHL1yQAadf1ZNSc4Nc/n6w6NA18JtgJmJaHW170ym3r8MR zTkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=YWt+tkLl; 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 x3-20020a63fe43000000b0050bde92fcbbsi15975490pgj.760.2023.03.22.12.31.13; Wed, 22 Mar 2023 12:31:25 -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=YWt+tkLl; 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 S230376AbjCVT0T (ORCPT + 99 others); Wed, 22 Mar 2023 15:26:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230064AbjCVT0Q (ORCPT ); Wed, 22 Mar 2023 15:26:16 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 546666287C for ; Wed, 22 Mar 2023 12:26:13 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id r11so77368781edd.5 for ; Wed, 22 Mar 2023 12:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1679513172; 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=TC6eNLv6iVcM+dLqVd9h+kHjsMmIK0cHmLbQH5XvCQ4=; b=YWt+tkLlfdne2Kd0Awx/G4k2qdpzdqxUYDyTBl1Ztnt2ciLuzV00hGhXgAwtJraOta foR02SN4g6mrdL4klrVO+c7tFOawmQREXUGb39aqVJgplHebbVKbDKt4rfoJICjBvCMu wBK2gDh8hkB0IAhJCytrzvJckPBgh5K8Bt8+sUhwVZuFARuNc2HPfnpZAWb/gZhAHBHq kdsvBwn5zagJhUTI8/WriLqEs0UsqOBQ2L8AwQN8ZEYSgKvcT+c7MRTTgCRjZ+bdh0qB sZ+7dpMJR+G+PGeubi3mV2QNhg22WsB2UIRYmJqmyL2COl0dZwD8v2RsGie0Xjj8WSpI WVDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679513172; 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=TC6eNLv6iVcM+dLqVd9h+kHjsMmIK0cHmLbQH5XvCQ4=; b=Xn/yqYXVk+xa7Ncu3unqcbq2SuQHMAFCskGXaC9ITFYDbaKaYw/maKbjFnxbz+OTgi nWPAmyUTKt+F6GFfH/RuXmbV7Mjj+gRG9FF/yGSHKh5du9KWnv4QCNMrl+EmHCrKR9Oq jj+FVJwSCF6FAXHaEUJtPMI5IPcyfQy1xvKjWqCMLCpqYE+FnzWJ0cNrhipTSptjTVKM yvrvSmzEnP2wZRrCSuvWCQF8JsXaeYi2kJ5vgmhLEJ5hD40NN5Jlge1UGp2sBepODCFt +DVSdfA1PgwEQLqbRFPc0BSbla5oLJJKpjIrQruCovloNiAVarwQpokYw4j/DYQACp4r 6LvQ== X-Gm-Message-State: AO0yUKUIQjreEUZitY6rGkBM0LBxVx5DeatFf0z6YO1uR9Hv9dkvkGrS DAYhTalMlGt3kf93s3UaSeZcDw== X-Received: by 2002:a17:906:c257:b0:932:6452:2396 with SMTP id bl23-20020a170906c25700b0093264522396mr7250972ejb.74.1679513171843; Wed, 22 Mar 2023 12:26:11 -0700 (PDT) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id k19-20020a1709063fd300b00928de86245fsm7587557ejj.135.2023.03.22.12.26.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 12:26:11 -0700 (PDT) Date: Wed, 22 Mar 2023 20:26:10 +0100 From: Andrew Jones To: Conor Dooley Cc: "Jason A. Donenfeld" , 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: <20230322192610.sad42xau33ye5ayn@orel> References: <20230322120907.2968494-1-Jason@zx2c4.com> <20230322124631.7p67thzeblrawsqj@orel> <1884bd96-2783-4556-bc57-8b733758baff@spud> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1884bd96-2783-4556-bc57-8b733758baff@spud> 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 03:17:13PM +0000, Conor Dooley wrote: > On Wed, Mar 22, 2023 at 01:46:31PM +0100, Andrew Jones wrote: > > 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 > > Thanks for fixing it! > Reviewed-by: 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.) > > At that point, the config option should just go away entirely, no? Ah, yes, and that makes the idea even more attractive, as we could remove several ifdefs. Thanks, drew