From patchwork Thu Oct 31 19:38:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 11221809 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 29033913 for ; Thu, 31 Oct 2019 19:39:49 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EDDAE2086D for ; Thu, 31 Oct 2019 19:39:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="BQEtaarp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EDDAE2086D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iQGGv-0006qX-OT; Thu, 31 Oct 2019 19:38:17 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iQGGu-0006qS-1H for xen-devel@lists.xenproject.org; Thu, 31 Oct 2019 19:38:16 +0000 X-Inumbo-ID: fae40618-fc15-11e9-9550-12813bfff9fa Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id fae40618-fc15-11e9-9550-12813bfff9fa; Thu, 31 Oct 2019 19:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1572550694; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6JCPKajX0qAU+X07RQaVo3ui9CX6yX1v0Szo9c/EPxw=; b=BQEtaarpnlqCqMpb0AoN4uDt2130pUzWTToxoD9KkV8L21V2vdkccyAO zUD/qVEDcRC0Y09hcZh0yC9FNQ9ccMa9Icdm0+t5PFUz+uEQ0fgg7CLrn K/c8LYrkWpoU7oins2ieqIDpnnuP3KJuR3Q99CoODOlciH7ZmC7qxiSLn A=; Authentication-Results: esa6.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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.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=esa6.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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: +HugxMiAzNfO38zRpOiIs9mkBXCFwWhVFIrimtUZ2jWb2zdodrd0bVoimeLGA5OgaNspYcA1hD ei3tdUYvxlSYa/6sf70axkWzgvizQSfcf4smEWbPghvrvbpILYfgHxgOxisQYGWiQbG0LWc1uX h8S5J0hPJ1UiA4a6KXZOT7JrKZ5gIkCK5+VY8O6zVA7BFPuIIaR+/kTdbNj3/+Q1uKhAXtx9cB IyVn7IIC0q0Ni0dcuzHCIPDgCNg+lwkvZ+XYLtOL9uzHfwLi4JOe2AcyNAdHLoj2TaWMSS0Ij8 TVM= X-SBRS: 2.7 X-MesageID: 8073740 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.68,252,1569297600"; d="scan'208";a="8073740" From: Andrew Cooper To: Xen-devel Date: Thu, 31 Oct 2019 19:38:08 +0000 Message-ID: <20191031193808.15401-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/pv: Fix !CONFIG_PV build following XSA-296 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 , George Dunlap , Andrew Cooper , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" PTF_* are declared within CONFIG_PV, and used outside: mm.c: In function ‘_put_page_type’: mm.c:2819:32: error: ‘PTF_preemptible’ undeclared (first use in this function) bool preemptible = flags & PTF_preemptible; ^~~~~~~~~~~~~~~ mm.c:2819:32: note: each undeclared identifier is reported only once for each function it appears in mm.c:2842:24: error: ‘PTF_partial_set’ undeclared (first use in this function) if ( !(flags & PTF_partial_set) ) ^~~~~~~~~~~~~~~ mm.c: In function ‘put_page_type_preemptible’: mm.c:3090:33: error: ‘PTF_preemptible’ undeclared (first use in this function) return _put_page_type(page, PTF_preemptible, NULL); ^~~~~~~~~~~~~~~ mm.c: In function ‘put_old_guest_table’: mm.c:3108:25: error: ‘PTF_preemptible’ undeclared (first use in this function) PTF_preemptible | ^~~~~~~~~~~~~~~ mm.c:3110:27: error: ‘PTF_partial_set’ undeclared (first use in this function) PTF_partial_set : 0 ), ^~~~~~~~~~~~~~~ mm.c: In function ‘put_page_type_preemptible’: mm.c:3091:1: error: control reaches end of non-void function [-Werror=return-type] } ^ cc1: all warnings being treated as errors Reposition the definitions to be outside of the #ifdef CONFIG_PV Signed-off-by: Andrew Cooper Reviewed-by: Wei Liu --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monné CC: George Dunlap CC: Juergen Gross --- xen/arch/x86/mm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 79c3e4c473..57f22775ac 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -1063,8 +1063,6 @@ get_page_from_l1e( return -EBUSY; } -#ifdef CONFIG_PV - /* * The following flags are used to specify behavior of various get and * put commands. The first is also stored in page->partial_flags to @@ -1077,6 +1075,8 @@ get_page_from_l1e( #define PTF_defer (1 << 3) #define PTF_retain_ref_on_restart (1 << 4) +#ifdef CONFIG_PV + static int get_page_and_type_from_mfn( mfn_t mfn, unsigned long type, struct domain *d, unsigned int flags)