From nobody Mon Feb 9 16:47:05 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1594150852; cv=none; d=zohomail.com; s=zohoarc; b=OhIMQkvPw44wFxfPNcgIgRquq8ORDp0IfmfbrTbecJAm3UPG4ncEJ/cZmkijjvabgvDKyfB2lQz79ShOBZUw7ZdylgGrLZKfaMTrYkQcaHmQoNXGFN3St8Z6o2l0Hb/f1vuTqmESTxMa3aZy9QJ3NPRhujRCBwBXEC3beB3zovo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594150852; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=uq+fQG3ACG4lbEKDM5hx3f0t/6BPEJZ+MPgpc7ISLuY=; b=NgYWnrICAeJTGiorReY7l6DvJQr/WwamqW7I7Imcxnqf4+SkyNtGA9r8pNUyPBPBNT5OvwHAcXgfo08e5uZSF0PEuwSeYbJqDqomhkF1FYoJHG2AycFtDN808+hdPtpaan+FUGDDVdC1SG6XtXj+DpiOkKZS2a9ubbaYg4RdxlQ= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1594150852633874.9727155461145; Tue, 7 Jul 2020 12:40:52 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jstSE-0007ay-OM; Tue, 07 Jul 2020 19:40:34 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jstSD-0007ao-01 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2020 19:40:33 +0000 Received: from bagnar.nask.net.pl (unknown [195.187.242.196]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b7d032be-c089-11ea-bb8b-bc764e2007e4; Tue, 07 Jul 2020 19:40:32 +0000 (UTC) Received: from bagnar.nask.net.pl (unknown [172.16.9.10]) by bagnar.nask.net.pl (Postfix) with ESMTP id 0E816A2675; Tue, 7 Jul 2020 21:40:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by bagnar.nask.net.pl (Postfix) with ESMTP id 06A92A2691; Tue, 7 Jul 2020 21:40:30 +0200 (CEST) Received: from bagnar.nask.net.pl ([127.0.0.1]) by localhost (bagnar.nask.net.pl [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id fcq4hya3Rxz7; Tue, 7 Jul 2020 21:40:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by bagnar.nask.net.pl (Postfix) with ESMTP id 8CFE0A261F; Tue, 7 Jul 2020 21:40:29 +0200 (CEST) Received: from bagnar.nask.net.pl ([127.0.0.1]) by localhost (bagnar.nask.net.pl [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id SD8nyO5q28Qn; Tue, 7 Jul 2020 21:40:29 +0200 (CEST) Received: from belindir.nask.net.pl (belindir-ext.nask.net.pl [195.187.242.210]) by bagnar.nask.net.pl (Postfix) with ESMTP id 5986AA2647; Tue, 7 Jul 2020 21:40:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by belindir.nask.net.pl (Postfix) with ESMTP id 3AE5A22383; Tue, 7 Jul 2020 21:39:59 +0200 (CEST) Received: from belindir.nask.net.pl ([127.0.0.1]) by localhost (belindir.nask.net.pl [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id kvb5TwRL8e28; Tue, 7 Jul 2020 21:39:53 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by belindir.nask.net.pl (Postfix) with ESMTP id ACE342242F; Tue, 7 Jul 2020 21:39:53 +0200 (CEST) Received: from belindir.nask.net.pl ([127.0.0.1]) by localhost (belindir.nask.net.pl [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 8p2776uf7EM3; Tue, 7 Jul 2020 21:39:53 +0200 (CEST) Received: from mq-desktop.cert.pl (unknown [195.187.238.217]) by belindir.nask.net.pl (Postfix) with ESMTPSA id 6C40922303; Tue, 7 Jul 2020 21:39:53 +0200 (CEST) X-Inumbo-ID: b7d032be-c089-11ea-bb8b-bc764e2007e4 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Virus-Scanned: amavisd-new at bagnar.nask.net.pl X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Quarantine-ID: <8p2776uf7EM3> X-Virus-Scanned: amavisd-new at belindir.nask.net.pl X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" From: =?UTF-8?q?Micha=C5=82=20Leszczy=C5=84ski?= To: xen-devel@lists.xenproject.org Subject: [PATCH v6 04/11] common: add vmtrace_pt_size domain parameter Date: Tue, 7 Jul 2020 21:39:43 +0200 Message-Id: <036bc768bfb074269d9bd4530304a11170b7142d.1594150543.git.michal.leszczynski@cert.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Stefano Stabellini , luwei.kang@intel.com, Wei Liu , Andrew Cooper , Michal Leszczynski , Ian Jackson , George Dunlap , Jan Beulich , tamas.lengyel@intel.com, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Michal Leszczynski Add vmtrace_pt_size domain parameter in live domain and vmtrace_pt_order parameter in xen_domctl_createdomain. Signed-off-by: Michal Leszczynski --- xen/arch/x86/domain.c | 6 ++++++ xen/common/domain.c | 9 +++++++++ xen/include/public/domctl.h | 1 + xen/include/xen/sched.h | 3 +++ 4 files changed, 19 insertions(+) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index fee6c3931a..b75017b28b 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -499,6 +499,12 @@ int arch_sanitise_domain_config(struct xen_domctl_crea= tedomain *config) */ config->flags |=3D XEN_DOMCTL_CDF_oos_off; =20 + if ( !hvm && config->processor_trace_buf_kb ) + { + dprintk(XENLOG_INFO, "Processor trace is not supported on non-HVM\= n"); + return -EINVAL; + } + return 0; } =20 diff --git a/xen/common/domain.c b/xen/common/domain.c index a45cf023f7..e6e8f88da1 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -338,6 +338,12 @@ static int sanitise_domain_config(struct xen_domctl_cr= eatedomain *config) return -EINVAL; } =20 + if ( config->processor_trace_buf_kb && !vmtrace_supported ) + { + dprintk(XENLOG_INFO, "Processor tracing is not supported\n"); + return -EINVAL; + } + return arch_sanitise_domain_config(config); } =20 @@ -443,6 +449,9 @@ struct domain *domain_create(domid_t domid, d->nr_pirqs =3D min(d->nr_pirqs, nr_irqs); =20 radix_tree_init(&d->pirq_tree); + + if ( config->processor_trace_buf_kb ) + d->processor_trace_buf_kb =3D config->processor_trace_buf_kb; } =20 if ( (err =3D arch_domain_create(d, config)) !=3D 0 ) diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 59bdc28c89..7681675a94 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -92,6 +92,7 @@ struct xen_domctl_createdomain { uint32_t max_evtchn_port; int32_t max_grant_frames; int32_t max_maptrack_frames; + uint32_t processor_trace_buf_kb; =20 struct xen_arch_domainconfig arch; }; diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index ac53519d7f..c046e59886 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -457,6 +457,9 @@ struct domain unsigned pbuf_idx; spinlock_t pbuf_lock; =20 + /* Used by vmtrace features */ + uint32_t processor_trace_buf_kb; + /* OProfile support. */ struct xenoprof *xenoprof; =20 --=20 2.17.1