Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4259748ybl; Sat, 21 Dec 2019 03:13:20 -0800 (PST) X-Google-Smtp-Source: APXvYqxi+R8eTKfqTNxlWO8kF/omQv60bFNQ0JhIwb1tgAUcelVEgxH6fN1v4MXFRpGsV56LnQdk X-Received: by 2002:a9d:6f8f:: with SMTP id h15mr19571698otq.1.1576926800383; Sat, 21 Dec 2019 03:13:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576926800; cv=none; d=google.com; s=arc-20160816; b=IHaHKhLs1W9stGiLgARgCkslAX0prI0+mWoc8p4Wdb87GrFIKDbEzWggX7ijeakL19 KjR6xWEQIrNQ+xHPJ2lKzDApyF+uwsUkcnMcyZusZZ1LPSLGes5kNZMQsp7aMoqLV/ig I5ihhejeUyrct/GxUQmDz713oGurH+AvkmHoLPuu7PhnHN6m0xOMslFujaRD1q4k7UYI PMkWnm7IE4BqOVgRjBMNgiZqrCsJzp44YV73bLrRkZwuMLp0Bx5Zm4Gn8zXl8AWDzSC0 39CRpJKqwFgqvWDMJrykGHpFbu/hhCnvsJYwsEr7JUBEiMU5yMOYltnEtEYRArcvP2NG 9xkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:cc:from:date:content-transfer-encoding:mime-version :subject:to; bh=LG9WmtwUFBNSYpVWr9SvU8xDWw2wH3QriqMP3NacI4c=; b=uu3fTMOVUG4Sg33CYxqrfD2TcyBasZkYpJLLAVmI6Q+4J/gjF04Bbzse8FGdZNuKJD QZMGg5P1l+N0gvYa0MpYFQO2RTyMkC89aYibjjmubsF56Dd2F/7JHl/+RtLLVIfVbf75 gcF6NkfbF3Scjb0jxLW0ahOlWcvo3KAcGsSf0vg8vHKnR83Ihg2JdH0gRi6Bms71hSAx z4XuFZLtXcq24wl2mxy7ybvCFZa1fgU5/eTPXQmJsj05cVhg8u9WDMWRbaKdyB+4U3fh iKqYhWbsU2f1nVbKsLs58QcDgX58LhFd+cFiska/1LvsOy/Zs/o6f13BWomH7iu0PMGn yKeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si7169259otq.41.2019.12.21.03.13.08; Sat, 21 Dec 2019 03:13:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726486AbfLUKsT (ORCPT + 99 others); Sat, 21 Dec 2019 05:48:19 -0500 Received: from inca-roads.misterjones.org ([213.251.177.50]:38416 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726144AbfLUKsT (ORCPT ); Sat, 21 Dec 2019 05:48:19 -0500 Received: from www-data by cheepnis.misterjones.org with local (Exim 4.80) (envelope-from ) id 1iicIy-00080I-IP; Sat, 21 Dec 2019 11:48:16 +0100 To: Andrew Murray Subject: Re: [PATCH v2 00/18] arm64: KVM: add SPE profiling support X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 21 Dec 2019 10:48:16 +0000 From: Marc Zyngier Cc: Catalin Marinas , Mark Rutland , , , Sudeep Holla , , , In-Reply-To: <20191220143025.33853-1-andrew.murray@arm.com> References: <20191220143025.33853-1-andrew.murray@arm.com> Message-ID: X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/0.7.2 X-SA-Exim-Connect-IP: X-SA-Exim-Rcpt-To: andrew.murray@arm.com, catalin.marinas@arm.com, mark.rutland@arm.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, sudeep.holla@arm.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [fixing email addresses] Hi Andrew, On 2019-12-20 14:30, Andrew Murray wrote: > This series implements support for allowing KVM guests to use the Arm > Statistical Profiling Extension (SPE). Thanks for this. In future, please Cc me and Will on email addresses we can actually read. > It has been tested on a model to ensure that both host and guest can > simultaneously use SPE with valid data. E.g. > > $ perf record -e arm_spe/ts_enable=1,pa_enable=1,pct_enable=1/ \ > dd if=/dev/zero of=/dev/null count=1000 > $ perf report --dump-raw-trace > spe_buf.txt > > As we save and restore the SPE context, the guest can access the SPE > registers directly, thus in this version of the series we remove the > trapping and emulation. > > In the previous series of this support, when KVM SPE isn't supported > (e.g. via CONFIG_KVM_ARM_SPE) we were able to return a value of 0 to > all reads of the SPE registers - as we can no longer do this there > isn't > a mechanism to prevent the guest from using SPE - thus I'm keen for > feedback on the best way of resolving this. Surely there is a way to conditionally trap SPE registers, right? You should still be able to do this if SPE is not configured for a given guest (as we do for other feature such as PtrAuth). > It appears necessary to pin the entire guest memory in order to > provide > guest SPE access - otherwise it is possible for the guest to receive > Stage-2 faults. Really? How can the guest receive a stage-2 fault? This doesn't fit what I understand of the ARMv8 exception model. Or do you mean a SPE interrupt describing a S2 fault? And this is not just pinning the memory either. You have to ensure that all S2 page tables are created ahead of SPE being able to DMA to guest memory. This may have some impacts on the THP code... I'll have a look at the actual series ASAP (but that's not very soon). Thanks, M. -- Jazz is not dead. It just smells funny...