[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231027160347.05c6cd60.pasic@linux.ibm.com>
Date: Fri, 27 Oct 2023 16:03:47 +0200
From: Halil Pasic <pasic@...ux.ibm.com>
To: Tony Krowiak <akrowiak@...ux.ibm.com>
Cc: linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, jjherne@...ux.ibm.com,
borntraeger@...ux.ibm.com, frankja@...ux.ibm.com,
imbrenda@...ux.ibm.com, david@...hat.com,
Halil Pasic <pasic@...ux.ibm.com>
Subject: Re: [PATCH v2 2/3] s390/vfio-ap: set status response code to 06 on
gisc registration failure
On Fri, 27 Oct 2023 09:36:26 -0400
Tony Krowiak <akrowiak@...ux.ibm.com> wrote:
> >> The interception handler for the PQAP(AQIC) command calls the
> >> kvm_s390_gisc_register function to register the guest ISC with the channel
> >> subsystem. If that call fails, the status response code 08 - indicating
> >> Invalid ZONE/GISA designation - is returned to the guest. This response
> >> code does not make sense because the non-zero return code from the
> >> kvm_s390_gisc_register function can be due one of two things: Either the
> >> ISC passed as a parameter by the guest to the PQAP(AQIC) command is greater
> >> than the maximum ISC value allowed, or the guest is not using a GISA.
> >
> > The "ISC passed as a parameter by the guest to the PQAP(AQIC) command is
> > greater than the maximum ISC value allowed" is not possible. The isc is
> > 3 bits wide and all 8 values that can be represented on 3 bits are valid.
> >
> > This is only possible if the hypervisor was to mess up, or if the machine
> > was broken.
>
> kvm_s390_gisc_register(struct kvm *kvm, u32 gisc)
> {
> struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int;
>
> if (!gi->origin)
> return -ENODEV;
> if (gisc > MAX_ISC)
> return -ERANGE;
> ...
>
> Just quoting what is in the code.
Right! But it is not the guest that calls this function directly. This
function is called by the vfio_ap code.
The guest passes ISC in bits 61, 62 and 63 of GR1.
So the guest can't give you an invalid value.
Regards,
Halil
Powered by blists - more mailing lists