From nobody Fri Nov 29 20:56:27 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=pass; 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=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1627629508; cv=none; d=zohomail.com; s=zohoarc; b=Q1sGWonbajRMa6b2L6U2bKwse9gsZqcldRaHgBo4mOzwtwF6NpxtMH9YFseGusviNQl9uWG8N3EVmkBJAkMjWWatQRbgGGOL4szsYaXjVH2PCV0xVSQ9qptH7GyBLrVLXLPaLlgnjKWM6D/EqxHgXhgz4I6vdCvfcZoSdyVv6Vs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627629508; h=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; bh=dXHUM7lXyWrAMLgi9KDBkwkBbe+GUHRQIfTUEaC3Es0=; b=IYKiegIBgWOg4I3wv6D23t2L7BELHaFwbLf2sQzHvL430h5hOvBDqOTgRZTfxd6P25BVTMGDak9KUwLDdyD+Q3f3ZwEWK06w68GsfPESdiJqGvlzzc6H/QfI4i0gME8uqEJbYI5ox24M41SxX6WzhgzBK2TQJkQz5SLhp982G70= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1627629508541178.2526329920978; Fri, 30 Jul 2021 00:18:28 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.162327.297751 (Exim 4.92) (envelope-from ) id 1m9Mmc-0006nb-Jr; Fri, 30 Jul 2021 07:18:14 +0000 Received: by outflank-mailman (output) from mailman id 162327.297751; Fri, 30 Jul 2021 07:18:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1m9Mmc-0006nF-FW; Fri, 30 Jul 2021 07:18:14 +0000 Received: by outflank-mailman (input) for mailman id 162327; Fri, 30 Jul 2021 07:18:13 +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.92) (envelope-from ) id 1m9Mmb-0006Do-Gc for xen-devel@lists.xenproject.org; Fri, 30 Jul 2021 07:18:13 +0000 Received: from smtp-out2.suse.de (unknown [195.135.220.29]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 497dc7b5-f106-11eb-9889-12813bfff9fa; Fri, 30 Jul 2021 07:18:07 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EA8E11FDB3; Fri, 30 Jul 2021 07:18:06 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id C1BDE13748; Fri, 30 Jul 2021 07:18:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id KJISLq6nA2FufQAAGKfGzw (envelope-from ); Fri, 30 Jul 2021 07:18:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 497dc7b5-f106-11eb-9889-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1627629486; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dXHUM7lXyWrAMLgi9KDBkwkBbe+GUHRQIfTUEaC3Es0=; b=CmagrxEtD3TrPfNSVaCrRb3MI++Zl+msTB5z3G5Rw6JB7REz302fCG1SqoONxV1eNTGnct Y+rl61k756x1QzQ+JElqVBfV00m8i4I2NGBtj+H1Y8RxSlw4j5dStPbm5iOlPeHUUcHVtO /QcnYVu7ZytRetzZdBNEKdoG4o56Ej8= From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini Subject: [PATCH v2 1/3] xen: check required Xen features Date: Fri, 30 Jul 2021 09:18:02 +0200 Message-Id: <20210730071804.4302-2-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210730071804.4302-1-jgross@suse.com> References: <20210730071804.4302-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1627629510463100001 Content-Type: text/plain; charset="utf-8" Linux kernel is not supported to run on Xen versions older than 4.0. Add tests for required Xen features always being present in Xen 4.0 and newer. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky --- V2: - rename macro (Boris Ostrovsky) - panic() in case of missing feature (Boris Ostrovsky) --- drivers/xen/features.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/xen/features.c b/drivers/xen/features.c index 25c053b09605..7b591443833c 100644 --- a/drivers/xen/features.c +++ b/drivers/xen/features.c @@ -9,13 +9,26 @@ #include #include #include +#include =20 #include =20 +#include #include #include #include =20 +/* + * Linux kernel expects at least Xen 4.0. + * + * Assume some features to be available for that reason (depending on guest + * mode, of course). + */ +#define chk_required_feature(f) { \ + if (!xen_feature(f)) \ + panic("Xen: feature %s not available!\n", #f); \ + } + u8 xen_features[XENFEAT_NR_SUBMAPS * 32] __read_mostly; EXPORT_SYMBOL_GPL(xen_features); =20 @@ -31,4 +44,9 @@ void xen_setup_features(void) for (j =3D 0; j < 32; j++) xen_features[i * 32 + j] =3D !!(fi.submap & 1< (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 162762951015427.271525309910544; Fri, 30 Jul 2021 00:18:30 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.162326.297732 (Exim 4.92) (envelope-from ) id 1m9MmY-0006HH-CG; Fri, 30 Jul 2021 07:18:10 +0000 Received: by outflank-mailman (output) from mailman id 162326.297732; Fri, 30 Jul 2021 07:18:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1m9MmY-0006Gn-7M; Fri, 30 Jul 2021 07:18:10 +0000 Received: by outflank-mailman (input) for mailman id 162326; Fri, 30 Jul 2021 07:18:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1m9MmX-0006Du-13 for xen-devel@lists.xenproject.org; Fri, 30 Jul 2021 07:18:09 +0000 Received: from smtp-out2.suse.de (unknown [195.135.220.29]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0ed57977-2e82-49ba-a4c9-1248175ef1e7; Fri, 30 Jul 2021 07:18:08 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 48B1B1FDB8; Fri, 30 Jul 2021 07:18:07 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id F1E8613748; Fri, 30 Jul 2021 07:18:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id gEHcOa6nA2FufQAAGKfGzw (envelope-from ); Fri, 30 Jul 2021 07:18:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0ed57977-2e82-49ba-a4c9-1248175ef1e7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1627629487; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jiGuhZ6peP0OyKJAWTTjdxww+zrMIYBBDWdPs4yyawo=; b=gNlUD5gMM0mE/D5nD9CzenbbL5/H0UE/NgIAm/XUY858kcCf+GMFVnQBd5kS+JFNWF9YSV bdFmmwQYVnVydNdb8UHm5qJgkxqtpOKqem8jj7kF/gUtSOXbsFS/JoxDlSu2teBMdPE+BQ 1jrymsXmezVEAPqIsKDItGMIGbmiS58= From: Juergen Gross To: xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Peter Zijlstra Subject: [PATCH v2 2/3] xen: assume XENFEAT_mmu_pt_update_preserve_ad being set for pv guests Date: Fri, 30 Jul 2021 09:18:03 +0200 Message-Id: <20210730071804.4302-3-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210730071804.4302-1-jgross@suse.com> References: <20210730071804.4302-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1627629510838100005 Content-Type: text/plain; charset="utf-8" XENFEAT_mmu_pt_update_preserve_ad is always set in Xen 4.0 and newer. Remove coding assuming it might be zero. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) Reviewed-by: Boris Ostrovsky --- arch/x86/xen/enlighten_pv.c | 12 ++---------- arch/x86/xen/mmu_pv.c | 4 ++-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 03149422dce2..753f63734c13 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -116,9 +116,8 @@ static void __init xen_banner(void) HYPERVISOR_xen_version(XENVER_extraversion, &extra); =20 pr_info("Booting paravirtualized kernel on %s\n", pv_info.name); - printk(KERN_INFO "Xen version: %d.%d%s%s\n", - version >> 16, version & 0xffff, extra.extraversion, - xen_feature(XENFEAT_mmu_pt_update_preserve_ad) ? " (preserve-AD)" = : ""); + pr_info("Xen version: %d.%d%s (preserve-AD)\n", + version >> 16, version & 0xffff, extra.extraversion); } =20 static void __init xen_pv_init_platform(void) @@ -1302,13 +1301,6 @@ asmlinkage __visible void __init xen_start_kernel(vo= id) xen_init_apic(); #endif =20 - if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) { - pv_ops.mmu.ptep_modify_prot_start =3D - xen_ptep_modify_prot_start; - pv_ops.mmu.ptep_modify_prot_commit =3D - xen_ptep_modify_prot_commit; - } - machine_ops =3D xen_machine_ops; =20 /* diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c index ade789e73ee4..1df5f01529e5 100644 --- a/arch/x86/xen/mmu_pv.c +++ b/arch/x86/xen/mmu_pv.c @@ -2099,8 +2099,8 @@ static const struct pv_mmu_ops xen_mmu_ops __initcons= t =3D { .set_pte =3D xen_set_pte_init, .set_pmd =3D xen_set_pmd_hyper, =20 - .ptep_modify_prot_start =3D __ptep_modify_prot_start, - .ptep_modify_prot_commit =3D __ptep_modify_prot_commit, + .ptep_modify_prot_start =3D xen_ptep_modify_prot_start, + .ptep_modify_prot_commit =3D xen_ptep_modify_prot_commit, =20 .pte_val =3D PV_CALLEE_SAVE(xen_pte_val), .pgd_val =3D PV_CALLEE_SAVE(xen_pgd_val), --=20 2.26.2 From nobody Fri Nov 29 20:56:27 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=pass; 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=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1627629515; cv=none; d=zohomail.com; s=zohoarc; b=C9MrdChJ/eQg+BOjwkZc2md7NfRGdzHO5RjY/Z9Enk5ht8fXvc5mVDMvKSvthNOHepb8L6ZBPqxqImoi+mW+QUYEtWP92Lxme666Ep4Bn5d0Dvvie4PoMWx0B54quMNM39rGnPgxnsvFuj3BWmY1mZKLs68WiWT5ehhbrSk1RaE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627629515; h=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; bh=cyZcoypMsiPyV5D5l5wSyscmkn1Z3KKgfGDueS4Lb8Q=; b=D/W/iA8rEHbY4pMyxTazoItL8O65caZzVJ5o+DWayTWIYoDf2HXCwWx32ziTzaWQ7TqRyBL+02vTr3Z357v7UAbpQ59o1mSFwc7yo2+Z70imQe09/ZEfhmvMaOdOud1rbyYSQUq0sU5CYAGwagmMzOUX2FDRzyfGyllb9/EtliM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1627629515238179.7262955838488; Fri, 30 Jul 2021 00:18:35 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.162328.297763 (Exim 4.92) (envelope-from ) id 1m9Mmi-0007Ba-3g; Fri, 30 Jul 2021 07:18:20 +0000 Received: by outflank-mailman (output) from mailman id 162328.297763; Fri, 30 Jul 2021 07:18:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1m9Mmi-0007BP-07; Fri, 30 Jul 2021 07:18:20 +0000 Received: by outflank-mailman (input) for mailman id 162328; Fri, 30 Jul 2021 07:18:18 +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.92) (envelope-from ) id 1m9Mmg-0006Do-Gm for xen-devel@lists.xenproject.org; Fri, 30 Jul 2021 07:18:18 +0000 Received: from smtp-out2.suse.de (unknown [195.135.220.29]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 49f0c2d2-f106-11eb-9889-12813bfff9fa; Fri, 30 Jul 2021 07:18:08 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7D68D2020B; Fri, 30 Jul 2021 07:18:07 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 4F3551374D; Fri, 30 Jul 2021 07:18:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id wAzgEa+nA2FufQAAGKfGzw (envelope-from ); Fri, 30 Jul 2021 07:18:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 49f0c2d2-f106-11eb-9889-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1627629487; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cyZcoypMsiPyV5D5l5wSyscmkn1Z3KKgfGDueS4Lb8Q=; b=GXcQ+AQRPZJ+G9sddnPaaK086EH9kpql9cfa/M7rnCoYYva1VeOrv39m3yuBfqLvG/hmtm zIL8dEPA2skQc0m4Gm69R5UdSDqG86/k0qiGUZPPoks7j7TRoCWxOS8ApDYgPOkchj5ycQ 9JaOXOFZXnkGxrtmQ4JVPg1/khQ7yaw= From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini , Peter Zijlstra Subject: [PATCH v2 3/3] xen: assume XENFEAT_gnttab_map_avail_bits being set for pv guests Date: Fri, 30 Jul 2021 09:18:04 +0200 Message-Id: <20210730071804.4302-4-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210730071804.4302-1-jgross@suse.com> References: <20210730071804.4302-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1627629516797100001 Content-Type: text/plain; charset="utf-8" XENFEAT_gnttab_map_avail_bits is always set in Xen 4.0 and newer. Remove coding assuming it might be zero. Signed-off-by: Juergen Gross Acked-by: Peter Zijlstra (Intel) Reviewed-by: Boris Ostrovsky --- drivers/xen/gntdev.c | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index a3e7be96527d..1e7f6b1c0c97 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -266,20 +266,13 @@ static int find_grant_ptes(pte_t *pte, unsigned long = addr, void *data) { struct gntdev_grant_map *map =3D data; unsigned int pgnr =3D (addr - map->vma->vm_start) >> PAGE_SHIFT; - int flags =3D map->flags | GNTMAP_application_map | GNTMAP_contains_pte; + int flags =3D map->flags | GNTMAP_application_map | GNTMAP_contains_pte | + (1 << _GNTMAP_guest_avail0); u64 pte_maddr; =20 BUG_ON(pgnr >=3D map->count); pte_maddr =3D arbitrary_virt_to_machine(pte).maddr; =20 - /* - * Set the PTE as special to force get_user_pages_fast() fall - * back to the slow path. If this is not supported as part of - * the grant map, it will be done afterwards. - */ - if (xen_feature(XENFEAT_gnttab_map_avail_bits)) - flags |=3D (1 << _GNTMAP_guest_avail0); - gnttab_set_map_op(&map->map_ops[pgnr], pte_maddr, flags, map->grants[pgnr].ref, map->grants[pgnr].domid); @@ -288,14 +281,6 @@ static int find_grant_ptes(pte_t *pte, unsigned long a= ddr, void *data) return 0; } =20 -#ifdef CONFIG_X86 -static int set_grant_ptes_as_special(pte_t *pte, unsigned long addr, void = *data) -{ - set_pte_at(current->mm, addr, pte, pte_mkspecial(*pte)); - return 0; -} -#endif - int gntdev_map_grant_pages(struct gntdev_grant_map *map) { int i, err =3D 0; @@ -1055,23 +1040,6 @@ static int gntdev_mmap(struct file *flip, struct vm_= area_struct *vma) err =3D vm_map_pages_zero(vma, map->pages, map->count); if (err) goto out_put_map; - } else { -#ifdef CONFIG_X86 - /* - * If the PTEs were not made special by the grant map - * hypercall, do so here. - * - * This is racy since the mapping is already visible - * to userspace but userspace should be well-behaved - * enough to not touch it until the mmap() call - * returns. - */ - if (!xen_feature(XENFEAT_gnttab_map_avail_bits)) { - apply_to_page_range(vma->vm_mm, vma->vm_start, - vma->vm_end - vma->vm_start, - set_grant_ptes_as_special, NULL); - } -#endif } =20 return 0; --=20 2.26.2