diff mbox

[11/11] s390x/css: update css_adapter_interrupt

Message ID 2c703b61-a77f-c5dc-0f26-9af136dd8181@de.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Christian Borntraeger July 13, 2017, 8:08 a.m. UTC
On 07/12/2017 04:26 PM, Thomas Huth wrote:
> On 12.07.2017 14:57, Christian Borntraeger wrote:
>> From: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
>>
>> Let's use the new inject_airq callback of flic to inject adapter
>> interrupts. For kvm case, if the kernel flic doesn't support the new
>> interface, the irq routine remains unchanged. For non-kvm case,
>> qemu-flic handles the suppression process.
>>
>> Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
>> Signed-off-by: Fei Li <sherrylf@linux.vnet.ibm.com>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> ---
>>  hw/s390x/css.c          | 18 ++++++++++++++++--
>>  hw/s390x/s390-pci-bus.c |  2 +-
>>  hw/s390x/virtio-ccw.c   |  2 +-
>>  include/hw/s390x/css.h  |  2 +-
>>  4 files changed, 19 insertions(+), 5 deletions(-)
>>
>> diff --git a/hw/s390x/css.c b/hw/s390x/css.c
>> index 7b82176..ee4ebbf 100644
>> --- a/hw/s390x/css.c
>> +++ b/hw/s390x/css.c
>> @@ -547,12 +547,26 @@ out:
>>      return r;
>>  }
>>  
>> -void css_adapter_interrupt(uint8_t isc)
>> +void css_adapter_interrupt(CssIoAdapterType type, uint8_t isc)
>>  {
>> +    S390FLICState *fs = s390_get_flic();
>> +    S390FLICStateClass *fsc = S390_FLIC_COMMON_GET_CLASS(fs);
>>      uint32_t io_int_word = (isc << 27) | IO_INT_WORD_AI;
>> +    IoAdapter *adapter = channel_subsys.io_adapters[type][isc];
>> +
>> +    if (!adapter) {
>> +        return;
>> +    }
>>  
>>      trace_css_adapter_interrupt(isc);
>> -    s390_io_interrupt(0, 0, 0, io_int_word);
>> +    if (fs->ais_supported) {
>> +        if (fsc->inject_airq(fs, type, isc, adapter->flags)) {
>> +            fprintf(stderr, "Failed to inject airq with AIS supported\n");
> 
> Use error_report() instead?

something like this on top?

Comments

Thomas Huth July 13, 2017, 8:18 a.m. UTC | #1
On 13.07.2017 10:08, Christian Borntraeger wrote:
> On 07/12/2017 04:26 PM, Thomas Huth wrote:
>> On 12.07.2017 14:57, Christian Borntraeger wrote:
>>> From: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
>>>
>>> Let's use the new inject_airq callback of flic to inject adapter
>>> interrupts. For kvm case, if the kernel flic doesn't support the new
>>> interface, the irq routine remains unchanged. For non-kvm case,
>>> qemu-flic handles the suppression process.
>>>
>>> Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
>>> Signed-off-by: Fei Li <sherrylf@linux.vnet.ibm.com>
>>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>>> ---
>>>  hw/s390x/css.c          | 18 ++++++++++++++++--
>>>  hw/s390x/s390-pci-bus.c |  2 +-
>>>  hw/s390x/virtio-ccw.c   |  2 +-
>>>  include/hw/s390x/css.h  |  2 +-
>>>  4 files changed, 19 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/hw/s390x/css.c b/hw/s390x/css.c
>>> index 7b82176..ee4ebbf 100644
>>> --- a/hw/s390x/css.c
>>> +++ b/hw/s390x/css.c
>>> @@ -547,12 +547,26 @@ out:
>>>      return r;
>>>  }
>>>  
>>> -void css_adapter_interrupt(uint8_t isc)
>>> +void css_adapter_interrupt(CssIoAdapterType type, uint8_t isc)
>>>  {
>>> +    S390FLICState *fs = s390_get_flic();
>>> +    S390FLICStateClass *fsc = S390_FLIC_COMMON_GET_CLASS(fs);
>>>      uint32_t io_int_word = (isc << 27) | IO_INT_WORD_AI;
>>> +    IoAdapter *adapter = channel_subsys.io_adapters[type][isc];
>>> +
>>> +    if (!adapter) {
>>> +        return;
>>> +    }
>>>  
>>>      trace_css_adapter_interrupt(isc);
>>> -    s390_io_interrupt(0, 0, 0, io_int_word);
>>> +    if (fs->ais_supported) {
>>> +        if (fsc->inject_airq(fs, type, isc, adapter->flags)) {
>>> +            fprintf(stderr, "Failed to inject airq with AIS supported\n");
>>
>> Use error_report() instead?
> 
> something like this on top?
> 
> diff --git a/hw/s390x/css.c b/hw/s390x/css.c
> index 3d28caa..997815c 100644
> --- a/hw/s390x/css.c
> +++ b/hw/s390x/css.c
> @@ -674,7 +674,7 @@ void css_adapter_interrupt(CssIoAdapterType type, uint8_t isc)
>      trace_css_adapter_interrupt(isc);
>      if (fs->ais_supported) {
>          if (fsc->inject_airq(fs, type, isc, adapter->flags)) {
> -            fprintf(stderr, "Failed to inject airq with AIS supported\n");
> +            error_report("Failed to inject airq with AIS supported");
>              exit(1);
>          }
>      } else {

Yes, that looks fine. Alternatively, this could maybe be a g_assert()
instead? ... but then you don't get the nice error message anymore, so I
think error_report + exit is OK here.

 Thomas
diff mbox

Patch

diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 3d28caa..997815c 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -674,7 +674,7 @@  void css_adapter_interrupt(CssIoAdapterType type, uint8_t isc)
     trace_css_adapter_interrupt(isc);
     if (fs->ais_supported) {
         if (fsc->inject_airq(fs, type, isc, adapter->flags)) {
-            fprintf(stderr, "Failed to inject airq with AIS supported\n");
+            error_report("Failed to inject airq with AIS supported");
             exit(1);
         }
     } else {