Thread (152 messages) 152 messages, 8 authors, 2020-06-12

Re: [PATCH v3 40/75] x86/sev-es: Compile early handler code into kernel image

From: Joerg Roedel <joro@8bytes.org>
Date: 2020-06-04 11:54:17
Also in: kvm, lkml

On Wed, May 20, 2020 at 11:14:15AM +0200, Borislav Petkov wrote:
On Tue, Apr 28, 2020 at 05:16:50PM +0200, Joerg Roedel wrote:
quoted
+static inline u64 sev_es_rd_ghcb_msr(void)
+{
+	return native_read_msr(MSR_AMD64_SEV_ES_GHCB);
+}
+
+static inline void sev_es_wr_ghcb_msr(u64 val)
+{
+	u32 low, high;
+
+	low  = (u32)(val);
+	high = (u32)(val >> 32);
+
+	native_write_msr(MSR_AMD64_SEV_ES_GHCB, low, high);
+}
Instead of duplicating those two, you can lift the ones in the
compressed image into sev-es.h and use them here. I don't care one bit
about the MSR tracepoints in native_*_msr().
It is not only the trace-point, this would also eliminate exception
handling in case the MSR access triggers a #GP. The "Unhandled MSR
read/write" messages would turn into a "General Protection Fault"
message.


	Joerg
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help