qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 08/11] s390x/flic: introduce modify_ais_mode cal


From: Cornelia Huck
Subject: Re: [Qemu-devel] [PATCH 08/11] s390x/flic: introduce modify_ais_mode callback
Date: Wed, 12 Jul 2017 17:07:13 +0200

On Wed, 12 Jul 2017 14:57:42 +0200
Christian Borntraeger <address@hidden> wrote:

> From: Fei Li <address@hidden>
> 
> In order to emulate the adapter interruption suppression (AIS)
> facility properly, the guest needs to be able to modify the AIS mask.
> Interrupt suppression will be handled via the flic (for kvm, via a
> recently introduced kernel backend; for !kvm, in the flic code), so
> let's introduce a method to change the mode via the flic interface.
> 
> Co-authored-by: Yi Min Zhao <address@hidden>
> Signed-off-by: Yi Min Zhao <address@hidden>
> Signed-off-by: Fei Li <address@hidden>
> Signed-off-by: Christian Borntraeger <address@hidden>
> ---
>  hw/intc/s390_flic.c          | 37 ++++++++++++++++++++++++++++++++++++-
>  hw/intc/s390_flic_kvm.c      | 36 ++++++++++++++++++++++++++++++++++++
>  include/hw/s390x/s390_flic.h |  9 ++++++++-
>  3 files changed, 80 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c
> index d3938b3..ce7f355 100644
> --- a/hw/intc/s390_flic.c
> +++ b/hw/intc/s390_flic.c
> @@ -79,15 +79,47 @@ static int qemu_s390_clear_io_flic(S390FLICState *fs, 
> uint16_t subchannel_id,
>      return -ENOSYS;
>  }
>  
> +static int qemu_s390_modify_ais_mode(S390FLICState *fs, uint8_t isc,
> +                                     uint16_t mode)
> +{
> +    QEMUS390FLICState *flic  = QEMU_S390_FLIC(fs);
> +
> +    switch (mode) {
> +    case SIC_IRQ_MODE_ALL:
> +        flic->simm &= ~AIS_MODE_MASK(isc);
> +        flic->nimm &= ~AIS_MODE_MASK(isc);
> +        break;
> +    case SIC_IRQ_MODE_SINGLE:
> +        flic->simm |= AIS_MODE_MASK(isc);
> +        flic->nimm &= ~AIS_MODE_MASK(isc);

Can we have some documentation about the meaning of simm/nimm in qemu?
The one from the patch description of the respective kernel patch would
be fine.

> +        break;
> +    default:
> +        return -EINVAL;
> +    }
> +
> +    return 0;
> +}
> +
>

(...)

> @@ -406,6 +427,7 @@ typedef struct KVMS390FLICStateClass {
>  
>  static void kvm_s390_flic_realize(DeviceState *dev, Error **errp)
>  {
> +    S390FLICState *fs = S390_FLIC_COMMON(dev);
>      KVMS390FLICState *flic_state = KVM_S390_FLIC(dev);
>      struct kvm_create_device cd = {0};
>      struct kvm_device_attr test_attr = {0};
> @@ -438,6 +460,7 @@ static void kvm_s390_flic_realize(DeviceState *dev, Error 
> **errp)
>      flic_state->clear_io_supported = !ioctl(flic_state->fd,
>                                              KVM_HAS_DEVICE_ATTR, test_attr);
>  
> +    fs->ais_supported = false;

The patch actually enabling this for kvm is in the next batch of
patches, I assume?

>      return;
>  fail:
>      error_propagate(errp, errp_local);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]