Received: by 10.223.185.116 with SMTP id b49csp1022014wrg; Wed, 21 Feb 2018 10:42:59 -0800 (PST) X-Google-Smtp-Source: AH8x225ZkTLmxEx0NA722Id1dhQaQROvHwJf7wCXoj+OQwmB2N5bum5Bd+A2ppDXcZ8Vuc911Rbw X-Received: by 2002:a17:902:76c4:: with SMTP id j4-v6mr4085814plt.410.1519238579606; Wed, 21 Feb 2018 10:42:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519238579; cv=none; d=google.com; s=arc-20160816; b=uuGSSnpjpcXzCK4xfiOl3DK4afcfq40BxHAXV9m20I2HD1CIpW1ikDnwkZ1ThK1WYm DQmwSQiYKyqVHt9Cg4bCzLG5X59pBZs0dXYxlTeAgs//zngySJuI3r8z8CtuB1tmiloA 2A2ZLRAmOFGz8VTfmekHTp1x9Hsi46WnlICzeEviGeZH6xX3j4prvvZs5wcsqvP0c6OC Aii+8+sVWf1M0Fj1FoIjMPERJXRyZzqN3yEtgNDK6inIgLziHJJJSomhqoaEBtmCOqxK s5cTp9lUy+XudcIh/9zSUsJURAVJcuGtGtNnUGdmXmgekrwvXH9oVCwVLKFO6TljXoCS aMKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Mtd7ZOzmarsTz80pEViqRLcNd/ScEk4BTZFljAiWY/o=; b=q70j2ySUcpW0cgE3NfRJq3EFvOVeJAWdh2uER7JPOvScfNPJpx9L524mBpItE82WPM SyZHC1A3+tqu3zGlWCYwpPiRtx0SZkWfxsIY2dZFxCapMXk1Q4Q/05AJ+oOiA5Eg6pE/ 1ne/IvSmj96/hpnn5p1Nxd2rvRPHCF9onJUESqaFXLP+C27Yu3MxbBK7LSw7IeOq6mpk u0jPciBELChxBZY98a/3Ll0dlmWsHOFKDyLjXDU2irF+fcFHnSGAmpUuWVbOgEuDqQys gsigVU0jaF7pveSYXepVA/SYN81G+Frg64VxSk7/oxxF9oYdZDPoDXQ1lzRO2y3TcRtK m48Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n13si1511872pgq.674.2018.02.21.10.42.45; Wed, 21 Feb 2018 10:42:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965813AbeBUN0m (ORCPT + 99 others); Wed, 21 Feb 2018 08:26:42 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44488 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936330AbeBUNLP (ORCPT ); Wed, 21 Feb 2018 08:11:15 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B21171224; Wed, 21 Feb 2018 13:11:12 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Simon Gaiser , Juergen Gross Subject: [PATCH 4.15 122/163] xen: Fix {set,clear}_foreign_p2m_mapping on autotranslating guests Date: Wed, 21 Feb 2018 13:49:11 +0100 Message-Id: <20180221124536.845877001@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180221124529.931834518@linuxfoundation.org> References: <20180221124529.931834518@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Simon Gaiser commit 781198f1f373c3e350dbeb3af04a7d4c81c1b8d7 upstream. Commit 82616f9599a7 ("xen: remove tests for pvh mode in pure pv paths") removed the check for autotranslation from {set,clear}_foreign_p2m_mapping but those are called by grant-table.c also on PVH/HVM guests. Cc: # 4.14 Fixes: 82616f9599a7 ("xen: remove tests for pvh mode in pure pv paths") Signed-off-by: Simon Gaiser Reviewed-by: Juergen Gross Signed-off-by: Juergen Gross Signed-off-by: Greg Kroah-Hartman --- arch/x86/xen/p2m.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c @@ -694,6 +694,9 @@ int set_foreign_p2m_mapping(struct gntta int i, ret = 0; pte_t *pte; + if (xen_feature(XENFEAT_auto_translated_physmap)) + return 0; + if (kmap_ops) { ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, kmap_ops, count); @@ -736,6 +739,9 @@ int clear_foreign_p2m_mapping(struct gnt { int i, ret = 0; + if (xen_feature(XENFEAT_auto_translated_physmap)) + return 0; + for (i = 0; i < count; i++) { unsigned long mfn = __pfn_to_mfn(page_to_pfn(pages[i])); unsigned long pfn = page_to_pfn(pages[i]);