From: Scott Wood <scottwood@freescale•com>
To: Bhushan Bharat-R65777 <R65777@freescale•com>
Cc: Wood Scott-B07421 <B07421@freescale•com>,
"kvm@vger•kernel.org" <kvm@vger•kernel.org>,
Alexander Graf <agraf@suse•de>,
"kvm-ppc@vger•kernel.org" <kvm-ppc@vger•kernel.org>,
"linuxppc-dev@lists•ozlabs.org" <linuxppc-dev@lists•ozlabs.org>
Subject: Re: [PATCH v2 4/4] kvm/ppc: IRQ disabling cleanup
Date: Fri, 10 May 2013 17:53:23 -0500 [thread overview]
Message-ID: <1368226403.19683.15@snotra> (raw)
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D0700F859@039-SN2MPN1-011.039d.mgd.msft.net> (from R65777@freescale.com on Fri May 10 00:01:38 2013)
On 05/10/2013 12:01:38 AM, Bhushan Bharat-R65777 wrote:
>=20
>=20
> > -----Original Message-----
> > From: kvm-ppc-owner@vger•kernel.org =20
> [mailto:kvm-ppc-owner@vger•kernel.org] On
> > Behalf Of Scott Wood
> > Sent: Friday, May 10, 2013 8:40 AM
> > To: Alexander Graf; Benjamin Herrenschmidt
> > Cc: kvm-ppc@vger•kernel.org; kvm@vger•kernel.org; =20
> linuxppc-dev@lists•ozlabs.org;
> > Wood Scott-B07421
> > Subject: [PATCH v2 4/4] kvm/ppc: IRQ disabling cleanup
> >
> > - WARN_ON_ONCE(!irqs_disabled());
> > + WARN_ON(irqs_disabled());
> > + hard_irq_disable();
>=20
> Here we hard disable in kvmppc_prepare_to_enter(), so my comment in =20
> other patch about interrupt loss is no more valid.
>=20
> So here
> MSR.EE =3D 0
> local_paca->soft_enabled =3D 0
> local_paca->irq_happened |=3D PACA_IRQ_HARD_DIS;
>=20
> > +
> > while (true) {
> > if (need_resched()) {
> > local_irq_enable();
>=20
> This will make the state:
> MSR.EE =3D 1
> local_paca->soft_enabled =3D 1
> local_paca->irq_happened =3D PACA_IRQ_HARD_DIS; //same as before
>=20
> Is that a valid state where interrupts are fully enabled and =20
> irq_happend in not 0?
PACA_IRQ_HARD_DIS will have been cleared by local_irq_enable(), as =20
Tiejun pointed out.
> int kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu)
> {
> int r =3D 0;
> WARN_ON_ONCE(!irqs_disabled());
>=20
> kvmppc_core_check_exceptions(vcpu);
>=20
> if (vcpu->requests) {
> /* Exception delivery raised request; start over */
> return 1;
> }
>=20
> if (vcpu->arch.shared->msr & MSR_WE) {
> local_irq_enable();
> kvm_vcpu_block(vcpu);
> clear_bit(KVM_REQ_UNHALT, &vcpu->requests);
> local_irq_disable();
> ^^^
> We do not require hard_irq_disable() here?
Yes, that should be changed to hard_irq_disable(), and I'll add a =20
WARN_ON to double check that interrupts are hard-disabled (eventually =20
we'll probably want to make these critical-path assertions dependent on =20
a debug option...). It doesn't really matter all that much, though, =20
since we don't have MSR_WE on any 64-bit booke chips. :-)
-Scott=
prev parent reply other threads:[~2013-05-10 22:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-10 3:09 [PATCH v2 0/4] kvm/ppc: interrupt disabling fixes Scott Wood
2013-05-10 3:09 ` [PATCH v2 1/4] powerpc: hard_irq_disable(): Call trace_hardirqs_off after disabling Scott Wood
2013-05-10 7:00 ` Benjamin Herrenschmidt
2013-05-10 3:09 ` [PATCH v2 2/4] kvm/ppc/booke64: Fix lazy ee handling in kvmppc_handle_exit() Scott Wood
2013-05-10 5:01 ` Bhushan Bharat-R65777
2013-05-10 22:43 ` Scott Wood
2013-05-10 3:09 ` [PATCH v2 3/4] kvm/ppc: Call trace_hardirqs_on before entry Scott Wood
2013-05-10 3:34 ` Bhushan Bharat-R65777
2013-05-10 4:40 ` tiejun.chen
2013-05-10 22:47 ` Scott Wood
2013-05-10 3:09 ` [PATCH v2 4/4] kvm/ppc: IRQ disabling cleanup Scott Wood
2013-05-10 5:01 ` Bhushan Bharat-R65777
2013-05-10 5:31 ` tiejun.chen
2013-05-10 22:53 ` Scott Wood [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=1368226403.19683.15@snotra \
--to=scottwood@freescale$(echo .)com \
--cc=B07421@freescale$(echo .)com \
--cc=R65777@freescale$(echo .)com \
--cc=agraf@suse$(echo .)de \
--cc=kvm-ppc@vger$(echo .)kernel.org \
--cc=kvm@vger$(echo .)kernel.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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