lkml.org 
[lkml]   [2021]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 3/3] nSVM: use svm->nested.save to load vmcb12 registers and avoid TOC/TOU races
From
Date


On 12/09/2021 12:42, Maxim Levitsky wrote:
>>
>> - if (!nested_vmcb_valid_sregs(vcpu, &vmcb12->save) ||
>> + if (!nested_vmcb_valid_sregs(vcpu, &svm->nested.save) ||
>> !nested_vmcb_check_controls(vcpu, &svm->nested.ctl)) {

> If you use a different struct for the copied fields, then it makes
> sense IMHO to drop the 'control' parameter from nested_vmcb_check_controls,
> and just use the svm->nested.save there directly.
>

Ok, what you say in patch 2 makes sense to me. I can create a new struct
vmcb_save_area_cached, but I need to keep nested.ctl because 1) it is
used also elsewhere, and different fields from the one checked here are
read/set and 2) using another structure (or the same
vmcb_save_area_cached) in its place would just duplicate the same fields
of nested.ctl, creating even more confusion and possible inconsistency.

Let me know if you disagree.

Thank you,
Emanuele

\
 
 \ /
  Last update: 2021-09-14 10:21    [W:0.072 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site