public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Juergen Gross <jgross@suse.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] KVM fixes for v4.12-rc2
Date: Mon, 22 May 2017 16:37:12 +0200	[thread overview]
Message-ID: <20170522143711.GA30620@potion> (raw)
In-Reply-To: <97a8ffc4-dd0f-3e2a-0dc4-1ac46c993745@suse.com>

2017-05-20 12:52+0200, Juergen Gross:
> On 20/05/17 00:21, Linus Torvalds wrote:
> > So I noticed that my diffstat didn't match either the KVM or the Xen pull.
> > 
> > The *reason* seems to be that both Radim and Juergen have enabled the
> > "patience" diff, because if I add "--patience" to the diff line, I get
> > the same numbers you guys report.
> 
> In my case it was a patch which was much easier to review using the
> patience diff. I just didn't switch back afterwards (what I did now).

Similar here.  I have the 'histogram' algorithm in the global config for
few years now.
Using the same algorithm for pull diffstat would be best, though;
I added "algorithm = default" to the repo config.


---
This KVM pull shows the reason why I abandoned 'myers' -- it can
obfuscate simple cut & paste. (I don't recall the case that brought
'histogram' and there apparently were no significant improvements to be
gained by switching since then.)

The patch in question is 76d837a4c0f9 ("KVM: PPC: Book3S PR: Don't
include SPAPR TCE code on non-pseries platforms"), see trimmed output of
both algorithms below.

First, the important hunks of the 'histogram' diff:

    @@ -244,20 +262,6 @@ static int kvmppc_h_pr_protect(struct kvm_vcpu *vcpu)
     	return EMULATE_DONE;
     }
     
    -static int kvmppc_h_pr_put_tce(struct kvm_vcpu *vcpu)
    -{
    -	unsigned long liobn = kvmppc_get_gpr(vcpu, 4);
    -	unsigned long ioba = kvmppc_get_gpr(vcpu, 5);
    -	unsigned long tce = kvmppc_get_gpr(vcpu, 6);
    -	long rc;
    -
    -	rc = kvmppc_h_put_tce(vcpu, liobn, ioba, tce);
    -	if (rc == H_TOO_HARD)
    -		return EMULATE_FAIL;
    -	kvmppc_set_gpr(vcpu, 3, rc);
    -	return EMULATE_DONE;
    -}
    -
     static int kvmppc_h_pr_logical_ci_load(struct kvm_vcpu *vcpu)
     {
     	long rc;
    @@ -280,6 +284,21 @@ static int kvmppc_h_pr_logical_ci_store(struct kvm_vcpu *vcpu)
     	return EMULATE_DONE;
     }
     
    +#ifdef CONFIG_SPAPR_TCE_IOMMU
    +static int kvmppc_h_pr_put_tce(struct kvm_vcpu *vcpu)
    +{
    +	unsigned long liobn = kvmppc_get_gpr(vcpu, 4);
    +	unsigned long ioba = kvmppc_get_gpr(vcpu, 5);
    +	unsigned long tce = kvmppc_get_gpr(vcpu, 6);
    +	long rc;
    +
    +	rc = kvmppc_h_put_tce(vcpu, liobn, ioba, tce);
    +	if (rc == H_TOO_HARD)
    +		return EMULATE_FAIL;
    +	kvmppc_set_gpr(vcpu, 3, rc);
    +	return EMULATE_DONE;
    +}
    +
     static int kvmppc_h_pr_put_tce_indirect(struct kvm_vcpu *vcpu)
     {
     	unsigned long liobn = kvmppc_get_gpr(vcpu, 4);


and now the same change with the 'myers' algorithm:

    @@ -244,36 +262,37 @@ static int kvmppc_h_pr_protect(struct kvm_vcpu *vcpu)
     	return EMULATE_DONE;
     }
     
    -static int kvmppc_h_pr_put_tce(struct kvm_vcpu *vcpu)
    +static int kvmppc_h_pr_logical_ci_load(struct kvm_vcpu *vcpu)
     {
    -	unsigned long liobn = kvmppc_get_gpr(vcpu, 4);
    -	unsigned long ioba = kvmppc_get_gpr(vcpu, 5);
    -	unsigned long tce = kvmppc_get_gpr(vcpu, 6);
     	long rc;
     
    -	rc = kvmppc_h_put_tce(vcpu, liobn, ioba, tce);
    +	rc = kvmppc_h_logical_ci_load(vcpu);
     	if (rc == H_TOO_HARD)
     		return EMULATE_FAIL;
     	kvmppc_set_gpr(vcpu, 3, rc);
     	return EMULATE_DONE;
     }
     
    -static int kvmppc_h_pr_logical_ci_load(struct kvm_vcpu *vcpu)
    +static int kvmppc_h_pr_logical_ci_store(struct kvm_vcpu *vcpu)
     {
     	long rc;
     
    -	rc = kvmppc_h_logical_ci_load(vcpu);
    +	rc = kvmppc_h_logical_ci_store(vcpu);
     	if (rc == H_TOO_HARD)
     		return EMULATE_FAIL;
     	kvmppc_set_gpr(vcpu, 3, rc);
     	return EMULATE_DONE;
     }
     
    -static int kvmppc_h_pr_logical_ci_store(struct kvm_vcpu *vcpu)
    +#ifdef CONFIG_SPAPR_TCE_IOMMU
    +static int kvmppc_h_pr_put_tce(struct kvm_vcpu *vcpu)
     {
    +	unsigned long liobn = kvmppc_get_gpr(vcpu, 4);
    +	unsigned long ioba = kvmppc_get_gpr(vcpu, 5);
    +	unsigned long tce = kvmppc_get_gpr(vcpu, 6);
     	long rc;
     
    -	rc = kvmppc_h_logical_ci_store(vcpu);
    +	rc = kvmppc_h_put_tce(vcpu, liobn, ioba, tce);
     	if (rc == H_TOO_HARD)
     		return EMULATE_FAIL;
     	kvmppc_set_gpr(vcpu, 3, rc);


The move of kvmppc_h_pr_put_tce() under #ifdef is not so simple anymore.

      reply	other threads:[~2017-05-22 14:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19 18:43 [GIT PULL] KVM fixes for v4.12-rc2 Radim Krčmář
2017-05-19 22:21 ` Linus Torvalds
2017-05-20 10:52   ` Juergen Gross
2017-05-22 14:37     ` Radim Krčmář [this message]

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=20170522143711.GA30620@potion \
    --to=rkrcmar@redhat.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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