diff mbox series

[walnascar,10/12] linux-yocto/6.12: riscv: Enable TUNE_FEATURES based KERNEL_FEATURES

Message ID 850949594410a9a228e164977c9e8a08f4a52876.1753041740.git.steve@sakoman.com
State Accepted
Delegated to: Steve Sakoman
Headers show
Series [walnascar,01/12] avahi: fix CVE-2024-52616 | expand

Commit Message

Steve Sakoman July 20, 2025, 8:04 p.m. UTC
From: Mark Hatle <mark.hatle@amd.com>

Allow the risc-v TUNE_FEATURES to select specific ISA (kconfig) selections
in the kernel config via config fragments selected by KERNEL_FEATURES.

This allows the following items to be selected dynamically:

    CONFIG_ARCH_RV32I
    CONFIG_ARCH_RV64I
    CONFIG_FPU
    CONFIG_RISCV_ISA_C
    CONFIG_RISCV_ISA_V
    CONFIG_RISCV_ISA_ZBB
    CONFIG_RISCV_ISA_ZICBOM
    CONFIG_RISCV_ISA_ZICBOZ
    CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI

Note: Some ISA options, such as CONFIG_RISCV_ISA_C may be reenabled by other
options such as CONFIG_EFI.  This is properly reported by the configuration
tooling.

Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 45a1b5aa6abc9007d0d87efc2d740b5564a209dd)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/recipes-kernel/linux/linux-yocto.inc | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Gyorgy Sarvari Aug. 29, 2025, 2:11 p.m. UTC | #1
Since this patch, it looks like qemuriscv64 doesn't boot in Walnascar.

I'm using a vanilla core-image-sato with some extra added applications.
I can't really figure out how to save the console output from qemu, so
all I offer is a useless screenshot that is not showing anything because
it scrolled too far: https://postimg.cc/G8sqjK0b

Once I remove this patch, it boots again. Am I missing something on my
end, or is this something with the combo of Walnascar and this patch?

On 7/20/25 22:04, Steve Sakoman via lists.openembedded.org wrote:
> From: Mark Hatle <mark.hatle@amd.com>
>
> Allow the risc-v TUNE_FEATURES to select specific ISA (kconfig) selections
> in the kernel config via config fragments selected by KERNEL_FEATURES.
>
> This allows the following items to be selected dynamically:
>
>     CONFIG_ARCH_RV32I
>     CONFIG_ARCH_RV64I
>     CONFIG_FPU
>     CONFIG_RISCV_ISA_C
>     CONFIG_RISCV_ISA_V
>     CONFIG_RISCV_ISA_ZBB
>     CONFIG_RISCV_ISA_ZICBOM
>     CONFIG_RISCV_ISA_ZICBOZ
>     CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
>
> Note: Some ISA options, such as CONFIG_RISCV_ISA_C may be reenabled by other
> options such as CONFIG_EFI.  This is properly reported by the configuration
> tooling.
>
> Signed-off-by: Mark Hatle <mark.hatle@amd.com>
> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> (cherry picked from commit 45a1b5aa6abc9007d0d87efc2d740b5564a209dd)
> Signed-off-by: Steve Sakoman <steve@sakoman.com>
> ---
>  meta/recipes-kernel/linux/linux-yocto.inc | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
> index 389329030d..4d0a726bb6 100644
> --- a/meta/recipes-kernel/linux/linux-yocto.inc
> +++ b/meta/recipes-kernel/linux/linux-yocto.inc
> @@ -37,6 +37,22 @@ KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'cfg/
>  KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}"
>  KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vfat', 'cfg/fs/vfat.scc', '', d)}"
>  
> +KERNEL_FEATURES_RISCV = "\
> +    arch/riscv/tunes/riscv-isa-clear.scc \
> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'rv 32 i m a', 'arch/riscv/tunes/riscv-isa-rv32i.scc',  '', d)} \
> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'rv 64 i m a', 'arch/riscv/tunes/riscv-isa-rv64i.scc',  '', d)} \
> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'f d',         'arch/riscv/tunes/riscv-isa-fpu.scc',    '', d)} \
> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'c',           'arch/riscv/tunes/riscv-isa-c.scc',      '', d)} \
> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'v',           'arch/riscv/tunes/riscv-isa-v.scc',      '', d)} \
> +    ${@bb.utils.contains_any('TUNE_FEATURES', 'b zba',       'arch/riscv/tunes/riscv-isa-zba.scc',    '', d)} \
> +    ${@bb.utils.contains_any('TUNE_FEATURES', 'b zbb',       'arch/riscv/tunes/riscv-isa-zbb.scc',    '', d)} \
> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'zbc',         'arch/riscv/tunes/riscv-isa-zbc.scc',    '', d)} \
> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'zicbom',      'arch/riscv/tunes/riscv-isa-zicbom.scc', '', d)} \
> +    "
> +
> +KERNEL_FEATURES:append:riscv32 = " ${KERNEL_FEATURES_RISCV}"
> +KERNEL_FEATURES:append:riscv64 = " ${KERNEL_FEATURES_RISCV}"
> +
>  # A KMACHINE is the mapping of a yocto $MACHINE to what is built
>  # by the kernel. This is typically the branch that should be built,
>  # and it can be specific to the machine or shared
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#220635): https://lists.openembedded.org/g/openembedded-core/message/220635
> Mute This Topic: https://lists.openembedded.org/mt/114257145/6084445
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [skandigraun@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Gyorgy Sarvari Aug. 29, 2025, 2:37 p.m. UTC | #2
On 8/29/25 16:11, Gyorgy Sarvari via lists.openembedded.org wrote:
> Since this patch, it looks like qemuriscv64 doesn't boot in Walnascar.
>
> I'm using a vanilla core-image-sato with some extra added applications.
> I can't really figure out how to save the console output from qemu, so
> all I offer is a useless screenshot that is not showing anything because
> it scrolled too far: https://postimg.cc/G8sqjK0b
>
> Once I remove this patch, it boots again. Am I missing something on my
> end, or is this something with the combo of Walnascar and this patch?

I managed to figure out how to save the bootlog from qemu: 
https://gist.github.com/OldManYellsAtCloud/e31d7a286d074fd095d9e1c29dd0b359

>
> On 7/20/25 22:04, Steve Sakoman via lists.openembedded.org wrote:
>> From: Mark Hatle <mark.hatle@amd.com>
>>
>> Allow the risc-v TUNE_FEATURES to select specific ISA (kconfig) selections
>> in the kernel config via config fragments selected by KERNEL_FEATURES.
>>
>> This allows the following items to be selected dynamically:
>>
>>     CONFIG_ARCH_RV32I
>>     CONFIG_ARCH_RV64I
>>     CONFIG_FPU
>>     CONFIG_RISCV_ISA_C
>>     CONFIG_RISCV_ISA_V
>>     CONFIG_RISCV_ISA_ZBB
>>     CONFIG_RISCV_ISA_ZICBOM
>>     CONFIG_RISCV_ISA_ZICBOZ
>>     CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
>>
>> Note: Some ISA options, such as CONFIG_RISCV_ISA_C may be reenabled by other
>> options such as CONFIG_EFI.  This is properly reported by the configuration
>> tooling.
>>
>> Signed-off-by: Mark Hatle <mark.hatle@amd.com>
>> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
>> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>> (cherry picked from commit 45a1b5aa6abc9007d0d87efc2d740b5564a209dd)
>> Signed-off-by: Steve Sakoman <steve@sakoman.com>
>> ---
>>  meta/recipes-kernel/linux/linux-yocto.inc | 16 ++++++++++++++++
>>  1 file changed, 16 insertions(+)
>>
>> diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
>> index 389329030d..4d0a726bb6 100644
>> --- a/meta/recipes-kernel/linux/linux-yocto.inc
>> +++ b/meta/recipes-kernel/linux/linux-yocto.inc
>> @@ -37,6 +37,22 @@ KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'cfg/
>>  KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}"
>>  KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vfat', 'cfg/fs/vfat.scc', '', d)}"
>>  
>> +KERNEL_FEATURES_RISCV = "\
>> +    arch/riscv/tunes/riscv-isa-clear.scc \
>> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'rv 32 i m a', 'arch/riscv/tunes/riscv-isa-rv32i.scc',  '', d)} \
>> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'rv 64 i m a', 'arch/riscv/tunes/riscv-isa-rv64i.scc',  '', d)} \
>> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'f d',         'arch/riscv/tunes/riscv-isa-fpu.scc',    '', d)} \
>> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'c',           'arch/riscv/tunes/riscv-isa-c.scc',      '', d)} \
>> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'v',           'arch/riscv/tunes/riscv-isa-v.scc',      '', d)} \
>> +    ${@bb.utils.contains_any('TUNE_FEATURES', 'b zba',       'arch/riscv/tunes/riscv-isa-zba.scc',    '', d)} \
>> +    ${@bb.utils.contains_any('TUNE_FEATURES', 'b zbb',       'arch/riscv/tunes/riscv-isa-zbb.scc',    '', d)} \
>> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'zbc',         'arch/riscv/tunes/riscv-isa-zbc.scc',    '', d)} \
>> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'zicbom',      'arch/riscv/tunes/riscv-isa-zicbom.scc', '', d)} \
>> +    "
>> +
>> +KERNEL_FEATURES:append:riscv32 = " ${KERNEL_FEATURES_RISCV}"
>> +KERNEL_FEATURES:append:riscv64 = " ${KERNEL_FEATURES_RISCV}"
>> +
>>  # A KMACHINE is the mapping of a yocto $MACHINE to what is built
>>  # by the kernel. This is typically the branch that should be built,
>>  # and it can be specific to the machine or shared
>>
>>
>>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#222615): https://lists.openembedded.org/g/openembedded-core/message/222615
> Mute This Topic: https://lists.openembedded.org/mt/114257145/6084445
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [skandigraun@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Khem Raj Aug. 29, 2025, 4:34 p.m. UTC | #3
On Fri, Aug 29, 2025 at 7:11 AM Gyorgy Sarvari via
lists.openembedded.org <skandigraun=gmail.com@lists.openembedded.org>
wrote:
>
> Since this patch, it looks like qemuriscv64 doesn't boot in Walnascar.
>
> I'm using a vanilla core-image-sato with some extra added applications.
> I can't really figure out how to save the console output from qemu, so
> all I offer is a useless screenshot that is not showing anything because
> it scrolled too far: https://postimg.cc/G8sqjK0b
>
> Once I remove this patch, it boots again. Am I missing something on my
> end, or is this something with the combo of Walnascar and this patch?
>
> On 7/20/25 22:04, Steve Sakoman via lists.openembedded.org wrote:
> > From: Mark Hatle <mark.hatle@amd.com>
> >
> > Allow the risc-v TUNE_FEATURES to select specific ISA (kconfig) selections
> > in the kernel config via config fragments selected by KERNEL_FEATURES.
> >
> > This allows the following items to be selected dynamically:
> >
> >     CONFIG_ARCH_RV32I
> >     CONFIG_ARCH_RV64I
> >     CONFIG_FPU
> >     CONFIG_RISCV_ISA_C
> >     CONFIG_RISCV_ISA_V
> >     CONFIG_RISCV_ISA_ZBB
> >     CONFIG_RISCV_ISA_ZICBOM
> >     CONFIG_RISCV_ISA_ZICBOZ
> >     CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
> >
> > Note: Some ISA options, such as CONFIG_RISCV_ISA_C may be reenabled by other
> > options such as CONFIG_EFI.  This is properly reported by the configuration
> > tooling.
> >
> > Signed-off-by: Mark Hatle <mark.hatle@amd.com>
> > Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > (cherry picked from commit 45a1b5aa6abc9007d0d87efc2d740b5564a209dd)
> > Signed-off-by: Steve Sakoman <steve@sakoman.com>
> > ---
> >  meta/recipes-kernel/linux/linux-yocto.inc | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> >
> > diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
> > index 389329030d..4d0a726bb6 100644
> > --- a/meta/recipes-kernel/linux/linux-yocto.inc
> > +++ b/meta/recipes-kernel/linux/linux-yocto.inc
> > @@ -37,6 +37,22 @@ KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'cfg/
> >  KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}"
> >  KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vfat', 'cfg/fs/vfat.scc', '', d)}"
> >
> > +KERNEL_FEATURES_RISCV = "\
> > +    arch/riscv/tunes/riscv-isa-clear.scc \
> > +    ${@bb.utils.contains(    'TUNE_FEATURES', 'rv 32 i m a', 'arch/riscv/tunes/riscv-isa-rv32i.scc',  '', d)} \
> > +    ${@bb.utils.contains(    'TUNE_FEATURES', 'rv 64 i m a', 'arch/riscv/tunes/riscv-isa-rv64i.scc',  '', d)} \
> > +    ${@bb.utils.contains(    'TUNE_FEATURES', 'f d',         'arch/riscv/tunes/riscv-isa-fpu.scc',    '', d)} \
> > +    ${@bb.utils.contains(    'TUNE_FEATURES', 'c',           'arch/riscv/tunes/riscv-isa-c.scc',      '', d)} \
> > +    ${@bb.utils.contains(    'TUNE_FEATURES', 'v',           'arch/riscv/tunes/riscv-isa-v.scc',      '', d)} \
> > +    ${@bb.utils.contains_any('TUNE_FEATURES', 'b zba',       'arch/riscv/tunes/riscv-isa-zba.scc',    '', d)} \
> > +    ${@bb.utils.contains_any('TUNE_FEATURES', 'b zbb',       'arch/riscv/tunes/riscv-isa-zbb.scc',    '', d)} \
> > +    ${@bb.utils.contains(    'TUNE_FEATURES', 'zbc',         'arch/riscv/tunes/riscv-isa-zbc.scc',    '', d)} \
> > +    ${@bb.utils.contains(    'TUNE_FEATURES', 'zicbom',      'arch/riscv/tunes/riscv-isa-zicbom.scc', '', d)} \
> > +    "
> > +
> > +KERNEL_FEATURES:append:riscv32 = " ${KERNEL_FEATURES_RISCV}"
> > +KERNEL_FEATURES:append:riscv64 = " ${KERNEL_FEATURES_RISCV}"
> > +

I think this patch needs [1] backported as well which I would not
recommend. Its better to revert this
patch from walnascar.

[1] https://git.yoctoproject.org/poky/commit/?id=3c5c4cfa6bf4aa88bcd69e2688fdceea6a655165

> >  # A KMACHINE is the mapping of a yocto $MACHINE to what is built
> >  # by the kernel. This is typically the branch that should be built,
> >  # and it can be specific to the machine or shared
> >
> >
> >
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#222615): https://lists.openembedded.org/g/openembedded-core/message/222615
> Mute This Topic: https://lists.openembedded.org/mt/114257145/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Mark Hatle Sept. 2, 2025, 2:11 p.m. UTC | #4
As Khem indicates below.  The full set of patches need to go together.

Without the tune selection patches, using tune features to select kernel options won't work properly.  It does look like this is an issue with a backport.

(There is nothing wrong with using the 6.12 kernel, the issue is using the TUNE_FEATURES that are not implemented.)

On 8/29/25 11:34 AM, Khem Raj wrote:
> On Fri, Aug 29, 2025 at 7:11 AM Gyorgy Sarvari via
> lists.openembedded.org <skandigraun=gmail.com@lists.openembedded.org>
> wrote:
>>
>> Since this patch, it looks like qemuriscv64 doesn't boot in Walnascar.
>>
>> I'm using a vanilla core-image-sato with some extra added applications.
>> I can't really figure out how to save the console output from qemu, so
>> all I offer is a useless screenshot that is not showing anything because
>> it scrolled too far: https://postimg.cc/G8sqjK0b
>>
>> Once I remove this patch, it boots again. Am I missing something on my
>> end, or is this something with the combo of Walnascar and this patch?
>>
>> On 7/20/25 22:04, Steve Sakoman via lists.openembedded.org wrote:
>>> From: Mark Hatle <mark.hatle@amd.com>
>>>
>>> Allow the risc-v TUNE_FEATURES to select specific ISA (kconfig) selections
>>> in the kernel config via config fragments selected by KERNEL_FEATURES.
>>>
>>> This allows the following items to be selected dynamically:
>>>
>>>      CONFIG_ARCH_RV32I
>>>      CONFIG_ARCH_RV64I
>>>      CONFIG_FPU
>>>      CONFIG_RISCV_ISA_C
>>>      CONFIG_RISCV_ISA_V
>>>      CONFIG_RISCV_ISA_ZBB
>>>      CONFIG_RISCV_ISA_ZICBOM
>>>      CONFIG_RISCV_ISA_ZICBOZ
>>>      CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
>>>
>>> Note: Some ISA options, such as CONFIG_RISCV_ISA_C may be reenabled by other
>>> options such as CONFIG_EFI.  This is properly reported by the configuration
>>> tooling.
>>>
>>> Signed-off-by: Mark Hatle <mark.hatle@amd.com>
>>> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
>>> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>>> (cherry picked from commit 45a1b5aa6abc9007d0d87efc2d740b5564a209dd)
>>> Signed-off-by: Steve Sakoman <steve@sakoman.com>
>>> ---
>>>   meta/recipes-kernel/linux/linux-yocto.inc | 16 ++++++++++++++++
>>>   1 file changed, 16 insertions(+)
>>>
>>> diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
>>> index 389329030d..4d0a726bb6 100644
>>> --- a/meta/recipes-kernel/linux/linux-yocto.inc
>>> +++ b/meta/recipes-kernel/linux/linux-yocto.inc
>>> @@ -37,6 +37,22 @@ KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'cfg/
>>>   KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}"
>>>   KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vfat', 'cfg/fs/vfat.scc', '', d)}"
>>>
>>> +KERNEL_FEATURES_RISCV = "\
>>> +    arch/riscv/tunes/riscv-isa-clear.scc \
>>> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'rv 32 i m a', 'arch/riscv/tunes/riscv-isa-rv32i.scc',  '', d)} \
>>> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'rv 64 i m a', 'arch/riscv/tunes/riscv-isa-rv64i.scc',  '', d)} \
>>> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'f d',         'arch/riscv/tunes/riscv-isa-fpu.scc',    '', d)} \
>>> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'c',           'arch/riscv/tunes/riscv-isa-c.scc',      '', d)} \
>>> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'v',           'arch/riscv/tunes/riscv-isa-v.scc',      '', d)} \
>>> +    ${@bb.utils.contains_any('TUNE_FEATURES', 'b zba',       'arch/riscv/tunes/riscv-isa-zba.scc',    '', d)} \
>>> +    ${@bb.utils.contains_any('TUNE_FEATURES', 'b zbb',       'arch/riscv/tunes/riscv-isa-zbb.scc',    '', d)} \
>>> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'zbc',         'arch/riscv/tunes/riscv-isa-zbc.scc',    '', d)} \
>>> +    ${@bb.utils.contains(    'TUNE_FEATURES', 'zicbom',      'arch/riscv/tunes/riscv-isa-zicbom.scc', '', d)} \
>>> +    "
>>> +
>>> +KERNEL_FEATURES:append:riscv32 = " ${KERNEL_FEATURES_RISCV}"
>>> +KERNEL_FEATURES:append:riscv64 = " ${KERNEL_FEATURES_RISCV}"
>>> +
> 
> I think this patch needs [1] backported as well which I would not
> recommend. Its better to revert this
> patch from walnascar.
> 
> [1] https://git.yoctoproject.org/poky/commit/?id=3c5c4cfa6bf4aa88bcd69e2688fdceea6a655165
> 
>>>   # A KMACHINE is the mapping of a yocto $MACHINE to what is built
>>>   # by the kernel. This is typically the branch that should be built,
>>>   # and it can be specific to the machine or shared
>>>
>>>
>>>
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#222615): https://lists.openembedded.org/g/openembedded-core/message/222615
>> Mute This Topic: https://lists.openembedded.org/mt/114257145/1997914
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
Steve Sakoman Sept. 2, 2025, 5:04 p.m. UTC | #5
On Fri, Aug 29, 2025 at 9:34 AM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Fri, Aug 29, 2025 at 7:11 AM Gyorgy Sarvari via
> lists.openembedded.org <skandigraun=gmail.com@lists.openembedded.org>
> wrote:
> >
> > Since this patch, it looks like qemuriscv64 doesn't boot in Walnascar.
> >
> > I'm using a vanilla core-image-sato with some extra added applications.
> > I can't really figure out how to save the console output from qemu, so
> > all I offer is a useless screenshot that is not showing anything because
> > it scrolled too far: https://postimg.cc/G8sqjK0b
> >
> > Once I remove this patch, it boots again. Am I missing something on my
> > end, or is this something with the combo of Walnascar and this patch?
> >
> > On 7/20/25 22:04, Steve Sakoman via lists.openembedded.org wrote:
> > > From: Mark Hatle <mark.hatle@amd.com>
> > >
> > > Allow the risc-v TUNE_FEATURES to select specific ISA (kconfig) selections
> > > in the kernel config via config fragments selected by KERNEL_FEATURES.
> > >
> > > This allows the following items to be selected dynamically:
> > >
> > >     CONFIG_ARCH_RV32I
> > >     CONFIG_ARCH_RV64I
> > >     CONFIG_FPU
> > >     CONFIG_RISCV_ISA_C
> > >     CONFIG_RISCV_ISA_V
> > >     CONFIG_RISCV_ISA_ZBB
> > >     CONFIG_RISCV_ISA_ZICBOM
> > >     CONFIG_RISCV_ISA_ZICBOZ
> > >     CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
> > >
> > > Note: Some ISA options, such as CONFIG_RISCV_ISA_C may be reenabled by other
> > > options such as CONFIG_EFI.  This is properly reported by the configuration
> > > tooling.
> > >
> > > Signed-off-by: Mark Hatle <mark.hatle@amd.com>
> > > Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
> > > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > > (cherry picked from commit 45a1b5aa6abc9007d0d87efc2d740b5564a209dd)
> > > Signed-off-by: Steve Sakoman <steve@sakoman.com>
> > > ---
> > >  meta/recipes-kernel/linux/linux-yocto.inc | 16 ++++++++++++++++
> > >  1 file changed, 16 insertions(+)
> > >
> > > diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
> > > index 389329030d..4d0a726bb6 100644
> > > --- a/meta/recipes-kernel/linux/linux-yocto.inc
> > > +++ b/meta/recipes-kernel/linux/linux-yocto.inc
> > > @@ -37,6 +37,22 @@ KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'cfg/
> > >  KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}"
> > >  KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vfat', 'cfg/fs/vfat.scc', '', d)}"
> > >
> > > +KERNEL_FEATURES_RISCV = "\
> > > +    arch/riscv/tunes/riscv-isa-clear.scc \
> > > +    ${@bb.utils.contains(    'TUNE_FEATURES', 'rv 32 i m a', 'arch/riscv/tunes/riscv-isa-rv32i.scc',  '', d)} \
> > > +    ${@bb.utils.contains(    'TUNE_FEATURES', 'rv 64 i m a', 'arch/riscv/tunes/riscv-isa-rv64i.scc',  '', d)} \
> > > +    ${@bb.utils.contains(    'TUNE_FEATURES', 'f d',         'arch/riscv/tunes/riscv-isa-fpu.scc',    '', d)} \
> > > +    ${@bb.utils.contains(    'TUNE_FEATURES', 'c',           'arch/riscv/tunes/riscv-isa-c.scc',      '', d)} \
> > > +    ${@bb.utils.contains(    'TUNE_FEATURES', 'v',           'arch/riscv/tunes/riscv-isa-v.scc',      '', d)} \
> > > +    ${@bb.utils.contains_any('TUNE_FEATURES', 'b zba',       'arch/riscv/tunes/riscv-isa-zba.scc',    '', d)} \
> > > +    ${@bb.utils.contains_any('TUNE_FEATURES', 'b zbb',       'arch/riscv/tunes/riscv-isa-zbb.scc',    '', d)} \
> > > +    ${@bb.utils.contains(    'TUNE_FEATURES', 'zbc',         'arch/riscv/tunes/riscv-isa-zbc.scc',    '', d)} \
> > > +    ${@bb.utils.contains(    'TUNE_FEATURES', 'zicbom',      'arch/riscv/tunes/riscv-isa-zicbom.scc', '', d)} \
> > > +    "
> > > +
> > > +KERNEL_FEATURES:append:riscv32 = " ${KERNEL_FEATURES_RISCV}"
> > > +KERNEL_FEATURES:append:riscv64 = " ${KERNEL_FEATURES_RISCV}"
> > > +
>
> I think this patch needs [1] backported as well which I would not
> recommend. Its better to revert this
> patch from walnascar.

Thanks for reviewing.

I have reverted the patch as you suggested.

Steve
>
> [1] https://git.yoctoproject.org/poky/commit/?id=3c5c4cfa6bf4aa88bcd69e2688fdceea6a655165
>
> > >  # A KMACHINE is the mapping of a yocto $MACHINE to what is built
> > >  # by the kernel. This is typically the branch that should be built,
> > >  # and it can be specific to the machine or shared
> > >
> > >
> > >
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#222615): https://lists.openembedded.org/g/openembedded-core/message/222615
> > Mute This Topic: https://lists.openembedded.org/mt/114257145/1997914
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
diff mbox series

Patch

diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
index 389329030d..4d0a726bb6 100644
--- a/meta/recipes-kernel/linux/linux-yocto.inc
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
@@ -37,6 +37,22 @@  KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'cfg/
 KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'numa', 'features/numa/numa.scc', '', d)}"
 KERNEL_FEATURES:append = " ${@bb.utils.contains('MACHINE_FEATURES', 'vfat', 'cfg/fs/vfat.scc', '', d)}"
 
+KERNEL_FEATURES_RISCV = "\
+    arch/riscv/tunes/riscv-isa-clear.scc \
+    ${@bb.utils.contains(    'TUNE_FEATURES', 'rv 32 i m a', 'arch/riscv/tunes/riscv-isa-rv32i.scc',  '', d)} \
+    ${@bb.utils.contains(    'TUNE_FEATURES', 'rv 64 i m a', 'arch/riscv/tunes/riscv-isa-rv64i.scc',  '', d)} \
+    ${@bb.utils.contains(    'TUNE_FEATURES', 'f d',         'arch/riscv/tunes/riscv-isa-fpu.scc',    '', d)} \
+    ${@bb.utils.contains(    'TUNE_FEATURES', 'c',           'arch/riscv/tunes/riscv-isa-c.scc',      '', d)} \
+    ${@bb.utils.contains(    'TUNE_FEATURES', 'v',           'arch/riscv/tunes/riscv-isa-v.scc',      '', d)} \
+    ${@bb.utils.contains_any('TUNE_FEATURES', 'b zba',       'arch/riscv/tunes/riscv-isa-zba.scc',    '', d)} \
+    ${@bb.utils.contains_any('TUNE_FEATURES', 'b zbb',       'arch/riscv/tunes/riscv-isa-zbb.scc',    '', d)} \
+    ${@bb.utils.contains(    'TUNE_FEATURES', 'zbc',         'arch/riscv/tunes/riscv-isa-zbc.scc',    '', d)} \
+    ${@bb.utils.contains(    'TUNE_FEATURES', 'zicbom',      'arch/riscv/tunes/riscv-isa-zicbom.scc', '', d)} \
+    "
+
+KERNEL_FEATURES:append:riscv32 = " ${KERNEL_FEATURES_RISCV}"
+KERNEL_FEATURES:append:riscv64 = " ${KERNEL_FEATURES_RISCV}"
+
 # A KMACHINE is the mapping of a yocto $MACHINE to what is built
 # by the kernel. This is typically the branch that should be built,
 # and it can be specific to the machine or shared