From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932837AbcBPPMs (ORCPT ); Tue, 16 Feb 2016 10:12:48 -0500 Received: from foss.arm.com ([217.140.101.70]:53949 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932200AbcBPPMr (ORCPT ); Tue, 16 Feb 2016 10:12:47 -0500 Date: Tue, 16 Feb 2016 15:12:53 +0000 From: Will Deacon To: Jan Glauber Cc: Mark Rutland , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 5/5] arm64/perf: Extend event mask for ARMv8.1 Message-ID: <20160216151252.GG14509@arm.com> References: <20160215200404.GX6298@arm.com> <20160216080015.GA3490@hardcore> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160216080015.GA3490@hardcore> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 16, 2016 at 09:00:15AM +0100, Jan Glauber wrote: > On Mon, Feb 15, 2016 at 08:04:04PM +0000, Will Deacon wrote: > > [...] > > > On Wed, Feb 03, 2016 at 06:12:00PM +0100, Jan Glauber wrote: > > > + cpu_pmu->event_mask = 0xffff; /* ARMv8.1 extended events */ > > > + else > > > + cpu_pmu->event_mask = ARMV8_EVTYPE_EVENT; > > > > ... although can't we just update ARMV8_EVTYPE_EVENT to be 0xffff now? > > AFAICT, that just eats into bits that used to be RES0, so we shouldn't > > see any problems. That should make your patch *much* simpler! > > That would of course be easier, but I just can't assess the implications. > > Probably I'm missing something but to me it looks like the event mask is the > only verification we do for the user-space selectable events. Is it safe for > implementations that only support 0x3ff events to allow access to the > whole 0xffff range? What memory would be accessed for non-existing > events? Which memory? The worst-case is that we end up writing to some bits in a register (e.g. PMXEVTYPER) that are RES0 in ARMv8 afaict. Will