Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5973868rwb; Wed, 21 Sep 2022 15:32:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6djKYh0za3wT9jO/9Q4sJnvmNSpcKxrLSDAvMyVPyqbNUX/98MMLqbPPAyR9HNkOVAxMKh X-Received: by 2002:a17:906:dc8f:b0:77f:ed68:d9ae with SMTP id cs15-20020a170906dc8f00b0077fed68d9aemr354956ejc.692.1663799562941; Wed, 21 Sep 2022 15:32:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663799562; cv=none; d=google.com; s=arc-20160816; b=lnL+ue6V3k6hWwLgKhTpBjaM6bq8BJeRPctGAznw2SwxgLWhjUIuZjeHn7MuUQDSi6 HiaZuqquhCrvaf0ZsYFtA9odsB2GTFOS3V4khF4fQM1XwNbvQKOQz8OGC6Cnng/EfTuw 6zhkpcEuMPR8SE8FvV2QcRKDqMHFWtVnhs80rAjrLMdYT6lWzCYd0FQWab4/FGBzFhRl CBGQ/ayw8bqiQbn4GEX1EksoXfKWXeoxuF5QtJ7bk+rX0Q0OJwGdu+Q0dZVhJSiceGrS unC/W6G9lTzA96ATM/axSO9Dyc41Yg/8W9h1OD2ZiHQjRJknB06pnE6wCVFuj8T7Tdkf 5srA== 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=d2FRAtCKVgQ9Y5TpjSPH0GfFjJSalodszbXO/KC34yw=; b=BXHhRRJCiDFZ9eEzxFgY5Jzx7btLDRIL9+HhSRglbaqDyLkscQLwjoSSp4tLTo2Tg5 T9Vr+mlDFHLevvkw8EiFJE98pVJGbdpqcXhUVpDPwAnjCVPFrcgWU5cfK3q4Z1wgacWI A3Ry5hb4bR7Ecnscewk+iz/OlGipoXBuMe/Yn438Lzcw+Zga4uXhvKX6FPZjAHgQgPxq tTeW7cDG2etutMlMNc8aF/+FyhGFJ2csz8slNL3rAvfIydbqmoOFaVuxl0/DWeggJGN1 CljQHHFScxh+rst00i4wjaMETcfSCTxjD5iGrGcy7zDPLQjiul4HExIUkWtNrgR/LH1U 3l9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b="SqB//mwo"; 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 hv11-20020a17090760cb00b007309350f2f9si4001751ejc.555.2022.09.21.15.32.16; Wed, 21 Sep 2022 15:32:42 -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="SqB//mwo"; 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 S229731AbiIUVqg (ORCPT + 99 others); Wed, 21 Sep 2022 17:46:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbiIUVqe (ORCPT ); Wed, 21 Sep 2022 17:46:34 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94129A6ACB for ; Wed, 21 Sep 2022 14:46:33 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id c7so7228272pgt.11 for ; Wed, 21 Sep 2022 14:46:33 -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=d2FRAtCKVgQ9Y5TpjSPH0GfFjJSalodszbXO/KC34yw=; b=SqB//mwo/47ysApdTgzQ+IrvUnDTUj6re2dbVZCaupyv86WbxYsQTfHGpKAf0ygC/3 eQyXlZ7swsfhtoATSV/TiAXCCV7uE7KJk62yVyyOIjWHOQRhaY1NKVNoc8IpuVPd33y2 gpSwomTb3kJy8rvXDssyaHfMLON0VK5Fl6B+YmCc2DCMUCZSTO1ycs2ucIoKgmoWOsCh 5ieOGz0sQ0k28Su5Yk11GG2UI8jPiw8LNgTYvI8nYQHj3ofOJQJNctGLgj/lRkkXOrSv 5UY9eEcvOKR0VR24IBZuBHBatGXcU37zKM+tZvFnmYcSS7uzUJVBwdnYAMGuhx1aAWCv DHww== 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=d2FRAtCKVgQ9Y5TpjSPH0GfFjJSalodszbXO/KC34yw=; b=2nO1Df2TunfjclIX/359o+gK2evogwURMx9FBfxil4nWpFdZKZbQ8+/BzCATvUxnU7 mCdStcx64/92LEX4wP3bw1pKr8d75PfbrbdJPWLaQXh6xRGekO4KXj7fAseEVT6Bon9e OezcEFXMjN4Y5pIWNCJljOSX4ys91Eh0Ohu7a5aWcdPzzwhb4TiBVoAExZ+f7IzaYMDc cDJtpzQHXXuLpCcFM4MgVPyGIeaWySdN8GSKe3H0aJvly4D335bxa+XNnsaBUkaqeymD M2PDUBa0NsDqxWNeC8IN/8Ls5huA84hyE3+3RL4Dfs6HFFuMUZXzTbbMzFSD2xWH3kbt bX0w== X-Gm-Message-State: ACrzQf3Qdj+Njkz3K0+IumjhBGHRjJwRFVwM5JYZGp5lGskz7MwfR4l+ l/GfFWl9hnbPpS8M/vOH32OZBg== X-Received: by 2002:a63:5a05:0:b0:434:23a5:a5ca with SMTP id o5-20020a635a05000000b0043423a5a5camr190906pgb.515.1663796792969; Wed, 21 Sep 2022 14:46:32 -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.46.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 14:46:32 -0700 (PDT) From: Chris Stillson Cc: Greentime Hu , Guo Ren , Guo Ren , Vincent Chen , Palmer Dabbelt , Paul Walmsley , Palmer Dabbelt , Albert Ou , Eric Biederman , Kees Cook , Anup Patel , Atish Patra , Oleg Nesterov , Heinrich Schuchardt , Arnaud Pouliquen , Mayuresh Chitale , Chris Stillson , Paolo Bonzini , Qinglin Pan , Alexandre Ghiti , Arnd Bergmann , Heiko Stuebner , Jisheng Zhang , Dao Lu , Sunil V L , Han-Kuan Chen , Li Zhengyu , Alexander Graf , Ard Biesheuvel , Tsukasa OI , Yury Norov , Mark Rutland , Nicolas Saenz Julienne , Frederic Weisbecker , Changbin Du , hasheddan , Vitaly Wool , Myrtle Shah , Catalin Marinas , Will Deacon , Mark Brown , Andrew Morton , Alexey Dobriyan , Huacai Chen , Janosch Frank , Christian Brauner , Evgenii Stepanov , Colin Cross , Peter Collingbourne , Eugene Syromiatnikov , 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 03/17] riscv: Add new csr defines related to vector extension Date: Wed, 21 Sep 2022 14:43:45 -0700 Message-Id: <20220921214439.1491510-3-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=unavailable 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: Greentime Hu Follow the riscv vector spec to add new csr numbers. [guoren@linux.alibaba.com: first porting for new vector related csr] Acked-by: Guo Ren Co-developed-by: Guo Ren Signed-off-by: Guo Ren Co-developed-by: Vincent Chen Signed-off-by: Vincent Chen Signed-off-by: Greentime Hu Reviewed-by: Palmer Dabbelt --- arch/riscv/include/asm/csr.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h index 0e571f6483d9..78a68f29c3ba 100644 --- a/arch/riscv/include/asm/csr.h +++ b/arch/riscv/include/asm/csr.h @@ -24,6 +24,12 @@ #define SR_FS_CLEAN _AC(0x00004000, UL) #define SR_FS_DIRTY _AC(0x00006000, UL) +#define SR_VS _AC(0x00000600, UL) /* Vector Status */ +#define SR_VS_OFF _AC(0x00000000, UL) +#define SR_VS_INITIAL _AC(0x00000200, UL) +#define SR_VS_CLEAN _AC(0x00000400, UL) +#define SR_VS_DIRTY _AC(0x00000600, UL) + #define SR_XS _AC(0x00018000, UL) /* Extension Status */ #define SR_XS_OFF _AC(0x00000000, UL) #define SR_XS_INITIAL _AC(0x00008000, UL) @@ -31,9 +37,9 @@ #define SR_XS_DIRTY _AC(0x00018000, UL) #ifndef CONFIG_64BIT -#define SR_SD _AC(0x80000000, UL) /* FS/XS dirty */ +#define SR_SD _AC(0x80000000, UL) /* FS/VS/XS dirty */ #else -#define SR_SD _AC(0x8000000000000000, UL) /* FS/XS dirty */ +#define SR_SD _AC(0x8000000000000000, UL) /* FS/VS/XS dirty */ #endif #ifdef CONFIG_64BIT @@ -297,6 +303,12 @@ #define CSR_MIMPID 0xf13 #define CSR_MHARTID 0xf14 +#define CSR_VSTART 0x8 +#define CSR_VCSR 0xf +#define CSR_VL 0xc20 +#define CSR_VTYPE 0xc21 +#define CSR_VLENB 0xc22 + #ifdef CONFIG_RISCV_M_MODE # define CSR_STATUS CSR_MSTATUS # define CSR_IE CSR_MIE -- 2.25.1