From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: "<kvm@vger.kernel.org>" <kvm@vger.kernel.org>,
"<kvm-ppc@vger.kernel.org>" <kvm-ppc@vger.kernel.org>
Subject: Re: [PATCH 3/6] KVM: PPC: booke: Check for MSR[WE] in prepare_to_enter
Date: Mon, 14 Nov 2011 18:56:41 +0000 [thread overview]
Message-ID: <4EC16469.6090108@freescale.com> (raw)
In-Reply-To: <1D7AA65D-00B5-4E06-97AD-3912A3D63E9A@suse.de>
On 11/14/2011 12:01 PM, Alexander Graf wrote:
>
> On 14.11.2011, at 18:22, Scott Wood <scottwood@freescale.com> wrote:
>
>> kvmppc_core_check_exceptions can clear MSR_WE, so we need to check after
>> that. We can't enable interrupts after kvmppc_core_check_exceptions (or
>> rather, if we do, we need to check again once interrupts are
>> re-disabled, as in the MSR_WE case) because otherwise we could have an
>> exception delivered afterward and receive the resched IPI at just the
>> wrong time to take any action on it (just like the signal check).
>
> Well, but if you enable interrupts here you're basically rendering code that runs earlier in disabled-interrupt mode racy.
That's why once we wake, we disable interrupts and check again.
> How does this align with the signal handling? We could receive a signal here and not handle it the same as the race you fixed earlier, no?
Signals are checked by the caller after calling prepare_to_enter.
Moving the check into prepare_to_enter wouldn't buy us much since the
method of returning is different, and so there'd still need to be code
in the caller to deal with it.
-Scott
WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: "<kvm@vger.kernel.org>" <kvm@vger.kernel.org>,
"<kvm-ppc@vger.kernel.org>" <kvm-ppc@vger.kernel.org>
Subject: Re: [PATCH 3/6] KVM: PPC: booke: Check for MSR[WE] in prepare_to_enter
Date: Mon, 14 Nov 2011 12:56:41 -0600 [thread overview]
Message-ID: <4EC16469.6090108@freescale.com> (raw)
In-Reply-To: <1D7AA65D-00B5-4E06-97AD-3912A3D63E9A@suse.de>
On 11/14/2011 12:01 PM, Alexander Graf wrote:
>
> On 14.11.2011, at 18:22, Scott Wood <scottwood@freescale.com> wrote:
>
>> kvmppc_core_check_exceptions can clear MSR_WE, so we need to check after
>> that. We can't enable interrupts after kvmppc_core_check_exceptions (or
>> rather, if we do, we need to check again once interrupts are
>> re-disabled, as in the MSR_WE case) because otherwise we could have an
>> exception delivered afterward and receive the resched IPI at just the
>> wrong time to take any action on it (just like the signal check).
>
> Well, but if you enable interrupts here you're basically rendering code that runs earlier in disabled-interrupt mode racy.
That's why once we wake, we disable interrupts and check again.
> How does this align with the signal handling? We could receive a signal here and not handle it the same as the race you fixed earlier, no?
Signals are checked by the caller after calling prepare_to_enter.
Moving the check into prepare_to_enter wouldn't buy us much since the
method of returning is different, and so there'd still need to be code
in the caller to deal with it.
-Scott
next prev parent reply other threads:[~2011-11-14 18:56 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-09 0:22 [PATCH 0/6] KVM: PPC: mostly booke: race and idle fixes, paravirt Scott Wood
2011-11-09 0:22 ` Scott Wood
2011-11-09 0:23 ` [PATCH 1/6] KVM: PPC: Rename deliver_interrupts to prepare_to_enter Scott Wood
2011-11-09 0:23 ` Scott Wood
2011-11-09 0:23 ` [PATCH 2/6] KVM: PPC: Move prepare_to_enter call site into subarch Scott Wood
2011-11-09 0:23 ` [PATCH 2/6] KVM: PPC: Move prepare_to_enter call site into subarch code Scott Wood
2011-11-09 0:23 ` [PATCH 3/6] KVM: PPC: booke: Check for MSR[WE] in prepare_to_enter Scott Wood
2011-11-09 0:23 ` Scott Wood
2011-11-14 13:13 ` Alexander Graf
2011-11-14 13:13 ` Alexander Graf
2011-11-14 17:22 ` Scott Wood
2011-11-14 17:22 ` Scott Wood
2011-11-14 18:01 ` Alexander Graf
2011-11-14 18:01 ` Alexander Graf
2011-11-14 18:56 ` Scott Wood [this message]
2011-11-14 18:56 ` Scott Wood
2011-11-09 0:23 ` [PATCH 4/6] KVM: PPC: booke: Fix int_pending calculation for MSR[EE] Scott Wood
2011-11-09 0:23 ` [PATCH 4/6] KVM: PPC: booke: Fix int_pending calculation for MSR[EE] paravirt Scott Wood
2011-11-09 0:23 ` [PATCH 5/6] KVM: PPC: booke: Paravirtualize wrtee Scott Wood
2011-11-09 0:23 ` Scott Wood
2011-11-09 0:23 ` [PATCH 6/6] KVM: PPC: Paravirtualize SPRG4-7, ESR, PIR, MASn Scott Wood
2011-11-09 0:23 ` Scott Wood
2011-11-18 13:12 ` [PATCH 0/6] KVM: PPC: mostly booke: race and idle fixes, paravirt Alexander Graf
2011-11-18 13:12 ` Alexander Graf
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=4EC16469.6090108@freescale.com \
--to=scottwood@freescale.com \
--cc=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.