From: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
To: Halil Pasic <pasic@linux.vnet.ibm.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] s390x/css: check ccw address validity
Date: Thu, 27 Jul 2017 09:03:46 +0800 [thread overview]
Message-ID: <20170727010346.GT7483@bjsdjshi@linux.vnet.ibm.com> (raw)
In-Reply-To: <7067811a-825b-adbb-78a9-5d06083f50ec@linux.vnet.ibm.com>
* Halil Pasic <pasic@linux.vnet.ibm.com> [2017-07-26 18:45:34 +0200]:
[...]
> >>> @@ -946,6 +953,17 @@ static void sch_handle_start_func_virtual(SubchDev *sch)
> >>> suspend_allowed = true;
> >>> }
> >>> sch->last_cmd_valid = false;
> >>> + if (sch->channel_prog & (CCW1_ADDR_MASK |
> >>> + sch->ccw_fmt_1 ? 0 : 0xff000000)) {
> >> I have problem in recognizing the operator precedence here:
> >> (CCW1_ADDR_MASK | sch->ccw_fmt_1 ? 0 : 0xff000000)
> >>
> >> Bitwise '|' has higher precedence than '?:', so the above equals to:
> >> (CCW1_ADDR_MASK | sch->ccw_fmt_1) ? 0 : 0xff000000
> >>
> >> So you will always get a '0', no?
> >>
> >
> > I'm afraid you are right. Good catch! This was supposed to be
> > (CCW1_ADDR_MASK | (sch->ccw_fmt_1 ? 0 : 0xff000000))
> >
> >
> >>> + /* generate channel program check */
> >>> + s->ctrl &= ~SCSW_ACTL_START_PEND;
> >>> + s->cstat = SCSW_CSTAT_PROG_CHECK;
> >>> + s->ctrl &= ~SCSW_CTRL_MASK_STCTL;
> >>> + s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY |
> >>> + SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND;
> >>> + s->cpa = sch->channel_prog + 8;
> >>> + return;
> >>> + }
> >> I think you could let css_interpret_ccw() do the sanity check on its
> >> @ccw_addr parameter when (sch->last_cmd_valid == false), to reuse the
> >> code of generating channel program check.
> >>
> >
> > I'm working on factoring out the code manipulating SCSW (among others). If we
> > do that this will look nicer. What you propose is certainly viable, althoug
> > maybe little less straight forward.
> >
> > Yet another option would be to use a label and jump into the loop (AFAIR that
> > would be also valid).
> >
> > Let us see what is Connie's opinion.
> >
>
> After re-examining the PoP I'm inclined to say we have to check this on every
> iteration because of how "main-storage location is unavailable" is defined in
> this context: the definition depends on the ccw format.
Sounds natural!
> There is nothing about this in the ccw chaining section of the pop but
> it can be found in the I/O interrupts chapter.
>
> I think I will have to redo this patch :/
Ok.
>
> Regards,
> Halil
>
> >
> >>> do {
> >>> ret = css_interpret_ccw(sch, sch->channel_prog, suspend_allowed);
> >>> switch (ret) {
> >>> --
> >>> 2.11.2
> >>>
> >>
> >
> >
>
>
--
Dong Jia Shi
next prev parent reply other threads:[~2017-07-27 1:03 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-25 22:44 [Qemu-devel] [PATCH 0/2] ccw interpretation AR compliance improvements Halil Pasic
2017-07-25 22:44 ` [Qemu-devel] [PATCH 1/2] s390x/css: check ccw address validity Halil Pasic
2017-07-26 3:31 ` Dong Jia Shi
2017-07-26 12:05 ` Halil Pasic
2017-07-26 16:45 ` Halil Pasic
2017-07-27 1:03 ` Dong Jia Shi [this message]
2017-07-25 22:44 ` [Qemu-devel] [PATCH 2/2] s390x/css: fix bits must be zero check for TIC Halil Pasic
2017-07-26 3:01 ` Dong Jia Shi
2017-07-26 11:38 ` Halil Pasic
2017-07-27 0:41 ` Dong Jia Shi
2017-07-27 8:01 ` Cornelia Huck
2017-07-27 11:18 ` Halil Pasic
2017-07-27 13:40 ` Halil Pasic
2017-07-27 13:45 ` Cornelia Huck
2017-07-27 8:32 ` Cornelia Huck
2017-07-27 8:43 ` Dong Jia Shi
2017-07-27 8:26 ` [Qemu-devel] [PATCH 0/2] ccw interpretation AR compliance improvements Cornelia Huck
2017-07-27 11:34 ` Halil Pasic
2017-07-27 13:18 ` Halil Pasic
2017-07-27 13:40 ` Cornelia Huck
2017-07-27 13:52 ` Halil Pasic
2017-07-27 14:24 ` Cornelia Huck
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=20170727010346.GT7483@bjsdjshi@linux.vnet.ibm.com \
--to=bjsdjshi@linux.vnet.ibm.com \
--cc=pasic@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/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).