From nobody Fri May 3 07:03:54 2024 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=fail; 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=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1590418012; cv=none; d=zohomail.com; s=zohoarc; b=Y6k8j0fLTpc75Gs0PT82AnsxUZKQJ1rjnshsg83SV0P6wgT3LQ569CnMGyR73cd+uNoY5eNaiO0StGgSGLrrCQRMAnYXKZjUwtMzkb+zOlXsNLo5L/OHuoRpT0Rejntf6wY3fnwJiB8pLy19n+9vHQHPv2WWrbJGxIXGHTB2vrw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590418012; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=2HoAMOZQ3HefgrNkWv0E4FEusKuZTEg4JrxhK22N/y8=; b=HuFGqQD7Of5FuPCR/FG+SiBBVTOaFuN6AYtxlLYJVu7L0rkLbctzygq1CvjrGpwibqOwmkPd+PxLkXPfegH7r9u4L5nwbcNJxUC7CWK1WhyQqLM+7JtC8951hgiuII/iuI90EpwJcrd2Aq7TvA4P/HsO+COkuYPjvQM+bNK5rag= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=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 1590418012366186.807034951962; Mon, 25 May 2020 07:46: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 1jdEMt-00022P-DH; Mon, 25 May 2020 14:46:19 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jdEMs-00022K-Gn for xen-devel@lists.xenproject.org; Mon, 25 May 2020 14:46:18 +0000 Received: from mail-oi1-x242.google.com (unknown [2607:f8b0:4864:20::242]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 7da9c308-9e96-11ea-9887-bc764e2007e4; Mon, 25 May 2020 14:46:18 +0000 (UTC) Received: by mail-oi1-x242.google.com with SMTP id s198so16193373oie.6 for ; Mon, 25 May 2020 07:46:18 -0700 (PDT) Received: from t0.lan (c-71-205-12-124.hsd1.co.comcast.net. [71.205.12.124]) by smtp.googlemail.com with ESMTPSA id s124sm5327251oig.19.2020.05.25.07.46.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 07:46:16 -0700 (PDT) X-Inumbo-ID: 7da9c308-9e96-11ea-9887-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2HoAMOZQ3HefgrNkWv0E4FEusKuZTEg4JrxhK22N/y8=; b=ReMeZAzm0OhxA9ZFrXFaIJr4A7AitXK67M1nc1DIMnZVm4rsNnGd6GLwpZssIvlK4S RIPBPFac6YVzcojeIYwVYfj7eX8C7Uupl5wQaCticSg8T635U3MmG0VMYUNrNvDuFx8b 1is+wqVRsnUSMPL9ZeXcz2OZMxBMVVDJ8/75uiVZbbaP20EasdKrKI7lwjuOTOJuyudb eOL0ob+v74UyXOV8Qb0UNpIPKIKJiEfmZnQi72RfoIAg0tRdGQiofKhuVneht52NP78W t5bFmFUD6EbsF8WKc4xOPzF3+iZCSMf2OWH0BDbHN/na+vHsKZyIdCsmvw58H8hXe/uZ dr+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2HoAMOZQ3HefgrNkWv0E4FEusKuZTEg4JrxhK22N/y8=; b=Q3KgA1XVWFu6exGJWM6ASu1DzQwmLRqDRNB537ZntNglBf/eK7spb6oaMhoIvIW7an GwN+rD9FoPB7VMqsCPkuw94fMlfvgCAmSEFYu5CgOV/GuCeRQQ1eD3Uof8queLWkfd90 n5jvNuXJoR5nBePBvmYRrVT9iYqAyHWDE+2YnEEjY61ExD9ECrRNT6a/73deNslv0Tes 3p09OqIhoRd+tCiLhOhvmlerWhXShoxUXfCV/XpaeCqLY3lyEgMUgGZcmkewGRJgQnKs kCXSGFQtV7ZLZlA94hs04cB6QLhk3fskIu56DxzRc3RiPtxEI7zX1p3EtNSyWbEh839S 2Fuw== X-Gm-Message-State: AOAM531GNH3DvdcUvWp+Vujw5HLzyYIy/3D4aaxMDzOQs4/zQ5P6I9XR HXp3H/SYwfhy50sOQzakqxxRW6gg X-Google-Smtp-Source: ABdhPJzwhYnhhOJL1Gojw7XS0y1IEPkHFTcDYYY1DCzZz6LbJNmwj/AxkU0NJSTJ2j2tzilQmSQ9ZQ== X-Received: by 2002:aca:c594:: with SMTP id v142mr11228598oif.66.1590417977063; Mon, 25 May 2020 07:46:17 -0700 (PDT) From: Tamas K Lengyel X-Google-Original-From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Subject: [PATCH] x86/mem_sharing: gate enabling on cpu_has_vmx Date: Mon, 25 May 2020 08:46:06 -0600 Message-Id: <20200525144606.126767-1-tamas.lengyel@intel.com> X-Mailer: git-send-email 2.26.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: Tamas K Lengyel , Wei Liu , Andrew Cooper , George Dunlap , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Tamas K Lengyel It is unclear whether mem_sharing was ever made to work on other architectu= res but at this time the only verified platform for it is vmx. No plans to supp= ort or maintain it on other architectures. Make this explicit by checking during initialization. Signed-off-by: Tamas K Lengyel Reviewed-by: Wei Liu --- xen/arch/x86/mm/mem_sharing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c index 7271e5c90b..19922ab5d1 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -1444,7 +1444,7 @@ static inline int mem_sharing_control(struct domain *= d, bool enable, { if ( enable ) { - if ( unlikely(!is_hvm_domain(d)) ) + if ( unlikely(!is_hvm_domain(d) || !cpu_has_vmx) ) return -EOPNOTSUPP; =20 if ( unlikely(!hap_enabled(d)) ) --=20 2.26.1