From: Charlie Jenkins <charlie@rivosinc.com>
To: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Conor Dooley <conor.dooley@microchip.com>,
Evan Green <evan@rivosinc.com>, Andy Chiu <andy.chiu@sifive.com>
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
Charlie Jenkins <charlie@rivosinc.com>,
Yu Chien Peter Lin <peterlin@andestech.com>
Subject: [PATCH v3 0/4] riscv: Separate vendor extensions from standard extensions
Date: Fri, 19 Jul 2024 09:15:17 -0700 [thread overview]
Message-ID: <20240719-support_vendor_extensions-v3-0-0af7587bbec0@rivosinc.com> (raw)
All extensions, both standard and vendor, live in one struct
"riscv_isa_ext". There is currently one vendor extension, xandespmu, but
it is likely that more vendor extensions will be added to the kernel in
the future. As more vendor extensions (and standard extensions) are
added, riscv_isa_ext will become more bloated with a mix of vendor and
standard extensions.
This also allows each vendor to be conditionally enabled through
Kconfig.
---
This has been split out from the previous series that contained the
addition of xtheadvector due to lack of reviews. The xtheadvector
support will be posted again separately from this.
The alternative patching code from "riscv: Introduce vendor variants of
extension helpers" has been migrated to "riscv: Extend cpufeature.c to
detect vendor extensions" such that the andes patching still works in
that patch.
I also fix a bug in this patch from the previous series that the Andes
extensions were not being properly enabled due to the manual alternative
patching not incrementing the id to be greater than
RISCV_VENDOR_EXT_ALTERNATIVES_BASE.
To: Paul Walmsley <paul.walmsley@sifive.com>
To: Palmer Dabbelt <palmer@dabbelt.com>
To: Albert Ou <aou@eecs.berkeley.edu>
To: Conor Dooley <conor.dooley@microchip.com>
To: Evan Green <evan@rivosinc.com>
To: Andy Chiu <andy.chiu@sifive.com>
Cc: linux-riscv@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
---
Changes in v3:
- Rebase onto for-next as there have been a lot of upstream changes!
- Link to v2: https://lore.kernel.org/r/20240609-support_vendor_extensions-v2-0-9a43f1fdcbb9@rivosinc.com
Changes in v2:
- Fixed issue in riscv_fill_vendor_ext_list() that initalizion was only
happening properly for the first vendor. Add is_initialized field to
riscv_isa_vendor_ext_data_list to allow intialization to be tracked on
a per-vendor basis.
- Link to v1: https://lore.kernel.org/r/20240515-support_vendor_extensions-v1-0-b05dd5ea7d8d@rivosinc.com
---
Charlie Jenkins (4):
riscv: Extend cpufeature.c to detect vendor extensions
riscv: Add vendor extensions to /proc/cpuinfo
riscv: Introduce vendor variants of extension helpers
riscv: cpufeature: Extract common elements from extension checking
arch/riscv/Kconfig | 2 +
arch/riscv/Kconfig.vendor | 19 +++
arch/riscv/errata/andes/errata.c | 3 +
arch/riscv/errata/sifive/errata.c | 3 +
arch/riscv/errata/thead/errata.c | 3 +
arch/riscv/include/asm/cpufeature.h | 103 ++++++++++------
arch/riscv/include/asm/hwcap.h | 25 ++--
arch/riscv/include/asm/vendor_extensions.h | 104 +++++++++++++++++
arch/riscv/include/asm/vendor_extensions/andes.h | 19 +++
arch/riscv/kernel/Makefile | 2 +
arch/riscv/kernel/cpu.c | 35 +++++-
arch/riscv/kernel/cpufeature.c | 143 ++++++++++++++++-------
arch/riscv/kernel/vendor_extensions.c | 56 +++++++++
arch/riscv/kernel/vendor_extensions/Makefile | 3 +
arch/riscv/kernel/vendor_extensions/andes.c | 18 +++
drivers/perf/riscv_pmu_sbi.c | 11 +-
16 files changed, 456 insertions(+), 93 deletions(-)
---
base-commit: 41c196e567fb1ea97f68a2ffb7faab451cd90854
change-id: 20240515-support_vendor_extensions-aa80120e4230
--
- Charlie
next reply other threads:[~2024-07-19 16:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-19 16:15 Charlie Jenkins [this message]
2024-07-19 16:15 ` [PATCH v3 1/4] riscv: Extend cpufeature.c to detect vendor extensions Charlie Jenkins
2024-07-19 16:15 ` [PATCH v3 2/4] riscv: Add vendor extensions to /proc/cpuinfo Charlie Jenkins
2024-07-19 16:15 ` [PATCH v3 3/4] riscv: Introduce vendor variants of extension helpers Charlie Jenkins
2024-07-19 16:15 ` [PATCH v3 4/4] riscv: cpufeature: Extract common elements from extension checking Charlie Jenkins
2024-07-22 19:32 ` [PATCH v3 0/4] riscv: Separate vendor extensions from standard extensions Andrew Jones
2024-07-22 20:23 ` Charlie Jenkins
2024-07-22 23:45 ` Palmer Dabbelt
2024-07-23 12:58 ` patchwork-bot+linux-riscv
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240719-support_vendor_extensions-v3-0-0af7587bbec0@rivosinc.com \
--to=charlie@rivosinc.com \
--cc=andy.chiu@sifive.com \
--cc=aou@eecs.berkeley.edu \
--cc=conor.dooley@microchip.com \
--cc=evan@rivosinc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=peterlin@andestech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®