Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp936513lqo; Wed, 8 May 2024 22:43:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX2raXfsAu7V9rzwD10CRUlpJ2mtLkxfv7o7IUyGEZ6f60lkQs7nezPg0fwwIfUGAbCUaWkxmj8oSsG1vFZF8IU3z8bEeRNFkie+ifIqQ== X-Google-Smtp-Source: AGHT+IEE8JlFqYxQ6RwshA24jTDv9MIqawp3d8TclCEr+qGF5LMJ0PiaZDowFE9Y2j2Q4HXT5KOY X-Received: by 2002:a50:cd08:0:b0:56e:2b0b:58 with SMTP id 4fb4d7f45d1cf-5731d9d2955mr2972160a12.10.1715233383764; Wed, 08 May 2024 22:43:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715233383; cv=pass; d=google.com; s=arc-20160816; b=ePHqfmCveC7pxcDa47zLOWvehCQlPz0Z54OvPA8DNyjGCKdvOsz0oV5dos6yEkj82L LMeaG4Vu0rJIFfbH3ohfiL0zakzy2lNceI8xK5Yo7EhmGwq6WDpiqAtplJMjfN2MavoP zwqd+K/uEf4pePPrc4jAazjogZO7xx0PvQGR5v/13MfGVYZwrlBAl6lIKcBeJZmZCNjG JdO9WnN9k9M/WQIcw++bJnvd/Ie2TRLKEri3Zfq87ImjJHwguz03y3kR6xsvTLJ0bzLg m4n43cdo13YcEvpm+BA0dlh2UnnZjesxYCL76l7wxzK+eSl0ReCXJWGdXUh9Ecl8C+53 qw+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=YPVPOugjACikRDkDRBDlmRlOvI7PSTQC76vgEtwmocw=; fh=5AyT5D2MMfHv8BGxNEMFwYLdQmK16IUmGwdrwnycGfc=; b=mPutp8bz/3lXvlj1G6WW964IZ6dm1Gj3D8gpov+i/wV/dkH1XEHcAm5CLHTVlnpg0L kBSuzlQTdKKNNHxUDZgv/z9SmKEKDkme/PPLT0aDqbkonivKj6x3uZZ6jlRxjcdAxUk1 HvL+2BOt1N9QenkPjBOTy8NbUDiu9Wk3EY83aqaTnW5t/Xn1sxY3f/4Xs3KCTG3BHIG4 gLpH5miWKX/kUOx01Eby/XYz9gyNmsKu4O/BKL5TLCXiQ0b4gqWwPXME+nJJbRXjcrT3 lyaU6cBWbPlxOz8g40l/fXUpOR/mnt2cYbeQthACwZqw/v+jGvlCYRX90WiOXehR41XI It/Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YsREM3FC; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-174170-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174170-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733beac6c4si398687a12.107.2024.05.08.22.43.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 22:43:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174170-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; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YsREM3FC; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-174170-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174170-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 7F17E1F23F12 for ; Thu, 9 May 2024 05:43:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD06B1494C2; Thu, 9 May 2024 05:42:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YsREM3FC" Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B85B148FF9; Thu, 9 May 2024 05:42:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715233375; cv=none; b=FdK+5qupopeDaJECZR+Ojr62Q5BvaUkwvAS1s3rh6OyeMLql5A8Ii0mn291kz+Z9bh/92WYsB+RNeO4sVXBK/fE3H8v0wiL2R0FDgZV/aloPr9XMZfckzI6io/Q0rpPBGGg9KQ74Vd3vi3FXuIDhNZRsuAGtUwpjV8FRfnVlP2U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715233375; c=relaxed/simple; bh=K6sEhlFSI+vssE8QH3XGgfU71DAVwiWBzjwkLw8plMQ=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=P4RnPx0DNCmEvnH8QcJ3X36XCQF9mWxr9DUUQ+Ic0NPAB6iMi3dsNezWlK+lolJN/5p/CZZ9EFeE51qmE3H/eEPtYDlc6+r8mnC+ZJz41rWAiOsECHjj2qvt+0Q2Hnpa2iGrYNBpCdHXc256XMKxeLENB1LuiQ86LZRI1kIOqEY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YsREM3FC; arc=none smtp.client-ip=209.85.166.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-7e1803a4290so23246239f.2; Wed, 08 May 2024 22:42:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715233374; x=1715838174; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YPVPOugjACikRDkDRBDlmRlOvI7PSTQC76vgEtwmocw=; b=YsREM3FCJYksmdcZDZw3vA/EFmtrcCt/jJISQDU8c2bJ5R6GGZp9xgZzosiKzt2oob oloQGyC5T8kYMxZexJd41V1KOPzJFdo2FB3ktV+qfFBpQ6UEyLZpEKiT/8c9E5FfWcOs 0jmWLIMhQymgJmQ1GCIfBfN09yb0QmliucUSwLvMCmmIk2HAfXRLczBaS7SPWWoSjCrq kvW2dYtznsnQhnzT71swtSs0k2ChoSV6WkOrgY45eRl6lMuCkog9HLaeXpMuY7uGmU/b ovx+oOuKW9vQ3axyj8ZzxFz+fh8CYgHCve/ElSMRQVihlWmcJpGlPE3TG+xr9IxIxsmW TwrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715233374; x=1715838174; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=YPVPOugjACikRDkDRBDlmRlOvI7PSTQC76vgEtwmocw=; b=EBQKMWeJ9T+wteZMmTG0g8k194V4SxO2GeqpnXnqXzP2vdTKsg+7m7rI/W9oPOM95k rbcuLn0GbsV/WSFk8VTWaFX63y0q8mgU47onI9j94id+j9OTMOVBmHH/+Y178btfxDzj sGSMc1dc8HPxmCLQZpG7W0PNkj01Pn12IgZiohgYccUlFt1JZj1jruFlwWbGFxLs1grL rfxCuap5lzlDkszdu1LqYH5e5ccUXAJVEsvXvzbjXSkr+BzDAUGaO2mU/6sBIbBa/tPE XU3H3Cre/HwHWey4kUMP0CQ/UFCn+wUPz3EoZGsMzk+BqxFQmsb1QtT4oUyvaTVn3YpG 2hmg== X-Forwarded-Encrypted: i=1; AJvYcCWu8cLTKfyAP8nbyQcBN7Idpn93rtF2vHzkP8QwZjkYLA7IufGiC2qfiBJYmuA2I7b2xjOptl2AIseEjRZUZygQ6tAs+SKum+2dEfYHTmj5wH/7fpx6zLAbPfIHVoIknqZC X-Gm-Message-State: AOJu0Yzr+91SmFCnz904kG9pv588N4acJwigO2KQlTErK04E5GDxPvES HFyz2r94G1HaTSPR01Znl+LEKCT3/5KJHz3/D3ya8AWcuA6fhgDUobiwLA== X-Received: by 2002:a05:6e02:160e:b0:36c:51c0:555e with SMTP id e9e14a558f8ab-36caecd6ea3mr54883395ab.5.1715233373672; Wed, 08 May 2024 22:42:53 -0700 (PDT) Received: from localhost (220-245-239-57.tpgi.com.au. [220.245.239.57]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-6340c99be0esm495803a12.45.2024.05.08.22.42.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 May 2024 22:42:53 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 09 May 2024 15:42:46 +1000 Message-Id: Cc: , , , "Vaibhav Jain" Subject: Re: [PATCH v6] arch/powerpc/kvm: Add support for reading VPA counters for pseries guests From: "Nicholas Piggin" To: "Michael Ellerman" , "Gautam Menghani" , , X-Mailer: aerc 0.17.0 References: <20240506145605.73794-1-gautam@linux.ibm.com> <87o79gmqek.fsf@mail.lhotse> In-Reply-To: <87o79gmqek.fsf@mail.lhotse> On Wed May 8, 2024 at 10:36 PM AEST, Michael Ellerman wrote: > Gautam Menghani writes: > > PAPR hypervisor has introduced three new counters in the VPA area of > > LPAR CPUs for KVM L2 guest (see [1] for terminology) observability - 2 > > for context switches from host to guest and vice versa, and 1 counter > > for getting the total time spent inside the KVM guest. Add a tracepoint > > that enables reading the counters for use by ftrace/perf. Note that thi= s > > tracepoint is only available for nestedv2 API (i.e, KVM on PowerVM). > ... > > diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.= c > > index 8e86eb577eb8..ed69ad58bd02 100644 > > --- a/arch/powerpc/kvm/book3s_hv.c > > +++ b/arch/powerpc/kvm/book3s_hv.c > > @@ -4108,6 +4108,54 @@ static void vcpu_vpa_increment_dispatch(struct k= vm_vcpu *vcpu) > > } > > } > > =20 > > +static inline int kvmhv_get_l2_counters_status(void) > > +{ > > + return get_lppaca()->l2_counters_enable; > > +} > > This is breaking the powernv build: [...] All the nested KVM code should really go under CONFIG_PSERIES. Possibly even moved out to its own file. For now maybe you could just ifdef these few functions and replace with noop variants for !PSERIES. Thanks, Nick