lkml.org 
[lkml]   [2021]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V6 7/8] Drivers: hv: vmbus: Add SNP support for VMbus channel initiate message
From
Date
Hi Michael:
Thanks for your review.


On 10/2/2021 9:26 PM, Michael Kelley wrote:
>> @@ -303,10 +365,26 @@ void vmbus_disconnect(void)
>> vmbus_connection.int_page = NULL;
>> }
>>
>> - hv_free_hyperv_page((unsigned long)vmbus_connection.monitor_pages[0]);
>> - hv_free_hyperv_page((unsigned long)vmbus_connection.monitor_pages[1]);
>> - vmbus_connection.monitor_pages[0] = NULL;
>> - vmbus_connection.monitor_pages[1] = NULL;
>> + if (hv_is_isolation_supported()) {
>> + memunmap(vmbus_connection.monitor_pages[0]);
>> + memunmap(vmbus_connection.monitor_pages[1]);
> The matching memremap() calls are made in vmbus_connect() only in the
> SNP case. In the non-SNP case, monitor_pages and monitor_pages_original
> are the same, so you would be doing an unmap, and then doing the
> set_memory_encrypted() and hv_free_hyperv_page() using an address
> that is no longer mapped, which seems wrong. Looking at memunmap(),
> it might be a no-op in this case, but even if it is, making them conditional
> on the SNP case might be a safer thing to do, and it would make the code
> more symmetrical.
>

Yes, memumap() does nothing is the non-SNP CVM and so I didn't check CVM
type here. I will add the check in the next version.

Thanks.


\
 
 \ /
  Last update: 2021-10-02 16:40    [W:0.067 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site