public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
To: Anthony Liguori <anthony-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH 1/2] KVM: Remove arch specific components	from	the general code
Date: Fri, 27 Jul 2007 09:54:01 +1000	[thread overview]
Message-ID: <1185494042.9484.29.camel@localhost.localdomain> (raw)
In-Reply-To: <46A8B816.7080303-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>

On Thu, 2007-07-26 at 10:04 -0500, Anthony Liguori wrote:
> How are you planning on going about switching to container_of()?  Commit 
> this, commit Rusty's stuff, then commit a fix or commit Rusty's stuff, 
> then update your patch set?

My patch is less mature, and am still arguing with Avi about the
details.

So I'll pull in Gregory's patch and try to work mine on top.  They
overlap somewhat, but mine should get rid of some of the warts,
including converting to container_of, and getting rid of "valid".

> >  static void svm_inject_gp(struct kvm_vcpu *vcpu, unsigned error_code)
> >  {
> > -	vcpu->svm->vmcb->control.event_inj = 	SVM_EVTINJ_VALID |
> > +	svm(vcpu)->vmcb->control.event_inj = 	SVM_EVTINJ_VALID |
> >  						SVM_EVTINJ_VALID_ERR |
> >  						SVM_EVTINJ_TYPE_EXEPT |
> >  						GP_VECTOR;
> > -	vcpu->svm->vmcb->control.event_inj_err = error_code;
> > +	svm(vcpu)->vmcb->control.event_inj_err = error_code;
> >  }
> 
> I'm willing to concede on using the name "svm()" here although I think 

Kernel convention seems to be converging on "to_<typename>", so
"to_vcpu_svm" (although "svm_vcpu" rings better than "vcpu_svm" to me,
but that's minor).

static inline struct vcpu_svm *to_vcpu_svm(struct kvm_vcpu *vcpu)
{
#if LATER
	return container_of(vcpu, struct vcpu_svm, vcpu);
#else
	return vcpu->_priv;
#endif
}

Cheers,
Rusty.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

  parent reply	other threads:[~2007-07-26 23:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-26 14:51 [PATCH 0/2] Arch cleanup v3 Gregory Haskins
     [not found] ` <20070726144602.4847.64724.stgit-sLgBBP33vUGnsjUZhwzVf9HuzzzSOjJt@public.gmane.org>
2007-07-26 14:52   ` [PATCH 1/2] KVM: Remove arch specific components from the general code Gregory Haskins
     [not found]     ` <20070726145204.4847.53350.stgit-sLgBBP33vUGnsjUZhwzVf9HuzzzSOjJt@public.gmane.org>
2007-07-26 15:04       ` Anthony Liguori
     [not found]         ` <46A8B816.7080303-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-07-26 15:10           ` Avi Kivity
2007-07-26 17:44           ` Paul Turner
2007-07-26 23:54           ` Rusty Russell [this message]
2007-07-26 14:52   ` [PATCH 2/2] KVM: Protect race-condition between VMCS and current_vmcs on VMX hardware Gregory Haskins
     [not found]     ` <20070726145210.4847.90637.stgit-sLgBBP33vUGnsjUZhwzVf9HuzzzSOjJt@public.gmane.org>
2007-07-26 15:03       ` Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2007-07-26 15:18 [PATCH 1/2] KVM: Remove arch specific components from the general code Gregory Haskins
2007-07-27 12:13 [PATCH 0/2] Arch cleanup v5 Gregory Haskins
     [not found] ` <20070727121250.9876.36599.stgit-sLgBBP33vUGnsjUZhwzVf9HuzzzSOjJt@public.gmane.org>
2007-07-27 12:13   ` [PATCH 1/2] KVM: Remove arch specific components from the general code Gregory Haskins
     [not found]     ` <20070727121309.9876.76020.stgit-sLgBBP33vUGnsjUZhwzVf9HuzzzSOjJt@public.gmane.org>
2007-07-29  7:48       ` Avi Kivity

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=1185494042.9484.29.camel@localhost.localdomain \
    --to=rusty-8n+1lvoiyb80n/f98k4iww@public.gmane.org \
    --cc=anthony-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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