linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: <jiang.biao2@zte.com.cn>
Cc: <linux-mips@linux-mips.org>, <pbonzini@redhat.com>,
	<rkrcmar@redhat.com>, <ralf@linux-mips.org>,
	<kvm@vger.kernel.org>
Subject: Re: [PATCH 2/13] KVM: MIPS: Pass type of fault down to kvm_mips_map_page()
Date: Thu, 19 Jan 2017 09:08:03 +0000	[thread overview]
Message-ID: <20170119090803.GE31545@jhogan-linux.le.imgtec.org> (raw)
In-Reply-To: <201701191629518310684@zte.com.cn>

[-- Attachment #1: Type: text/plain, Size: 1162 bytes --]

Hi,

On Thu, Jan 19, 2017 at 04:29:51PM +0800, jiang.biao2@zte.com.cn 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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: James Hogan <james.hogan@imgtec.com>
To: jiang.biao2@zte.com.cn
Cc: linux-mips@linux-mips.org, pbonzini@redhat.com,
	rkrcmar@redhat.com, ralf@linux-mips.org, kvm@vger.kernel.org
Subject: Re: [PATCH 2/13] KVM: MIPS: Pass type of fault down to kvm_mips_map_page()
Date: Thu, 19 Jan 2017 09:08:03 +0000	[thread overview]
Message-ID: <20170119090803.GE31545@jhogan-linux.le.imgtec.org> (raw)
Message-ID: <20170119090803.tugZhjjn5bBe9Nqz4a9BEryDrRmY_6cmXQy8VZFiEYQ@z> (raw)
In-Reply-To: <201701191629518310684@zte.com.cn>

[-- Attachment #1: Type: text/plain, Size: 1162 bytes --]

Hi,

On Thu, Jan 19, 2017 at 04:29:51PM +0800, jiang.biao2@zte.com.cn 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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

       reply	other threads:[~2017-01-19  9:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201701191629518310684@zte.com.cn>
2017-01-19  9:08 ` James Hogan [this message]
2017-01-19  9:08   ` [PATCH 2/13] KVM: MIPS: Pass type of fault down to kvm_mips_map_page() James Hogan
     [not found] <201701181618464411994@zte.com.cn>
2017-01-18 12:12 ` James Hogan
2017-01-18 12:12   ` James Hogan
     [not found] <201701171906397244491@zte.com.cn>
2017-01-17 13:27 ` James Hogan
2017-01-17 13:27   ` James Hogan
2017-01-16 12:49 [PATCH 0/13] KVM: MIPS: Dirty logging, SYNC_MMU & READONLY_MEM James Hogan
2017-01-16 12:49 ` [PATCH 2/13] KVM: MIPS: Pass type of fault down to kvm_mips_map_page() James Hogan
2017-01-16 12:49   ` James Hogan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170119090803.GE31545@jhogan-linux.le.imgtec.org \
    --to=james.hogan@imgtec.com \
    --cc=jiang.biao2@zte.com.cn \
    --cc=kvm@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=pbonzini@redhat.com \
    --cc=ralf@linux-mips.org \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).