Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2435397rdb; Mon, 5 Feb 2024 06:37:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEg+4Sgn2E0CNBXaYGoTB5heonro2tMjqBejqwAd+mQbuFPUY6mJBNouDo9vpcD/5HafoRC X-Received: by 2002:a05:6402:1847:b0:560:3a3:0 with SMTP id v7-20020a056402184700b0056003a30000mr5539402edy.30.1707143846770; Mon, 05 Feb 2024 06:37:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707143846; cv=pass; d=google.com; s=arc-20160816; b=fUBIu1hiAAXJ2O4VOlolmucxsA27Ch6iDUvIq8cGvmf9kg+51ok+FT+9ILmUN1Xxto a9+htIwsMYMu+qHm7wp7LsYA4wUrOCsyGZsEaXJgg2uMzm+625yt21CTPRY9pmTEWiSk gDZcS2JQ/2wY8/I9zIHzz2glE+SAA+YJLKvcM7udocsNcRKmKNfw//X5UimDjzrEHacX BsXJbDsHaO7X52eoskm+5k7tE9MLvGIH0bOVxL301X3JHgMYMwAKntb9pf5/VlWqMTNB J7Ly1Gl3p9NqPXGcN84Rfvh4G3QzYhPaMa/qyhGi4gSZBBpwpxLgm9wHTcwsMCs+ahvP Nn7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=Ag7DrRqf3FMbn0dESEurPMeC/385L2L93Qiv4nvsCy0=; fh=3X0gTkxw8FnoIitg8mFr9ljiF5IGUAeUPK/xDHtjVrk=; b=VC4nsUqZHjeDEf1nlQNLJcgaCzlnzCVVZJTfae6n6mJw2fKnh1siItx5SVkG5gtlB2 J/FEMq1YmPoTxwTZaSLsg+FIpg1PeKgkxh0Yu/XYW8PfKVuGHLL3xMnLz+tL+pjb2A5z oTpZUjPBOx+lI2LmGZsRNW40wG3JAhZY0tgZrlZsgQmc3Ge4EOqeAER/iJ0HEx939CDo +kMZwpSd1KzQXyV1AGjznd9BzfR1KEm7s0Sr72y4ilp2Gx+kIXZR+kvf9tWXBo5NVa6S F1RDbyHNsmJsUYhQxDkCgVBTV9vkOH9MwkHCN15ZxEWYx/WiSFJdoC8prqe3nzfbOH6a 8WUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-52803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=1; AJvYcCVuTPQQZ95lejVVgeHhLnpqqRNtjEANPnJ+opINMSBjgOpjx4NkaC39p/Gq8EUeFquG60HFJ5utzZ9M0zKx3VPP2Hbhc0n6pF+yJlwMNA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j12-20020a50ed0c000000b0055a4e60f287si3797023eds.495.2024.02.05.06.37.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 06:37:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-52803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2F3551F26EF0 for ; Mon, 5 Feb 2024 14:17:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5874B2C69D; Mon, 5 Feb 2024 14:17:18 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 07C402C688 for ; Mon, 5 Feb 2024 14:17:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707142637; cv=none; b=heWA2oVnnyiKKlOxfFNWQNa1sW7E2IEYNf8jLnq95I11XCGxVlJKngRs53FCLIKQumnsbW4RgiRjv+vOmN5m+1/1UhQyLvQZgn7nkDKebCrxzpdwNqW+Cy1LYB8a0YnQdIW0H8RNGg+ozGHTD3B64YYFI43HvdABZO4XBdACC5o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707142637; c=relaxed/simple; bh=nQTYnKbRzQLSB3AQO/WmD1zqTLESyqxm1/7PWB3Kn6M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ebLSvxj+QC0z4YBucubfNg1fMuldvN/IIE6Gyns+/wU5Eh8vzPzJp1aawx2DOg2KCIkuoqAxewaNjGuDdcmtAUEJxX+pxSAmsHaYS86VEK6Q7wLxTmTnzXt7mw1+nC1aq5m/gyH0TvSzo5xJoU1pDFcyd9BrkfbGP2UcN1YAjW0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ECF051FB; Mon, 5 Feb 2024 06:17:57 -0800 (PST) Received: from [192.168.1.100] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4D44B3F5A1; Mon, 5 Feb 2024 06:17:11 -0800 (PST) Message-ID: Date: Mon, 5 Feb 2024 14:17:10 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v4 2/7] arm64: KVM: Use shared area to pass PMU event state to hypervisor Content-Language: en-US To: Oliver Upton , Marc Zyngier Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, broonie@kernel.org, suzuki.poulose@arm.com, acme@kernel.org, James Morse , Zenghui Yu , Catalin Marinas , Will Deacon , Mike Leach , Leo Yan , Alexander Shishkin , Anshuman Khandual , Rob Herring , Miguel Luis , Jintack Lim , Ard Biesheuvel , Mark Rutland , Arnd Bergmann , Vincent Donnefort , Kristina Martsenko , Fuad Tabba , Joey Gouly , Akihiko Odaki , Jing Zhang , linux-kernel@vger.kernel.org References: <20240104162714.1062610-1-james.clark@arm.com> <20240104162714.1062610-3-james.clark@arm.com> <8a908ee8-620a-d9c2-734b-5a6402950072@arm.com> <867cjj6ohz.wl-maz@kernel.org> From: James Clark In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 05/02/2024 13:21, Oliver Upton wrote: > On Mon, Feb 05, 2024 at 01:15:36PM +0000, Marc Zyngier wrote: >> On Mon, 05 Feb 2024 13:04:51 +0000, >> Oliver Upton wrote: >>> >>> Unless someone has strong opinions about making this work in protected >>> mode, I am happy to see tracing support limited to the 'normal' nVHE >>> configuration. The protected feature as a whole is just baggage until >>> upstream support is completed. >> >> Limiting tracing to non-protected mode is a must IMO. Allowing tracing >> when pKVM is enabled is a sure way to expose secrets that should >> stay... secret. The only exception I can think of is when >> CONFIG_NVHE_EL2_DEBUG is enabled, at which point all bets are off. > > Zero argument there :) I left off the "and PMU" part of what I was > saying, because that was a feature that semi-worked in protected mode > before VM/VCPU shadowing support landed. > In that case I can hide all this behind CONFIG_NVHE_EL2_DEBUG for pKVM. This will also have the effect of disabling PMU again for pKVM because I moved that into this new shared area. The same place will be used to store the state for normal nVHE and at least then there is some code re-use and flexibility to use trace and PMU for debugging if needed. And the copy on every switch gets deleted.