[PATCH for-11.2] hw/riscv/server_platform_ref: Fix mtimer frequency

Sunil V L posted 1 patch 1 week, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20261111101609.1183263-1-sunilvl@oss.qualcomm.com
Maintainers: Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Chao Liu <chao.liu@processmission.com>
hw/riscv/server_platform_ref.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH for-11.2] hw/riscv/server_platform_ref: Fix mtimer frequency
Posted by Sunil V L 1 week, 4 days ago
The RISC-V server reference platform requires a 1 GHz timer frequency.
Although the timer frequency is advertised as 1 GHz in the device tree,
the mtimer device is still created with a 10 MHz frequency. This mismatch
causes the OS to boot very slowly.

Use the correct 1 GHz frequency when creating the mtimer device.

Fixes: c2fa4320803b ("hw/riscv: server platform reference machine")
Signed-off-by: Sunil V L <sunilvl@oss.qualcomm.com>
---
 hw/riscv/server_platform_ref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/riscv/server_platform_ref.c b/hw/riscv/server_platform_ref.c
index 5f485b1c79cb..fec967f708c2 100644
--- a/hw/riscv/server_platform_ref.c
+++ b/hw/riscv/server_platform_ref.c
@@ -556,7 +556,7 @@ static void rvserver_ref_machine_init(MachineState *machine)
                 base_hartid, hart_count,
                 RISCV_ACLINT_DEFAULT_MTIMECMP,
                 RISCV_ACLINT_DEFAULT_MTIME,
-                RISCV_ACLINT_DEFAULT_TIMEBASE_FREQ, true);
+                RVSERVER_ACLINT_TIMEBASE_FREQ, true);
 
         /* Per-socket interrupt controller */
         s->irqchip[i] = riscv_create_aia(system_memory, true, s->aia_guests,
-- 
2.43.0
Re: [PATCH for-11.2] hw/riscv/server_platform_ref: Fix mtimer frequency
Posted by Alistair Francis 1 week, 4 days ago
On Wed, 2026-11-11 at 15:46 +0530, Sunil V L wrote:
> The RISC-V server reference platform requires a 1 GHz timer
> frequency.
> Although the timer frequency is advertised as 1 GHz in the device
> tree,
> the mtimer device is still created with a 10 MHz frequency. This
> mismatch
> causes the OS to boot very slowly.
> 
> Use the correct 1 GHz frequency when creating the mtimer device.
> 
> Fixes: c2fa4320803b ("hw/riscv: server platform reference machine")
> Signed-off-by: Sunil V L <sunilvl@oss.qualcomm.com>

Thanks!

Applied to riscv-to-apply.next

Alistair

> ---
>  hw/riscv/server_platform_ref.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/riscv/server_platform_ref.c
> b/hw/riscv/server_platform_ref.c
> index 5f485b1c79cb..fec967f708c2 100644
> --- a/hw/riscv/server_platform_ref.c
> +++ b/hw/riscv/server_platform_ref.c
> @@ -556,7 +556,7 @@ static void
> rvserver_ref_machine_init(MachineState *machine)
>                  base_hartid, hart_count,
>                  RISCV_ACLINT_DEFAULT_MTIMECMP,
>                  RISCV_ACLINT_DEFAULT_MTIME,
> -                RISCV_ACLINT_DEFAULT_TIMEBASE_FREQ, true);
> +                RVSERVER_ACLINT_TIMEBASE_FREQ, true);
>  
>          /* Per-socket interrupt controller */
>          s->irqchip[i] = riscv_create_aia(system_memory, true, s-
> >aia_guests,
Re: [PATCH for-11.2] hw/riscv/server_platform_ref: Fix mtimer frequency
Posted by Alistair Francis 1 week, 4 days ago
On Wed, 2026-11-11 at 15:46 +0530, Sunil V L wrote:
> The RISC-V server reference platform requires a 1 GHz timer
> frequency.
> Although the timer frequency is advertised as 1 GHz in the device
> tree,
> the mtimer device is still created with a 10 MHz frequency. This
> mismatch
> causes the OS to boot very slowly.
> 
> Use the correct 1 GHz frequency when creating the mtimer device.
> 
> Fixes: c2fa4320803b ("hw/riscv: server platform reference machine")
> Signed-off-by: Sunil V L <sunilvl@oss.qualcomm.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  hw/riscv/server_platform_ref.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/riscv/server_platform_ref.c
> b/hw/riscv/server_platform_ref.c
> index 5f485b1c79cb..fec967f708c2 100644
> --- a/hw/riscv/server_platform_ref.c
> +++ b/hw/riscv/server_platform_ref.c
> @@ -556,7 +556,7 @@ static void
> rvserver_ref_machine_init(MachineState *machine)
>                  base_hartid, hart_count,
>                  RISCV_ACLINT_DEFAULT_MTIMECMP,
>                  RISCV_ACLINT_DEFAULT_MTIME,
> -                RISCV_ACLINT_DEFAULT_TIMEBASE_FREQ, true);
> +                RVSERVER_ACLINT_TIMEBASE_FREQ, true);
>  
>          /* Per-socket interrupt controller */
>          s->irqchip[i] = riscv_create_aia(system_memory, true, s-
> >aia_guests,
Re: [PATCH for-11.2] hw/riscv/server_platform_ref: Fix mtimer frequency
Posted by Daniel Henrique Barboza 1 week, 4 days ago

On 11/11/2026 7:16 AM, Sunil V L wrote:
> The RISC-V server reference platform requires a 1 GHz timer frequency.
> Although the timer frequency is advertised as 1 GHz in the device tree,
> the mtimer device is still created with a 10 MHz frequency. This mismatch
> causes the OS to boot very slowly.
> 
> Use the correct 1 GHz frequency when creating the mtimer device.
> 
> Fixes: c2fa4320803b ("hw/riscv: server platform reference machine")
> Signed-off-by: Sunil V L <sunilvl@oss.qualcomm.com>
> ---

Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>


I believe this is suitable for a freeze PR.  Thanks,

Daniel

>   hw/riscv/server_platform_ref.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/riscv/server_platform_ref.c b/hw/riscv/server_platform_ref.c
> index 5f485b1c79cb..fec967f708c2 100644
> --- a/hw/riscv/server_platform_ref.c
> +++ b/hw/riscv/server_platform_ref.c
> @@ -556,7 +556,7 @@ static void rvserver_ref_machine_init(MachineState *machine)
>                   base_hartid, hart_count,
>                   RISCV_ACLINT_DEFAULT_MTIMECMP,
>                   RISCV_ACLINT_DEFAULT_MTIME,
> -                RISCV_ACLINT_DEFAULT_TIMEBASE_FREQ, true);
> +                RVSERVER_ACLINT_TIMEBASE_FREQ, true);
>   
>           /* Per-socket interrupt controller */
>           s->irqchip[i] = riscv_create_aia(system_memory, true, s->aia_guests,