KVM: MIPS: Pass type of fault down to kvm_mips_map_page()
Hi,
Quoted 26 lines · On Thu, Jan 19, 2017 at 04:29:51PM +0800, [email protected] 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 togfn_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
Quoted 6 lines
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