From nobody Fri Apr 26 20:03:09 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; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1570645360; cv=none; d=zoho.com; s=zohoarc; b=kjfk1dR3U+Uz1yGAdrxa611i139Lw4o7kg6Ms1GHRIzzMb5ZNMnWMx4uQBl+IhPvSXsH2GLtUpxbEBlZeeRiBzdt8bm3MQlXW2x5piV3kS97MZMItfivt1RT0MglmOEgrClG0wvQIWCwq5kW7DsZwzX7Jgm6mOzkrwGjUc+A4Ys= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570645360; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=+uDrKNTMU44isVRPCofyD7brf7ylWvGLAnhVGZWj194=; b=SjsSoOZ/FcPjMlDP23vn2tkJkQpe58Jj/rpZq4SLqWdVTyrtzRj6074d3XWm1iDEqqpI5QLCOrRGyBV10EIxOXrMZls+UiJEKj30U+6WNcU1veavXsf2KASIu5j4GSXLuENs0wMH7NXTLUDPRPKOQICgqooFjcEH1dylaeSKNk0= 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; dmarc=fail header.from= (p=none 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 1570645360809482.9622934947231; Wed, 9 Oct 2019 11:22:40 -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 1iIGaO-0004nB-Jz; Wed, 09 Oct 2019 18:21:20 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iIGaN-0004n6-01 for xen-devel@lists.xenproject.org; Wed, 09 Oct 2019 18:21:19 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 95b5d2fe-eac1-11e9-8c93-bc764e2007e4; Wed, 09 Oct 2019 18:21:17 +0000 (UTC) X-Inumbo-ID: 95b5d2fe-eac1-11e9-8c93-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1570645277; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Ldl6YHcJrVzRUQIzaQ3nEPvYcf1wT9Dp6gt6RGGOclA=; b=UaNnOFebDbp1ibJ4aoA2eJMb51tmJnb11zYxkOLWdMWyRYtafzas+BgJ lUj47P9FpRBmH0DSxqmfcdJ8h0rMmTMNf+/dSNa21GfL5RlvwglQOcytR AzpZJ8pYHzAYz6OQAH5eElAqKzxqHofWiuDTHCe0O2TfsLvGx9XLu/Z1j U=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@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 (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@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 ip4:168.245.78.127 ~all" Received-SPF: None (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 7cqhtTykc0ySA7acD+2I53JM1QLKS+70yzFNZdC0JTOmVdf6aJ+4Ay7dNQ3abRP0eJ6VSCvtbr blBuLyEFCJnB1RFwR/Pm6CsV+Eb9gQS9khwsnioFiTerrgj3bsaWcChd3pvHvK7nH5Tqu8Dwhp VHirvoJK4+/4fAxf0G1Rs011ajsVcC85u5RfXBGnE6LjLcoHl3vWNY5WGj82XA47BlnM902WEo q3NjkdBbYVfIxuJ+C3wsFOqF98uYHqpxMgil10XIv3zl8xVsKcES0uovQNQQLvset7FwASDh6J f0g= X-SBRS: 2.7 X-MesageID: 6941273 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.67,277,1566878400"; d="scan'208";a="6941273" From: Andrew Cooper To: Xen-devel Date: Wed, 9 Oct 2019 19:21:14 +0100 Message-ID: <20191009182114.9376-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/hvm: Fix the use of "hap=0" following c/s c0902a9a143a 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: Juergen Gross , Wei Liu , Paul Durrant , Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= 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) c/s c0902a9a143a refactored hvm_enable() a little, but dropped the logic wh= ich cleared hap_supported in the case that the user had asked for it off. This results in Xen booting up, claiming: (XEN) HVM: Hardware Assisted Paging (HAP) detected but disabled but with HAP advertised via sysctl, and XEN_DOMCTL_CDF_hap being accepted in domain_create(). Signed-off-by: Andrew Cooper Acked-by: Jan Beulich Reviewed-by: Paul Durrant Reviewed-by: Wei Liu --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Paul Durrant CC: Juergen Gross This is a regression from 4.12, so should be fixed before 4.13 ships. --- xen/arch/x86/hvm/hvm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index c22cb39cf3..9acd359c99 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -142,7 +142,7 @@ static struct notifier_block cpu_nfb =3D { .notifier_call =3D cpu_callback }; =20 -static bool __init hap_supported(const struct hvm_function_table *fns) +static bool __init hap_supported(struct hvm_function_table *fns) { if ( !fns->hap_supported ) { @@ -152,6 +152,7 @@ static bool __init hap_supported(const struct hvm_funct= ion_table *fns) =20 if ( !opt_hap_enabled ) { + fns->hap_supported =3D 0; printk("HVM: Hardware Assisted Paging (HAP) detected but disabled\= n"); return false; } @@ -175,7 +176,7 @@ static int __init hvm_enable(void) hvm_enabled =3D 1; =20 printk("HVM: %s enabled\n", fns->name); - if ( !hap_supported(fns) ) + if ( !hap_supported(&hvm_funcs) ) clear_iommu_hap_pt_share(); else { --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel