Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2385820rdb; Mon, 5 Feb 2024 05:12:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8DPtgWGWMEhLcERsRicjGhiDp+RdiyNFxV40FSJ40WnPbDgNZBfuWyCBHRH6edWNiPrK6 X-Received: by 2002:a17:907:6d1d:b0:a37:9603:347f with SMTP id sa29-20020a1709076d1d00b00a379603347fmr4031184ejc.23.1707138746040; Mon, 05 Feb 2024 05:12:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707138746; cv=pass; d=google.com; s=arc-20160816; b=KEHMa7VHZrRVq++u1zrDTyTmllspk3LKHLzIR8b0B3/zbT5fn1lXaJiGQ8XUugkLbw EYbqpJGh6aIh49Bm2djof7FAJG01oJ9PRhYpgTnylNqAqs95tiZvv8QAVgIDk9Ral6hx YQRZF18m1eKpdolQeGrtqCm4A/guaXO7tlhJ3OloZnQp3uUfvLYXgcZoJfX0TNHGQq03 7Pr+rKeuHo/5wT+vgUqG3tAJ2xUvV9tvpaZIxuVTNN7fUCYgLL7QGB17DVrI7ulYma9o ix7FlWpGmlreL2vCrVO0Hr1gilF3QVjTZxt/IJ74NTWHlnVhttI6dVPen8aoeCx0bgQH v/Ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=kjDbYJsA64v+kSKvUvgWTs/MwMgC5uCGKzp4l4kiFPQ=; fh=u1AeGLbZW6bMQc/FI1SaszSglX6IMw1mmcM/BiVkw64=; b=PxIockJ2xa3MJECGzMrLkMudKIRNGDjr5MRYbR4HwknG78JY+NYg9gkBROqKcjV6HD 5On9Ip+y1r+JkfcPPcBkE6erMBIqu3nSB4Blh9DnR0arJgfiB+j6rE+qGYnMwlsQ04GJ 2rBP8i9ouEdyiFf/ZiOMdXvKZVkbvQkv15YK7rP37XjurNN+dfXjgOXdWZ7Kb6y3fYwm 5RVNISG3WMRFsv9cTWAHQeZvre79BT5DWM7jK2tVSzgD5m9T4bLQmW/iHvLlxgbNqHWH F/SIWtxbPD4zbxU/z0JuunDWlFp7W+d9w3E/zUBOePoFKXQy5eTQ+j9jXIX/f7MlTPBk lDDQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=d5OTMkxI; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-52679-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52679-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=1; AJvYcCWdz6O+CXvnhU5Ie7lVT0j/e9/yFHKcFnDgXCZhl2xQjQwuzcKBCswXtEqCdg52Ry5UtBe/xHGR6e0Xj9KOSOPlDkPJurHIKpQF2iGwiQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n21-20020a170906379500b00a37ec5f5016si288814ejc.638.2024.02.05.05.12.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 05:12:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52679-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=d5OTMkxI; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-52679-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52679-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 72FB21F28AD3 for ; Mon, 5 Feb 2024 13:05:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AFFB21BDD3; Mon, 5 Feb 2024 13:05:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="d5OTMkxI" Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 540B21CA9F for ; Mon, 5 Feb 2024 13:04:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707138299; cv=none; b=Dbt6zapHSW5QgRCcjMVaWwX7HdglR41S/qS8F3W3oFUUkiS1ILLTrCxw6LMk/H8HOq4DkkRuDnIrklMrS/qnptwmunSPPmcsxkGGE5xSBhaxXVX7r1wL2DZK9N4vOiSxTyw2IwZez3vPLSN+Urzc6qhLZ7daGj937sAvkY7zuVI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707138299; c=relaxed/simple; bh=6R73Y1eL+XW9/5GN5zqnbfIAD02pmTNPIsXX1PzbkQc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LZBGfVnoj4z5KDdh8wNTnCNLuIy6b33w6POyc0Ql5pGVpK2hdacNo4pDOl9/y9TAiWU4lo6x23feyGJsghBEU2IoR2GoEZp/C+QXd9rkPAqbKjmo6agxfvBxn8p4L5peBt5PAeWvjyYs4L9yyUJj2XY33A+7VJx+Nc5wW8I0LTQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=d5OTMkxI; arc=none smtp.client-ip=95.215.58.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Mon, 5 Feb 2024 13:04:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707138294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kjDbYJsA64v+kSKvUvgWTs/MwMgC5uCGKzp4l4kiFPQ=; b=d5OTMkxIJ0g6UM3z7bHVp+C0KObAXlBjbpjAGtUI0R/TQZptwEcQ3TPCtL7tWTrDSzMYAy OEIqo5T0Z0ZpuQ3X9or70pTazC4A7W2D8fH7WO3AfkMisgfErJgHNcefcgqSjmBGDZqsr1 QsiPxQfd2K9662ohcknZ8OQ8jJl523k= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: James Clark Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, broonie@kernel.org, maz@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 Subject: Re: [PATCH v4 2/7] arm64: KVM: Use shared area to pass PMU event state to hypervisor Message-ID: References: <20240104162714.1062610-1-james.clark@arm.com> <20240104162714.1062610-3-james.clark@arm.com> <8a908ee8-620a-d9c2-734b-5a6402950072@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8a908ee8-620a-d9c2-734b-5a6402950072@arm.com> X-Migadu-Flow: FLOW_OUT On Mon, Feb 05, 2024 at 12:16:53PM +0000, James Clark wrote: > > This now allows the host to program event counters for a protected > > guest. That _might_ be a useful feature behind some debug option, but is > > most definitely *not* something we want to do for pVMs generally. > > Unless I'm missing something, using PMUs on protected guests was added > by 722625c6f4c5b ("KVM: arm64: Reenable pmu in Protected Mode"). This > change is just a refactor that will allow us to add the same behavior > for a similar feature (tracing) without adding yet another copy of some > state before the guest switch. Ha, I had forgotten about that patch (and I had reviewed it!) My interpretation of the intent for that change was to enable the usage of vPMU for non-protected VMs. The situation has changed since then, as we use the shadow state for vCPUs unconditionally in protected mode as of commit be66e67f1750 ("KVM: arm64: Use the pKVM hyp vCPU structure in handle___kvm_vcpu_run()") Protected mode is well understood at this point to be a WIP feature, and that not all things are expected to work with it. Eventually we will need a way to distinguish between 'normal' VMs and true pVMs (i.e. the VMM selected full isolation) in nVHE, but right now what we have enables testing of some isolation features. > > I'm perfectly happy leaving these sorts of features broken for pKVM and > > using the 'normal' way of getting percpu data to the nVHE hypervisor > > otherwise. > > > > I can do that. But do I also disable PMU at the same time in a new > commit? Now that both PMU and tracing is working maybe it would be a > waste to throw that away and hiding it behind an option is better. Or I > can leave the PMU as it is and just keep tracing disabled in pKVM. > > I don't mind either way, my main goal was to get exclude/include guest > tracing working for normal VMs. For pKVM I don't have a strong opinion. 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. -- Thanks, Oliver