From: Gavin Shan <gshan@redhat.com>
To: Cornelia Huck <cohuck@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, kvm@vger.kernel.org
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 [thread overview]
Message-ID: <4a990b57-800c-6799-8c23-4488069ffb76@redhat.com> (raw)
In-Reply-To: <878rb5g0f0.fsf@redhat.com>
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, ®);
>
> 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
next prev parent reply other threads:[~2023-07-25 0:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 11:14 [PATCH for-8.2 0/2] arm/kvm: use kvm_{get,set}_one_reg Cornelia Huck
2023-07-18 11:14 ` [PATCH for-8.2 1/2] arm/kvm: convert to kvm_set_one_reg Cornelia Huck
2023-07-24 2:26 ` Gavin Shan
2023-07-24 8:47 ` Cornelia Huck
2023-07-18 11:14 ` [PATCH for-8.2 2/2] arm/kvm: convert to kvm_get_one_reg Cornelia Huck
2023-07-24 2:35 ` Gavin Shan
2023-07-24 8:48 ` Cornelia Huck
2023-07-25 0:01 ` Gavin Shan [this message]
2023-07-27 9:55 ` Cornelia Huck
2023-10-10 10:09 ` Cornelia Huck
2023-07-31 7:15 ` Gavin Shan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4a990b57-800c-6799-8c23-4488069ffb76@redhat.com \
--to=gshan@redhat.com \
--cc=cohuck@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).