qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH v2 18/22] i386/xen: handle VCPUOP_register_runstate_memor


From: Paul Durrant
Subject: Re: [RFC PATCH v2 18/22] i386/xen: handle VCPUOP_register_runstate_memory_area
Date: Mon, 12 Dec 2022 15:38:07 +0000
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1

On 09/12/2022 09:56, David Woodhouse wrote:
From: Joao Martins <joao.m.martins@oracle.com>

Allow guest to setup the vcpu runstates which is used as
steal clock.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
  target/i386/cpu.h     |  1 +
  target/i386/kvm/kvm.c |  9 +++++++++
  target/i386/machine.c |  4 +++-
  target/i386/xen.c     | 35 +++++++++++++++++++++++++++++++++++
  4 files changed, 48 insertions(+), 1 deletion(-)

[snip]
+static int vcpuop_register_runstate_info(CPUState *cs, CPUState *target,
+                                         uint64_t arg)
+{
+    struct vcpu_register_runstate_memory_area rma;
+    uint64_t gpa;
+    size_t len;
+
+    if (kvm_copy_from_gva(cs, arg, &rma, sizeof(*rma.addr.v))) {
+        return -EFAULT;
+    }
+
+    if (!kvm_gva_to_gpa(cs, rma.addr.p, &gpa, &len, false) ||
+        len < sizeof(struct vcpu_time_info)) {
+        return -EFAULT;
+    }

Again, Xen stashes the GVA for this and not the GPA.

  Paul



reply via email to

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