From nobody Fri Nov 29 23:53:04 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=1627629510; cv=none; d=zohomail.com; s=zohoarc; b=W9f6ZOP75uDnhZFSiI/Po0OCk6H9zHOoGlgW+SrPwjJnJHqNFS+8Nvz+CKMZyyp8stucyWcnlef4FQzthKVSuRpV6chmyzipWE2H6yxhUVP2Fr0fd6h1SurDGC2LKP0sA5xnDLHW97/+f0CMv3dSBsnE4fVzoTIilclWXy7y9X4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627629510; 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=jiGuhZ6peP0OyKJAWTTjdxww+zrMIYBBDWdPs4yyawo=; b=GbDxe+3ruN2zFThdd1FquxY06bQOYJH/Kp9ZMyojnmRDrcav+Ei029HEArzLUx53ftH4uj0/QW6jtwa8QkCakRUPfXvR0g3EF/w1KN9VA7cSeYL/ewV518XpfDR6a2cyHxBpGslSFEfxspH2EVKtClfovGWoD7mSZSykYM4QxEc= 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 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) --- 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