From: Wei Liu <wei.liu2@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
qemu-devel@nongnu.org, Anthony Perard <anthony.perard@citrix.com>,
Xen-devel <xen-devel@lists.xenproject.org>,
Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [Qemu-devel] [Xen-devel] [PATCH 2/2] xenfb: remove out_cons in xenfb_handle_events
Date: Tue, 12 Apr 2016 11:04:58 +0100 [thread overview]
Message-ID: <20160412100458.GB18652@citrix.com> (raw)
In-Reply-To: <570CC719.9000800@citrix.com>
On Tue, Apr 12, 2016 at 10:59:53AM +0100, Andrew Cooper wrote:
> On 12/04/16 10:57, Wei Liu wrote:
> > The variable out_cons was only used to temporarily hold the consumer
> > index. Use cons directly to simplify code a bit.
> >
> > No functional change introduced.
> >
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > ---
> > Cc: Stefano Stabellini <sstabellini@kernel.org>
> > Cc: Anthony Perard <anthony.perard@citrix.com>
> > ---
> > hw/display/xenfb.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
> > index 9866dfd..78a8dcd 100644
> > --- a/hw/display/xenfb.c
> > +++ b/hw/display/xenfb.c
> > @@ -770,16 +770,16 @@ static void xenfb_invalidate(void *opaque)
> >
> > static void xenfb_handle_events(struct XenFB *xenfb)
> > {
> > - uint32_t prod, cons, out_cons;
> > + uint32_t prod, cons;
> > struct xenfb_page *page = xenfb->c.page;
> >
> > prod = page->out_prod;
> > - out_cons = page->out_cons;
> > - if (prod - out_cons > XENFB_OUT_RING_LEN) {
> > + cons = page->out_cons;
>
> You need the xen_rmb() before the first use of prod or cons.
>
Good point. I overlooked that.
The change should belong to either previous patch or a new patch though.
Wei.
> ~Andrew
>
> > + if (prod - cons > XENFB_OUT_RING_LEN) {
> > return;
> > }
> > xen_rmb(); /* ensure we see ring contents up to prod */
> > - for (cons = out_cons; cons != prod; cons++) {
> > + for ( ; cons != prod; cons++) {
> > union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
> > uint8_t type = event->type;
> > int x, y, w, h;
>
prev parent reply other threads:[~2016-04-12 10:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-12 9:57 [Qemu-devel] [PATCH 0/2] xenfb bug fix and clean up Wei Liu
2016-04-12 9:57 ` [PATCH 1/2] xenfb: use the correct condition to avoid excessive looping Wei Liu
2016-04-12 9:57 ` [Qemu-devel] " Wei Liu
2016-04-12 10:04 ` Anthony PERARD
2016-04-12 10:04 ` Anthony PERARD
2016-04-12 9:57 ` [Qemu-devel] [PATCH 2/2] xenfb: remove out_cons in xenfb_handle_events Wei Liu
2016-04-12 9:57 ` Wei Liu
2016-04-12 9:59 ` [Qemu-devel] [Xen-devel] " Andrew Cooper
2016-04-12 9:59 ` Andrew Cooper
2016-04-12 10:04 ` Wei Liu
2016-04-12 10:04 ` Wei Liu [this message]
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=20160412100458.GB18652@citrix.com \
--to=wei.liu2@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.