Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5988813rwb; Wed, 21 Sep 2022 15:49:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM414NdeNHR0Uu5shl0m7dwy3zq5QMSZeE+QvX9iERvHLx516hx7jzC6wnKR0EloE1SX2XuR X-Received: by 2002:a05:6402:2694:b0:450:d537:f6d6 with SMTP id w20-20020a056402269400b00450d537f6d6mr390603edd.344.1663800548165; Wed, 21 Sep 2022 15:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663800548; cv=none; d=google.com; s=arc-20160816; b=QvK1D6GF2SjJCx5nosTZmuV6T+PbdyWBVrSvhiwZ0rL8N/8HyxdQPF8w57eSxQk3Qb 5sPFenp4CXwjjRYLspfwLJkEfz7N6dgfopSKHcjZEJtx2OeRXjJgLEewY4yvAw143mdP +oX0TJx5dg0aGmlzbzvS4JWsjh4LPn4RjQX1MIKoibNSlIEgPLhXhIk8Ix9EiRTNnKmw KeLyBxLgzUVn698appyPGp/YxDsWDO2KH1ZxUuk84OacIt/AWI2zWYbzbZ3YmU2PawQT FuZpYBo7a96vGU+1coL3RSmyFyhNIVh0l+xNB2hLHicy89UMVJNLGvk7olaNGf64AdnN c9Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=Mj3l9TL6WKmPWu+0iN9vSXqZMe6kPxftZnXjHP2P8BU=; b=w0wg8hGhqsogd6ZIK4RWpq93UEmN4wPe1m67NkT7R0HQBAOc5nrnTnQenMkOSq6/TT iXf9rMPUNq4IbPritfVTjMk6lcDFeqB75/x26nOJHizlmvUDBZhbvo5GKVBtBqkZ84OT gE0udaoX3dHEhxMEJCDjfBIH/lQj//tVOzuUedzkKRGrPrVi/ZNIV+g+4VlOw0iRuVvn xL+A0e1aoHP+ehsgTq0B/2prFvBf1DLDqfSCjpnbHs/o57LAHjieT7SVJF8BrCTueIb9 QH6QnqsRnQNFIassjKgbPm6tFraop2TWG5p2k9LyKA/hTUP5B8K3GAcdvHz3ZBfrWdut umoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=gRooOxAT; 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 mp11-20020a1709071b0b00b0078089d2de38si4040797ejc.754.2022.09.21.15.48.41; Wed, 21 Sep 2022 15:49:08 -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=fail header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=gRooOxAT; 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 S230326AbiIUVp7 (ORCPT + 99 others); Wed, 21 Sep 2022 17:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230317AbiIUVpy (ORCPT ); Wed, 21 Sep 2022 17:45:54 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCA7FA6C15 for ; Wed, 21 Sep 2022 14:45:51 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id i15-20020a17090a4b8f00b0020073b4ac27so157243pjh.3 for ; Wed, 21 Sep 2022 14:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=Mj3l9TL6WKmPWu+0iN9vSXqZMe6kPxftZnXjHP2P8BU=; b=gRooOxATLU9/plxfbBItc5MyPgEqAIU8yk7UUi6tX8/Sj5TPJ4jOh2lLNZLIq03yD/ Anz/Evd4AH3ChAtCsJuDGmKHg+0rcdzi1lQKRfwjFD85+ZVWFk3CFtpS42CYRWzeuEfc oELczcbuVEbrDxXJldujOAbTmpHkCa1YbObrjZR7sqUTetjEfsRocYoGbfz6w58b4Eyc KSXltdTvPqvblVn5uIuiWudlA4rjbmTUDaOjtU+cebKWEStWWDZsMyb/IEnKhJkYDWg9 xyUebBdly9VFkHNCzurtWPCABQx3Qgi03nhK7Xs1vx3Opd613fJpoPUWoPIusUNpdyXU 5mXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=Mj3l9TL6WKmPWu+0iN9vSXqZMe6kPxftZnXjHP2P8BU=; b=npEs6exHMCVN49YTlDHQ9t8f0yXoO2AOaEsbIue+h465H58IFdTi7cPXmwVpGMMHQX TQX10fdz6eYmrXL3B+jk/t9mOe3ElJPzkb5tjBBeJ3ZxeF/BbmBVRwrD9/iIn8NQlU4k F8zH0CYEeYS/8XYMSnL3wRkuKMgkpAxmZcu3nZsYiHr//Gb+CIvEPxY5SV5sxLnBRqpD DwyKFmuyxBK1758m7LpWWv48uNvxwr4WpjWFXNCYLxDIV4AxU2TYGRgeOUdwnl6VsXnm w1BvO2E2QPSTbiErSQUTdGc3jPx5SO9IG+yYRIH65Gb5E952XpIgsRaHUn2yMtq18WpO jOrg== X-Gm-Message-State: ACrzQf2rPqt4BOkwP9ttIi8H15/bx+g60anllbvGGYcNb87zQoLatL7G m/1naQe+H1Ew40Rde8adFfnijQ== X-Received: by 2002:a17:902:c792:b0:178:2bd6:c429 with SMTP id w18-20020a170902c79200b001782bd6c429mr201075pla.52.1663796751176; Wed, 21 Sep 2022 14:45:51 -0700 (PDT) Received: from stillson.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id k7-20020aa79727000000b005484d133127sm2634536pfg.129.2022.09.21.14.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 14:45:50 -0700 (PDT) From: Chris Stillson Cc: Guo Ren , Guo Ren , Anup Patel , Greentime Hu , Palmer Dabbelt , Paul Walmsley , Palmer Dabbelt , Albert Ou , Eric Biederman , Kees Cook , Atish Patra , Oleg Nesterov , Heinrich Schuchardt , Guo Ren , Conor Dooley , Mayuresh Chitale , Chris Stillson , Paolo Bonzini , Qinglin Pan , Alexandre Ghiti , Arnd Bergmann , Vincent Chen , Heiko Stuebner , Dao Lu , Jisheng Zhang , Geert Uytterhoeven , Sunil V L , Nick Knight , Han-Kuan Chen , Changbin Du , Li Zhengyu , Alexander Graf , Ard Biesheuvel , Tsukasa OI , Yury Norov , Nicolas Saenz Julienne , Frederic Weisbecker , Mark Rutland , Myrtle Shah , Vitaly Wool , Mathieu Desnoyers , Catalin Marinas , Will Deacon , Mark Brown , Heiko Carstens , Alexey Dobriyan , Huacai Chen , Christian Brauner , Eugene Syromiatnikov , Peter Collingbourne , Colin Cross , Andrew Morton , Barret Rhoden , Suren Baghdasaryan , Davidlohr Bueso , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Subject: [PATCH v12 02/17] riscv: Extending cpufeature.c to detect V-extension Date: Wed, 21 Sep 2022 14:43:44 -0700 Message-Id: <20220921214439.1491510-2-stillson@rivosinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921214439.1491510-1-stillson@rivosinc.com> References: <20220921214439.1491510-1-stillson@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Guo Ren Reviewed-by: Anup Patel Reviewed-by: Greentime Hu Signed-off-by: Greentime Hu Reviewed-by: Palmer Dabbelt --- arch/riscv/include/uapi/asm/hwcap.h | 1 + arch/riscv/kernel/cpufeature.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/riscv/include/uapi/asm/hwcap.h b/arch/riscv/include/uapi/asm/hwcap.h index 46dc3f5ee99f..c52bb7bbbabe 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 553d755483ed..8d4448c2d4f4 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -83,6 +83,7 @@ void __init 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; -- 2.25.1