Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp541861rwb; Thu, 6 Oct 2022 00:28:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4djam8WY+S4ffGTLSkM3Ky3d556qVanr+VcMPXaiO5FwShfkwp5IRpexAqUB1VDR/RvQAT X-Received: by 2002:a63:d0:0:b0:45b:b321:46d2 with SMTP id 199-20020a6300d0000000b0045bb32146d2mr1293727pga.250.1665041339512; Thu, 06 Oct 2022 00:28:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665041339; cv=none; d=google.com; s=arc-20160816; b=y5pv/vd3IvMH79jCD8TmFPpfX7+InwuGrkrlgxkgytcDxRy3ybBwvUInZHU50NqaL1 fNoOxNuCSwqVhKmOXcmsdR1gLAiZC7gJR2zTvY4qoi/Las5TAPfaY2o4U0kR5joK9/ee z9fkYM2Q/uR6J5Ush4dOJLQvbUzNP36BwfCKhUCxOANs0Z9ByiKsAzD8fDUxLeHJrb5Q peyy4gQw9q5EVrWPL0WldKrGIMYLgViWCHTkJK8tPlhYj0kBGlXMhBLRhK8GBIvvIZUt cW0OwzeOcHkBiSkzT/JT54XL9euoZjzqyTf+L3VnNkRlKbvU7tEO/NlBdkYVVjPqv0b0 h5hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=5RTtbpB9MqKeuFtwCR+bpAvBlgufCwcN1kH3vcMsM+o=; b=X5JKc1N+VS/9kRUWw9pteVz7VkHj1zk8er3xBhI+sJyfl/dlnCpJ/mH9IxuPCcVy3E EchGphSl6lhS2QlvbLFleRIN2KUbhD51klmql6FbgerW336+23lFLJblpfrJCgLIJOM8 tfxSDzuQC0PHiM1oh5eNDGR++bYaBB5UOV5CfPvhx7JnbbuRgEiO9pHmT91FVnKL/GR0 TyDGojRNnhikleY9vAYob3W1Sru4LBZDfPkwoUZOgrCvaKUpjtsoHNVP5CAE2zdxDfWz nhiKJIagjTX4x5FBoLENKOZ0s4Rd0jsiys5QyUK7n198ImF1QwprxlXfBvv2XHR+uuXm JE7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maquefel.me header.s=mail header.b="Ifrc/9hW"; 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 i7-20020a170902cf0700b00178431e112asi18900792plg.449.2022.10.06.00.28.48; Thu, 06 Oct 2022 00:28:59 -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=@maquefel.me header.s=mail header.b="Ifrc/9hW"; 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 S230184AbiJFHOO (ORCPT + 99 others); Thu, 6 Oct 2022 03:14:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbiJFHOL (ORCPT ); Thu, 6 Oct 2022 03:14:11 -0400 X-Greylist: delayed 451 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 06 Oct 2022 00:14:08 PDT Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FBB750717 for ; Thu, 6 Oct 2022 00:14:07 -0700 (PDT) Received: from iva6-2d18925256a6.qloud-c.yandex.net (iva6-2d18925256a6.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:7594:0:640:2d18:9252]) by forward104j.mail.yandex.net (Yandex) with ESMTP id A67862F9A67A; Thu, 6 Oct 2022 10:03:00 +0300 (MSK) Received: by iva6-2d18925256a6.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id yYZDPb1P4X-2vi0vajV; Thu, 06 Oct 2022 10:02:59 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1665039779; bh=5RTtbpB9MqKeuFtwCR+bpAvBlgufCwcN1kH3vcMsM+o=; h=Message-Id:Date:Cc:Subject:To:From; b=Ifrc/9hW4yrF4ki1RLIQujMFhYr0zxD7vN1d29GeqSFVmpauj+mKQsaWpLAAm6pWB cij52U+cowo8cWFmWfkEl8+FwywXqJM5smUFfbFIQ8nAOcbiuDpBpS/SumP8MGFY0i 9kFhx2S/AzngcEJwgx4CguPKkYY99ipKxUgxWCOU= Authentication-Results: iva6-2d18925256a6.qloud-c.yandex.net; dkim=pass header.i=@maquefel.me From: Nikita Shubin To: Atish Patra Cc: Nikita Shubin , linux@yadro.com, Nikita Shubin , Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Heiko Stuebner , Guo Ren , Tsukasa OI , Jisheng Zhang , Sunil V L , Yury Norov , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] riscv: fix multi-letter extension compare Date: Thu, 6 Oct 2022 10:02:56 +0300 Message-Id: <20221006070257.11632-1-nikita.shubin@maquefel.me> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 From: Nikita Shubin Increment ext pointer to match letters after 'z' character, so it points to actual extension name. Fixes: 4905ec2fb7e6 ("RISC-V: Add sscofpmf extension support") Signed-off-by: Nikita Shubin --- Hello Atish, Sorry to blame you, but i double checked this and i don't see a way how extensions from device tree could be successfully matched with encoded ones without incrementing the ext pointer or prepending the encoded extensions with 'z' letter. I have no idea how this could slip through review - am i missing something ? --- arch/riscv/kernel/cpufeature.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 3b5583db9d80..031546052dc0 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -199,6 +199,7 @@ void __init riscv_fill_hwcap(void) this_hwcap |= isa2hwcap[(unsigned char)(*ext)]; set_bit(*ext - 'a', this_isa); } else { + ext++; SET_ISA_EXT_MAP("sscofpmf", RISCV_ISA_EXT_SSCOFPMF); SET_ISA_EXT_MAP("svpbmt", RISCV_ISA_EXT_SVPBMT); SET_ISA_EXT_MAP("zicbom", RISCV_ISA_EXT_ZICBOM); -- 2.35.1