qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] icount: fix shift=auto for record/replay


From: Alex Bennée
Subject: Re: [PATCH] icount: fix shift=auto for record/replay
Date: Mon, 18 May 2020 17:14:18 +0100
User-agent: mu4e 1.4.6; emacs 28.0.50

Pavel Dovgalyuk <address@hidden> writes:

> This patch fixes shift=auto when record/replay is enabled.
> Now user does not need to guess the best shift value.
>
> Signed-off-by: Pavel Dovgalyuk <address@hidden>
> ---
>  cpus.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/cpus.c b/cpus.c
> index 5670c96bcf..dfb9f4717f 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -379,7 +379,8 @@ static void icount_adjust(void)
>  
>      seqlock_write_lock(&timers_state.vm_clock_seqlock,
>                         &timers_state.vm_clock_lock);
> -    cur_time = cpu_get_clock_locked();
> +    cur_time = REPLAY_CLOCK_LOCKED(REPLAY_CLOCK_VIRTUAL_RT,
> +                                   cpu_get_clock_locked());
>      cur_icount = cpu_get_icount_locked();
>  
>      delta = cur_icount - cur_time;
> @@ -685,6 +686,7 @@ static const VMStateDescription icount_vmstate_timers = {
>      .fields = (VMStateField[]) {
>          VMSTATE_INT64(qemu_icount_bias, TimersState),
>          VMSTATE_INT64(qemu_icount, TimersState),
> +        VMSTATE_INT16(icount_time_shift, TimersState),

Surely we should be bumping .version_id/.minimum_version_id here so we
error out gracefully. No recordings pre this change would work right?

>          VMSTATE_END_OF_LIST()
>      },
>      .subsections = (const VMStateDescription*[]) {


-- 
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]