Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp291394ybl; Wed, 22 Jan 2020 21:46:42 -0800 (PST) X-Google-Smtp-Source: APXvYqypq5pLO45J6NRN+UtHjWqXOTTA8fPdV3syvsh8BroNMmzBK2y9cZzUj1MC3n0RovZRKyBW X-Received: by 2002:a05:6808:a11:: with SMTP id n17mr9218124oij.94.1579758402184; Wed, 22 Jan 2020 21:46:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579758402; cv=none; d=google.com; s=arc-20160816; b=ZxvTw6YtpOmEVSZBUlzhEqgFJYfjx5OLpTNU9XH62WGD9NXehv1tFMnLK9qx6QH7dR TDUAkwONiGjo6HYx3VPJyYyiQV06zTrSQn9SVm3Ki3kvntzVz/VLCSfFl9u7Uu1FMFZo Qe1st+ygshNAcAw9Hq5C5XHCkrSPqaw+lzzxuEee81c8FRnm8FkV2QCkAgNDLbUn3aL2 +UApJ8hxKsEzZyhvI6D3WVDScMUS0qP4SdhejTrRn6pNRYgX+ZvNIEw3D5TdKGdvM/xa 3iCsGWvrRu93YQOVxO1f58WRmy+TvfcgJZufN1ZM/I9DhcDJEI2mz9a221WEktL6riR/ mkew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1dhaSiajlLJy3RCstW1Wok1ELZDJt5jnnFEHfck4kgA=; b=AwXhksQtMsMAziesoM/qhrCuthD4NfPL3F05VC/MxFIg8ytgqw6OiC9LyC5+BKa4fY n0GRydJUyBXhmgZaUjfNefbPWMsUKpiZEIsPWSoq82+pInc2WhD68eHxIlkUnV7yiKOr qd5ryJ7opt/jbHEB8ONPy2R157l4R4NMBoKkOTn61KCfjYZMCBJOYxnRCKFTknwZjrY1 GI1YnUH2p41ohcQiiGbkqUPwjaHrEPzsvcQ1SnoGUhkHeT+Yd/ntcRMPjAQ1dhAKr9np gb4EkeBwQAVFeOCW1S3fvk0kLa+W6Peh/Cgi90532iV7+IA6r6KDrsqkQOmt9hfGYe7Q l1Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b="srT44r3/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si628594otq.188.2020.01.22.21.46.30; Wed, 22 Jan 2020 21:46:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b="srT44r3/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726442AbgAWFpX (ORCPT + 99 others); Thu, 23 Jan 2020 00:45:23 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:44798 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbgAWFpX (ORCPT ); Thu, 23 Jan 2020 00:45:23 -0500 Received: by mail-wr1-f65.google.com with SMTP id q10so1642443wrm.11 for ; Wed, 22 Jan 2020 21:45:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1dhaSiajlLJy3RCstW1Wok1ELZDJt5jnnFEHfck4kgA=; b=srT44r3/1SbNdevUdQ9bRBy6SwEXY/02irxN+XL8wHgIDa5Gt0+V0FEwHhidbMcR6M BhRrTNOfiTV/bqTjedt7rzstSl75yNFgA9Xh6Z/NzoQU6gSIOFWU7+IWH5J9qKDz7kc/ xEfLD2tLDo/XeFfbhcnXTXuW6nFgfXmYxV9uMkRe/Mf46YpGZdyyZ4B4KhlSb5qmluDi cIojFHALTVqjpGujeH0O/w7/d83vqIbY0/KVTu3LFvlgRy38fYGPzVyN45an5Q9b/Y8e OQaeKoHgWBhZZkeTOY/oj78yWUmV7UwxPw2hAFBVc/3Xy0EXKR75C7y572p5uI0cuCLc dWfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1dhaSiajlLJy3RCstW1Wok1ELZDJt5jnnFEHfck4kgA=; b=elvnYJOTArRW1aI4YfRBsnlxXuZkFRIfzpCynYMoHDf4T+obUi5yll0IfcJK/qws4a 9u69E1yemYWHIydY7w4G7pst3/HQHFQ1g/Q10alVXmzLTfacTqZ2h0+P+9nKWznghOXI rDef2xWgeRrHYQpjeoLidTaAc7GaKKAnspyydqileXxIQnB9E0iG7n/UBC1Und0W6Qmt VZIWjL0QFRc02ftRIsn2Dcm6rktg8evzfhXLpZF5cFR9eKee0H/hE4Fu2nUkM1Fs4qYi gwPstVs91DKh0C//l2SxILJkeMG5I/ywGE+K5nl5hpv7UviDzuW56BjxPgjKM+OmkSJ3 FEyQ== X-Gm-Message-State: APjAAAXdJLl8lLjFcwD8/FWWk71Kttt3Iv+Rk+t1Sn8o8DP+y/k4bvUR CJcHMpPwlnizQEDXs5eflmc8NeH/0ijtZ/qe2aElQQ== X-Received: by 2002:adf:eb09:: with SMTP id s9mr15396459wrn.61.1579758320776; Wed, 22 Jan 2020 21:45:20 -0800 (PST) MIME-Version: 1.0 References: <20200116143029.31441-1-guoren@kernel.org> <20200116143029.31441-3-guoren@kernel.org> In-Reply-To: <20200116143029.31441-3-guoren@kernel.org> From: Anup Patel Date: Thu, 23 Jan 2020 11:15:09 +0530 Message-ID: Subject: Re: [PATCH V2 3/4] riscv: Extending cpufeature.c to detect V-extension To: Guo Ren Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Vincent Chen , Zong Li , Greentime Hu , Bin Meng , Atish Patra , Andreas Schwab , "linux-kernel@vger.kernel.org List" , linux-arch@vger.kernel.org, Arnd Bergmann , linux-csky@vger.kernel.org, linux-riscv , Guo Ren Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 16, 2020 at 8:01 PM wrote: > > From: Guo Ren > > Current cpufeature.c doesn't support detecting V-extension, because > "rv64" also contain a 'v' letter and we need to skip it. > > Signed-off-by: Guo Ren > Cc: Anup Patel > --- > arch/riscv/include/uapi/asm/hwcap.h | 1 + > arch/riscv/kernel/cpufeature.c | 4 +++- > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/arch/riscv/include/uapi/asm/hwcap.h b/arch/riscv/include/uapi/asm/hwcap.h > index dee98ee28318..a913e9a38819 100644 > --- a/arch/riscv/include/uapi/asm/hwcap.h > +++ b/arch/riscv/include/uapi/asm/hwcap.h > @@ -21,5 +21,6 @@ > #define COMPAT_HWCAP_ISA_F (1 << ('F' - 'A')) > #define COMPAT_HWCAP_ISA_D (1 << ('D' - 'A')) > #define COMPAT_HWCAP_ISA_C (1 << ('C' - 'A')) > +#define COMPAT_HWCAP_ISA_V (1 << ('V' - 'A')) > > #endif /* _UAPI_ASM_RISCV_HWCAP_H */ > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c > index a5ad00043104..c8527d770c98 100644 > --- a/arch/riscv/kernel/cpufeature.c > +++ b/arch/riscv/kernel/cpufeature.c > @@ -30,6 +30,7 @@ void riscv_fill_hwcap(void) > isa2hwcap['f'] = isa2hwcap['F'] = COMPAT_HWCAP_ISA_F; > isa2hwcap['d'] = isa2hwcap['D'] = COMPAT_HWCAP_ISA_D; > isa2hwcap['c'] = isa2hwcap['C'] = COMPAT_HWCAP_ISA_C; > + isa2hwcap['v'] = isa2hwcap['V'] = COMPAT_HWCAP_ISA_V; > > elf_hwcap = 0; > > @@ -44,7 +45,8 @@ void riscv_fill_hwcap(void) > continue; > } > > - for (i = 0; i < strlen(isa); ++i) > + /* Skip rv64/rv32 to support v/V:vector */ > + for (i = 4; i < strlen(isa); ++i) > this_hwcap |= isa2hwcap[(unsigned char)(isa[i])]; > > /* > -- > 2.17.0 > LGTM. Reviewed-by: Anup Patel Regards, Anup