Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1646988

Re: [GIT PULL] KVM fixes for v4.12-rc2

From Radim Krčmář <rkrcmar@redhat.com>
Newsgroups linux.kernel
Subject Re: [GIT PULL] KVM fixes for v4.12-rc2
Date 2017-05-22 16:40 +0200
Message-ID <tJWF4-6Ra-21@gated-at.bofh.it> (permalink)
References <tIV8m-63l-7@gated-at.bofh.it> <tIYzg-hU-5@gated-at.bofh.it> <tJah3-jb-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[GIT PULL] KVM fixes for v4.12-rc2 Radim Krčmář <rkrcmar@redhat.com> - 2017-05-19 20:50 +0200
  Re: [GIT PULL] KVM fixes for v4.12-rc2 Linus Torvalds <torvalds@linux-foundation.org> - 2017-05-20 00:30 +0200
    Re: [GIT PULL] KVM fixes for v4.12-rc2 Juergen Gross <jgross@suse.com> - 2017-05-20 13:00 +0200
      Re: [GIT PULL] KVM fixes for v4.12-rc2 Radim Krčmář <rkrcmar@redhat.com> - 2017-05-22 16:40 +0200

csiph-web