Re: [PATCH v2 06/39] xen/riscv: use UINT64_MAX to disable the VS-timer
Baptiste Le Duc <[email protected]>
| Newsgroups | gmane.comp.emulators.xen.devel |
|---|---|
| Message-ID | <1788180505.8631fc262581453bbf619ec5b2062170.1a057dd21b7000c4f3@vates.tech> |
On Thu, 27 Aug 2026 17:20:50 +0200, Oleksii Kurochko <[email protected]> wrote: > vstimecmp is a 64-bit CSR independently of XLEN, which is why it is > written with csr_write64(). On RV32 that macro splits the value into > the vstimecmp/vstimecmph pair, so passing ULONG_MAX (0xffffffff there) > writes all ones to the low half and zero to the high half, leaving the > CSR at 0x00000000ffffffff rather than at its maximum. A VS-timer irq > would then become pending as soon as (time + htimedelta) reaches 2^32, > which is exactly what the code is trying to avoid. > > [...] Reviewed-by: Baptiste Le Duc <[email protected]> -- Baptiste Le Duc <[email protected]>