RISC-V runtime detection of extenstions
v7 cover RISC-V runtime detection of extenstions
Based on riscv,isa property of device tree file parse extenstions which are available in CPU.
As a part of this feature, drop CONFIG_RISCV_ISA_RV64G and explicitly use extensions 'i', 'm', 'a', 'zicsr', 'zifencei' as they are necessary for a work if Xen and it should be true not only for RISC-V 64 (but also for 32 and 128).
Oleksii Kurochko (4):
automation: drop debian:11-riscv64 container xen/riscv: drop CONFIG_RISCV_ISA_RV64G xen/riscv: make zbb as mandatory xen/riscv: identify specific ISA supported by cpu
automation/gitlab-ci/build.yaml | 14 - automation/scripts/containerize | 1 - xen/arch/riscv/Kconfig | 18 - xen/arch/riscv/Makefile | 1 + xen/arch/riscv/arch.mk | 13 +- xen/arch/riscv/cpufeature.c | 504 ++++++++++++++++++++++++ xen/arch/riscv/include/asm/cpufeature.h | 59 +++ xen/arch/riscv/setup.c | 3 + 8 files changed, 573 insertions(+), 40 deletions(-) create mode 100644 xen/arch/riscv/cpufeature.c create mode 100644 xen/arch/riscv/include/asm/cpufeature.h
Signature · 1 line
2.48.1
PATCH v7 1/4 automation: drop debian:11-riscv64 container
There are two reasons for that:
1. In the README, GCC baseline is chosen to be 12.2, whereas Debian 11 uses GCC 10.2.1.
2. Xen requires mandatory some Z extensions, but GCC 10.2.1 does not support Z extensions in -march, causing the compilation to fail.
---
Changes in v7:
- new patch.
--- automation/gitlab-ci/build.yaml | 14 -------------- automation/scripts/containerize | 1 - 2 files changed, 15 deletions(-)
automation/gitlab-ci/build.yaml +0 -14
@@ -720,20 +720,6 @@ debian-12-ppc64le-gcc: HYPERVISOR_ONLY: y # RISC-V 64 cross-build -debian-11-riscv64-gcc: - extends: .gcc-riscv64-cross-build - variables: - CONTAINER: debian:11-riscv64 - KBUILD_DEFCONFIG: tiny64_defconfig - HYPERVISOR_ONLY: y - -debian-11-riscv64-gcc-debug: - extends: .gcc-riscv64-cross-build-debug - variables: - CONTAINER: debian:11-riscv64 - KBUILD_DEFCONFIG: tiny64_defconfig - HYPERVISOR_ONLY: y - debian-12-riscv64-gcc: extends: .gcc-riscv64-cross-build variables:
automation/scripts/containerize +0 -1
@@ -31,7 +31,6 @@ case "_${CONTAINER}" in _fedora) CONTAINER="${BASE}/fedora:41-x86_64";; _bullseye-ppc64le) CONTAINER="${BASE}/debian:11-ppc64le" ;; _bookworm-ppc64le) CONTAINER="${BASE}/debian:12-ppc64le" ;; - _bullseye-riscv64) CONTAINER="${BASE}/debian:11-riscv64" ;; _bookworm-riscv64) CONTAINER="${BASE}/debian:12-riscv64" ;; _bookworm-x86_64-gcc-ibt) CONTAINER="${BASE}/debian:12-x86_64-gcc-ibt" ;; _bookworm|_bookworm-x86_64|_) CONTAINER="${BASE}/debian:12-x86_64" ;;
Signature · 1 line
2.48.1
PATCH v7 2/4 xen/riscv: drop CONFIG_RISCV_ISA_RV64G
In reply to Oleksii Kurochko'G' stands for "imafd_zicsr_zifencei".
Extensions 'f' and 'd' aren't really needed for Xen, and allowing floating point registers to be used can lead to crashes.
Extensions 'i', 'm', 'a', 'zicsr', and 'zifencei' are necessary for the operation of Xen, which is why they are used explicitly (unconditionally) in -march.
Drop "Base ISA" choice from riscv/Kconfig as it is always empty.
---
Changes in V7:
- For better readability use += instead of := for riscv-march-* in arch.mk.
- Drop spaces from riscv-march-y by usage of subst macros.
- Drop "Base ISA" choice as it is empty now.
- Update the commit message.
---
Changes in V6:
- new patch.
--- xen/arch/riscv/Kconfig | 18 ------------------ xen/arch/riscv/arch.mk | 8 +++++--- 2 files changed, 5 insertions(+), 21 deletions(-)
xen/arch/riscv/Kconfig +0 -18
@@ -23,24 +23,6 @@ endmenu menu "ISA Selection" -choice - prompt "Base ISA" - default RISCV_ISA_RV64G if RISCV_64 - help - This selects the base ISA extensions that Xen will target. - -config RISCV_ISA_RV64G - bool "RV64G" - help - Use the RV64I base ISA, plus - "M" for multiply/divide, - "A" for atomic instructions, - “F”/"D" for {single/double}-precision floating-point instructions, - "Zicsr" for control and status register access, - "Zifencei" for instruction-fetch fence. - -endchoice - config RISCV_ISA_C bool "Compressed extension" default y
xen/arch/riscv/arch.mk +5 -3
@@ -6,10 +6,12 @@ $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS)) riscv-abi-$(CONFIG_RISCV_32) := -mabi=ilp32 riscv-abi-$(CONFIG_RISCV_64) := -mabi=lp64 -riscv-march-$(CONFIG_RISCV_ISA_RV64G) := rv64g -riscv-march-$(CONFIG_RISCV_ISA_C) := $(riscv-march-y)c +riscv-march-$(CONFIG_RISCV_64) := rv64 +riscv-march-y += ima +riscv-march-$(CONFIG_RISCV_ISA_C) += c +riscv-march-y += _zicsr_zifencei -riscv-generic-flags := $(riscv-abi-y) -march=$(riscv-march-y) +riscv-generic-flags := $(riscv-abi-y) -march=$(subst $(space),,$(riscv-march-y)) # check-extension: Check whether extenstion is supported by a compiler and # an assembler.
Signature · 1 line
2.48.1
PATCH v7 3/4 xen/riscv: make zbb as mandatory
In reply to Oleksii KurochkoAccording to riscv/booting.txt, it is expected that Zbb should be supported.
---
Changes in v7:
- new patch.
--- xen/arch/riscv/arch.mk | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
xen/arch/riscv/arch.mk +2 -5
@@ -9,7 +9,7 @@ riscv-abi-$(CONFIG_RISCV_64) := -mabi=lp64 riscv-march-$(CONFIG_RISCV_64) := rv64 riscv-march-y += ima riscv-march-$(CONFIG_RISCV_ISA_C) += c -riscv-march-y += _zicsr_zifencei +riscv-march-y += _zicsr_zifencei_zbb riscv-generic-flags := $(riscv-abi-y) -march=$(subst $(space),,$(riscv-march-y))
@@ -25,13 +25,10 @@ $(eval $(1) := \ $(call as-insn,$(CC) $(riscv-generic-flags)_$(1),$(value $(1)-insn),_$(1))) endef -zbb-insn := "andn t0$(comma)t0$(comma)t0" -$(call check-extension,zbb) - zihintpause-insn := "pause" $(call check-extension,zihintpause) -extensions := $(zbb) $(zihintpause) +extensions := $(zihintpause) extensions := $(subst $(space),,$(extensions))
Signature · 1 line
2.48.1
PATCH v7 4/4 xen/riscv: identify specific ISA supported by cpu
In reply to Oleksii KurochkoSupported ISA extensions are specified in the device tree within the CPU node, using two properties: riscv,isa-extensions and riscv,isa.
Currently, Xen does not support the riscv,isa-extensions property and will be added in the future.
The riscv,isa property is parsed for each CPU, and the common extensions are stored in the host_riscv_isa bitmap.
This bitmap is then used by riscv_isa_extension_available() to check if a specific extension is supported.
The current implementation is based on Linux kernel v6.12-rc3 implementation with the following changes:
- Drop unconditional setting of {RISCV_ISA_EXT_ZICSR, RISCV_ISA_EXT_ZIFENCEI, RISCV_ISA_EXT_ZICNTR, RISCV_ISA_EXT_ZIHPM} because Xen is going to run on hardware produced after the aforementioned extensions were split out of "i".
- Remove saving of the ISA for each CPU, only the common available ISA is saved.
- Remove ACPI-related code as ACPI is not supported by Xen.
- Drop handling of elf_hwcap, since Xen does not provide hwcap to userspace.
- Replace of_cpu_device_node_get() API, which is not available in Xen, with a combination of dt_for_each_child_node(), dt_device_type_is_equal(), and dt_get_cpuid_from_node() to retrieve cpuid and riscv,isa in riscv_fill_hwcap_from_isa_string().
- Rename arguments of __RISCV_ISA_EXT_DATA() from _name to ext_name, and _id to ext_id for clarity.
- Replace instances of __RISCV_ISA_EXT_DATA with RISCV_ISA_EXT_DATA.
- Replace instances of __riscv_isa_extension_available with riscv_isa_extension_available for consistency. Also, update the type of bit argument of riscv_isa_extension_available().
- Redefine RISCV_ISA_EXT_DATA() to work only with ext_name and ext_id, as other fields are not used in Xen currently. Also RISCV_ISA_EXT_DATA() is reworked in the way to take only one argument ext_name.
- Add check of first 4 letters of riscv,isa string to riscv_isa_parse_string() as Xen doesn't do this check before so it is necessary to check correctness of riscv,isa string. ( it should start with rv{32,64} with taking into account upper and lower case of "rv"). Additionally, check also that 'i' goes after 'rv{32,64}' to be sure that out_bitmap can't be empty.
- Drop an argument of riscv_fill_hwcap() and riscv_fill_hwcap_from_isa_string() as it isn't used, at the moment.
- Update the comment message about QEMU workaround.
- Apply Xen coding style.
- s/pr_info/printk.
- Drop handling of uppercase letters of riscv,isa in riscv_isa_parse_string() as Xen checks that riscv,isa should be in lowercase according to the device tree bindings.
- Update logic of riscv_isa_parse_string(): now it stops parsing of riscv,isa if illegal symbol was found instead of ignoring them.
---
Changes in V7:
- Add blanks around '##' in RISCV_ISA_EXT_DATA macros.
- Add zba and zbs to riscv_isa_ext[] as we have such in enumerators so someone could try to ask if it is supported or not by CPU.
- Fix the comment, start from uppercase letter.
- Add Acked-by: Jan Beulich <[email protected]>.
---
Changes in V6:
- Explicitly set ZBA, ZBB, ZBS extensions if b is present in riscv,isa.
- Update enum riscv_isa_ext_id; not an extension name is in lowercase.
- Update RISCV_ISA_EXT_DATA() macro to recieve only one argument.
- Add __init for is_lowercase_extension_name().
- Indent label by one blank.
- Add quotes around %c.
- Drop extensions 'f' and 'd' from required_extensions[] array.
- Update the commit message.
---
Changes in V5:
- Add IMAFD + zifencei extensions to required_extensions[] as we are using -maarch=rv64g* for compilation.
- Add "C" extension to required_extensions[] as if CONFIG_RISCV_ISA_C=y then -march will be = rv64gc*.
- Fix typos.
- s/strncmp/memcmp.
- Drop usage of ext_err and reuse ext_end instead.
- Drop tolower() functions as we guarante that riscv,isa will be in lower case.
- Declare req_extns_amount as const.
- Check what riscv_isa_parse_string() returns.
- Add check that Vendor extensions (case 'x') name is alnum.
- Return -EINVAL from riscv_isa_parse_string() if an extension has wrong name.
- Update logic of riscv_isa_parse_string(): now it stop parsing of riscv,isa if illegal symbol was found instead of ignoring them.
- Drop ASSERT ASSERT(!bitmap_empty(this_isa, RISCV_ISA_EXT_MAX)) as now riscv_isa_parse_string() has a check which guarantes that, at least, "rv{32,64}i" is in "riscv,isa" thereby this_isa can't be empty.
- Update the commit message.
---
Changes in V4:
- Add "Originally ... " at the start of cpufeature.c.
- Sync required_extensions[] with riscv_isa_ext[] in terms of element sorting/ordering.
- Fix identations.
- s/#error/# error.
- With insisting on ISA string being all lowercase, drop handling the uppercases in riscv_isa_parse_string().
- check riscv,isa recieved from device tree; it must be in lowercase.
- Update ASSERT() in match_isa_ext(): drop checking of riscv,isa recieved from device tree as this check was moved to riscv_fill_hwcap().
- Update is_lowercase_extension_name() to ignore digits as they could be used for extension version which is part of the extension name so should be skipped.
- Alight ternanry operator properly in riscv_fill_hwcap().
- Update the commit message: add information that handling of uppercase letters in riscv,isa are dropped in riscv_isa_parsing_string() becase Xen checks that riscv,isa must be all in lowercase according to device tree binding.
---
Changes in V3:
- Drop description of changes in cpufeature.c and leave only in the commit message to not deal with possible staleness of them in the future.
- Update for dt_get_cpuid_from_node():
- update printk() message.
- add some explanation about if-condition on the start of the function.
- add dt_cpuid argument for function dt_get_cpuid_from_node() to deal with potential truncation issue from paddr_t (dt_read_paddr() returns that ) to int.
- Add Zicsr to required_extensions[].
- Drop an argument check at the start of is_lowercase_extension_name() as function is static and callers are expected to pass a good pointer.
- Add a comment with some additional explanation about the stop condition of checking a case of extension name.
- Omit blanks after opening and closing parentheses in the comments.
- Add missed parentheses in match_isa_ext().
- Drop ASSERT() which checks that first two letters of isa string are in lower case as after this ASSERT() there is an if-condition which does the same.
- Cut part of printk_once()'s message in riscv_isa_parse_string() related to riscv,isa-extension as it isn't supported for now and usage of it will lead to panic().
- Drop function riscv_fill_hwcap_from_ext_list() at all as Xen isn't going to support riscv,isa-extensions for now.
- Clarify printk()'s message when riscv,isa property wasn't found in cpu node. Now it contains "for DT's cpu%d node", where %d is cpuid, instead of "for cpu%d" to not confuse cpuid number ( if it Xen's cpu id and physical cpu's id).
- Updates in riscv_isa_extension_available():
- Drop local varible bmap and initialize isa_bitmap in more readable way.
- Rename argument bit of riscv_isa_extension_available() to id for clearness.
- Update handling of failure of h/w capabilities parsing in riscv_fill_hwcap().
- Introduce has_isa_extensions_property() to check if "riscv,isa-extension" is present in any device tree cpu node.
---
Changes in V2:
- Update the list of changes in comparison with Linux on the top of cpufeature.c.
- Now really drop all ACPI-related stuff.
Add #ifdef CONFIG_ACPI #error ... #endif instead.
- Make id ( member of riscv_isa_ext_data structure ) not const.
- s/__read_mostly/__ro_after_init for riscv_isa bitmap.
- Update the comment above riscv_isa_ext[] declaration:
- Drop Linux details.
- Revised the numbering of the ordering rules for RISC-V ISA extensions.
- Add comment that extension name must be all lowercase according to device tree binding.
- Add __initconst for declarations of riscv_isa_ext[] and required_extensions[].
- Move riscv_isa_ext_count for global declaration to match_isa_ext where it is really used.
- Add new function is_lowercase_extension_name().
- Updates for match_isa_ext():
- Move last argument of match_isa_ext() to new line to not violate line length.
- s/int/unsigned int for cycle varible i.
- s/set_bit/__set_bit as no need for atomicity at this stage of boot.
- Add ASSERT() to be sure that extension name is in lowercase.
- s/strncasecmp/strncasecmp as extension name must be in a lowercase.
- Updates for riscv_isa_parse_string():
- Move last argument of riscv_isa_parse_string() to new line to not violate line length.
- Update the checks at the start of the function. Now if CONFIG_RISCV_32=y the only rv32 is accepted, or rv64 for CONFIG_RISCV_64=y.
- Drop ACPI-related stuff.
- Add blank lines between non-fall-through case blocks.
- Add blanks in for loops before ')'.
- Update the comment about QEMU workaround for invalid single-letter
's' & 'u'.
- Updates for riscv_fill_hwcap_from_ext_list():
- Drop initilizer of cpuid inside dt_for_each_child_node() {...}.
- Introduce res and return it instead of -EINVAL.
- Drop else and change printk("riscv,isa-extensions isnt supported\n") to panic("riscv,isa-extensions isnt supported\n").
- Drop ( cpuid >= NR_CPUS ) check as cpuid technically could be any number. Only cpuid=0 is guaranteed to be.
- Updates for riscv_fill_hwcap_from_isa_string():
- move cpuid and isa variables to dt_for_each_child_node() {...}.
- Drop initilizer of cpuid inside dt_for_each_child_node() {...}.
- Drop ( cpuid >= NR_CPUS ) check as cpuid technically could be any number. Only cpuid=0 is guaranteed to be.
- Add ASSERT() to be sure that this_isa isn't null to prevent ending up with extensions not supported by one of the CPUs.
- Updates for riscv_isa_extension_available():
- Code style fixes.
- Drop conditional operator used in return as functions returns bool.
- s/extenstion/extensions, s/extenstion/extenstion.
- Drop RISCV_ISA_EXT_SxAIA as it isn't used.
- Move definitions of RISCV_ISA_EXT_{a,c,d,...,v} to enum riscv_isa_ext_id.
- Move macros RISCV_ISA_EXT_MAX to enum riscv_isa_ext_id.
- Update the comment above definition of RISCV_ISA_EXT_BASE.
- Fix code style ( violation of line length ) for riscv_isa_extension_available().
- Sync commit message with the comment on the start of cpufeature.c
--- xen/arch/riscv/Makefile | 1 + xen/arch/riscv/cpufeature.c | 504 ++++++++++++++++++++++++ xen/arch/riscv/include/asm/cpufeature.h | 59 +++ xen/arch/riscv/setup.c | 3 + 4 files changed, 567 insertions(+) create mode 100644 xen/arch/riscv/cpufeature.c create mode 100644 xen/arch/riscv/include/asm/cpufeature.h
xen/arch/riscv/Makefile +1 -0
@@ -1,3 +1,4 @@ +obj-y += cpufeature.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o obj-y += entry.o obj-y += mm.o
xen/arch/riscv/cpufeature.c new file +504 -0
504 lines not on this page · raw message
xen/arch/riscv/include/asm/cpufeature.h new file +59 -0
59 lines not on this page · raw message
xen/arch/riscv/setup.c +3 -0
@@ -13,6 +13,7 @@#include <public/version.h> +#include <asm/cpufeature.h> #include <asm/early_printk.h> #include <asm/fixmap.h> #include <asm/sbi.h>
@@ -123,6 +124,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id,panic ("Booting using ACPI isn't supported\n" ); } +riscv_fill_hwcap (); +printk ("All set up\n" );machine_halt ();
Signature · 1 line
2.48.1
Re: [PATCH for 4.21 v7 1/4] automation: drop debian:11-riscv64 container
In reply to Oleksii KurochkoQuoted 3 lines · Oleksii Kurochko
There are two reasons for that:
1. In the README, GCC baseline is chosen to be 12.2, whereas Debian 11 uses GCC 10.2.1.
Which README is this? Not the one at the root of the tree, afaics, which continues to mention only x86 and Arm.
Jan
Re: [PATCH for 4.21 v7 1/4] automation: drop debian:11-riscv64 container
Quoted 6 lines · Jan Beulich
Quoted 3 lines · Oleksii Kurochko
There are two reasons for that:
1. In the README, GCC baseline is chosen to be 12.2, whereas Debian 11uses GCC 10.2.1.Which README is this? Not the one at the root of the tree, afaics, which continues to mention only x86 and Arm.
I missed to add this patch:https://gitlab.com/xen-project/people/olkur/xen/-/commit/57901e60066e93d986670aa91fb390774c965d3f.
Would it be enough just to do a reply for this patch series and send what git format-patch gives?
~ Oleksii
Re: [PATCH for 4.21 v7 1/4] automation: drop debian:11-riscv64 container
Quoted 6 lines · Oleksii Kurochko
Quoted 4 lines · Jan Beulich
Quoted 3 lines · Oleksii Kurochko
There are two reasons for that:
1. In the README, GCC baseline is chosen to be 12.2, whereas Debian 11uses GCC 10.2.1.
Quoted 6 lines
Quoted 2 lines
Which README is this? Not the one at the root of the tree, afaics, which continues to mention only x86 and Arm.
I missed to add this patch:https://gitlab.com/xen-project/people/olkur/xen/-/commit/57901e60066e93d986670aa91fb390774c965d3f.
Would it be enough just to do a reply for this patch series and send what git format-patch gives?
Don't know. In particular I have been under the impression that "git format-patch" formats things slightly differently than what "git am" would expect. Can't you use "git send-email" here as well, making that patch 0.5/4?
Jan
Re: [PATCH for 4.21 v7 1/4] automation: drop debian:11-riscv64 container
In reply to Oleksii KurochkoQuoted 6 lines · Oleksii Kurochko
Quoted 4 lines · Jan Beulich
Quoted 3 lines · Oleksii Kurochko
There are two reasons for that:
1. In the README, GCC baseline is chosen to be 12.2, whereas Debian 11uses GCC 10.2.1.
Quoted 6 lines
Quoted 2 lines
Which README is this? Not the one at the root of the tree, afaics, which continues to mention only x86 and Arm.
I missed to add this patch:https://gitlab.com/xen-project/people/olkur/xen/-/commit/57901e60066e93d986670aa91fb390774c965d3f.
Would it be enough just to do a reply for this patch series and send what git format-patch gives?
Oh, and: The patch description wants to change as well before you send.
Jan
PATCH v7 1/1 xen/README: add compiler and binutils versions for RISCV-64
In reply to Oleksii KurochkoSet the baseline for the compiler and binutils to >=12.2 for GCC and
Quoted 1 line
=2.39 for GNU binutils, as Xen's GitLab CI will use the Debian 12
container for RISCV-64 testing. Therefore, these versions are expected to be the minimum supported versions.
--- README | 3 +++ 1 file changed, 3 insertions(+)
README +3 -0
@@ -48,6 +48,9 @@ provided by your OS distributor: - For ARM 64-bit: - GCC 5.1 or later - GNU Binutils 2.24 or later + - For RISC-V 64-bit: + - GCC 12.2 or later + - GNU Binutils 2.39 or later * POSIX compatible awk * Development install of zlib (e.g., zlib-dev) * Development install of Python 2.7 or later (e.g., python-dev)
Signature · 1 line
2.48.1
Re: [PATCH for 4.21 v7 1/4] automation: drop debian:11-riscv64 container
In reply to Jan BeulichQuoted 6 lines · Jan Beulich
Quoted 5 lines · Oleksii Kurochko
Quoted 4 lines · Jan Beulich
Quoted 3 lines · Oleksii Kurochko
There are two reasons for that:
1. In the README, GCC baseline is chosen to be 12.2, whereas Debian 11uses GCC 10.2.1.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Which README is this? Not the one at the root of the tree, afaics, which continues to mention only x86 and Arm.
I missed to add this patch:https://gitlab.com/xen-project/people/olkur/xen/-/commit/57901e60066e93d986670aa91fb390774c965d3f.
Would it be enough just to do a reply for this patch series and send what git format-patch gives?
Don't know. In particular I have been under the impression that "git format-patch" formats things slightly differently than what "git am" would expect. Can't you use "git send-email" here as well, making that patch 0.5/4?
Done by using git send-email.
At least, my mail app parsed this case well.
~ Oleksii
Re: [PATCH for 4.21 v7 0.5/4] xen/README: add compiler and binutils versions for RISCV-64
In reply to Oleksii KurochkoQuoted 4 lines · Oleksii Kurochko
Set the baseline for the compiler and binutils to >=12.2 for GCC and
Quoted 1 line
=2.39 for GNU binutils, as Xen's GitLab CI will use the Debian 12
container for RISCV-64 testing. Therefore, these versions are expected to be the minimum supported versions.
It's not the container that dictates the minimum version, but the issues with older versions. Those want naming here instead.
Jan
Re: [PATCH for 4.21 v7 0.5/4] xen/README: add compiler and binutils versions for RISCV-64
Quoted 7 lines · Jan Beulich
Quoted 4 lines · Oleksii Kurochko
Set the baseline for the compiler and binutils to >=12.2 for GCC and
Quoted 1 line
=2.39 for GNU binutils, as Xen's GitLab CI will use the Debian 12
container for RISCV-64 testing. Therefore, these versions are expected to be the minimum supported versions.
It's not the container that dictates the minimum version, but the issues with older versions. Those want naming here instead.
I will add this information too. (I thought it would be enough to have that in the patch where debian11 container is dropped)
Thanks.
~ Oleksii
Re: [PATCH for 4.21 v7 2/4] xen/riscv: drop CONFIG_RISCV_ISA_RV64G
In reply to Oleksii KurochkoQuoted 5 lines · Oleksii Kurochko
'G' stands for "
imafd_zicsr_zifencei".Extensions 'f' and 'd' aren't really needed for Xen, and allowing floating point registers to be used can lead to crashes.
Quoted 7 lines
Extensions 'i', 'm', 'a', 'zicsr', and 'zifencei' are necessary for the operation of Xen, which is why they are used explicitly (unconditionally) in -march.
Drop "Base ISA" choice from riscv/Kconfig as it is always empty.
Signed-off-by Oleksii Kurochko <[email protected]>
Re: [PATCH for 4.21 v7 3/4] xen/riscv: make zbb as mandatory
In reply to Oleksii KurochkoQuoted 9 lines · Oleksii Kurochko
According to
riscv/booting.txt, it is expected that Zbb should be supported.Signed-off-by Oleksii Kurochko <[email protected]>---
Changes in v7:
- new patch.--- xen/arch/riscv/arch.mk | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
Please can you also tidy asm/cmpxchg.h of ANDN_INSN() then?
Jan
Re: [PATCH for 4.21 v7 3/4] xen/riscv: make zbb as mandatory
Quoted 11 lines · Jan Beulich
Quoted 9 lines · Oleksii Kurochko
According to
riscv/booting.txt, it is expected that Zbb should be supported.Signed-off-by Oleksii Kurochko<[email protected]>---
Changes in v7:
- new patch.--- xen/arch/riscv/arch.mk | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)Please can you also tidy
asm/cmpxchg.hofANDN_INSN()then?
Sure, I can leave only:
/*
* To not face an issue that gas doesn't understand ANDN instruction
* it is encoded using .insn directive.
*/
#define ANDN_INSN(rd, rs1, rs2) \
".insn r OP, 0x7, 0x20, " rd ", " rs1 ", " rs2 "\n"~ Oleksii
Re: [PATCH for 4.21 v7 3/4] xen/riscv: make zbb as mandatory
Quoted 14 lines · Oleksii Kurochko
Quoted 11 lines · Jan Beulich
Quoted 9 lines · Oleksii Kurochko
According to
riscv/booting.txt, it is expected that Zbb should be supported.Signed-off-by Oleksii Kurochko<[email protected]>---
Changes in v7:
- new patch.--- xen/arch/riscv/arch.mk | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)Please can you also tidy
asm/cmpxchg.hofANDN_INSN()then?
Quoted 7 lines
Sure, I can leave only:
/*
* To not face an issue that gas doesn't understand ANDN instruction
* it is encoded using .insn directive.
*/#define ANDN_INSN(rd, rs1, rs2) \ ".insn r OP, 0x7, 0x20, " rd ", " rs1 ", " rs2 "\n"
Wait, no - why would you? Patch 0.5 is supposed to be setting a baseline where Zbb is known by the tool chain. With that proper "andn" can be used wherever we like.
Jan
Re: [PATCH for 4.21 v7 3/4] xen/riscv: make zbb as mandatory
Quoted 20 lines · Jan Beulich
Quoted 11 lines · Oleksii Kurochko
Quoted 10 lines · Jan Beulich
Quoted 9 lines · Oleksii Kurochko
According to
riscv/booting.txt, it is expected that Zbb should be supported.Signed-off-by Oleksii Kurochko<[email protected]>---
Changes in v7:
- new patch.--- xen/arch/riscv/arch.mk | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)Quoted 8 lines
Quoted 1 line
Please can you also tidy
asm/cmpxchg.hofANDN_INSN()then?Sure, I can leave only:
/*
* To not face an issue that gas doesn't understand ANDN instruction
* it is encoded using .insn directive.
*/#define ANDN_INSN(rd, rs1, rs2) \ ".insn r OP, 0x7, 0x20, " rd ", " rs1 ", " rs2 "\n"
Quoted 3 lines
Wait, no - why would you? Patch 0.5 is supposed to be setting a baseline where Zbb is known by the tool chain. With that proper "andn" can be used wherever we like.
I thought that Zbb in binutils (part of whic is gas) was added later then I mentioned in Patch 0.5 but Zbb was added starting from 2.37, so we can just really use andn instruction instead of .insn .
Thanks for clarification.
~ Oleksii