From nobody Fri Apr 26 06:48:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1567780322; cv=none; d=zoho.com; s=zohoarc; b=A8++YUci70aXiPbbUaUaq3FfyPbB1WwtR9n33bxw4izOXHH2uFA2TmgdAa7NDtChc8p0cnCg6S8nOByr8ekagYKb0hk3ikOl+TmXwbc3SIdks/XTIvtY45ZfiTW9jO5rkrxr8njAcKzH0U0P2vMO300lsoHIcJlT7c3fTcI6/jw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567780322; 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:ARC-Authentication-Results; bh=iYMOXhj7MyH0mnA4ZVvd8QyuC4VKVfhGECj3pyy0EqU=; b=cVGSTpOhX+akHzOSMa0v0v/6MYO4SSPldpIGWB/fCDXMSvhOVetlx5pKlPnpV8gBMY2ZjowAXxCV4y+K+Qx48uKElZAPMIZUKKS1oKNTYf6V4Jo2b3yCx5NDzToojcfGtF+zhIYu/EOYb/SyKWZY40q7K2LZ7qqtgXXkb31QVqE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 1567780322361418.7373573958106; Fri, 6 Sep 2019 07:32:02 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i6FG0-0001Vw-P0; Fri, 06 Sep 2019 14:30:36 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i6FFy-0001Vr-Qb for xen-devel@lists.xenproject.org; Fri, 06 Sep 2019 14:30:34 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e2a140fe-d0b2-11e9-b299-bc764e2007e4; Fri, 06 Sep 2019 14:30:34 +0000 (UTC) X-Inumbo-ID: e2a140fe-d0b2-11e9-b299-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1567780233; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+qidJH2vUzDHkpETUJA22f+ofe7g152Kmnnxa46yTWA=; b=bK+Z9+c7qw56Tp2IiMm6DdJQvf3SFWMTNeenhWsJlGfhli5A4SmQuuqe PkqlYxkM707its7V0QcqARFS7UfW1Xs1q8KAJ53YV+H/jeiE8LwkEUjhN osA829USnAD21za8GgUWZ4I0nrzohLaMQzzl4E0zO4DPK+CqdwLUdpeLN g=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: jlYk5crpYgMU3bmMogyIAMGijpdEcMQePxWk6yadcMFs2NuO8VrT3yLhkNcha3JoOC1eRrsxTh kIJhEfNF3bIFT0Zy6OYJ01ZCn23wPqenAuY2ed4hCckJ7WsSFkG3kNzxLR5ve2vcWi3iQva64f RtQF89dg833suoqwIp807qNJ5ver6lQyO0fF7p107HFtCfWnmMAnjOIKfzT4NDYL5JcKqD2GA6 HfuYXINOwac064tyhFwIF3AFeBxffuwGKooZrrCch/Zs56hH9dsRzzobhHPD/SBkKftKMaE3/7 D2g= X-SBRS: 2.7 X-MesageID: 5516274 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.64,473,1559534400"; d="scan'208";a="5516274" From: Roger Pau Monne To: Date: Fri, 6 Sep 2019 16:30:20 +0200 Message-ID: <20190906143021.28261-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190906143021.28261-1-roger.pau@citrix.com> References: <20190906143021.28261-1-roger.pau@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 1/2] sysctl: report existing physcaps on ARM X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Paul Durrant , Jan Beulich , Volodymyr Babchuk , Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Current physcaps in XEN_SYSCTL_physinfo are only used by x86, albeit the capabilities themselves are not x86 specific. This patch adds support for also reporting the current capabilities on ARM hardware. Note that on ARM PHYSCAP_hvm is always reported, and setting PHYSCAP_directio has been moved to common code since the same logic to set it is used by x86 and ARM. Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Paul Durrant Acked-by: Jan Beulich Acked-by: Julien Grall --- Changes since v1: - New in this version. --- xen/arch/arm/sysctl.c | 5 ++++- xen/arch/x86/sysctl.c | 2 -- xen/common/sysctl.c | 2 ++ xen/include/public/sysctl.h | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/sysctl.c b/xen/arch/arm/sysctl.c index fbfdb44eff..92ac99c928 100644 --- a/xen/arch/arm/sysctl.c +++ b/xen/arch/arm/sysctl.c @@ -12,7 +12,10 @@ #include #include =20 -void arch_do_physinfo(struct xen_sysctl_physinfo *pi) { } +void arch_do_physinfo(struct xen_sysctl_physinfo *pi) +{ + pi->capabilities |=3D XEN_SYSCTL_PHYSCAP_hvm; +} =20 long arch_do_sysctl(struct xen_sysctl *sysctl, XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl) diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c index c50d910a1c..7ec6174e6b 100644 --- a/xen/arch/x86/sysctl.c +++ b/xen/arch/x86/sysctl.c @@ -163,8 +163,6 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi) pi->capabilities |=3D XEN_SYSCTL_PHYSCAP_hvm; if ( IS_ENABLED(CONFIG_PV) ) pi->capabilities |=3D XEN_SYSCTL_PHYSCAP_pv; - if ( iommu_enabled ) - pi->capabilities |=3D XEN_SYSCTL_PHYSCAP_directio; } =20 long arch_do_sysctl( diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c index fcf2d2fd7c..92b4ea0d21 100644 --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -267,6 +267,8 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_s= ysctl) pi->cpu_khz =3D cpu_khz; pi->max_mfn =3D get_upper_mfn_bound(); arch_do_physinfo(pi); + if ( iommu_enabled ) + pi->capabilities |=3D XEN_SYSCTL_PHYSCAP_directio; =20 if ( copy_to_guest(u_sysctl, op, 1) ) ret =3D -EFAULT; diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h index 91c48dcae0..36b3f8c429 100644 --- a/xen/include/public/sysctl.h +++ b/xen/include/public/sysctl.h @@ -81,13 +81,13 @@ struct xen_sysctl_tbuf_op { * Get physical information about the host machine */ /* XEN_SYSCTL_physinfo */ - /* (x86) The platform supports HVM guests. */ + /* The platform supports HVM guests. */ #define _XEN_SYSCTL_PHYSCAP_hvm 0 #define XEN_SYSCTL_PHYSCAP_hvm (1u<<_XEN_SYSCTL_PHYSCAP_hvm) - /* (x86) The platform supports PV guests. */ + /* The platform supports PV guests. */ #define _XEN_SYSCTL_PHYSCAP_pv 1 #define XEN_SYSCTL_PHYSCAP_pv (1u<<_XEN_SYSCTL_PHYSCAP_pv) - /* (x86) The platform supports direct access to I/O devices with IOMMU. */ + /* The platform supports direct access to I/O devices with IOMMU. */ #define _XEN_SYSCTL_PHYSCAP_directio 2 #define XEN_SYSCTL_PHYSCAP_directio (1u<<_XEN_SYSCTL_PHYSCAP_directio) struct xen_sysctl_physinfo { --=20 2.22.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Fri Apr 26 06:48:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1567780310; cv=none; d=zoho.com; s=zohoarc; b=PF95p3v3SIt0q1bFMc0uigDh6fuh5XieEOAtSnHsuu45kCs02I/J1WcDORiZEEvl7WVyDLzVU9Xr+n0iMSIE+fo3/MNW6JS2mZF/ugueTfCrDRXBoK4x+PMzi6BYcKwn6tFfKvNZYDt9VH4QLQsZHJB2TMJuWOQ6OJ+Dh/QbNK4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567780310; 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:ARC-Authentication-Results; bh=YSTvog5eqhKZTkRwcUb6pCvZkCH1pPOkEyU1ZlyaJ3k=; b=nzXQWim7yWacm8EfF3A9qWwVILthD3lUa6UwUUbvi11+JkRXp91Zw9Ga6cNAw4HJk7oS2p4+7RRqzUOaPxHU/kk0x4DYcjbsZyW9PLiBuatXK6jFgoHTGnW7TJhWA8JSM+OtRVFNmaG2c81wuRAF9XLdBSO9TpW23Ob+F5n7pkw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 1567780310349643.2604655588666; Fri, 6 Sep 2019 07:31:50 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i6FG9-0001Wo-5G; Fri, 06 Sep 2019 14:30:45 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i6FG7-0001Wd-Qm for xen-devel@lists.xenproject.org; Fri, 06 Sep 2019 14:30:43 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e7eb46a4-d0b2-11e9-b299-bc764e2007e4; Fri, 06 Sep 2019 14:30:43 +0000 (UTC) X-Inumbo-ID: e7eb46a4-d0b2-11e9-b299-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1567780242; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Ylv0RYKNCWlWLlE/xBicfe1vVV1JFnK3J0WIm4JCfGw=; b=I0r2XXnit5FHvLq5bFbV93ppbZiUySJ93ikotCOR2o288Nb9C1Z/zj1+ gMkl+ONXRkjG++wtKPmCssaAIp5eDaMArP2FICA3HO5Dw9ymvB1VrLMuS YsIxwriEX6Xd/3DWfmP/4Wo3GIayG1LAxEL/G9ELvzcLbD3te6Y8qJhg5 c=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: zesjd3T7R99QvmwIe9CqUYy9fFnJiC5IODoBU8UlKOczLAXStfImkmFV2TrZEPRceyGoJCk5eN 3mF7iooBcWB+M/AakvvYqJWOD+/SPj4e0BTEHP2VAOPPVeRS99OKIFRBhKWtavSyjvolZziWAC UaTkKLXIfMQ9Z8Cao2qWsr0qcAYczgl3ksr/QbBv+9WxI8Z//a4RTF/rmmh4D2t+RFY0B5TycX u5q9aQQ/NerVt9VGoQOenn2zHreBA5Qc5YpOwnDceX0caER1u3jMFI0RxZjbbFTA4gC/Mxyo0W ZEc= X-SBRS: 2.7 X-MesageID: 5516283 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.64,473,1559534400"; d="scan'208";a="5516283" From: Roger Pau Monne To: Date: Fri, 6 Sep 2019 16:30:21 +0200 Message-ID: <20190906143021.28261-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190906143021.28261-1-roger.pau@citrix.com> References: <20190906143021.28261-1-roger.pau@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 2/2] sysctl/libxl: choose a sane default for HAP X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Paul Durrant , Jan Beulich , Anthony PERARD , Volodymyr Babchuk , Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Current libxl code will always enable Hardware Assisted Paging (HAP), expecting that the hypervisor will fallback to shadow if HAP is not available. With the changes to the domain builder that's not the case any longer, and the hypervisor will raise an error if HAP is not available instead of silently falling back to shadow. In order to keep the previous functionality report whether HAP is available or not in XEN_SYSCTL_physinfo, so that the toolstack can select a sane default if there's no explicit user selection of whether HAP should be used. Note that on ARM hardware HAP capability is always reported since it's a required feature in order to run Xen. Fixes: d0c0ba7d3de ('x86/hvm/domain: remove the 'hap_enabled' flag') Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Paul Durrant Acked-by: Jan Beulich Acked-by: Ian Jackson Acked-by: Julien Grall --- Cc: Paul Durrant --- Changes since v2: - Add a LIBXL_HAVE_PHYSINFO_CAP_HAP for compatibility. Changes since v1: - Also report HAP capability for ARM. - Print hap capability in xl info. --- tools/libxl/libxl.c | 1 + tools/libxl/libxl.h | 7 +++++++ tools/libxl/libxl_create.c | 8 +++++++- tools/libxl/libxl_types.idl | 1 + tools/xl/xl_info.c | 5 +++-- xen/arch/arm/sysctl.c | 2 +- xen/arch/x86/sysctl.c | 2 ++ xen/include/public/sysctl.h | 4 ++++ 8 files changed, 26 insertions(+), 4 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index ec71574e99..5c0fcf320e 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -399,6 +399,7 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *= physinfo) physinfo->cap_pv =3D !!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_p= v); physinfo->cap_hvm_directio =3D !!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_directio); + physinfo->cap_hap =3D !!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_= hap); =20 GC_FREE; return 0; diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 9bacfb97f0..3ff67792a7 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -394,6 +394,13 @@ */ #define LIBXL_HAVE_EXTENDED_VKB 1 =20 +/* + * LIBXL_HAVE_PHYSINFO_CAP_HAP indicates that libxl_physinfo has a cap_hap + * field that indicates whether the hardware supports Hardware Assisted + * Paging. + */ +#define LIBXL_HAVE_PHYSINFO_CAP_HAP 1 + /* * libxl ABI compatibility * diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 03ce166f4f..6a556dea8f 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -38,7 +38,13 @@ int libxl__domain_create_info_setdefault(libxl__gc *gc, libxl__arch_domain_create_info_setdefault(gc, c_info); =20 if (c_info->type !=3D LIBXL_DOMAIN_TYPE_PV) { - libxl_defbool_setdefault(&c_info->hap, true); + libxl_physinfo info; + int rc =3D libxl_get_physinfo(CTX, &info); + + if (rc) + return rc; + + libxl_defbool_setdefault(&c_info->hap, info.cap_hap); libxl_defbool_setdefault(&c_info->oos, true); } =20 diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index b61399ce36..9e1f8515d3 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -1025,6 +1025,7 @@ libxl_physinfo =3D Struct("physinfo", [ ("cap_hvm", bool), ("cap_pv", bool), ("cap_hvm_directio", bool), # No longer HVM specific + ("cap_hap", bool), ], dir=3DDIR_OUT) =20 libxl_connectorinfo =3D Struct("connectorinfo", [ diff --git a/tools/xl/xl_info.c b/tools/xl/xl_info.c index 46d9c9f712..aa6724bc7f 100644 --- a/tools/xl/xl_info.c +++ b/tools/xl/xl_info.c @@ -210,11 +210,12 @@ static void output_physinfo(void) info.hw_cap[4], info.hw_cap[5], info.hw_cap[6], info.hw_cap[7] ); =20 - maybe_printf("virt_caps :%s%s%s%s\n", + maybe_printf("virt_caps :%s%s%s%s%s\n", info.cap_pv ? " pv" : "", info.cap_hvm ? " hvm" : "", info.cap_hvm && info.cap_hvm_directio ? " hvm_directio" : "", - info.cap_pv && info.cap_hvm_directio ? " pv_directio" : "" + info.cap_pv && info.cap_hvm_directio ? " pv_directio" : "", + info.cap_hap ? " hap" : "" ); =20 vinfo =3D libxl_get_version_info(ctx); diff --git a/xen/arch/arm/sysctl.c b/xen/arch/arm/sysctl.c index 92ac99c928..f87944e847 100644 --- a/xen/arch/arm/sysctl.c +++ b/xen/arch/arm/sysctl.c @@ -14,7 +14,7 @@ =20 void arch_do_physinfo(struct xen_sysctl_physinfo *pi) { - pi->capabilities |=3D XEN_SYSCTL_PHYSCAP_hvm; + pi->capabilities |=3D XEN_SYSCTL_PHYSCAP_hvm | XEN_SYSCTL_PHYSCAP_hap; } =20 long arch_do_sysctl(struct xen_sysctl *sysctl, diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c index 7ec6174e6b..5777a05ffc 100644 --- a/xen/arch/x86/sysctl.c +++ b/xen/arch/x86/sysctl.c @@ -163,6 +163,8 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi) pi->capabilities |=3D XEN_SYSCTL_PHYSCAP_hvm; if ( IS_ENABLED(CONFIG_PV) ) pi->capabilities |=3D XEN_SYSCTL_PHYSCAP_pv; + if ( hvm_hap_supported() ) + pi->capabilities |=3D XEN_SYSCTL_PHYSCAP_hap; } =20 long arch_do_sysctl( diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h index 36b3f8c429..e02d7ce4c6 100644 --- a/xen/include/public/sysctl.h +++ b/xen/include/public/sysctl.h @@ -90,6 +90,10 @@ struct xen_sysctl_tbuf_op { /* The platform supports direct access to I/O devices with IOMMU. */ #define _XEN_SYSCTL_PHYSCAP_directio 2 #define XEN_SYSCTL_PHYSCAP_directio (1u<<_XEN_SYSCTL_PHYSCAP_directio) +/* The platform supports Hardware Assisted Paging. */ +#define _XEN_SYSCTL_PHYSCAP_hap 3 +#define XEN_SYSCTL_PHYSCAP_hap (1u<<_XEN_SYSCTL_PHYSCAP_hap) + struct xen_sysctl_physinfo { uint32_t threads_per_core; uint32_t cores_per_socket; --=20 2.22.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel