lkml.org 
[lkml]   [2021]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 03/13] x86/HV: Add new hvcall guest address host visibility support
From
Date
On 7/29/2021 1:06 AM, Dave Hansen wrote:
> On 7/28/21 7:52 AM, Tianyu Lan wrote:
>> @@ -1986,7 +1988,9 @@ static int __set_memory_enc_dec(unsigned long addr, int numpages, bool enc)
>> int ret;
>>
>> /* Nothing to do if memory encryption is not active */
>> - if (!mem_encrypt_active())
>> + if (hv_is_isolation_supported())
>> + return hv_set_mem_enc(addr, numpages, enc);
>> + else if (!mem_encrypt_active())
>> return 0;
>
> One more thing. If you're going to be patching generic code, please
> start using feature checks that can get optimized away at runtime.
> hv_is_isolation_supported() doesn't look like the world's cheapest
> check. It can't be inlined and costs at least a function call.

Yes, you are right. How about adding a static branch key for the check
of isolation VM? This may reduce the check cost.


\
 
 \ /
  Last update: 2021-07-29 15:03    [W:1.054 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site