All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/xen: set default memory type for pv guests to WB
@ 2023-06-15 12:39 Juergen Gross
  2023-06-15 19:37 ` Boris Ostrovsky
  2023-06-16  9:33 ` [tip: x86/mtrr] x86/xen: Set default memory type for PV " tip-bot2 for Juergen Gross
  0 siblings, 2 replies; 3+ messages in thread
From: Juergen Gross @ 2023-06-15 12:39 UTC (permalink / raw)
  To: linux-kernel, x86
  Cc: Juergen Gross, Boris Ostrovsky, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, H. Peter Anvin, xen-devel

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 <jgross@suse.com>
---
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)
 
 	if (xen_initial_domain())
 		xen_set_mtrr_data();
+	else
+		mtrr_overwrite_state(NULL, 0, MTRR_TYPE_WRBACK);
 }
 
 static void __init xen_pv_guest_late_init(void)
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/xen: set default memory type for pv guests to WB
  2023-06-15 12:39 [PATCH] x86/xen: set default memory type for pv guests to WB Juergen Gross
@ 2023-06-15 19:37 ` Boris Ostrovsky
  2023-06-16  9:33 ` [tip: x86/mtrr] x86/xen: Set default memory type for PV " tip-bot2 for Juergen Gross
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Ostrovsky @ 2023-06-15 19:37 UTC (permalink / raw)
  To: Juergen Gross, linux-kernel, x86
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	H. Peter Anvin, xen-devel



On 6/15/23 8:39 AM, Juergen Gross wrote:
> 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 <jgross@suse.com>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: x86/mtrr] x86/xen: Set default memory type for PV guests to WB
  2023-06-15 12:39 [PATCH] x86/xen: set default memory type for pv guests to WB Juergen Gross
  2023-06-15 19:37 ` Boris Ostrovsky
@ 2023-06-16  9:33 ` tip-bot2 for Juergen Gross
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Juergen Gross @ 2023-06-16  9:33 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Juergen Gross, Borislav Petkov (AMD), Boris Ostrovsky, x86, linux-kernel

The following commit has been merged into the x86/mtrr branch of tip:

Commit-ID:     30d65d1b19850c9bc8c17dba8ebe9be5e0c17054
Gitweb:        https://git.kernel.org/tip/30d65d1b19850c9bc8c17dba8ebe9be5e0c17054
Author:        Juergen Gross <jgross@suse.com>
AuthorDate:    Thu, 15 Jun 2023 14:39:59 +02:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Fri, 16 Jun 2023 11:22:33 +02:00

x86/xen: Set default memory type for PV guests to WB

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 <jgross@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/20230615123959.12298-1-jgross@suse.com
---
 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 8732b85..93b6582 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)
 
 	if (xen_initial_domain())
 		xen_set_mtrr_data();
+	else
+		mtrr_overwrite_state(NULL, 0, MTRR_TYPE_WRBACK);
 }
 
 static void __init xen_pv_guest_late_init(void)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-16  9:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15 12:39 [PATCH] x86/xen: set default memory type for pv guests to WB Juergen Gross
2023-06-15 19:37 ` Boris Ostrovsky
2023-06-16  9:33 ` [tip: x86/mtrr] x86/xen: Set default memory type for PV " tip-bot2 for Juergen Gross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.