[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v2 19/24] target/arm: move aarch64_sync_32_to_64 (and vv) to cp
From: |
Claudio Fontana |
Subject: |
Re: [RFC v2 19/24] target/arm: move aarch64_sync_32_to_64 (and vv) to cpu code |
Date: |
Tue, 2 Mar 2021 12:58:52 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 |
On 3/2/21 7:23 AM, Richard Henderson wrote:
> On 3/1/21 8:49 AM, Claudio Fontana wrote:
>> and arm_phys_excp_target_el since it is tied up inside the
>> same #ifdef block.
>>
>> aarch64_sync_32_to_64 and aarch64_sync_64_to_32 are
>> mixed in with the tcg helpers, but they shouldn't, as they
>> are needed for kvm too, in the sysemu case.
>
> Really? Now that *is* surprising. Again, please document. Because I surely
> cannot believe this to be used by kvm.
>
>
> r~
>
Ok, will add comment here as well, they are needed by kvm64.c
There is lots that surprised me too on how kvm is bolted on top of tcg code
currently;
partly related to this, if it can help understand this,
in kvm.c notice the kvm_arm_init_cpreg_list():
it basically undoes all TCG initializations in the cpreg_indexes, cpreg_values
etc, and
rebuilds the cpreg list based on the list read from the kernel.
Then, in kvm64.c:
kvm_arch_get_registers()
{
...
if (!is_a64(env)) {
aarch64_sync_64_to_32(env);
}
...
write_kvmstate_to_list(cpu);
...
write_list_to_cpustate(cpu);
...
}
kvm_arch_put_registers()
{
...
if (!is_a64(env)) {
aarch64_sync_32_to_64(env);
}
...
write_cpustate_to_list(cpu, true);
...
write_list_to_kvmstate(cpu, level)
...
}
Thanks,
Claudio