Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP3:GA
xen.5854
xsa155-xen-0003-libvchan-Read-prod-cons-only-on...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xsa155-xen-0003-libvchan-Read-prod-cons-only-once.patch of Package xen.5854
References: bsc#957988 From ef86ad0b60fe179b1a6fa390e05c339fb44b9cc9 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Date: Fri, 20 Nov 2015 12:22:14 -0500 Subject: [PATCH] libvchan: Read prod/cons only once. We must ensure that the prod/cons are only read once and that the compiler won't try to optimize the reads. That is split the read of these in multiple instructions influencing later branch code. As such insert barriers when fetching the cons and prod index. This is part of XSA155. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- tools/libvchan/io.c | 2 ++ 1 file changed, 2 insertions(+) Index: xen-4.4.3-testing/tools/libvchan/io.c =================================================================== --- xen-4.4.3-testing.orig/tools/libvchan/io.c +++ xen-4.4.3-testing/tools/libvchan/io.c @@ -118,6 +118,7 @@ static inline int send_notify(struct lib static inline int raw_get_data_ready(struct libxenvchan *ctrl) { uint32_t ready = rd_prod(ctrl) - rd_cons(ctrl); + xen_mb(); /* Ensure 'ready' is read only once. */ if (ready >= rd_ring_size(ctrl)) /* We have no way to return errors. Locking up the ring is * better than the alternatives. */ @@ -159,6 +160,7 @@ int libxenvchan_data_ready(struct libxen static inline int raw_get_buffer_space(struct libxenvchan *ctrl) { uint32_t ready = wr_ring_size(ctrl) - (wr_prod(ctrl) - wr_cons(ctrl)); + xen_mb(); /* Ensure 'ready' is read only once. */ if (ready > wr_ring_size(ctrl)) /* We have no way to return errors. Locking up the ring is * better than the alternatives. */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor