From nobody Thu May 9 23:00:57 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=1686832838; cv=none; d=zohomail.com; s=zohoarc; b=KV6rJcT0rDoRGvBkvxiyhkhzuD4gxjgMzjE3PlRLtCJoj9nbZhSbCYXST4zNHqLcPkEkxrBKwKjuSIybPFuqaXelVxNcIb7AumuYCGOUDmR4q3Z8K7RDuG2/F3PoCx+tV1LEVcsOQnJy5zLiAUgtxF7sdb2kksxY3+kTTBgXBX8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1686832838; 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=sLKvpHmhwxzhGsa8RD9GXj1E3Cqd53RX8qPUzRGgONI=; b=WR2xrCKea43rowy2rOo4mKC/aUEvAhm1EQa5/BJVnYX1i77FOyDl6eLhOKvzokpQY3RedC4SoIVQYD6mMwy6ztnKlwiG9FMpL2mN/IeT+WxzOW6aoP2mg/u5o0Oe9dILJLQtCgwyJTT8rH6l5kyp3lkQduWQFRjUszNT5ZWCHS8= 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 1686832838569486.9605815805469; Thu, 15 Jun 2023 05:40:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.549581.858182 (Exim 4.92) (envelope-from ) id 1q9mGi-00029n-TC; Thu, 15 Jun 2023 12:40:04 +0000 Received: by outflank-mailman (output) from mailman id 549581.858182; Thu, 15 Jun 2023 12:40:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q9mGi-000299-Oz; Thu, 15 Jun 2023 12:40:04 +0000 Received: by outflank-mailman (input) for mailman id 549581; Thu, 15 Jun 2023 12:40:03 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q9mGh-0001pM-AI for xen-devel@lists.xenproject.org; Thu, 15 Jun 2023 12:40:03 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id be9bd698-0b79-11ee-b232-6b7b168915f2; Thu, 15 Jun 2023 14:40:01 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (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-out1.suse.de (Postfix) with ESMTPS id 38D70223DE; Thu, 15 Jun 2023 12:40:01 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (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 imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D010513A47; Thu, 15 Jun 2023 12:40:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id JJxjMaAGi2T1OQAAMHmgww (envelope-from ); Thu, 15 Jun 2023 12:40:00 +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: be9bd698-0b79-11ee-b232-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1686832801; 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; bh=sLKvpHmhwxzhGsa8RD9GXj1E3Cqd53RX8qPUzRGgONI=; b=Adcvt8jp3J6VJHStWp7XI8UqjjBdIO+60lveaGrjsR2IoO908L/uW+lrRpAlKri7Tr1U1b 0rSAZhSTlsBqaIbAeAjCVNdKHFRgkFCQ/FRCyulDtp7vEKz/s5lL6REthbZkfhlyB+L2PA Eawu3ARj6wsxY5ljRaIEnRG2FZSLwEo= From: Juergen Gross To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Juergen Gross , Boris Ostrovsky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , xen-devel@lists.xenproject.org Subject: [PATCH] x86/xen: set default memory type for pv guests to WB Date: Thu, 15 Jun 2023 14:39:59 +0200 Message-Id: <20230615123959.12298-1-jgross@suse.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1686832839499100001 Content-Type: text/plain; charset="utf-8" When running as an unprivileged PV-guest under Xen (not dom0), the default MTRR memory type should be write-back. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky --- Based on tip x86/mtrr branch --- arch/x86/xen/enlighten_pv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 8732b85d5650..93b658248d01 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -187,6 +187,8 @@ static void __init xen_pv_init_platform(void) =20 if (xen_initial_domain()) xen_set_mtrr_data(); + else + mtrr_overwrite_state(NULL, 0, MTRR_TYPE_WRBACK); } =20 static void __init xen_pv_guest_late_init(void) --=20 2.35.3