Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Andrew Jones <andrew.jones@linux.dev>
To: Xiang W <wangxiang@iscas.ac.cn>
Cc: kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
	 pbonzini@redhat.com, thuth@redhat.com
Subject: Re: [kvm-unit-tests PATCH v2 7/8] riscv: initialize ISA extensions for all harts in cpu_init
Date: Fri, 20 Nov 2026 14:49:26 +0100	[thread overview]
Message-ID: <awBPzACbLy95U5yE@orel> (raw)
In-Reply-To: <20261105082035.133680-8-wangxiang@iscas.ac.cn>

"initialize" should be capitalized in the patch summary.

On Thu, Nov 05, 2026 at 04:20:34PM +0800, Xiang W wrote:
> Move `isa_init()` from `thread_info_init()` to `cpu_init()`.
> 
> Previously it only ran for the current hart; now it is called for every
> hart so that ISA extensions are parsed for the whole system.
> 
> Signed-off-by: Xiang W <wangxiang@iscas.ac.cn>
> ---
>  lib/riscv/processor.c | 1 -
>  lib/riscv/setup.c     | 4 ++++
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/riscv/processor.c b/lib/riscv/processor.c
> index b055acc9..ddecc25e 100644
> --- a/lib/riscv/processor.c
> +++ b/lib/riscv/processor.c
> @@ -81,7 +81,6 @@ void thread_info_init(void)
>  	unsigned long hartid = csr_read(CSR_SSCRATCH);
>  	int cpu = hartid_to_cpu(hartid);
>  
> -	isa_init(&cpus[cpu]);
>  	csr_write(CSR_SSCRATCH, &cpus[cpu]);
>  }
>  
> diff --git a/lib/riscv/setup.c b/lib/riscv/setup.c
> index f1121573..8c16686f 100644
> --- a/lib/riscv/setup.c
> +++ b/lib/riscv/setup.c
> @@ -16,6 +16,7 @@
>  #include <on-cpus.h>
>  #include <vmalloc.h>
>  #include <asm/csr.h>
> +#include <asm/isa.h>
>  #include <asm/mmu.h>
>  #include <asm/page.h>
>  #include <asm/processor.h>
> @@ -105,6 +106,9 @@ static void cpu_init(void)
>  		cpu_init_acpi();
>  	}
>  
> +	for (int cpu = 0; cpu < nr_cpus; cpu++)
> +		isa_init(&cpus[cpu]);
> +
>  	me = hartid_to_cpu(csr_read(CSR_SSCRATCH));
>  	assert(cpu_present(me));
>  	set_cpu_online(me, true);
> -- 
> 2.47.3
> 

  parent reply	other threads:[~2026-11-20 13:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  8:20 [kvm-unit-tests PATCH v2 0/8] riscv: ACPI boot and BRS-I SBI tests Xiang W
2026-11-05  8:20 ` [kvm-unit-tests PATCH v2 1/8] riscv: Initialize the ACPI RSDP from the EFI system table Xiang W
2026-11-05  8:20 ` [kvm-unit-tests PATCH v2 2/8] riscv: Add ACPI support for CPU initialization Xiang W
2026-11-05  8:20 ` [kvm-unit-tests PATCH v2 3/8] riscv: Add ACPI support for timer frequency discovery Xiang W
2026-11-20 13:51   ` Andrew Jones
2026-11-05  8:20 ` [kvm-unit-tests PATCH v2 4/8] riscv: Add ACPI support for ISA string discovery Xiang W
2026-11-20  8:54   ` Andrew Jones
2026-11-20  9:14   ` Andrew Jones
2026-11-20 11:20   ` Andrew Jones
2026-11-05  8:20 ` [kvm-unit-tests PATCH v2 5/8] riscv: Prefer SBI DBCN console with UART fallback Xiang W
2026-11-20 10:08   ` Andrew Jones
2026-11-05  8:20 ` [kvm-unit-tests PATCH v2 6/8] riscv: efi: Allow ACPI boots Xiang W
2026-11-20 10:12   ` Andrew Jones
2026-11-05  8:20 ` [kvm-unit-tests PATCH v2 7/8] riscv: initialize ISA extensions for all harts in cpu_init Xiang W
2026-11-20 11:37   ` Andrew Jones
2026-11-20 13:49   ` Andrew Jones [this message]
2026-11-05  8:20 ` [kvm-unit-tests PATCH v2 8/8] riscv: Add BRS SBI requirement tests Xiang W
2026-11-20 14:09   ` Andrew Jones

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=awBPzACbLy95U5yE@orel \
    --to=andrew.jones@linux.dev \
    --cc=kvm-riscv@lists.infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=thuth@redhat.com \
    --cc=wangxiang@iscas.ac.cn \
    /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