Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755324AbdLGNiK (ORCPT ); Thu, 7 Dec 2017 08:38:10 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:51364 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753439AbdLGNiH (ORCPT ); Thu, 7 Dec 2017 08:38:07 -0500 Date: Thu, 7 Dec 2017 13:38:13 +0000 From: Will Deacon To: "Leeder, Neil" Cc: Mark Rutland , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mark Langsdorf , Mark Salter , Jon Masters , Timur Tabi , Mark Brown Subject: Re: [PATCH] perf: qcom_l2_pmu: don't allow guest access Message-ID: <20171207133812.GG31900@arm.com> References: <1512575733-923-1-git-send-email-nleeder@codeaurora.org> <20171206161149.ezlzzcuvxbot5tio@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Content-Length: 1161 Lines: 29 On Wed, Dec 06, 2017 at 04:19:24PM -0500, Leeder, Neil wrote: > On 12/6/2017 11:11 AM, Mark Rutland wrote: > > On Wed, Dec 06, 2017 at 10:55:33AM -0500, Neil Leeder wrote: > >> Guests cannot access IMPDEF system registers, which are used > >> by this driver. Disable the driver if it's running in a guest VM. > >> > >> Signed-off-by: Neil Leeder > >> --- > >> drivers/perf/qcom_l2_pmu.c | 4 ++++ > >> 1 file changed, 4 insertions(+) > > > > I'm a little confused by this. Why is this hypervisor providing a > > QCOM8130 device to the guest that it cannot use? > > > > Could you elaborate on what's going on? > > > > While there's an argument that the guest shouldn't be loading the driver > in the first place, we can't control everyone's guest configuration or what > their hypervisor does. Ok, but why is the hypervisor advertising a device that effectively doesn't exist? Most drivers trust the firmware tables they are given, so this makes it sound like we should start annotating all drivers for devices that we don't expect to see in a guest with is_hyp_mode_available() checks. That doesn't feel quite right to me. Will