From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751335AbeAPVhY (ORCPT + 1 other); Tue, 16 Jan 2018 16:37:24 -0500 Received: from mail-pg0-f43.google.com ([74.125.83.43]:46112 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750750AbeAPVhW (ORCPT ); Tue, 16 Jan 2018 16:37:22 -0500 X-Google-Smtp-Source: ACJfBovKVOU21KONoFC4NonkUmsvhVy+AQ/BylSeyOaje4C71yFpO06MAvleM1SgDqeiKc8Kb5blhg== Date: Tue, 16 Jan 2018 13:37:46 -0800 From: Nicolin Chen To: Marc Zyngier Cc: mark.rutland@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, oleg@redhat.com, cdall@linaro.org, tbaicar@codeaurora.org, julien.thierry@arm.com, Dave.Martin@arm.com, robin.murphy@arm.com, james.morse@arm.com, ard.biesheuvel@linaro.org, xiexiuqi@huawei.com, mingo@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC v1] arm64: Handle traps from accessing CNTVCT/CNTFRQ for CONFIG_COMPAT Message-ID: <20180116213745.GA9545@Asurada-Nvidia> References: <1515645816-14063-1-git-send-email-nicoleotsuka@gmail.com> <20180116203218.GA6318@Asurada-Nvidia> <86r2qpec32.wl-marc.zyngier@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86r2qpec32.wl-marc.zyngier@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Jan 16, 2018 at 09:19:13PM +0000, Marc Zyngier wrote: > > I understand that it should take care of the condition field as > > a general instruction handler. Just for curiosity: If we confine > > the topic to read access of CNTVCT/CNTFRQ, what'd be the penalty > > by ignoring the condition field and executing it anyway? > > Do you mean, apart from severely corrupting userspace execution? > That's a rhetorical question, right? I don't quite understand the corrupting userspace execution part. What I see for a conditional CNTVCT read is more likely: if (condition) { // in this case, if (true) r1 = lower32(cntvct); r2 = higher32(cntvct); } Could you please elaborate a bit? Thank you.