Hello Richard,
On 8/14/20 10:28 PM, Richard Henderson wrote:
> On 8/12/20 11:32 AM, Claudio Fontana wrote:
>> uint64_t cpu_get_tsc(CPUX86State *env)
>> {
>> - return cpu_get_ticks();
>> + return cpus_get_elapsed_ticks();
>
> What has this change got to do with creating the interface?
> You said the interface wasn't used yet...
the new CpusAccel interface isn't used,
The cpu_get_ticks() function is changed to mean getting the actual cpu ticks,
while cpus_get_elapsed_ticks() contains the code that special cases icount and
qtest,
until the respective CpusAccel enablement patches.
>
>
>> diff --git a/stubs/cpu-synchronize-state.c b/stubs/cpu-synchronize-state.c
>> new file mode 100644
>> index 0000000000..3112fe439d
>> --- /dev/null
>> +++ b/stubs/cpu-synchronize-state.c
>> @@ -0,0 +1,15 @@
>> +#include "qemu/osdep.h"
>> +#include "sysemu/hw_accel.h"
>> +
>> +void cpu_synchronize_state(CPUState *cpu)
>> +{
>> +}
>> +void cpu_synchronize_post_reset(CPUState *cpu)
>> +{
>> +}
>> +void cpu_synchronize_post_init(CPUState *cpu)
>> +{
>> +}
>> +void cpu_synchronize_pre_loadvm(CPUState *cpu)
>> +{
>> +}
these are needed for non softmmu builds by hw/core/cpu.c
and by gdbstub.c,
but actually we could get away with just _state() and _post_init(). Will remove
the others.
>> diff --git a/stubs/cpus-get-virtual-clock.c b/stubs/cpus-get-virtual-clock.c
>> new file mode 100644
>> index 0000000000..fd447d53f3
>> --- /dev/null
>> +++ b/stubs/cpus-get-virtual-clock.c
>> @@ -0,0 +1,8 @@
>> +#include "qemu/osdep.h"
>> +#include "sysemu/cpu-timers.h"
>> +#include "qemu/main-loop.h"
>> +
>> +int64_t cpus_get_virtual_clock(void)
>> +{
>> + return cpu_get_clock();
>> +}
>
> How do these stubs get used?
>
>
> r~
>
util/timer.c needs it for non-softmmu builds (see previous discussion with
Paolo).
Thanks,
Claudio