public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: Gavin Shan <gshan@redhat.com>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org, kvm@vger.kernel.org,
	Cornelia Huck <cohuck@redhat.com>
Subject: [PATCH v2 3/3] arm/kvm: convert to read_sys_reg64
Date: Tue, 10 Oct 2023 16:24:53 +0200	[thread overview]
Message-ID: <20231010142453.224369-4-cohuck@redhat.com> (raw)
In-Reply-To: <20231010142453.224369-1-cohuck@redhat.com>

We can use read_sys_reg64 to get the SVE_VLS register instead of
calling GET_ONE_REG directly.

Suggested-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 target/arm/kvm64.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c
index 558c0b88dd69..d40c89a84752 100644
--- a/target/arm/kvm64.c
+++ b/target/arm/kvm64.c
@@ -500,10 +500,6 @@ uint32_t kvm_arm_sve_get_vls(CPUState *cs)
             .target = -1,
             .features[0] = (1 << KVM_ARM_VCPU_SVE),
         };
-        struct kvm_one_reg reg = {
-            .id = KVM_REG_ARM64_SVE_VLS,
-            .addr = (uint64_t)&vls[0],
-        };
         int fdarray[3], ret;
 
         probed = true;
@@ -512,7 +508,7 @@ uint32_t kvm_arm_sve_get_vls(CPUState *cs)
             error_report("failed to create scratch VCPU with SVE enabled");
             abort();
         }
-        ret = ioctl(fdarray[2], KVM_GET_ONE_REG, &reg);
+        ret = read_sys_reg64(fdarray[2], &vls[0], KVM_REG_ARM64_SVE_VLS);
         kvm_arm_destroy_scratch_host_vcpu(fdarray);
         if (ret) {
             error_report("failed to get KVM_REG_ARM64_SVE_VLS: %s",
-- 
2.41.0


  parent reply	other threads:[~2023-10-10 14:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10 14:24 [PATCH v2 0/3] arm/kvm: use kvm_{get,set}_one_reg Cornelia Huck
2023-10-10 14:24 ` [PATCH v2 1/3] arm/kvm: convert to kvm_set_one_reg Cornelia Huck
2023-10-11  2:44   ` Philippe Mathieu-Daudé
2023-10-10 14:24 ` [PATCH v2 2/3] arm/kvm: convert to kvm_get_one_reg Cornelia Huck
2023-10-11  2:44   ` Philippe Mathieu-Daudé
2023-10-10 14:24 ` Cornelia Huck [this message]
2023-10-11  0:02   ` [PATCH v2 3/3] arm/kvm: convert to read_sys_reg64 Gavin Shan
2023-10-17 12:09   ` Peter Maydell
2023-10-17 15:28     ` Cornelia Huck
2023-10-17 12:15 ` [PATCH v2 0/3] arm/kvm: use kvm_{get,set}_one_reg Peter Maydell

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=20231010142453.224369-4-cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=gshan@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