Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp183312lqh; Mon, 6 May 2024 15:56:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVt4ZDVHE+kVcE0CPuN4/KGpaUf6tyibczS8h3P4+onJg0k8bbC34+xuClijRu5fns21aahqL+YT5TqJdYkZwRpVri9jeH1m3GARP6NmQ== X-Google-Smtp-Source: AGHT+IEvl256ISu0TaXjw5z0TenO8zvpUFafinYLZxe8Ds9nbqx5XNDQeLLWsMhvjcSw1ftm7TY+ X-Received: by 2002:a17:90a:a60c:b0:2ac:513b:b316 with SMTP id c12-20020a17090aa60c00b002ac513bb316mr10895945pjq.10.1715036202073; Mon, 06 May 2024 15:56:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715036202; cv=pass; d=google.com; s=arc-20160816; b=Kw+jRVW/D3pMG9ghBdO4zmUDqAu+h9d1eF0iO3hhtxm8g+7jke82+qHQxpqk4dZyGe oNWTO51aewb9uk5vOnLlhf1xUf49+Wo2N7+GndKF3PenK2YA9vmzarYQshcVeJD2NdfQ 3S4fxcUaL39ujk1nRRTN9nbUNJ+BxfBR07/CG5V2FFRFry9i2dPEYyTm4jze4ayrgYBV GYtEGNxtTVi7mPHVoMd7aSHJ1+W0DYD3ZaVkCnUopC4i3+obYy5Rc/LKxl3/4+Htvyr4 2xXRIv/ANozcugcwOFAg2NFDkky+45DSfAQwQyzDfhY0ifilVPWGk26hgvaNI7jFXq0f tdYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=A2XtzDXeNoRq/ufPaLApKpwk+q93I7X6NJO3p9yDQPM=; fh=ZEcWXiZjjR222Z2r+piLSY1+zfZmK0fMSlPFo2iZ92Y=; b=Ruj5wYzoH4y2mRnBXCT2Z3vcp/g0HP2h9n/y/FrSQdr6Dj2lZEpLDbHltKwBciRC9a vec0h11VuWYTUEvSMzVx3Krj7IEc6VIi2pXFUqIO04zlsCS/OMiqOHxHIpgDPD4xPEGA sO+6lhDRJZ0IseYvTNwOmBrVQWFk0JJN3umvWGO8qFBHEv8QhEDFk7oTKpJA0Y/2tnBi cVeSK6umPZA0kMzV/J5qkw8U+Sa0QkTpNNaqW+XiFWlpgUU8LabkeOZC/cOWbLOERViF BBdKCbxxrTuFpCQqdENXeWNe50FBEte1Kzc3h1KM53KWfWy5Cyqz9lxYb5JrGUU79vgq avKg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=jOrSkDXt; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-170490-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170490-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oracle.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id lj10-20020a17090b344a00b002b4470d2175si6416428pjb.107.2024.05.06.15.56.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 15:56:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170490-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=jOrSkDXt; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-170490-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170490-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oracle.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B2BB0280E84 for ; Mon, 6 May 2024 22:56:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 865E315F410; Mon, 6 May 2024 22:53:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="jOrSkDXt" Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (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 CEDB715EFC7; Mon, 6 May 2024 22:53:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.165.32 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715036012; cv=none; b=KlnIPc/3Jm5Q1gkvbgbKhcRESWqSUJKXWPA6FpEo4qzRjaY07V5IVKjoR9++UWsnYwIf0zpBTNbeAaOYdmfzYfHIbjStmg+4Wa+2d26hIEMEyEGoVuedA79jhlU+mwrTJ+xKqJ4CZ7pQ2qedegSdLedj0QOzyunYfpMamJJHEOY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715036012; c=relaxed/simple; bh=t5m5X8l1lGsaDr6JkMgbUNaOOXPX6KBq64+h46gU6UQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=WVjAPzyniyXn/MpA64GHWLTSDD4qAvxbpp/rHTUGMkuWVuvwqpLQ9CWUwEaUKCEMjdnRsHjtWbcDv+CEUGsS7f9Q1U3yQHYzMjB7MrPr1xedRpzDwCy1Zj90+mL2exqcKUHfY0aG+gChOwrSB+1C08kesoCSLabYPfRZPd7cCTo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=jOrSkDXt; arc=none smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 446MqfiX031673; Mon, 6 May 2024 22:53:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2023-11-20; bh=A2XtzDXeNoRq/ufPaLApKpwk+q93I7X6NJO3p9yDQPM=; b=jOrSkDXtWEHagHReGU4sZxpnDGl+tvZdTDmZPj2oUZN5FxumD0tiPQOb9oPsmvbdPlQC GBuj/y10W/g2M/KS8IL6pl5d5NpmhA2Zi0QyEVV+MSzpK43CsvDBramfP8k7gdJL3U6l b1S9sOSS91TBvjbQvxiDHao4q8gfN9PKHmUwOkC98p6eVCuMyYBQ/KMVpZ07IY93rVww HNJUvoYHYMvQrHHcXtEaHQ0ashdK9IksEcxnZLi4BnWbOsIyXa7C9SKj5UAAs4hC1fcz /X00pAEd7nVaHR0JbMBoGKV8GntiIBh/MCGWiTt/Fb1J8a3eMM9ngu5goKXB+FcrxM/h Eg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xwdjuupqn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 06 May 2024 22:53:23 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 446LL33H027634; Mon, 6 May 2024 22:53:22 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3xwbfdg8n3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 06 May 2024 22:53:22 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 446MrMxA006764; Mon, 6 May 2024 22:53:22 GMT Received: from alaljime-dev-e4flex-vm.osdevelopmeniad.oraclevcn.com (alaljime-dev-e4flex-vm.allregionaliads.osdevelopmeniad.oraclevcn.com [100.100.249.106]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3xwbfdg8mq-1; Mon, 06 May 2024 22:53:22 +0000 From: Alejandro Jimenez To: kvm@vger.kernel.org, seanjc@google.com, vasant.hegde@amd.com Cc: pbonzini@redhat.com, linux-kernel@vger.kernel.org, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, suravee.suthikulpanit@amd.com, mlevitsk@redhat.com, alejandro.j.jimenez@oracle.com Subject: [PATCH v2 0/2] Print names of apicv inhibit reasons in traces Date: Mon, 6 May 2024 22:53:19 +0000 Message-Id: <20240506225321.3440701-1-alejandro.j.jimenez@oracle.com> X-Mailer: git-send-email 2.39.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-06_17,2024-05-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2405060166 X-Proofpoint-ORIG-GUID: UKBLgMe9FheJPimU9wUznHLP_WY0ga4n X-Proofpoint-GUID: UKBLgMe9FheJPimU9wUznHLP_WY0ga4n v2: - Use Sean's implementation/patch from v1: https://lore.kernel.org/all/ZjVQOFLXWrZvoa-Y@google.com/ - Fix typo in commit message (s/inhbit/inhibit). - Add patch renaming APICV_INHIBIT_REASON_DISABLE to APICV_INHIBIT_REASON_DISABLED. - Drop Vasant's R-b from v1 since implementation was refined, even though the general approach and behavior remains the same. v1: https://lore.kernel.org/all/20240214223554.1033154-1-alejandro.j.jimenez@oracle.com/ Tested on Genoa system. With the proposed changes, the tracepoint output looks like the following examples: qemu-system-x86-7068 [194] ..... 1397.647770: kvm_apicv_inhibit_changed: set reason=2, inhibits=0x4 ABSENT qemu-system-x86-7068 [003] ..... 1397.676703: kvm_apicv_inhibit_changed: cleared reason=2, inhibits=0x0 qemu-system-x86-7074 [247] ..... 1397.701398: kvm_apicv_inhibit_changed: cleared reason=4, inhibits=0x0 qemu-system-x86-7074 [008] ..... 1408.697413: kvm_apicv_inhibit_changed: set reason=8, inhibits=0x100 IRQWIN qemu-system-x86-7074 [008] ..... 1408.697420: kvm_apicv_inhibit_changed: cleared reason=8, inhibits=0x0 [...] qemu-system-x86-7173 [056] ..... 1570.541372: kvm_apicv_inhibit_changed: set reason=8, inhibits=0x300 IRQWIN|PIT_REINJ qemu-system-x86-7173 [056] ..... 1570.541380: kvm_apicv_inhibit_changed: cleared reason=8, inhibits=0x200 PIT_REINJ Alejandro Jimenez (2): KVM: x86: Print names of apicv inhibit reasons in traces KVM: x86: Keep consistent naming for APICv/AVIC inhibit reasons arch/x86/include/asm/kvm_host.h | 21 ++++++++++++++++++++- arch/x86/kvm/svm/svm.h | 2 +- arch/x86/kvm/trace.h | 9 +++++++-- arch/x86/kvm/vmx/main.c | 2 +- arch/x86/kvm/x86.c | 6 +++++- 5 files changed, 34 insertions(+), 6 deletions(-) base-commit: d91a9cc16417b8247213a0144a1f0fd61dc855dd -- 2.39.3