qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v10 47/59] i386/xen: handle PV timer hypercalls


From: Paul Durrant
Subject: Re: [PATCH v10 47/59] i386/xen: handle PV timer hypercalls
Date: Tue, 14 Feb 2023 10:10:05 +0000
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1

On 01/02/2023 14:31, David Woodhouse wrote:
From: Joao Martins <joao.m.martins@oracle.com>

Introduce support for one shot and periodic mode of Xen PV timers,
whereby timer interrupts come through a special virq event channel
with deadlines being set through:

1) set_timer_op hypercall (only oneshot)
2) vcpu_op hypercall for {set,stop}_{singleshot,periodic}_timer
hypercalls

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
  hw/i386/kvm/xen_evtchn.c  |  31 +++++
  hw/i386/kvm/xen_evtchn.h  |   2 +
  target/i386/cpu.h         |   5 +
  target/i386/kvm/xen-emu.c | 245 +++++++++++++++++++++++++++++++++++++-
  target/i386/machine.c     |   1 +
  5 files changed, 282 insertions(+), 2 deletions(-)

[snip]
@@ -1246,6 +1466,9 @@ static bool do_kvm_xen_handle_exit(X86CPU *cpu, struct 
kvm_xen_exit *exit)
      }
switch (code) {
+    case __HYPERVISOR_set_timer_op:
+        return kvm_xen_hcall_set_timer_op(exit, cpu,
+                                          exit->u.hcall.params[0]);

There's a nasty little semantic subtlety here which has been missed... If the guest is not in longmode then the timer value is actually split across param[0] and param[1] (so that it is still 64-bits).

  Paul




reply via email to

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