Thread (59 messages) 59 messages, 9 authors, 2023-09-13

Re: [RFC PATCH 29/32] KVM: arm64: Pass hypercalls to userspace

From: Suzuki K Poulose <suzuki.poulose@arm.com>
Date: 2023-02-06 10:21:33
Also in: kvm, kvmarm, linux-acpi, linux-arch, linux-pm, lkml, loongarch

Hi,

A few cents from the Realm support point of view.

On 05/02/2023 10:12, Marc Zyngier wrote:
On Fri, 03 Feb 2023 13:50:40 +0000,
James Morse [off-list ref] wrote:
quoted
From: Jean-Philippe Brucker <redacted>

When capability KVM_CAP_ARM_HVC_TO_USER is available, userspace can
request to handle all hypercalls that aren't handled by KVM. With the
help of another capability, this will allow userspace to handle PSCI
calls.

Suggested-by: James Morse <james.morse@arm.com>
Signed-off-by: Jean-Philippe Brucker <redacted>
Signed-off-by: James Morse <james.morse@arm.com>

---
On top of Oliver's ask not to make this a blanket "steal everything",
but instead to have an actual request for ranges of forwarded
hypercalls:
quoted
Notes on this implementation:

* A similar mechanism was proposed for SDEI some time ago [1]. This RFC
   generalizes the idea to all hypercalls, since that was suggested on
   the list [2, 3].

* We're reusing kvm_run.hypercall. I copied x0-x5 into
   kvm_run.hypercall.args[] to help userspace but I'm tempted to remove
   this, because:
   - Most user handlers will need to write results back into the
     registers (x0-x3 for SMCCC), so if we keep this shortcut we should
     go all the way and read them back on return to kernel.
   - QEMU doesn't care about this shortcut, it pulls all vcpu regs before
     handling the call.
This may not be always possible, e.g., for Realms. GET_ONE_REG is
not supported. So using an explicit passing down of the args is
preferrable.

Thanks
Suzuki

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help