|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 5/8] x86/hvm: Don't raise #GP behind the emulators back for MSR accesses
>>> On 05.12.16 at 17:29, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 05/12/16 12:10, Jan Beulich wrote:
>>>>> On 05.12.16 at 11:09, <andrew.cooper3@xxxxxxxxxx> wrote:
>>> --- a/xen/arch/x86/hvm/hvm.c
>>> +++ b/xen/arch/x86/hvm/hvm.c
>>> @@ -509,7 +509,11 @@ void hvm_do_resume(struct vcpu *v)
>>>
>>> if ( w->do_write.msr )
>>> {
>>> - hvm_msr_write_intercept(w->msr, w->value, 0);
>>> + int rc = hvm_msr_write_intercept(w->msr, w->value, 0);
>>> +
>>> + if ( rc == X86EMUL_EXCEPTION )
>>> + hvm_inject_hw_exception(TRAP_gp_fault, 0);
>> The use of a local variable looks kind of pointless here.
>
> The first version had
>
> if ( hvm_msr_write_intercept(w->msr, w->value, 0) ==
> X86EMUL_EXCEPTION )
>
> but this looked rather ugly to read. I prefer the version as submitted,
> but am not too fussed if you insist for the latter?
I won't insist, it was just a suggestion to make the code look better
to my eyes. If you like it better as is, keep it.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |