qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Jason J. Herne" <jjherne@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>,
	qemu-devel@nongnu.org, qemu-s390x@nongnu.org, cohuck@redhat.com,
	pasic@linux.ibm.com, alifm@linux.ibm.com, borntraeger@de.ibm.com
Subject: Re: [Qemu-devel] [qemu-s390x] [PATCH v5 11/15] s390-bios: cio error handling
Date: Mon, 1 Apr 2019 10:11:34 -0400	[thread overview]
Message-ID: <eba1dd75-6b95-1026-52b0-c5ca0c4552a0@linux.ibm.com> (raw)
In-Reply-To: <a52f522d-e161-f11f-a9b1-85f2ed2d0262@redhat.com>

On 3/27/19 6:47 AM, Thomas Huth wrote:
> On 13/03/2019 17.31, Jason J. Herne wrote:
>> Add verbose error output for when unexpected i/o errors happen. This eases the
>> burden of debugging and reporting i/o errors. No error information is printed
>> in the success case, here is an example of what is output on error:
>>
>> cio device error
>>    ssid  : 0x0000000000000000
>>    cssid : 0x0000000000000000
>>    sch_no: 0x0000000000000000
>>
>> Interrupt Response Block Data:
>>      Function Ctrl : [Start]
>>      Activity Ctrl : [Start-Pending]
>>      Status Ctrl : [Alert] [Primary] [Secondary] [Status-Pending]
>>      Device Status : [Unit-Check]
>>      Channel Status :
>>      cpa=: 0x000000007f8d6038
>>      prev_ccw=: 0x0000000000000000
>>      this_ccw=: 0x0000000000000000
>> Eckd Dasd Sense Data (fmt 32-bytes):
>>      Sense Condition Flags :
>>      Residual Count     =: 0x0000000000000000
>>      Phys Drive ID      =: 0x000000000000009e
>>      low cyl address    =: 0x0000000000000000
>>      head addr & hi cyl =: 0x0000000000000000
>>      format/message     =: 0x0000000000000008
>>      fmt-dependent[0-7] =: 0x0000000000000004
>>      fmt-dependent[8-15]=: 0xe561282305082fff
>>      prog action code   =: 0x0000000000000016
>>      Configuration info =: 0x00000000000040e0
>>      mcode / hi-cyl     =: 0x0000000000000000
>>      cyl & head addr [0]=: 0x0000000000000000
>>      cyl & head addr [1]=: 0x0000000000000000
>>      cyl & head addr [2]=: 0x0000000000000000
>>
>> The Sense Data section is currently only printed for ECKD DASD.
>>
>> Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com>
>> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
>> ---
>>   pc-bios/s390-ccw/cio.c  | 237 +++++++++++++++++++++++++++++++++++++++++++++++-
>>   pc-bios/s390-ccw/libc.h |  11 +++
>>   2 files changed, 247 insertions(+), 1 deletion(-)
>>
>> diff --git a/pc-bios/s390-ccw/cio.c b/pc-bios/s390-ccw/cio.c
>> index 58f63e4..54fd6ad 100644
>> --- a/pc-bios/s390-ccw/cio.c
>> +++ b/pc-bios/s390-ccw/cio.c
>> @@ -85,6 +85,228 @@ static bool irb_error(Irb *irb)
>>       return irb->scsw.dstat != (SCSW_DSTAT_DEVEND | SCSW_DSTAT_CHEND);
>>   }
>>   
>> +static void print_eckd_dasd_sense_data(SenseDataEckdDasd *sd)
>> +{
>> +    char msgline[512];
>> +
>> +    if (sd->config_info & 0x8000) {
>> +        sclp_print("Eckd Dasd Sense Data (fmt 24-bytes):\n");
>> +    } else {
>> +        sclp_print("Eckd Dasd Sense Data (fmt 32-bytes):\n");
>> +    }
>> +
>> +    strcat(msgline, "    Sense Condition Flags :");
>> +    if (sd->status[0] & SNS_STAT0_CMD_REJECT) {
>> +        strcat(msgline, " [Cmd-Reject]");
>> +    }
>> +    if (sd->status[0] & SNS_STAT0_INTERVENTION_REQ) {
>> +        strcat(msgline, " [Intervention-Required]");
>> +    }
>> +    if (sd->status[0] & SNS_STAT0_BUS_OUT_CHECK) {
>> +        strcat(msgline, " [Bus-Out-Parity-Check]");
>> +    }
>> +    if (sd->status[0] & SNS_STAT0_EQUIPMENT_CHECK) {
>> +        strcat(msgline, " [Equipment-Check]");
>> +    }
>> +    if (sd->status[0] & SNS_STAT0_DATA_CHECK) {
>> +        strcat(msgline, " [Data-Check]");
>> +    }
>> +    if (sd->status[0] & SNS_STAT0_OVERRUN) {
>> +        strcat(msgline, " [Overrun]");
>> +    }
>> +    if (sd->status[0] & SNS_STAT0_INCOMPL_DOMAIN) {
>> +        strcat(msgline, " [Incomplete-Domain]");
>> +    }
>> +
>> +    if (sd->status[1] & SNS_STAT1_PERM_ERR) {
>> +        strcat(msgline, " [Permanent-Error]");
>> +    }
>> +    if (sd->status[1] & SNS_STAT1_INV_TRACK_FORMAT) {
>> +        strcat(msgline, " [Invalid-Track-Fmt]");
>> +    }
>> +    if (sd->status[1] & SNS_STAT1_EOC) {
>> +        strcat(msgline, " [End-of-Cyl]");
>> +    }
>> +    if (sd->status[1] & SNS_STAT1_MESSAGE_TO_OPER) {
>> +        strcat(msgline, " [Operator-Msg]");
>> +    }
>> +    if (sd->status[1] & SNS_STAT1_NO_REC_FOUND) {
>> +        strcat(msgline, " [No-Record-Found]");
>> +    }
>> +    if (sd->status[1] & SNS_STAT1_FILE_PROTECTED) {
>> +        strcat(msgline, " [File-Protected]");
>> +    }
>> +    if (sd->status[1] & SNS_STAT1_WRITE_INHIBITED) {
>> +        strcat(msgline, " [Write-Inhibited]");
>> +    }
>> +    if (sd->status[1] & SNS_STAT1_IMPRECISE_END) {
>> +        strcat(msgline, " [Imprecise-Ending]");
>> +    }
>> +
>> +    if (sd->status[2] & SNS_STAT2_REQ_INH_WRITE) {
>> +        strcat(msgline, " [Req-Inhibit-Write]");
>> +    }
>> +    if (sd->status[2] & SNS_STAT2_CORRECTABLE) {
>> +        strcat(msgline, " [Correctable-Data-Check]");
>> +    }
>> +    if (sd->status[2] & SNS_STAT2_FIRST_LOG_ERR) {
>> +        strcat(msgline, " [First-Error-Log]");
>> +    }
>> +    if (sd->status[2] & SNS_STAT2_ENV_DATA_PRESENT) {
>> +        strcat(msgline, " [Env-Data-Present]");
>> +    }
>> +    if (sd->status[2] & SNS_STAT2_IMPRECISE_END) {
>> +        strcat(msgline, " [Imprecise-End]");
>> +    }
> 
> GCC 8 aborts here:
> 
> pc-bios/s390-ccw/cio.c: In function ‘do_cio’:
> pc-bios/s390-ccw/cio.c:146:19: error: array subscript 2 is above array
> bounds of ‘uint8_t[2]’ {aka ‘unsigned char[2]’} [-Werror=array-bounds]
>       if (sd->status[2] & SNS_STAT2_REQ_INH_WRITE) {
>           ~~~~~~~~~~^~~
> 
>   Thomas
> 

This is a result of incomplete refactoring. We renamed status byte 0 to common_status and 
I never updated the references. Thanks for catching this. Myself and my compiler missed it.

-- 
-- Jason J. Herne (jjherne@linux.ibm.com)

  parent reply	other threads:[~2019-04-01 14:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1552494682-16788-1-git-send-email-jjherne@linux.ibm.com>
     [not found] ` <1552494682-16788-2-git-send-email-jjherne@linux.ibm.com>
     [not found]   ` <5961e42d-8574-48de-3057-6cd7680645cc@redhat.com>
2019-04-01  8:51     ` [Qemu-devel] [qemu-s390x] [PATCH v5 01/15] s390 vfio-ccw: Add bootindex property and IPLB data Cornelia Huck
     [not found] ` <1552494682-16788-12-git-send-email-jjherne@linux.ibm.com>
     [not found]   ` <a52f522d-e161-f11f-a9b1-85f2ed2d0262@redhat.com>
2019-04-01 14:11     ` Jason J. Herne [this message]
     [not found] ` <1552494682-16788-16-git-send-email-jjherne@linux.ibm.com>
     [not found]   ` <fd2f7e0d-cfab-245e-8c06-9b9ed424b7e4@redhat.com>
2019-04-01 15:35     ` [Qemu-devel] [qemu-s390x] [PATCH v5 15/15] s390-bios: Support booting from real dasd device Jason J. Herne
2019-04-01 15:55       ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eba1dd75-6b95-1026-52b0-c5ca0c4552a0@linux.ibm.com \
    --to=jjherne@linux.ibm.com \
    --cc=alifm@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).