Re: [PATCH 4/4] Modify KVM to update guest time accounting.

Laurent Vivier
2007-08-20T13:49:57Z

[-- Attachment #1.1: Type: text/plain, Size: 1428 bytes --]

Avi Kivity wrote:
> Laurent Vivier wrote:
>> [PATCH 4/4] Modify KVM to update guest time accounting.
>>
>>
>
>> Index: kvm/drivers/kvm/kvm.h
>> ===================================================================
>> --- kvm.orig/drivers/kvm/kvm.h 2007-08-20 13:23:53.000000000 +0200
>> +++ kvm/drivers/kvm/kvm.h 2007-08-20 13:23:58.000000000 +0200
>> @@ -589,6 +589,17 @@ void kvm_mmu_unload(struct kvm_vcpu *vcp
>>
>> int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run);
>>
>> +static inline void kvm_guest_enter(void)
>> +{
>> +#ifdef CONFIG_GUEST_ACCOUNTING
>> + current->flags |= PF_VCPU;
>> +#endif
>>
>
> Since you select GUEST_ACCOUNTING, the #ifdef is always true?

It is just to avoid error if we compile kvm module outside of the kernel, with
kernel without support of guest accounting. Can be removed if you want.

>> +}
>> +
>> +static inline void kvm_guest_exit(void)
>> +{
>>
>
> Missing content?

No, empty function.

It is just to introduce "symmetry" in code, the VCPU code begins with
"kvm_guest_start()" and ends with "kvm_guest_exit()". And we have no operation
to do in kvm_guest_exit() (the PF_VCPU is cleared by account_system_time()), so
"empty function", removed by the optimizer (I hope).

Laurent
--
------------- Laurent.Vivier-6ktuUTfB/bM@public.gmane.org --------------
"Software is hard" - Donald Knuth

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 315 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

[-- Attachment #3: Type: text/plain, Size: 186 bytes --]