From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15B4AC433F5 for ; Fri, 7 Oct 2022 06:08:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229519AbiJGGIy (ORCPT ); Fri, 7 Oct 2022 02:08:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbiJGGIu (ORCPT ); Fri, 7 Oct 2022 02:08:50 -0400 Received: from forward500j.mail.yandex.net (forward500j.mail.yandex.net [5.45.198.250]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 552F2B2772 for ; Thu, 6 Oct 2022 23:08:47 -0700 (PDT) Received: from sas1-78334f65778a.qloud-c.yandex.net (sas1-78334f65778a.qloud-c.yandex.net [IPv6:2a02:6b8:c08:b21f:0:640:7833:4f65]) by forward500j.mail.yandex.net (Yandex) with ESMTP id 065F76CB6733; Fri, 7 Oct 2022 09:08:46 +0300 (MSK) Received: by sas1-78334f65778a.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id gnALNBxKrX-8gi0sD8f; Fri, 07 Oct 2022 09:08:44 +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=1665122925; bh=/dZOB0OZJ5ewGOYu6Vfqo3dohgfS+f5k8XzKDbToPI0=; h=Cc:Message-ID:Subject:Date:References:To:From:In-Reply-To; b=iRCL76I/Z5mJWT4zaddxYfALWpgqZn2sHdNjdOuO/IP5PzDvVxEcsgiKDEuKMl29I DSnX1ikLFGBDZBU9qGlr5A0yGMRzjZXRmh7Fghn7MazWYgaw77in7dHvQLLLizxlaa td9mpUR0go+l/s8gTdV06Bgb3ipi06Spsx+Zg48E= Authentication-Results: sas1-78334f65778a.qloud-c.yandex.net; dkim=pass header.i=@maquefel.me Date: Fri, 7 Oct 2022 09:08:42 +0300 From: Nikita Shubin To: Atish Patra Cc: 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: Re: [PATCH] riscv: fix multi-letter extension compare Message-ID: <20221007090842.69272c4a@redslave.neermore.group> In-Reply-To: <20221006070257.11632-1-nikita.shubin@maquefel.me> References: <20221006070257.11632-1-nikita.shubin@maquefel.me> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Atish, My bad, i somehow decided that 'sscofpmf' should be 'zsscofpmf' in device tree, but it's 'Sscofpmf' actually. Sorry for noise please ignore this patch. On Thu, 6 Oct 2022 10:02:56 +0300 Nikita Shubin wrote: > 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);