lkml.org 
[lkml]   [2023]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v4 5/6] Drivers: hv: vmbus: Support TDX guests
Date
> From: Michael Kelley (LINUX) <mikelley@microsoft.com>
> Sent: Wednesday, April 12, 2023 7:05 AM
> > @@ -168,6 +170,30 @@ int hv_synic_alloc(void)
> > pr_err("Unable to allocate post msg page\n");
> > goto err;
> > }
> > +
> > +
> > + if (hv_isolation_type_tdx()) {
> > + ret = set_memory_decrypted(
> > + (unsigned long)hv_cpu->synic_message_page, 1);
> > + if (ret) {
> > + pr_err("Failed to decrypt SYNIC msg page\n");
> > + goto err;
> > + }
> > +
> > + ret = set_memory_decrypted(
> > + (unsigned long)hv_cpu->synic_event_page, 1);
> > + if (ret) {
> > + pr_err("Failed to decrypt SYNIC event page\n");
> > + goto err;
> > + }
> > +
> > + ret = set_memory_decrypted(
> > + (unsigned long)hv_cpu->post_msg_page, 1);
> > + if (ret) {
> > + pr_err("Failed to decrypt post msg page\n");
> > + goto err;
> > + }
> > + }
>
> One other comment: The memory for the synic_message_page,
> synic_event_page, and post_msg_page is obtained using get_zeroed_page().
> But after the decryption, the memory contents will be random garbage that

I'm not sure about this, as I don't see any "unknown msgtype=" message from
vmbus_on_msg_dpc() :-)

I agree it's good to add a memset(). Will do it in v5.

> isn't all zeroes. You'll need to do a memset() after the decryption to get the
> contents back to zero. Compare with Patch 6 in Tianyu's fully enlightened
> SNP patch series.
>
> Michael


\
 
 \ /
  Last update: 2023-04-21 05:35    [W:1.064 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site