From nobody Mon Feb 9 14:50:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1611265992; cv=none; d=zohomail.com; s=zohoarc; b=Y4OMaym4Kusm5p3zcBp2bxyaDur4PLBAfPjFhdecuxpAyKrx2AH/CpyvvNQSrEtg3Kldkbims3qc8645KhpsIOGZAAuoorcCI57mHxhGzhyI8uhc/fR6SmCv6+kTBZZCrCOnja0RTahM0BEXj311lAg12XmPN+U9rkSXi8cRgwA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611265992; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VYNwtMJB2OKgPYmg2SPVWwwfCjNngrBGRYuRUGwtPQE=; b=CYXrwiPhAFlk8J6WtlYPY1hdalGaVSAPSeuoDCN3o0hOM77OgT0vqy8cdwHLeGc1GX567D0U58juxGJymTspRuhDO4Sa0RBt4VWynAIJbyDHuPdLsvO2tue4Mmc8Z2+ZWKTiaowVVKlRZMG2bdnlx2FJdS4diAiwsgKIOOREmOc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1611265992418895.3451200127802; Thu, 21 Jan 2021 13:53:12 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.72475.130511 (Exim 4.92) (envelope-from ) id 1l2hsa-0000i6-Rv; Thu, 21 Jan 2021 21:52:36 +0000 Received: by outflank-mailman (output) from mailman id 72475.130511; Thu, 21 Jan 2021 21:52:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l2hsa-0000hz-Ou; Thu, 21 Jan 2021 21:52:36 +0000 Received: by outflank-mailman (input) for mailman id 72475; Thu, 21 Jan 2021 21:52:35 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l2hsZ-0000hu-9L for xen-devel@lists.xenproject.org; Thu, 21 Jan 2021 21:52:35 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 90c8481c-d379-4e99-bb30-9231fc32ec76; Thu, 21 Jan 2021 21:52:34 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 90c8481c-d379-4e99-bb30-9231fc32ec76 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1611265954; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zH10SOrS7TRCmlRhWyG1y7Y9O10ncjn3XWV3SJVhL6Y=; b=gga2V/WHyJ063ht6vuo3T+EliWp00GLnNHYHpphtKa2O2DYoMCCJI/3m xQ11VnurqXaZzHooEIEbQUP4AN3UprucBMyi/1adNbxyncjQ/YR3l2fP6 oj4WZNF065Txt/Kkiz9XJkpzKXUaG2JytecZPmTh7WXebRNJ3+65rY6ug M=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: Z5eoCsesdA5J0UFxtp/KuY8s6qAAYZrfcrxD/3PJKeCdae9f9Q5cx4sOQDRyplc9S/5Rx5tyNk FcXLVipkwbPT7CMTgSM7YnTEz8EzkaY1cZoO5MsHF7PFOnlQ8HlCdWS83L6sgAmAZTwLFAWkZE zqt7oOHH5k07/khV9Yjt/n4Ag9jVytHirgZbsK9cfKgKMQ6TS9SJOWkM1fBJ58NGM30SP+P24n PvRG7euZrF08Z5XvVF4hSMRkKYc/fV/XK+l6G3s6dH5tkYvW5/8uAZ2f7CvRGWG4Y2wOOQ+/bf Vqo= X-SBRS: 5.1 X-MesageID: 36915711 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.79,365,1602561600"; d="scan'208";a="36915711" From: Andrew Cooper To: Xen-devel CC: Tamas K Lengyel , Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Jun Nakajima , Kevin Tian , =?UTF-8?q?Micha=C5=82=20Leszczy=C5=84ski?= , Tamas K Lengyel Subject: [PATCH v7 10/10] x86/vm_event: Carry Processor Trace buffer offset in vm_event Date: Thu, 21 Jan 2021 21:27:18 +0000 Message-ID: <20210121212718.2441-11-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210121212718.2441-1-andrew.cooper3@citrix.com> References: <20210121212718.2441-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) From: Tamas K Lengyel Add pt_offset field to x86 regs in vm_event. Initialized to ~0 if PT is not in use. Signed-off-by: Tamas K Lengyel Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu CC: Jun Nakajima CC: Kevin Tian CC: Micha=C5=82 Leszczy=C5=84ski CC: Tamas K Lengyel v7: * New --- xen/arch/x86/vm_event.c | 3 +++ xen/include/public/vm_event.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/xen/arch/x86/vm_event.c b/xen/arch/x86/vm_event.c index 848d69c1b0..09dfc0924e 100644 --- a/xen/arch/x86/vm_event.c +++ b/xen/arch/x86/vm_event.c @@ -251,6 +251,9 @@ void vm_event_fill_regs(vm_event_request_t *req) =20 req->data.regs.x86.shadow_gs =3D ctxt.shadow_gs; req->data.regs.x86.dr6 =3D ctxt.dr6; + + if ( hvm_vmtrace_output_position(curr, &req->data.regs.x86.pt_offset) = !=3D 1 ) + req->data.regs.x86.pt_offset =3D ~0; #endif } =20 diff --git a/xen/include/public/vm_event.h b/xen/include/public/vm_event.h index 141ea024a3..57f34bf902 100644 --- a/xen/include/public/vm_event.h +++ b/xen/include/public/vm_event.h @@ -223,6 +223,12 @@ struct vm_event_regs_x86 { */ uint64_t npt_base; =20 + /* + * Current offset in the Processor Trace buffer. For Intel Processor T= race + * this is MSR_RTIT_OUTPUT_MASK. Set to ~0 if no Processor Trace is ac= tive. + */ + uint64_t pt_offset; + uint32_t cs_base; uint32_t ss_base; uint32_t ds_base; --=20 2.11.0