[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_
From: |
David Woodhouse |
Subject: |
Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ |
Date: |
Wed, 21 Dec 2022 01:41:26 +0000 |
User-agent: |
Evolution 3.44.4-0ubuntu1 |
On Mon, 2022-12-12 at 16:16 +0000, Paul Durrant wrote:
>
> > @@ -287,24 +289,53 @@ static bool kvm_xen_hcall_memory_op(struct
> > kvm_xen_exit *exit,
> > return true;
> > }
> >
> > +static int handle_set_param(struct kvm_xen_exit *exit, X86CPU *cpu,
> > + uint64_t arg)
> > +{
> > + CPUState *cs = CPU(cpu);
> > + struct xen_hvm_param hp;
> > + int err = 0;
> > +
> > + if (kvm_copy_from_gva(cs, arg, &hp, sizeof(hp))) {
> > + err = -EFAULT;
> > + goto out;
> > + }
> > +
> > + if (hp.domid != DOMID_SELF) {
>
> Xen actually allows the domain's own id to be specified as well as the
> magic DOMID_SELF.
>
> > + err = -EINVAL;
>
> And this should be -ESRCH.
>
Oops, fixed that after posting v4 series. Fixed in:
https://git.infradead.org/users/dwmw2/qemu.git/shortlog/refs/heads/xenfv
I fixed the similar -EPERM in evtchn_status_op() too.
> > + goto out;
> > + }
> > +
> > + switch (hp.index) {
> > + case HVM_PARAM_CALLBACK_IRQ:
> > + err = xen_evtchn_set_callback_param(hp.value);
> > + break;
> > + default:
> > + return false;
> > + }
> > +
> > +out:
> > + exit->u.hcall.result = err;
>
> This is a bit on the ugly side isn't it? Why not return the err and have
> kvm_xen_hcall_hvm_op() deal with passing it back?
Because 'return false' means qemu will whine about it being
unimplemented.
smime.p7s
Description: S/MIME cryptographic signature
- [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, (continued)
- [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, David Woodhouse, 2022/12/09
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, Paul Durrant, 2022/12/12
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, David Woodhouse, 2022/12/12
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, Paul Durrant, 2022/12/12
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, David Woodhouse, 2022/12/15
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, Paul Durrant, 2022/12/20
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, David Woodhouse, 2022/12/20
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, Paul Durrant, 2022/12/20
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, David Woodhouse, 2022/12/20
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, David Woodhouse, 2022/12/28
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ,
David Woodhouse <=
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, Paul Durrant, 2022/12/21
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, David Woodhouse, 2022/12/21
[RFC PATCH v2 09/22] pc_piix: allow xenfv machine with XEN_EMULATE, David Woodhouse, 2022/12/09
[RFC PATCH v2 05/22] xen-platform-pci: allow its creation with XEN_EMULATE mode, David Woodhouse, 2022/12/09
[RFC PATCH v2 11/22] i386/xen: implement HYPERCALL_xen_version, David Woodhouse, 2022/12/09