From: Wei Liu Subject: Re: [PATCH v7 2/3] x86: add domctl cmd to set/get CDP code/data CBM Date: Thu, 15 Oct 2015 16:10:47 +0100 Message-ID: <20151015151046.GC32638@zion.uk.xensource.com> References: <1444726426-10567-1-git-send-email-he.chen@linux.intel.com> <1444726426-10567-3-git-send-email-he.chen@linux.intel.com> <20151015145716.GA19658@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZmkBA-0003wp-Ms for xen-devel@lists.xenproject.org; Thu, 15 Oct 2015 15:10:52 +0000 Content-Disposition: inline In-Reply-To: <20151015145716.GA19658@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, He Chen , ian.jackson@eu.citrix.com, jbeulich@suse.com, chao.p.peng@linux.intel.com, xen-devel@lists.xenproject.org, keir@xen.org List-Id: xen-devel@lists.xenproject.org On Thu, Oct 15, 2015 at 04:57:16PM +0200, Olaf Hering wrote: > On Tue, Oct 13, He Chen wrote: > > > +int psr_set_l3_cbm(struct domain *d, unsigned int socket, > > + uint64_t cbm, enum cbm_type type) > > { > > > + uint64_t cbm_data, cbm_code; > > > + switch ( type ) > > { > > > + case PSR_CBM_TYPE_L3: > > + cbm_code = cbm; > > + break; > > > + case PSR_CBM_TYPE_L3_CODE: > > + cbm_code = cbm; > > + break; > > > + case PSR_CBM_TYPE_L3_DATA: > > + cbm_code = map[old_cos].code; > > + break; > > + > > + default: > > + ASSERT_UNREACHABLE(); > > > + cos = find_cos(map, cos_max, cbm_code, cbm_data, cdp_enabled); > > gcc5 does not like ASSERT_UNREACHABLE(), whatever is in staging fails: > > [ 2144s] psr.c: In function 'psr_set_l3_cbm': > [ 2144s] psr.c:381:25: error: 'cbm_code' may be used uninitialized in this function [-Werror=maybe-uninitialized] > [ 2144s] struct cos_cbm_info info = > [ 2144s] ^ > [ 2144s] psr.c:442:24: note: 'cbm_code' was declared here > [ 2144s] uint64_t cbm_data, cbm_code; > [ 2144s] ^ > [ 2144s] psr.c:513:27: error: 'cbm_data' may be used uninitialized in this function [-Werror=maybe-uninitialized] > [ 2144s] map[cos].data = cbm_data; > [ 2144s] ^ > [ 2145s] cc1: all warnings being treated as errors > [ 2145s] /home/abuild/rpmbuild/BUILD/xen-4.7.31795/non-dbg/xen/Rules.mk:174: recipe for target 'psr.o' failed > [ 2145s] make[4]: *** [psr.o] Error 1 > Is it because in non-debug build ASSERT_UNREACHABLE is nop? > Havent checked if there is already a fix in-flight. > > Olaf