From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755235AbdKIXiB (ORCPT ); Thu, 9 Nov 2017 18:38:01 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:34108 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754687AbdKIXh6 (ORCPT ); Thu, 9 Nov 2017 18:37:58 -0500 Date: Thu, 9 Nov 2017 15:37:46 -0800 From: Ram Pai To: Breno Leitao Cc: mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org, corbet@lwn.net, arnd@arndb.de, linux-arch@vger.kernel.org, ebiederm@xmission.com, linux-doc@vger.kernel.org, x86@kernel.org, dave.hansen@intel.com, linux-kernel@vger.kernel.org, mhocko@kernel.org, linux-mm@kvack.org, paulus@samba.org, aneesh.kumar@linux.vnet.ibm.com, linux-kselftest@vger.kernel.org, bauerman@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org, khandual@linux.vnet.ibm.com Subject: Re: [PATCH v9 44/51] selftest/vm: powerpc implementation for generic abstraction Reply-To: Ram Pai References: <1509958663-18737-1-git-send-email-linuxram@us.ibm.com> <1509958663-18737-45-git-send-email-linuxram@us.ibm.com> <20171109184714.xs523k4cvmqghew3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171109184714.xs523k4cvmqghew3@gmail.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-GCONF: 00 x-cbid: 17110923-0008-0000-0000-000008D77422 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008040; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00943595; UDB=6.00476094; IPR=6.00723878; BA=6.00005683; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017943; XFM=3.00000015; UTC=2017-11-09 23:37:56 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17110923-0009-0000-0000-000044B2E810 Message-Id: <20171109233745.GD5546@ram.oc3035372033.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-09_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711090316 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 09, 2017 at 04:47:15PM -0200, Breno Leitao wrote: > Hi Ram, > > On Mon, Nov 06, 2017 at 12:57:36AM -0800, Ram Pai wrote: > > @@ -206,12 +209,14 @@ void signal_handler(int signum, siginfo_t *si, void *vucontext) > > > > trapno = uctxt->uc_mcontext.gregs[REG_TRAPNO]; > > ip = uctxt->uc_mcontext.gregs[REG_IP_IDX]; > > - fpregset = uctxt->uc_mcontext.fpregs; > > - fpregs = (void *)fpregset; > > Since you removed all references for fpregset now, you probably want to > remove the declaration of the variable above. fpregs is still needed. > > > @@ -219,20 +224,21 @@ void signal_handler(int signum, siginfo_t *si, void *vucontext) > > * state. We just assume that it is here. > > */ > > fpregs += 0x70; > > -#endif > > - pkey_reg_offset = pkey_reg_xstate_offset(); > > With this code, you removed all the reference for variable > pkey_reg_offset, thus, its declaration could be removed also. yes. will fix it. > > > - *(u64 *)pkey_reg_ptr = 0x00000000; > > + dprintf1("si_pkey from siginfo: %lx\n", si_pkey); > > +#if defined(__i386__) || defined(__x86_64__) /* arch */ > > + dprintf1("signal pkey_reg from xsave: %016lx\n", *pkey_reg_ptr); > > + *(u64 *)pkey_reg_ptr &= reset_bits(si_pkey, PKEY_DISABLE_ACCESS); > > +#elif __powerpc64__ > > Since the variable pkey_reg_ptr is only used for Intel code (inside > #ifdefs), you probably want to #ifdef the variable declaration also, > avoid triggering "unused variable" warning on non-Intel machines. yes. Actually it will trigger the warning on intel machines. Fixed it. Thanks Breno! RP