xenfb bug fixes and cleanup
v2 cover xenfb bug fixes and cleanup
Wei Liu (3):
xenfb: use the correct condition to avoid excessive looping
xenfb: move xen_rmb to the correct location
xenfb: remove out_cons in xenfb_handle_events
hw/display/xenfb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
PATCH v2 1/3 xenfb: use the correct condition to avoid excessive looping
In commit ac0487e1 ("xenfb.c: avoid expensive loops when prod <= out_cons"), ">=" was used. In fact, a full ring is a legit state. Correct the test to use ">".
---
Cc: Stefano Stabellini <[email protected]>
Cc: Anthony Perard <[email protected]>
Backport candidate to our own tree.
--- hw/display/xenfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/xenfb.c +1 -1
@@ -775,7 +775,7 @@ static void xenfb_handle_events(struct XenFB *xenfb) prod = page->out_prod; out_cons = page->out_cons; -if (prod - out_cons >=XENFB_OUT_RING_LEN ) { +if (prod - out_cons >XENFB_OUT_RING_LEN ) {return ; }xen_rmb ();/* ensure we see ring contents up to prod */
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
PATCH v2 1/3 xenfb: use the correct condition to avoid excessive looping
In reply to Wei LiuIn commit ac0487e1 ("xenfb.c: avoid expensive loops when prod <= out_cons"), ">=" was used. In fact, a full ring is a legit state. Correct the test to use ">".
---
Cc: Stefano Stabellini <[email protected]>
Cc: Anthony Perard <[email protected]>
Backport candidate to our own tree.
--- hw/display/xenfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/xenfb.c +1 -1
@@ -775,7 +775,7 @@ static void xenfb_handle_events(struct XenFB *xenfb) prod = page->out_prod; out_cons = page->out_cons; -if (prod - out_cons >=XENFB_OUT_RING_LEN ) { +if (prod - out_cons >XENFB_OUT_RING_LEN ) {return ; }xen_rmb ();/* ensure we see ring contents up to prod */
Signature · 1 line
2.1.4
Re: [PATCH v2 1/3] xenfb: use the correct condition to avoid excessive looping
Quoted 8 lines · Wei Liu
In commit
ac0487e1("xenfb.c: avoid expensive loops when prod <=out_cons"), ">=" was used. In fact, a full ring is a legit state. Correct the test to use ">".Reported-by "Hao, Xudong" <[email protected]>Signed-off-by Wei Liu <[email protected]>Tested-by "Hao, Xudong" <[email protected]>Acked-by Anthony Perard <[email protected]>
I'll add it to my queue
Quoted 24 lines
Cc Stefano Stabellini <[email protected]>Cc Anthony Perard <[email protected]>Backport candidate to our own tree.
--- hw/display/xenfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/display/xenfb.c +1
-1@@ -775,7 +775,7 @@ static void xenfb_handle_events(struct XenFB *xenfb) prod = page->out_prod; out_cons = page->out_cons; -if (prod - out_cons >=XENFB_OUT_RING_LEN ) { +if (prod - out_cons >XENFB_OUT_RING_LEN ) {return ; }xen_rmb ();/* ensure we see ring contents up to prod */ Signature · 1 line
2.1.4
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [Qemu-devel] [PATCH v2 1/3] xenfb: use the correct condition to avoid excessive looping
In reply to Wei LiuQuoted 8 lines · Wei Liu
In commit
ac0487e1("xenfb.c: avoid expensive loops when prod <=out_cons"), ">=" was used. In fact, a full ring is a legit state. Correct the test to use ">".Reported-by "Hao, Xudong" <[email protected]>Signed-off-by Wei Liu <[email protected]>Tested-by "Hao, Xudong" <[email protected]>Acked-by Anthony Perard <[email protected]>
I'll add it to my queue
Quoted 24 lines
Cc Stefano Stabellini <[email protected]>Cc Anthony Perard <[email protected]>Backport candidate to our own tree.
--- hw/display/xenfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/display/xenfb.c +1
-1@@ -775,7 +775,7 @@ static void xenfb_handle_events(struct XenFB *xenfb) prod = page->out_prod; out_cons = page->out_cons; -if (prod - out_cons >=XENFB_OUT_RING_LEN ) { +if (prod - out_cons >XENFB_OUT_RING_LEN ) {return ; }xen_rmb ();/* ensure we see ring contents up to prod */ Signature · 1 line
2.1.4
Re: [PATCH v2 1/3] xenfb: use the correct condition to avoid excessive looping
Quoted 5 lines · Stefano Stabellini
Quoted 4 lines · Wei Liu
In commit
ac0487e1("xenfb.c: avoid expensive loops when prod <=out_cons"), ">=" was used. In fact, a full ring is a legit state. Correct the test to use ">".
Quoted 14 lines
Quoted 4 lines
Reported-by "Hao, Xudong" <[email protected]>Signed-off-by Wei Liu <[email protected]>Tested-by "Hao, Xudong" <[email protected]>Acked-by Anthony Perard <[email protected]>I'll add it to my queue
Quoted 4 lines
Cc Stefano Stabellini <[email protected]>Cc Anthony Perard <[email protected]>Backport candidate to our own tree.
Patch backported to qemu-xen.git:master.
Signature · 6 lines
Anthony PERARD _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Re: [Qemu-devel] [PATCH v2 1/3] xenfb: use the correct condition to avoid excessive looping
In reply to Stefano StabelliniQuoted 5 lines · Stefano Stabellini
Quoted 4 lines · Wei Liu
In commit
ac0487e1("xenfb.c: avoid expensive loops when prod <=out_cons"), ">=" was used. In fact, a full ring is a legit state. Correct the test to use ">".
Quoted 14 lines
Quoted 4 lines
Reported-by "Hao, Xudong" <[email protected]>Signed-off-by Wei Liu <[email protected]>Tested-by "Hao, Xudong" <[email protected]>Acked-by Anthony Perard <[email protected]>I'll add it to my queue
Quoted 4 lines
Cc Stefano Stabellini <[email protected]>Cc Anthony Perard <[email protected]>Backport candidate to our own tree.
Patch backported to qemu-xen.git:master.
Signature · 1 line
Anthony PERARD
Re: [PATCH v2 1/3] xenfb: use the correct condition to avoid excessive looping
Quoted 16 lines · Anthony PERARD
Quoted 15 lines · Stefano Stabellini
Quoted 8 lines · Wei Liu
In commit
ac0487e1("xenfb.c: avoid expensive loops when prod <=out_cons"), ">=" was used. In fact, a full ring is a legit state. Correct the test to use ">".Reported-by "Hao, Xudong" <[email protected]>Signed-off-by Wei Liu <[email protected]>Tested-by "Hao, Xudong" <[email protected]>Acked-by Anthony Perard <[email protected]>I'll add it to my queue
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Cc Stefano Stabellini <[email protected]>Cc Anthony Perard <[email protected]>Backport candidate to our own tree.
Patch backported to qemu-xen.git:master.
I think you mean staging. :-)
Wei.
Quoted 2 lines
Signature · 1 line
Anthony PERARD
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [Qemu-devel] [PATCH v2 1/3] xenfb: use the correct condition to avoid excessive looping
In reply to Anthony PERARDQuoted 16 lines · Anthony PERARD
Quoted 15 lines · Stefano Stabellini
Quoted 8 lines · Wei Liu
In commit
ac0487e1("xenfb.c: avoid expensive loops when prod <=out_cons"), ">=" was used. In fact, a full ring is a legit state. Correct the test to use ">".Reported-by "Hao, Xudong" <[email protected]>Signed-off-by Wei Liu <[email protected]>Tested-by "Hao, Xudong" <[email protected]>Acked-by Anthony Perard <[email protected]>I'll add it to my queue
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Cc Stefano Stabellini <[email protected]>Cc Anthony Perard <[email protected]>Backport candidate to our own tree.
Patch backported to qemu-xen.git:master.
I think you mean staging. :-)
Wei.
Quoted 2 lines
Signature · 1 line
Anthony PERARD
PATCH v2 2/3 xenfb: move xen_rmb to the correct location
In reply to Wei LiuIt should be placed before first time producer and consumer are used.
---
Cc: Stefano Stabellini <[email protected]>
Cc: Anthony Perard <[email protected]>
Backport candidate to our own tree.
--- hw/display/xenfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/xenfb.c +1 -1
@@ -775,10 +775,10 @@ static void xenfb_handle_events(struct XenFB *xenfb) prod = page->out_prod; out_cons = page->out_cons; +xen_rmb ();if (prod - out_cons >XENFB_OUT_RING_LEN ) {return ; } -xen_rmb ();/* ensure we see ring contents up to prod */ for (cons = out_cons; cons != prod; cons++) {union xenfb_out_event *event = &XENFB_OUT_RING_REF (page, cons);uint8_t type = event->type;
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Re: [PATCH v2 2/3] xenfb: move xen_rmb to the correct location
Quoted 1 line · Wei Liu
It should be placed before first time producer and consumer are used.
This change isn't necessary and is confusing as this is not what this barrier is for.
The barrier needs to be between the load of prod and the load of the ring contents (there's even a comment that says this). This pairs with the corresponding write barrier between the store of the ring contents and the store of prod (in the other end).
David
Quoted 18 lines
Signed-off-by Wei Liu <[email protected]>---
Cc: Stefano Stabellini <[email protected]>
Cc: Anthony Perard <[email protected]>Backport candidate to our own tree.
--- hw/display/xenfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/display/xenfb.c +0
-0@@ -775,10 +775,10 @@ static void xenfb_handle_events(struct XenFB *xenfb)
hw/display/xenfb.c static void xenfb_handle_events(struct XenFB *xenfb) · line 784
Quoted 10 lines
hw/display/xenfb.c +1
-1prod = page->out_prod; out_cons = page->out_cons; +xen_rmb ();if (prod - out_cons >XENFB_OUT_RING_LEN ) {return ; } -xen_rmb ();/* ensure we see ring contents up to prod */ for (cons = out_cons; cons != prod; cons++) {union xenfb_out_event *event = &XENFB_OUT_RING_REF (page, cons);uint8_t type = event->type;
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [Qemu-devel] [Xen-devel] [PATCH v2 2/3] xenfb: move xen_rmb to the correct location
In reply to Wei LiuQuoted 1 line · Wei Liu
It should be placed before first time producer and consumer are used.
This change isn't necessary and is confusing as this is not what this barrier is for.
The barrier needs to be between the load of prod and the load of the ring contents (there's even a comment that says this). This pairs with the corresponding write barrier between the store of the ring contents and the store of prod (in the other end).
David
Quoted 28 lines
Signed-off-by Wei Liu <[email protected]>---
Cc: Stefano Stabellini <[email protected]>
Cc: Anthony Perard <[email protected]>Backport candidate to our own tree.
--- hw/display/xenfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/display/xenfb.c +1
-1@@ -775,10 +775,10 @@ static void xenfb_handle_events(struct XenFB *xenfb) prod = page->out_prod; out_cons = page->out_cons; +xen_rmb ();if (prod - out_cons >XENFB_OUT_RING_LEN ) {return ; } -xen_rmb ();/* ensure we see ring contents up to prod */ for (cons = out_cons; cons != prod; cons++) {union xenfb_out_event *event = &XENFB_OUT_RING_REF (page, cons);uint8_t type = event->type;
Re: [PATCH v2 2/3] xenfb: move xen_rmb to the correct location
Quoted 9 lines · David Vrabel
Quoted 1 line · Wei Liu
It should be placed before first time producer and consumer are used.
This change isn't necessary and is confusing as this is not what this barrier is for.
The barrier needs to be between the load of prod and the load of the ring contents (there's even a comment that says this). This pairs with the corresponding write barrier between the store of the ring contents and the store of prod (in the other end).
Looking further, this code will compile to multiple reads of the page, because there is no ACCESS_ONCE(). This code is still vulnerable to XSA-155.
~Andrew
Quoted 19 lines
David
Quoted 16 lines
Signed-off-by Wei Liu <[email protected]>---
Cc: Stefano Stabellini <[email protected]>
Cc: Anthony Perard <[email protected]>Backport candidate to our own tree.
--- hw/display/xenfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/display/xenfb.c +0
-0@@ -775,10 +775,10 @@ static void xenfb_handle_events(struct XenFB *xenfb)
Quoted 16 lines
hw/display/xenfb.c static void xenfb_handle_events(struct XenFB *xenfb) · line 784
Quoted 11 lines
hw/display/xenfb.c +1
-1prod = page->out_prod; out_cons = page->out_cons; +xen_rmb ();if (prod - out_cons >XENFB_OUT_RING_LEN ) {return ; } -xen_rmb ();/* ensure we see ring contents up to prod */ for (cons = out_cons; cons != prod; cons++) {union xenfb_out_event *event = &XENFB_OUT_RING_REF (page, cons);uint8_t type = event->type;_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [Qemu-devel] [Xen-devel] [PATCH v2 2/3] xenfb: move xen_rmb to the correct location
In reply to David VrabelQuoted 9 lines · David Vrabel
Quoted 1 line · Wei Liu
It should be placed before first time producer and consumer are used.
This change isn't necessary and is confusing as this is not what this barrier is for.
The barrier needs to be between the load of prod and the load of the ring contents (there's even a comment that says this). This pairs with the corresponding write barrier between the store of the ring contents and the store of prod (in the other end).
Looking further, this code will compile to multiple reads of the page, because there is no ACCESS_ONCE(). This code is still vulnerable to XSA-155.
~Andrew
Quoted 35 lines
David
Quoted 17 lines
Signed-off-by Wei Liu <[email protected]>---
Cc: Stefano Stabellini <[email protected]>
Cc: Anthony Perard <[email protected]>Backport candidate to our own tree.
--- hw/display/xenfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/display/xenfb.c +0
-0@@ -775,10 +775,10 @@ static void xenfb_handle_events(struct XenFB *xenfb)hw/display/xenfb.c static void xenfb_handle_events(struct XenFB *xenfb) · line 784
Quoted 10 lines
hw/display/xenfb.c +1
-1prod = page->out_prod; out_cons = page->out_cons; +xen_rmb ();if (prod - out_cons >XENFB_OUT_RING_LEN ) {return ; } -xen_rmb ();/* ensure we see ring contents up to prod */ for (cons = out_cons; cons != prod; cons++) {union xenfb_out_event *event = &XENFB_OUT_RING_REF (page, cons);uint8_t type = event->type;_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v2 2/3] xenfb: move xen_rmb to the correct location
Quoted 6 lines · Andrew Cooper
Quoted 5 lines · David Vrabel
Quoted 1 line · Wei Liu
It should be placed before first time producer and consumer are used.
This change isn't necessary and is confusing as this is not what this barrier is for.
Quoted 9 lines
Quoted 4 lines
The barrier needs to be between the load of prod and the load of the ring contents (there's even a comment that says this). This pairs with the corresponding write barrier between the store of the ring contents and the store of prod (in the other end).
Looking further, this code will compile to multiple reads of the page, because there is no
ACCESS_ONCE(). This code is still vulnerable to XSA-155.
Oops, accidentally kicked over a can of worms. Should have just sent patch 1. :-)
Jokes aside, more time is needed to fix this properly. So maybe we should just upstream patch #1 first. Stefano? Anthony?
Wei.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [Qemu-devel] [Xen-devel] [PATCH v2 2/3] xenfb: move xen_rmb to the correct location
In reply to Andrew CooperQuoted 6 lines · Andrew Cooper
Quoted 5 lines · David Vrabel
Quoted 1 line · Wei Liu
It should be placed before first time producer and consumer are used.
This change isn't necessary and is confusing as this is not what this barrier is for.
Quoted 9 lines
Quoted 4 lines
The barrier needs to be between the load of prod and the load of the ring contents (there's even a comment that says this). This pairs with the corresponding write barrier between the store of the ring contents and the store of prod (in the other end).
Looking further, this code will compile to multiple reads of the page, because there is no
ACCESS_ONCE(). This code is still vulnerable to XSA-155.
Oops, accidentally kicked over a can of worms. Should have just sent patch 1. :-)
Jokes aside, more time is needed to fix this properly. So maybe we should just upstream patch #1 first. Stefano? Anthony?
Wei.
Re: [Qemu-devel] [Xen-devel] [PATCH v2 2/3] xenfb: move xen_rmb to the correct location
Quoted 7 lines · Wei Liu
Quoted 6 lines · Andrew Cooper
Quoted 5 lines · David Vrabel
Quoted 1 line · Wei Liu
It should be placed before first time producer and consumer are used.
This change isn't necessary and is confusing as this is not what this barrier is for.
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
The barrier needs to be between the load of prod and the load of the ring contents (there's even a comment that says this). This pairs with the corresponding write barrier between the store of the ring contents and the store of prod (in the other end).
Looking further, this code will compile to multiple reads of the page, because there is no
ACCESS_ONCE(). This code is still vulnerable to XSA-155.
There is no ACCESS_ONCE in QEMU, the closest thing to it is atomic_read.
Quoted 5 lines
Oops, accidentally kicked over a can of worms. Should have just sent patch 1. :-)
Jokes aside, more time is needed to fix this properly. So maybe we should just upstream patch #1 first. Stefano? Anthony?
Sure
Re: [PATCH v2 2/3] xenfb: move xen_rmb to the correct location
In reply to Wei LiuQuoted 7 lines · Wei Liu
Quoted 6 lines · Andrew Cooper
Quoted 5 lines · David Vrabel
Quoted 1 line · Wei Liu
It should be placed before first time producer and consumer are used.
This change isn't necessary and is confusing as this is not what this barrier is for.
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
The barrier needs to be between the load of prod and the load of the ring contents (there's even a comment that says this). This pairs with the corresponding write barrier between the store of the ring contents and the store of prod (in the other end).
Looking further, this code will compile to multiple reads of the page, because there is no
ACCESS_ONCE(). This code is still vulnerable to XSA-155.
There is no ACCESS_ONCE in QEMU, the closest thing to it is atomic_read.
Quoted 5 lines
Oops, accidentally kicked over a can of worms. Should have just sent patch 1. :-)
Jokes aside, more time is needed to fix this properly. So maybe we should just upstream patch #1 first. Stefano? Anthony?
Sure
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
PATCH v2 3/3 xenfb: remove out_cons in xenfb_handle_events
In reply to Wei LiuThe variable out_cons was only used to temporarily hold the consumer index. Use cons directly to simplify code a bit.
No functional change introduced.
---
Cc: Stefano Stabellini <[email protected]>
Cc: Anthony Perard <[email protected]>
--- hw/display/xenfb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/display/xenfb.c +4 -4
@@ -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; + cons = page->out_cons;xen_rmb (); -if (prod - out_cons >XENFB_OUT_RING_LEN ) { +if (prod - cons >XENFB_OUT_RING_LEN ) {return ; } -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;
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
PATCH v2 3/3 xenfb: remove out_cons in xenfb_handle_events
In reply to Wei LiuThe variable out_cons was only used to temporarily hold the consumer index. Use cons directly to simplify code a bit.
No functional change introduced.
---
Cc: Stefano Stabellini <[email protected]>
Cc: Anthony Perard <[email protected]>
--- hw/display/xenfb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/display/xenfb.c +4 -4
@@ -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; + cons = page->out_cons;xen_rmb (); -if (prod - out_cons >XENFB_OUT_RING_LEN ) { +if (prod - cons >XENFB_OUT_RING_LEN ) {return ; } -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;
Signature · 1 line
2.1.4
Re: [PATCH v2 3/3] xenfb: remove out_cons in xenfb_handle_events
Quoted 6 lines · Wei Liu
The variable
out_conswas 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 <[email protected]>
Except for the fact that it is based on patch #2, which is wrong, this looks OK.
Quoted 34 lines
Cc Stefano Stabellini <[email protected]>Cc Anthony Perard <[email protected]>--- hw/display/xenfb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)hw/display/xenfb.c +4
-4@@ -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; + cons = page->out_cons;xen_rmb (); -if (prod - out_cons >XENFB_OUT_RING_LEN ) { +if (prod - cons >XENFB_OUT_RING_LEN ) {return ; } -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;Signature · 1 line
2.1.4
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [Qemu-devel] [PATCH v2 3/3] xenfb: remove out_cons in xenfb_handle_events
In reply to Wei LiuQuoted 6 lines · Wei Liu
The variable
out_conswas 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 <[email protected]>
Except for the fact that it is based on patch #2, which is wrong, this looks OK.
Quoted 34 lines
Cc Stefano Stabellini <[email protected]>Cc Anthony Perard <[email protected]>--- hw/display/xenfb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)hw/display/xenfb.c +4
-4@@ -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; + cons = page->out_cons;xen_rmb (); -if (prod - out_cons >XENFB_OUT_RING_LEN ) { +if (prod - cons >XENFB_OUT_RING_LEN ) {return ; } -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;Signature · 1 line
2.1.4