lkml.org 
[lkml]   [2022]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v5 1/6] x86/sev: Fix calculation of end address based on number of pages
From
On 9/27/22 12:10, Dave Hansen wrote:
> On 9/27/22 10:04, Tom Lendacky wrote:
>> --- a/arch/x86/kernel/sev.c
>> +++ b/arch/x86/kernel/sev.c
>> @@ -649,7 +649,7 @@ static void pvalidate_pages(unsigned long vaddr, unsigned int npages, bool valid
>> int rc;
>>
>> vaddr = vaddr & PAGE_MASK;
>> - vaddr_end = vaddr + (npages << PAGE_SHIFT);
>> + vaddr_end = vaddr + ((unsigned long)npages << PAGE_SHIFT);
>
> Could we please just fix the fragile typing that cascaded down to this
> point?
>
> Shouldn't 'npages' in this interface be a long?

I'll take a look at that.

Thanks,
Tom

>
>> struct x86_guest {
>> void (*enc_status_change_prepare)(unsigned long vaddr, int npages, bool enc);
>> bool (*enc_status_change_finish)(unsigned long vaddr, int npages, bool enc);
>> bool (*enc_tlb_flush_required)(bool enc);
>> bool (*enc_cache_flush_required)(void);
>> };

\
 
 \ /
  Last update: 2022-09-27 22:47    [W:0.507 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site