Re: [PATCH 05/13] KVM: x86: pass host_initiated to functions that read MSRs

From: Paolo Bonzini
Date: Mon May 04 2015 - 12:04:53 EST




On 04/05/2015 16:01, Radim KrÄmÃÅ wrote:
>> static int emulator_get_msr(struct x86_emulate_ctxt *ctxt,
>> u32 msr_index, u64 *pdata)
>> {
>> - return kvm_get_msr(emul_to_vcpu(ctxt), msr_index, pdata);
>> + struct msr_data msr;
>> + int r;
>> +
>> + msr.index = msr_index;
>> + msr.host_initiated = false;
>> + r = kvm_get_msr(emul_to_vcpu(ctxt), &msr);
>> + if (r)
>> + return r;
>> +
>> + *pdata = msr.data;
>> + return 0;
>> }
>
> (Only msr.host_initiated changed from do_get_msr() ...
> I'd add a function with an extra bool arg and call it twice.)

True, but the same situation is there already for do_set_msr vs.
emulator_set_msr

Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/