* [PATCH 0/2] RISC-V: minor fixes to the QEMU workaround in ISA string parser
@ 2023-07-22 6:22 Tsukasa OI
2023-07-22 6:22 ` [PATCH 1/2] RISC-V: make ISA string workaround case-insensitive Tsukasa OI
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Tsukasa OI @ 2023-07-22 6:22 UTC (permalink / raw)
To: Tsukasa OI, linux-riscv
Although hardly functional (mostly editorial), the author hopes this to be
useful to give less confusion to kernel developers and improve
the maintainability of the RISC-V ISA parser, including the QEMU-related
workaround that is "fixed" by this patch set (intended for QEMU < v7.1).
v1:
(the initial submission; see the each PATCH for details)
Tsukasa OI (2):
RISC-V: make ISA string workaround case-insensitive
RISC-V: fix the comment for ISA string workaround
arch/riscv/kernel/cpufeature.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
--
2.40.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] RISC-V: make ISA string workaround case-insensitive
2023-07-22 6:22 [PATCH 0/2] RISC-V: minor fixes to the QEMU workaround in ISA string parser Tsukasa OI
@ 2023-07-22 6:22 ` Tsukasa OI
2023-07-22 10:49 ` Conor Dooley
2023-07-22 6:22 ` [PATCH 2/2] RISC-V: fix the comment for ISA string workaround Tsukasa OI
2023-07-26 5:44 ` [PATCH v2 0/1] RISC-V: clarification of the QEMU workaround in the ISA parser Tsukasa OI
2 siblings, 1 reply; 10+ messages in thread
From: Tsukasa OI @ 2023-07-22 6:22 UTC (permalink / raw)
To: Tsukasa OI, linux-riscv
From: Tsukasa OI <research_trasio@irq.a4lg.com>
This is a follow-up for commit 255b34d799dd ("riscv: allow case-insensitive
ISA string parsing").
Although the QEMU workaround in the ISA string parser works well with
lowercase-only handling ('s' followed by 'u' and not preceded by '_'),
case-sensitive handling in the case-insensitive parser can be confusing.
This commit makes the QEMU workaround case-insensitive and gives more
robustness (against manually crafted Device Tree blobs) and less confusion
to kernel developers.
Signed-off-by: Tsukasa OI <research_trasio@irq.a4lg.com>
---
arch/riscv/kernel/cpufeature.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index a8f66c015229..63277cdc1ea5 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -168,19 +168,19 @@ void __init riscv_fill_hwcap(void)
switch (*ext) {
case 's':
+ case 'S':
/*
* Workaround for invalid single-letter 's' & 'u'(QEMU).
* No need to set the bit in riscv_isa as 's' & 'u' are
* not valid ISA extensions. It works until multi-letter
* extension starting with "Su" appears.
*/
- if (ext[-1] != '_' && ext[1] == 'u') {
+ if (ext[-1] != '_' && tolower(ext[1]) == 'u') {
++isa;
ext_err = true;
break;
}
fallthrough;
- case 'S':
case 'x':
case 'X':
case 'z':
--
2.40.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2] RISC-V: fix the comment for ISA string workaround
2023-07-22 6:22 [PATCH 0/2] RISC-V: minor fixes to the QEMU workaround in ISA string parser Tsukasa OI
2023-07-22 6:22 ` [PATCH 1/2] RISC-V: make ISA string workaround case-insensitive Tsukasa OI
@ 2023-07-22 6:22 ` Tsukasa OI
2023-07-22 10:52 ` Conor Dooley
2023-07-26 5:44 ` [PATCH v2 0/1] RISC-V: clarification of the QEMU workaround in the ISA parser Tsukasa OI
2 siblings, 1 reply; 10+ messages in thread
From: Tsukasa OI @ 2023-07-22 6:22 UTC (permalink / raw)
To: Tsukasa OI, linux-riscv
From: Tsukasa OI <research_trasio@irq.a4lg.com>
Extensions prefixed with "Su" won't corrupt the workaround in many
cases. The only exception is when the first multi-letter extension in the
ISA string begins with "Su" and is not prefixed with an underscore.
For instance, following ISA string can confuse this QEMU workaround.
* "rv64imacsuclic" (RV64I + M + A + C + "Suclic")
However, this case is very unlikely because extensions prefixed by either
"Z", "Sm" or "Ss" will most likely precede first.
For instance, the "Suclic" extension (draft as of now) will be placed after
related "Smclic" and "Ssclic" extensions. It's also highly likely that
other unprivileged extensions like "Zba" will precede.
It's also possible to suppress the issue in the QEMU workaround with an
underscore. Following ISA string won't confuse the QEMU workaround.
* "rv64imac_suclic" (RV64I + M + A + C + delimited "Suclic")
This fix is to tell kernel developers the nature of this workaround
precisely. There are some "Su*" extensions to be ratified but don't worry
about this workaround too much.
This commit comes with another minor editorial fix.
Signed-off-by: Tsukasa OI <research_trasio@irq.a4lg.com>
---
arch/riscv/kernel/cpufeature.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index 63277cdc1ea5..91f1ef3e762c 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -170,10 +170,11 @@ void __init riscv_fill_hwcap(void)
case 's':
case 'S':
/*
- * Workaround for invalid single-letter 's' & 'u'(QEMU).
- * No need to set the bit in riscv_isa as 's' & 'u' are
- * not valid ISA extensions. It works until multi-letter
- * extension starting with "Su" appears.
+ * Workaround for invalid single-letters 's' & 'u' (QEMU).
+ * No need to set the bits in riscv_isa as 's' and 'u' are
+ * not valid ISA extensions. It works unless the first multi-letter
+ * extension in the ISA string begins with "Su" and not prefixed
+ * with an underscore.
*/
if (ext[-1] != '_' && tolower(ext[1]) == 'u') {
++isa;
--
2.40.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] RISC-V: make ISA string workaround case-insensitive
2023-07-22 6:22 ` [PATCH 1/2] RISC-V: make ISA string workaround case-insensitive Tsukasa OI
@ 2023-07-22 10:49 ` Conor Dooley
0 siblings, 0 replies; 10+ messages in thread
From: Conor Dooley @ 2023-07-22 10:49 UTC (permalink / raw)
To: Tsukasa OI; +Cc: linux-riscv
[-- Attachment #1.1: Type: text/plain, Size: 2117 bytes --]
On Sat, Jul 22, 2023 at 06:22:37AM +0000, Tsukasa OI wrote:
> From: Tsukasa OI <research_trasio@irq.a4lg.com>
>
> This is a follow-up for commit 255b34d799dd ("riscv: allow case-insensitive
> ISA string parsing").
>
> Although the QEMU workaround in the ISA string parser works well with
> lowercase-only handling ('s' followed by 'u' and not preceded by '_'),
> case-sensitive handling in the case-insensitive parser can be confusing.
> This commit makes the QEMU workaround case-insensitive and gives more
> robustness (against manually crafted Device Tree blobs) and less confusion
> to kernel developers.
If people are manually crafting their DT, they should check it for
compliance with dt-validate (or dtbs_check). The case insensitivity only
makes sense for ACPI, but by the time ACPI was supported, you'd already
removed the "su" stuff from QEMU.
Thanks,
Conor.
>
> Signed-off-by: Tsukasa OI <research_trasio@irq.a4lg.com>
> ---
> arch/riscv/kernel/cpufeature.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
> index a8f66c015229..63277cdc1ea5 100644
> --- a/arch/riscv/kernel/cpufeature.c
> +++ b/arch/riscv/kernel/cpufeature.c
> @@ -168,19 +168,19 @@ void __init riscv_fill_hwcap(void)
>
> switch (*ext) {
> case 's':
> + case 'S':
> /*
> * Workaround for invalid single-letter 's' & 'u'(QEMU).
> * No need to set the bit in riscv_isa as 's' & 'u' are
> * not valid ISA extensions. It works until multi-letter
> * extension starting with "Su" appears.
> */
> - if (ext[-1] != '_' && ext[1] == 'u') {
> + if (ext[-1] != '_' && tolower(ext[1]) == 'u') {
> ++isa;
> ext_err = true;
> break;
> }
> fallthrough;
> - case 'S':
> case 'x':
> case 'X':
> case 'z':
> --
> 2.40.0
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] RISC-V: fix the comment for ISA string workaround
2023-07-22 6:22 ` [PATCH 2/2] RISC-V: fix the comment for ISA string workaround Tsukasa OI
@ 2023-07-22 10:52 ` Conor Dooley
2023-07-22 11:22 ` Tsukasa OI
0 siblings, 1 reply; 10+ messages in thread
From: Conor Dooley @ 2023-07-22 10:52 UTC (permalink / raw)
To: Tsukasa OI; +Cc: linux-riscv
[-- Attachment #1.1: Type: text/plain, Size: 2746 bytes --]
On Sat, Jul 22, 2023 at 06:22:38AM +0000, Tsukasa OI wrote:
> From: Tsukasa OI <research_trasio@irq.a4lg.com>
>
> Extensions prefixed with "Su" won't corrupt the workaround in many
> cases. The only exception is when the first multi-letter extension in the
> ISA string begins with "Su" and is not prefixed with an underscore.
>
> For instance, following ISA string can confuse this QEMU workaround.
>
> * "rv64imacsuclic" (RV64I + M + A + C + "Suclic")
>
> However, this case is very unlikely because extensions prefixed by either
> "Z", "Sm" or "Ss" will most likely precede first.
>
> For instance, the "Suclic" extension (draft as of now) will be placed after
> related "Smclic" and "Ssclic" extensions. It's also highly likely that
> other unprivileged extensions like "Zba" will precede.
>
> It's also possible to suppress the issue in the QEMU workaround with an
> underscore. Following ISA string won't confuse the QEMU workaround.
>
> * "rv64imac_suclic" (RV64I + M + A + C + delimited "Suclic")
>
> This fix is to tell kernel developers the nature of this workaround
> precisely. There are some "Su*" extensions to be ratified but don't worry
> about this workaround too much.
>
> This commit comes with another minor editorial fix.
Which is what?
The new wording is fine by me though..
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
> Signed-off-by: Tsukasa OI <research_trasio@irq.a4lg.com>
> ---
> arch/riscv/kernel/cpufeature.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
> index 63277cdc1ea5..91f1ef3e762c 100644
> --- a/arch/riscv/kernel/cpufeature.c
> +++ b/arch/riscv/kernel/cpufeature.c
> @@ -170,10 +170,11 @@ void __init riscv_fill_hwcap(void)
> case 's':
> case 'S':
> /*
> - * Workaround for invalid single-letter 's' & 'u'(QEMU).
> - * No need to set the bit in riscv_isa as 's' & 'u' are
> - * not valid ISA extensions. It works until multi-letter
> - * extension starting with "Su" appears.
> + * Workaround for invalid single-letters 's' & 'u' (QEMU).
> + * No need to set the bits in riscv_isa as 's' and 'u' are
> + * not valid ISA extensions. It works unless the first multi-letter
> + * extension in the ISA string begins with "Su" and not prefixed
> + * with an underscore.
> */
> if (ext[-1] != '_' && tolower(ext[1]) == 'u') {
> ++isa;
> --
> 2.40.0
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] RISC-V: fix the comment for ISA string workaround
2023-07-22 10:52 ` Conor Dooley
@ 2023-07-22 11:22 ` Tsukasa OI
2023-07-22 11:28 ` Conor Dooley
0 siblings, 1 reply; 10+ messages in thread
From: Tsukasa OI @ 2023-07-22 11:22 UTC (permalink / raw)
To: Conor Dooley; +Cc: linux-riscv
On 2023/07/22 19:52, Conor Dooley wrote:
> On Sat, Jul 22, 2023 at 06:22:38AM +0000, Tsukasa OI wrote:
>> From: Tsukasa OI <research_trasio@irq.a4lg.com>
>>
>> Extensions prefixed with "Su" won't corrupt the workaround in many
>> cases. The only exception is when the first multi-letter extension in the
>> ISA string begins with "Su" and is not prefixed with an underscore.
>>
>> For instance, following ISA string can confuse this QEMU workaround.
>>
>> * "rv64imacsuclic" (RV64I + M + A + C + "Suclic")
>>
>> However, this case is very unlikely because extensions prefixed by either
>> "Z", "Sm" or "Ss" will most likely precede first.
>>
>> For instance, the "Suclic" extension (draft as of now) will be placed after
>> related "Smclic" and "Ssclic" extensions. It's also highly likely that
>> other unprivileged extensions like "Zba" will precede.
>>
>> It's also possible to suppress the issue in the QEMU workaround with an
>> underscore. Following ISA string won't confuse the QEMU workaround.
>>
>> * "rv64imac_suclic" (RV64I + M + A + C + delimited "Suclic")
>>
>> This fix is to tell kernel developers the nature of this workaround
>> precisely. There are some "Su*" extensions to be ratified but don't worry
>> about this workaround too much.
>>
>
>> This commit comes with another minor editorial fix.
>
> Which is what?
>
> The new wording is fine by me though..
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
1. Use of plurals ("letters" and "bits")
2. Second "'s' & 'u'" to "'s' and 'u'"
3. Spacing after the first "'s' & 'u'" (before "(QEMU).")
It feels they are too minor to separate to another commit.
At least I should replace the commit message to "other minor editorial
fixes" and... should I clarify editorial fixes?
Thanks,
Tsukasa
>
> Thanks,
> Conor.
>
>> Signed-off-by: Tsukasa OI <research_trasio@irq.a4lg.com>
>> ---
>> arch/riscv/kernel/cpufeature.c | 9 +++++----
>> 1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
>> index 63277cdc1ea5..91f1ef3e762c 100644
>> --- a/arch/riscv/kernel/cpufeature.c
>> +++ b/arch/riscv/kernel/cpufeature.c
>> @@ -170,10 +170,11 @@ void __init riscv_fill_hwcap(void)
>> case 's':
>> case 'S':
>> /*
>> - * Workaround for invalid single-letter 's' & 'u'(QEMU).
>> - * No need to set the bit in riscv_isa as 's' & 'u' are
>> - * not valid ISA extensions. It works until multi-letter
>> - * extension starting with "Su" appears.
>> + * Workaround for invalid single-letters 's' & 'u' (QEMU).
>> + * No need to set the bits in riscv_isa as 's' and 'u' are
>> + * not valid ISA extensions. It works unless the first multi-letter
>> + * extension in the ISA string begins with "Su" and not prefixed
>> + * with an underscore.
>> */
>> if (ext[-1] != '_' && tolower(ext[1]) == 'u') {
>> ++isa;
>> --
>> 2.40.0
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] RISC-V: fix the comment for ISA string workaround
2023-07-22 11:22 ` Tsukasa OI
@ 2023-07-22 11:28 ` Conor Dooley
0 siblings, 0 replies; 10+ messages in thread
From: Conor Dooley @ 2023-07-22 11:28 UTC (permalink / raw)
To: Tsukasa OI; +Cc: linux-riscv
[-- Attachment #1.1: Type: text/plain, Size: 2401 bytes --]
On Sat, Jul 22, 2023 at 08:22:25PM +0900, Tsukasa OI wrote:
>
>
> On 2023/07/22 19:52, Conor Dooley wrote:
> > On Sat, Jul 22, 2023 at 06:22:38AM +0000, Tsukasa OI wrote:
> >> From: Tsukasa OI <research_trasio@irq.a4lg.com>
> >>
> >> Extensions prefixed with "Su" won't corrupt the workaround in many
> >> cases. The only exception is when the first multi-letter extension in the
> >> ISA string begins with "Su" and is not prefixed with an underscore.
> >>
> >> For instance, following ISA string can confuse this QEMU workaround.
> >>
> >> * "rv64imacsuclic" (RV64I + M + A + C + "Suclic")
> >>
> >> However, this case is very unlikely because extensions prefixed by either
> >> "Z", "Sm" or "Ss" will most likely precede first.
> >>
> >> For instance, the "Suclic" extension (draft as of now) will be placed after
> >> related "Smclic" and "Ssclic" extensions. It's also highly likely that
> >> other unprivileged extensions like "Zba" will precede.
> >>
> >> It's also possible to suppress the issue in the QEMU workaround with an
> >> underscore. Following ISA string won't confuse the QEMU workaround.
> >>
> >> * "rv64imac_suclic" (RV64I + M + A + C + delimited "Suclic")
> >>
> >> This fix is to tell kernel developers the nature of this workaround
> >> precisely. There are some "Su*" extensions to be ratified but don't worry
> >> about this workaround too much.
> >>
> >
> >> This commit comes with another minor editorial fix.
> >
> > Which is what?
> >
> > The new wording is fine by me though..
> > Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
>
> 1. Use of plurals ("letters" and "bits")
> 2. Second "'s' & 'u'" to "'s' and 'u'"
> 3. Spacing after the first "'s' & 'u'" (before "(QEMU).")
>
> It feels they are too minor to separate to another commit.
> At least I should replace the commit message to "other minor editorial
> fixes" and... should I clarify editorial fixes?
I dunno, I just wasn't sure what you meant.
> >> + * Workaround for invalid single-letters 's' & 'u' (QEMU).
> >> + * No need to set the bits in riscv_isa as 's' and 'u' are
> >> + * not valid ISA extensions. It works unless the first multi-letter
> >> + * extension in the ISA string begins with "Su" and not prefixed
Re-reading I noticed this should be "is not prefixed".
> >> + * with an underscore.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 0/1] RISC-V: clarification of the QEMU workaround in the ISA parser
2023-07-22 6:22 [PATCH 0/2] RISC-V: minor fixes to the QEMU workaround in ISA string parser Tsukasa OI
2023-07-22 6:22 ` [PATCH 1/2] RISC-V: make ISA string workaround case-insensitive Tsukasa OI
2023-07-22 6:22 ` [PATCH 2/2] RISC-V: fix the comment for ISA string workaround Tsukasa OI
@ 2023-07-26 5:44 ` Tsukasa OI
2023-07-26 5:44 ` [PATCH v2 1/1] RISC-V: clarify the QEMU workaround in " Tsukasa OI
2 siblings, 1 reply; 10+ messages in thread
From: Tsukasa OI @ 2023-07-26 5:44 UTC (permalink / raw)
To: Tsukasa OI, linux-riscv
Hello,
This is the PATCH v2 to clarify the intent and a non-working example of the
QEMU workaround in the RISC-V ISA parser. Along with comment fixes, I hope
the commit message itself should be helpful to understand the workaround
in the ISA string parser.
v1:
(the initial submission; see the each PATCH for details)
v2:
* PATCH 1/2 is withdrawn for now
(now only comment fix; previously PATCH 2/2)
* Other grammar fixes
* Clarification of the commit message
Tsukasa OI (1):
RISC-V: clarify the QEMU workaround in ISA parser
arch/riscv/kernel/cpufeature.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
--
2.41.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 1/1] RISC-V: clarify the QEMU workaround in ISA parser
2023-07-26 5:44 ` [PATCH v2 0/1] RISC-V: clarification of the QEMU workaround in the ISA parser Tsukasa OI
@ 2023-07-26 5:44 ` Tsukasa OI
2023-07-26 6:56 ` Conor Dooley
0 siblings, 1 reply; 10+ messages in thread
From: Tsukasa OI @ 2023-07-26 5:44 UTC (permalink / raw)
To: Tsukasa OI, linux-riscv
From: Tsukasa OI <research_trasio@irq.a4lg.com>
Extensions prefixed with "Su" won't corrupt the workaround in many
cases. The only exception is when the first multi-letter extension in the
ISA string begins with "Su" and is not prefixed with an underscore.
For instance, following ISA string can confuse this QEMU workaround.
* "rv64imacsuclic" (RV64I + M + A + C + "Suclic")
However, this case is very unlikely because extensions prefixed by either
"Z", "Sm" or "Ss" will most likely precede first.
For instance, the "Suclic" extension (draft as of now) will be placed after
related "Smclic" and "Ssclic" extensions. It's also highly likely that
other unprivileged extensions like "Zba" will precede.
It's also possible to suppress the issue in the QEMU workaround with an
underscore. Following ISA string won't confuse the QEMU workaround.
* "rv64imac_suclic" (RV64I + M + A + C + delimited "Suclic")
This fix is to tell kernel developers the nature of this workaround
precisely. There are some "Su*" extensions to be ratified but don't worry
about this workaround too much.
This commit comes with other minor editorial fixes (for minor wording and
spacing issues, without changing the meaning).
Signed-off-by: Tsukasa OI <research_trasio@irq.a4lg.com>
---
arch/riscv/kernel/cpufeature.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index a8f66c015229..5b2ac109980c 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -169,10 +169,11 @@ void __init riscv_fill_hwcap(void)
switch (*ext) {
case 's':
/*
- * Workaround for invalid single-letter 's' & 'u'(QEMU).
- * No need to set the bit in riscv_isa as 's' & 'u' are
- * not valid ISA extensions. It works until multi-letter
- * extension starting with "Su" appears.
+ * Workaround for invalid single-letters 's' & 'u' (QEMU).
+ * No need to set the bits in riscv_isa as 's' and 'u' are
+ * not valid ISA extensions. It works unless the first multi-letter
+ * extension in the ISA string begins with "Su" and is not prefixed
+ * with an underscore.
*/
if (ext[-1] != '_' && ext[1] == 'u') {
++isa;
--
2.41.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/1] RISC-V: clarify the QEMU workaround in ISA parser
2023-07-26 5:44 ` [PATCH v2 1/1] RISC-V: clarify the QEMU workaround in " Tsukasa OI
@ 2023-07-26 6:56 ` Conor Dooley
0 siblings, 0 replies; 10+ messages in thread
From: Conor Dooley @ 2023-07-26 6:56 UTC (permalink / raw)
To: Tsukasa OI; +Cc: linux-riscv
[-- Attachment #1.1: Type: text/plain, Size: 1564 bytes --]
On Wed, Jul 26, 2023 at 05:44:16AM +0000, Tsukasa OI wrote:
> From: Tsukasa OI <research_trasio@irq.a4lg.com>
>
> Extensions prefixed with "Su" won't corrupt the workaround in many
> cases. The only exception is when the first multi-letter extension in the
> ISA string begins with "Su" and is not prefixed with an underscore.
>
> For instance, following ISA string can confuse this QEMU workaround.
>
> * "rv64imacsuclic" (RV64I + M + A + C + "Suclic")
>
> However, this case is very unlikely because extensions prefixed by either
> "Z", "Sm" or "Ss" will most likely precede first.
>
> For instance, the "Suclic" extension (draft as of now) will be placed after
> related "Smclic" and "Ssclic" extensions. It's also highly likely that
> other unprivileged extensions like "Zba" will precede.
>
> It's also possible to suppress the issue in the QEMU workaround with an
> underscore. Following ISA string won't confuse the QEMU workaround.
>
> * "rv64imac_suclic" (RV64I + M + A + C + delimited "Suclic")
>
> This fix is to tell kernel developers the nature of this workaround
> precisely. There are some "Su*" extensions to be ratified but don't worry
> about this workaround too much.
>
> This commit comes with other minor editorial fixes (for minor wording and
> spacing issues, without changing the meaning).
>
> Signed-off-by: Tsukasa OI <research_trasio@irq.a4lg.com>
Pretty sure I gave you a Reviewed-by last time? Nevertheless,
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2023-07-26 6:57 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-22 6:22 [PATCH 0/2] RISC-V: minor fixes to the QEMU workaround in ISA string parser Tsukasa OI
2023-07-22 6:22 ` [PATCH 1/2] RISC-V: make ISA string workaround case-insensitive Tsukasa OI
2023-07-22 10:49 ` Conor Dooley
2023-07-22 6:22 ` [PATCH 2/2] RISC-V: fix the comment for ISA string workaround Tsukasa OI
2023-07-22 10:52 ` Conor Dooley
2023-07-22 11:22 ` Tsukasa OI
2023-07-22 11:28 ` Conor Dooley
2023-07-26 5:44 ` [PATCH v2 0/1] RISC-V: clarification of the QEMU workaround in the ISA parser Tsukasa OI
2023-07-26 5:44 ` [PATCH v2 1/1] RISC-V: clarify the QEMU workaround in " Tsukasa OI
2023-07-26 6:56 ` Conor Dooley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).