From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alexander Graf <agraf@suse.de>
Cc: "tiejun.chen" <tiejun.chen@windriver.com>,
"<kvm-ppc@vger.kernel.org>" <kvm-ppc@vger.kernel.org>,
"<kvm@vger.kernel.org> list" <kvm@vger.kernel.org>
Subject: Re: [v1][PATCH 1/1] KVM: PPC: disable preemption when using hard_irq_disable()
Date: Thu, 11 Jul 2013 22:54:53 +1000 [thread overview]
Message-ID: <1373547293.19894.99.camel@pasglop> (raw)
In-Reply-To: <3B36D92F-CD11-49A0-A0F5-CD3E49BD6793@suse.de>
On Thu, 2013-07-11 at 14:47 +0200, Alexander Graf wrote:
> > Yes of course, that's what we call "soft disabled" :-) It's even the
> > whole point of doing lazy disable...
>
> Meh. Of course it's soft_enabled = 1; hard_enabled = 0.
That doesn't happen in "normal" C code. It happens under very specific
circumstances, such as in the guts of entry_64.S, in areas where we just
want to temporarily mask HW interrupts without changing the SW state
(and thus without having to deal with replays etc...).
We typically also do that right before going to idle on some processors
where we come back from idle with interrupts hard enabled, possibly
right in an interrupt vector.
Typically that's a state that makes some sense on KVM entry. From a
Linux perspective, you enter KVM with interrupts enabled. But you
temporarily hard disable on the way down while doing the low level
context switch.
This works well as long as you know you have no pending replay event.
That should be fine if you do a direct transition from soft+hard enabled
to hard disabled (without soft disabling). In that case there should be
nothing in irq_happened.
It's equivalent to returning to userspace from the kernel. We are
soft-enabled, but the code in ret_from_except hard disables while
mucking around with TIF_FLAGS etc... until the final rfid
Cheers,
Ben.
next prev parent reply other threads:[~2013-07-11 12:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-10 6:02 [v1][PATCH 1/1] KVM: PPC: disable preemption when using hard_irq_disable() Tiejun Chen
2013-07-10 9:49 ` Alexander Graf
2013-07-11 2:48 ` tiejun.chen
2013-07-11 9:49 ` Alexander Graf
2013-07-11 12:28 ` Benjamin Herrenschmidt
2013-07-11 12:47 ` Alexander Graf
2013-07-11 12:54 ` Benjamin Herrenschmidt [this message]
2013-07-11 13:07 ` Alexander Graf
2013-07-12 0:19 ` Benjamin Herrenschmidt
2013-07-12 2:13 ` tiejun.chen
2013-07-12 3:57 ` Benjamin Herrenschmidt
2013-07-12 4:54 ` tiejun.chen
2013-07-14 4:13 ` Benjamin Herrenschmidt
2013-07-15 3:04 ` tiejun.chen
2013-07-10 19:15 ` Scott Wood
2013-07-11 3:00 ` tiejun.chen
2013-07-11 14:13 ` Scott Wood
[not found] <1373559480.8183.258@snotra>
2013-07-12 0:30 ` Benjamin Herrenschmidt
[not found] ` <FB21594A-C233-4A97-8503-E2A1275F8F17@suse.de>
[not found] ` <1373560585.8183.261@snotra>
2013-07-12 3:22 ` tiejun.chen
[not found] <1373651433.8183.276@snotra>
2013-07-12 23:05 ` Benjamin Herrenschmidt
2013-07-15 2:20 ` tiejun.chen
2013-07-15 2:47 ` Benjamin Herrenschmidt
2013-07-15 3:03 ` tiejun.chen
[not found] ` <1373909248.8183.303@snotra>
2013-07-16 2:15 ` tiejun.chen
2013-07-15 2:25 ` tiejun.chen
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=1373547293.19894.99.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=tiejun.chen@windriver.com \
/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