Received: by 2002:ab2:7407:0:b0:1f4:b336:87c4 with SMTP id e7csp6295lqn; Thu, 11 Apr 2024 11:57:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUVmlFmoQLrHC5dohaULcV3HM1nlo3MZPj3FK7tCP5Jywe33EzLmUEjbXBBfATkIs91Sdw3VzbDwF/SiXXKUvoQMHIKuqWsuIBUFypeDg== X-Google-Smtp-Source: AGHT+IGbg8qj4uGjU1WpHAiXtYIm1eLdIwJlgj96GQl2FNPFXzetXcp56TAUkow/GW2SmxeaDa9g X-Received: by 2002:a05:620a:288f:b0:78d:7368:4152 with SMTP id j15-20020a05620a288f00b0078d73684152mr5819949qkp.38.1712861829577; Thu, 11 Apr 2024 11:57:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712861829; cv=pass; d=google.com; s=arc-20160816; b=a99amICZiIN2lFKHUho/Bb0TeIgB9/Oyu/5F7yUsTN41Qv3PQ99PVZozBilCoaLEIC IKY5nPMyH4QDmMp1upX1LnDo04x96QcGavZh53sAbMSw7YPP3vhYz4Qz/x4k9oHn3xHC 9yca7x75/VovPDtjutV9nYN3aPMU9WvexvwTcd/fTEUPJlaXHFqXk3ng8ZZaeB5R5z0E qhbAH3OL5fxLMX1/TJpiTK1eKWY2jmqFaVfu7cD9qU6HUjlOxPpyRtM8LjkfgH6ZlfH1 /XkQu3gRNXdCFr3JGq/zxcS3VXwUtOgKyV9YxFjc61MGSIZOlQVFGk2oz5ZcTasifUMC t/bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=yGEHFGSvXh0z03nigzVMI+fVkzOE9PQp+ZJSe40gsQI=; fh=aEYrr4ys14reQGD13PcOc8Xb2PbLs6IG3nxRU8DSbWU=; b=0GflH0Z06UBwnAcWH3AjmtOtticuiem8bKIN4F/71Z2j4NLVzF/k9Aox9eNCUWQZKk EAR+BiDn4jq/XZSHDHAePkKhc/y7lKpqpXBh+1vxGGhNMI1UX36QJMt5UM96KGhc2EYj 58zfXAzcb+xKpuTj8KjHnCXDfoGO8pDa69nuF46G+nbl4iqLDj6ixwhdPZ2XKTEum9HV xC34WbAOifnGikdc09keWIK0NjdK7JX1MZdLxHpldOfFhd36ZQSa2X4WGrE/Pgz1ibq0 INr1596lqPiXwZ3wRF0xHPBd0e2oPHsg3jj/9jFm7r7xDqxNiCsjU1zFGsp2NhFlbzhl hCPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="xVK/mCOi"; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-141495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c14-20020ae9e20e000000b0078d77462f41si2014068qkc.596.2024.04.11.11.57.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 11:57:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="xVK/mCOi"; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-141495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4482B1C237A3 for ; Thu, 11 Apr 2024 18:57:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52280134D1; Thu, 11 Apr 2024 18:56:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="xVK/mCOi" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 383DF610E for ; Thu, 11 Apr 2024 18:56:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712861814; cv=none; b=hh7UbVxtTzQM+vQhtQMcCwcsMYNFstSG5MVZMTZe4hu3MrB3FYYZDiPz9o8/YGhxz2Mo6WwRzik9tfOAw+TUbXbJi7/s8z9tmZOklav/dO5Wq1JqrFsBvL0ql8BFaMFxQVZ2nKpZ70uwSGAoT6iyl2mkLiOq3M5vrPCQQzD1q/A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712861814; c=relaxed/simple; bh=BkM9vYHu+qyeMmH+VUq9zveHIqjsweQCNVJmljUh4Js=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=h4XLbPio+MMnEIzmUc+6MstpI+2y8uZBdEtK/SbptBcIsDu50joZrzQLahqfzk8BXw/sTobB9A9yk48NfJ0kuTTdTTUsptFRNSfffPE+C4OeHU70asOn0g8quyOJtoQoO4MZZlAK72nAgJZEKDd2/LVXbFKGzRVAV5J6JnP1lgM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=xVK/mCOi; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-61836c921a4so1422517b3.2 for ; Thu, 11 Apr 2024 11:56:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712861812; x=1713466612; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=yGEHFGSvXh0z03nigzVMI+fVkzOE9PQp+ZJSe40gsQI=; b=xVK/mCOiA/Kb7nCukLZdG+tGFuLS+KvT/053/ZLmHykdecUeTkqS8Yd8aqADJHMszf muJHiSwPdeexhWko6Yt0f/QlM7h9FBPjfJg8RwUmDs0sj/80tKkdNEPtC/JbNvYjp5Pe B8wFm9WuhzeB5cUXtEl8Wpze1dxYr+iDq2J/MbF8eC1btz5UKHDU6d7KDySqXcEo04Dk NkO1mVQ2H/BrQSXjIR+3e9RlX1mvaFhGp2evkA9Vch1o/f5IjmmgN4YTwTWg93fAYloW m4kUQ/wQtABwm+R679sHYdplWvw5mMpKDhe4/bZGCG1h/7rD//gRkI+BIIICnhdl9IVa rX+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712861812; x=1713466612; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yGEHFGSvXh0z03nigzVMI+fVkzOE9PQp+ZJSe40gsQI=; b=CF9nd0iRRjhwJfxJmMc+RT432aF0KLE0R2VNdMUoqCW56NpVuk+36yuhaCG1cqLr9C cyQPm9EdPnljrWvt89imqeuIcRi3cgKWyyrFmO13tRKW7iBFSt4Gj5w4RyMDbdESUOb/ RAjDtsDL0ndVTIAlw5KCVfVq7MYZJJyuWCGK3ag9QsO0gCn9XrJLnYoT+6ExzlFG168S ebOiv++IkkSruvDk8eqUkxnFDgTPkOwT5R5QkWV/9KQxJlxc4Q/bpqrBnBf6WPsAgEeZ eGDlrccEAmsqq4G8scL+v/1Fj29LvyaWGhfC0hy42yQgvG4d5A2MUcZ3HbUwb69gqOQX TWcw== X-Forwarded-Encrypted: i=1; AJvYcCWYL1BXY6+K9LF96x6WoyRBvpwJ6mrbxBXayXfUbjb4/FpL/3ImiKecZuKu5kCLkqNHSfkzq+fpddmvK9eBlITKpX8mfTx3cPjFNdMr X-Gm-Message-State: AOJu0YwyaqDKcHdvrybcpDIUm5b23D+up5AdaMhHO9v99eVSbk9wdaHp ZmWg1q2lQ5f6S27XAqKNiKZEO2nqgfZBuiEwNmbq5CQF+s/XDOAYfwHZvtiH9eXcArM9p9z10Je YZg== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:91d4:0:b0:615:32e1:d82c with SMTP id i203-20020a8191d4000000b0061532e1d82cmr67605ywg.6.1712861812259; Thu, 11 Apr 2024 11:56:52 -0700 (PDT) Date: Thu, 11 Apr 2024 11:56:50 -0700 In-Reply-To: <20240126085444.324918-4-xiong.y.zhang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240126085444.324918-1-xiong.y.zhang@linux.intel.com> <20240126085444.324918-4-xiong.y.zhang@linux.intel.com> Message-ID: Subject: Re: [RFC PATCH 03/41] perf: Set exclude_guest onto nmi_watchdog From: Sean Christopherson To: Xiong Zhang Cc: pbonzini@redhat.com, peterz@infradead.org, mizhang@google.com, kan.liang@intel.com, zhenyuw@linux.intel.com, dapeng1.mi@linux.intel.com, jmattson@google.com, kvm@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, zhiyuan.lv@intel.com, eranian@google.com, irogers@google.com, samantha.alt@intel.com, like.xu.linux@gmail.com, chao.gao@intel.com, Xiong Zhang Content-Type: text/plain; charset="us-ascii" On Fri, Jan 26, 2024, Xiong Zhang wrote: > From: Xiong Zhang > > The perf event for NMI watchdog is per cpu pinned system wide event, > if such event doesn't have exclude_guest flag, it will be put into > error state once guest with passthrough PMU starts, this breaks > NMI watchdog function totally. > > This commit adds exclude_guest flag for this perf event, so this perf > event is stopped during VM running, but it will continue working after > VM exit. In this way the NMI watchdog can not detect hardlockups during > VM running, it still breaks NMI watchdog function a bit. But host perf > event must be stopped during VM with passthrough PMU running, current > no other reliable method can be used to replace perf event for NMI > watchdog. As mentioned in the cover letter, I think this is backwards, and mediated PMU support should be disallowed if kernel-priority things like the watchdog are in use. Doubly so because this patch affects _everything_, not just systems with VMs that have a mediated PMU. > Signed-off-by: Xiong Zhang > Signed-off-by: Mingwei Zhang > --- > kernel/watchdog_perf.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/watchdog_perf.c b/kernel/watchdog_perf.c > index 8ea00c4a24b2..c8ba656ff674 100644 > --- a/kernel/watchdog_perf.c > +++ b/kernel/watchdog_perf.c > @@ -88,6 +88,7 @@ static struct perf_event_attr wd_hw_attr = { > .size = sizeof(struct perf_event_attr), > .pinned = 1, > .disabled = 1, > + .exclude_guest = 1, > }; > > /* Callback function for perf event subsystem */ > -- > 2.34.1 >