Re: [PATCH 2/13] KVM: MIPS: Pass type of fault down to kvm_mips_map_page()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, Jan 19, 2017 at 04:29:51PM +0800, jiang.biao2@xxxxxxxxxx wrote:
> Hi, James
> 
> 
> 
> 
> 
> 
> 
> > Whats wrong with bool parameters?
>
> > It needs a GPA mapping created, either for a read or a write depending
> > on the caller. bool would seem ideally suited for just such a situation,
> > and in fact its exactly what the KVM GPA fault code path does to pass
> > whether the page needs to be writable:
>
> > kvm_mips_map_page() -> gfn_to_pfn_prot() -> __gfn_to_pfn_memslot() ->
> > hva_to_pfn() -> hva_to_pfn_slow().
>
> > so all this really does is extend that pattern up the other way as
> > necessary to be able to provide that information to gfn_to_pfn_prot().
> Bool parameter may make the code less readable.  :-)
> 
> 
> The way used is indeed consistent with the exist pattern, but the tramp data 
> 
> 
> passed around and long parameters list maybe code smell(not for sure for 
> 
> 
> the kernel :-) ),  which may be improved by some means.
> 
> No offense,  just personal opinion. :-)

No offense taken :-)

Thanks again for reviewing,

Cheers
James

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux