lkml.org 
[lkml]   [2006]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/7] KVM: mmu virtualization
Jan Engelhardt wrote:
>> +static int is_write_protection(void)
>> +{
>> + return guest_cr0() & CR0_WP_MASK;
>> +}
>> +
>> +static int is_cpuid_PSE36(void)
>> +{
>> + return 1;
>> +}
>> +
>> +static int is_present_pte(unsigned long pte)
>> +{
>> + return pte & PT_PRESENT_MASK;
>> +}
>> +
>> +static int is_writeble_pte(unsigned long pte)
>> +{
>> + return pte & PT_WRITABLE_MASK;
>> +}
>> +
>> +static int is_io_pte(unsigned long pte)
>> +{
>> + return pte & PT_SHADOW_IO_MARK;
>> +}
>>
>
> Unless the above will grow in size by later patches, or is taken address of,
> mark them static inline.
>
>

gcc inlines them well enough based on size. That means I don't have to
keep adding/removing inline declarations.

>> +static void nonpaging_new_cr3(struct kvm_vcpu *vcpu)
>> +{
>> +}
>>
>
> Remove it unless needed shortly afterwards.
>
>

That's a (*callback)().

>> +static gpa_t nonpaging_gva_to_gpa(struct kvm_vcpu *vcpu, gva_t vaddr)
>> +{
>> + return vaddr;
>> +}
>>
>
> Candidate for inline too.
>
>

Ditto.


>> +static void nonpaging_inval_page(struct kvm_vcpu *vcpu, gva_t addr)
>> +{
>> +}
>>
>
> Removal candidate
>
>

Ditto.

>> +int kvm_mmu_reset_context(struct kvm_vcpu *vcpu)
>> +{
>> + destroy_kvm_mmu(vcpu);
>> + return init_kvm_mmu(vcpu);
>> +}
>>
>
> Inline candidate.
>
>

It's used in another file. gcc will probably inline its callees.

>> Index: linux-2.6/drivers/kvm/paging_tmpl.h
>> ===================================================================
>> + #define PT_DIR_BASE_ADDR_MASK PT32_DIR_BASE_ADDR_MASK
>> + #define PT_INDEX(addr, level) PT32_INDEX(addr, level)
>> + #define SHADOW_PT_INDEX(addr, level) PT64_INDEX(addr, level)
>> + #define PT_LEVEL_MASK(level) PT32_LEVEL_MASK(level)
>> + #define PT_PTE_COPY_MASK PT32_PTE_COPY_MASK
>> + #define PT_NON_PTE_COPY_MASK PT32_NON_PTE_COPY_MASK
>> +#else
>> + error
>> +#endif
>>
>
> #error Free Ad Space Here
> it is.
>
>

Will fix. Thanks for the review.

--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.

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

\
 
 \ /
  Last update: 2006-10-20 09:27    [W:0.090 / U:2.160 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site