[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250730153506.00006280@huawei.com>
Date: Wed, 30 Jul 2025 15:35:06 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: "Aneesh Kumar K.V (Arm)" <aneesh.kumar@...nel.org>
CC: <linux-coco@...ts.linux.dev>, <kvmarm@...ts.linux.dev>,
<linux-pci@...r.kernel.org>, <linux-kernel@...r.kernel.org>, <aik@....com>,
<lukas@...ner.de>, Samuel Ortiz <sameo@...osinc.com>, Xu Yilun
<yilun.xu@...ux.intel.com>, Jason Gunthorpe <jgg@...pe.ca>, "Suzuki K
Poulose" <Suzuki.Poulose@....com>, Steven Price <steven.price@....com>,
Catalin Marinas <catalin.marinas@....com>, Marc Zyngier <maz@...nel.org>,
Will Deacon <will@...nel.org>, Oliver Upton <oliver.upton@...ux.dev>
Subject: Re: [RFC PATCH v1 26/38] KVM: arm64: Add exit handler related to
device assignment
On Mon, 28 Jul 2025 19:22:03 +0530
"Aneesh Kumar K.V (Arm)" <aneesh.kumar@...nel.org> wrote:
> Different RSI calls related to DA result in REC exits. Add a facility to
> register handlers for handling these REC exits.
>
> Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar@...nel.org>
> diff --git a/arch/arm64/include/asm/rmi_smc.h b/arch/arm64/include/asm/rmi_smc.h
> index c6e16ab608e1..a5ef68b62bc0 100644
> --- a/arch/arm64/include/asm/rmi_smc.h
> +++ b/arch/arm64/include/asm/rmi_smc.h
> diff --git a/arch/arm64/kvm/rme-exit.c b/arch/arm64/kvm/rme-exit.c
> index 1a8ca7526863..25948207fc5b 100644
> --- a/arch/arm64/kvm/rme-exit.c
> +++ b/arch/arm64/kvm/rme-exit.c
> +static int rec_exit_dev_mem_map(struct kvm_vcpu *vcpu)
> +{
> + int ret;
> + struct realm_rec *rec = &vcpu->arch.rec;
> +
> + if (realm_exit_dev_mem_map_handler) {
> + ret = (*realm_exit_dev_mem_map_handler)(rec);
> + } else {
> + kvm_pr_unimpl("Unsupported exit reason: %u\n",
> + rec->run->exit.exit_reason);
> + vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
> + ret = 0;
I guess maybe this gets more complex later, but right now
return 0;
And maybe return in the if branch as well.
Same for other similar code in this patch.
> + }
> + return ret;
> +}
> +
> static void update_arch_timer_irq_lines(struct kvm_vcpu *vcpu)
> {
> struct realm_rec *rec = &vcpu->arch.rec;
> @@ -198,6 +252,12 @@ int handle_rec_exit(struct kvm_vcpu *vcpu, int rec_run_ret)
> return rec_exit_ripas_change(vcpu);
> case RMI_EXIT_HOST_CALL:
> return rec_exit_host_call(vcpu);
> + case RMI_EXIT_VDEV_REQUEST:
> + return rec_exit_vdev_request(vcpu);
> + case RMI_EXIT_VDEV_COMM:
> + return rec_exit_vdev_communication(vcpu);
> + case RMI_EXIT_DEV_MEM_MAP:
> + return rec_exit_dev_mem_map(vcpu);
> }
>
> kvm_pr_unimpl("Unsupported exit reason: %u\n",
Powered by blists - more mailing lists