[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v2 7/9] s390x/pci: fence off instructions fo
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH RFC v2 7/9] s390x/pci: fence off instructions for non-pci |
Date: |
Wed, 19 Jul 2017 10:07:53 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 |
On 18.07.2017 16:24, Cornelia Huck wrote:
> If a guest running on a machine without zpci issues a pci instruction,
> throw them an exception.
>
> Signed-off-by: Cornelia Huck <address@hidden>
> ---
> target/s390x/kvm.c | 54
> +++++++++++++++++++++++++++++++++++++++++-------------
> 1 file changed, 41 insertions(+), 13 deletions(-)
[...]
> static int kvm_mpcifc_service_call(S390CPU *cpu, struct kvm_run *run)
> @@ -1269,10 +1293,14 @@ static int kvm_mpcifc_service_call(S390CPU *cpu,
> struct kvm_run *run)
> uint64_t fiba;
> uint8_t ar;
>
> - cpu_synchronize_state(CPU(cpu));
> - fiba = get_base_disp_rxy(cpu, run, &ar);
> + if (s390_has_feat(S390_FEAT_ZPCI)) {
> + cpu_synchronize_state(CPU(cpu));
> + fiba = get_base_disp_rxy(cpu, run, &ar);
>
> - return mpcifc_service_call(cpu, r1, fiba, ar);
> + return mpcifc_service_call(cpu, r1, fiba, ar);
> + } else {
> + return -1;
> + }
> }
I think I'd rather write these cases with early exits à la
if (!s390_has_feat(S390_FEAT_ZPCI)) {
return -1;
}
so you could get along with less change and less indentation ... but
since this is rather a matter of taste, anyway:
Reviewed-by: Thomas Huth <address@hidden>
- Re: [Qemu-devel] [PATCH RFC v2 4/9] s390x/pci: do not advertise pci on non-pci builds, (continued)
[Qemu-devel] [PATCH RFC v2 1/9] kvm: remove hard dependency on pci, Cornelia Huck, 2017/07/18
[Qemu-devel] [PATCH RFC v2 5/9] s390x/ccw: create s390 phb conditionally, Cornelia Huck, 2017/07/18
[Qemu-devel] [PATCH RFC v2 7/9] s390x/pci: fence off instructions for non-pci, Cornelia Huck, 2017/07/18
[Qemu-devel] [PATCH RFC v2 8/9] s390x/kvm: msi route fixup for non-pci, Cornelia Huck, 2017/07/18
Re: [Qemu-devel] [PATCH RFC v2 8/9] s390x/kvm: msi route fixup for non-pci, Yi Min Zhao, 2017/07/18
[Qemu-devel] [PATCH RFC v2 9/9] s390x: refine pci dependencies, Cornelia Huck, 2017/07/18