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 C2E16ECAAD8 for ; Wed, 21 Sep 2022 21:46:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230348AbiIUVqA (ORCPT ); Wed, 21 Sep 2022 17:46:00 -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-Google-Smtp-Source: AMsMyM7vI5SJE0+lFi/SjzwB7byCbic4o87lhgQGCKazRPjoqX2GRJ8LTCmVDof9ZJUchurT/snvBQ== 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 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