qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH for-8.2 2/2] arm/kvm: convert to kvm_get_one_reg


From: Gavin Shan
Subject: Re: [PATCH for-8.2 2/2] arm/kvm: convert to kvm_get_one_reg
Date: Tue, 25 Jul 2023 10:01:04 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0


On 7/24/23 18:48, Cornelia Huck wrote:
On Mon, Jul 24 2023, Gavin Shan <gshan@redhat.com> wrote:

On 7/18/23 21:14, Cornelia Huck wrote:
We can neaten the code by switching the callers that work on a
CPUstate to the kvm_get_one_reg function.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
   target/arm/kvm.c   | 15 +++---------
   target/arm/kvm64.c | 57 ++++++++++++----------------------------------
   2 files changed, 18 insertions(+), 54 deletions(-)


The replacements look good to me. However, I guess it's worty to apply
the same replacements for target/arm/kvm64.c since we're here?

[gshan@gshan arm]$ pwd
/home/gshan/sandbox/q/target/arm
[gshan@gshan arm]$ git grep KVM_GET_ONE_REG
kvm64.c:    err = ioctl(fd, KVM_GET_ONE_REG, &idreg);
kvm64.c:    return ioctl(fd, KVM_GET_ONE_REG, &idreg);
kvm64.c:        ret = ioctl(fdarray[2], KVM_GET_ONE_REG, &reg);

These are the callers that don't work on a CPUState (all in initial
feature discovery IIRC), so they need to stay that way.


Right, All these ioctl commands are issued when CPUState isn't around. However, 
there
are two wrappers read_sys_{reg32, reg64}(). The ioctl call in 
kvm_arm_sve_get_vls()
can be replaced by read_sys_reg64(). I guess it'd better to do this in a 
separate
patch if you agree.

Thanks,
Gavin




reply via email to

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