All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@ozlabs.org>
To: kvm@vger.kernel.org
Cc: kvm-ppc@vger.kernel.org, Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Subject: Re: [PATCH] KVM: PPC: Book3S HV: Handle virtual mode in XIVE VCPU push code
Date: Tue, 30 Apr 2019 10:07:48 +0000	[thread overview]
Message-ID: <20190430100748.GG32205@blackberry> (raw)
In-Reply-To: <20190429085745.GA17146@blackberry>

On Mon, Apr 29, 2019 at 06:57:45PM +1000, Paul Mackerras wrote:
> From: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
> 
> The code in book3s_hv_rmhandlers.S that pushes the XIVE virtual CPU
> context to the hardware currently assumes it is being called in real
> mode, which is usually true.  There is however a path by which it can
> be executed in virtual mode, in the case where indep_threads_mode = N.
> A virtual CPU executing on an offline secondary thread can take a
> hypervisor interrupt in virtual mode and return from the
> kvmppc_hv_entry() call after the kvm_secondary_got_guest label.
> It is possible for it to be given another vcpu to execute before it
> gets to execute the stop instruction.  In that case it will call
> kvmppc_hv_entry() for the second VCPU in virtual mode, and the XIVE
> vCPU push code will be executed in virtual mode.  The result in that
> case will be a host crash due to an unexpected data storage interrupt
> caused by executing the stdcix instruction in virtual mode.
> 
> This fixes it by adding a code path for virtual mode, which uses the
> virtual TIMA pointer and normal load/store instructions.
> 
> [paulus@ozlabs.org - wrote patch description]
> 
> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>

Patch applied to my kvm-ppc-next tree.

Paul.

WARNING: multiple messages have this Message-ID (diff)
From: Paul Mackerras <paulus@ozlabs.org>
To: kvm@vger.kernel.org
Cc: kvm-ppc@vger.kernel.org, Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Subject: Re: [PATCH] KVM: PPC: Book3S HV: Handle virtual mode in XIVE VCPU push code
Date: Tue, 30 Apr 2019 20:07:48 +1000	[thread overview]
Message-ID: <20190430100748.GG32205@blackberry> (raw)
In-Reply-To: <20190429085745.GA17146@blackberry>

On Mon, Apr 29, 2019 at 06:57:45PM +1000, Paul Mackerras wrote:
> From: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
> 
> The code in book3s_hv_rmhandlers.S that pushes the XIVE virtual CPU
> context to the hardware currently assumes it is being called in real
> mode, which is usually true.  There is however a path by which it can
> be executed in virtual mode, in the case where indep_threads_mode = N.
> A virtual CPU executing on an offline secondary thread can take a
> hypervisor interrupt in virtual mode and return from the
> kvmppc_hv_entry() call after the kvm_secondary_got_guest label.
> It is possible for it to be given another vcpu to execute before it
> gets to execute the stop instruction.  In that case it will call
> kvmppc_hv_entry() for the second VCPU in virtual mode, and the XIVE
> vCPU push code will be executed in virtual mode.  The result in that
> case will be a host crash due to an unexpected data storage interrupt
> caused by executing the stdcix instruction in virtual mode.
> 
> This fixes it by adding a code path for virtual mode, which uses the
> virtual TIMA pointer and normal load/store instructions.
> 
> [paulus@ozlabs.org - wrote patch description]
> 
> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>

Patch applied to my kvm-ppc-next tree.

Paul.

  reply	other threads:[~2019-04-30 10:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29  8:57 [PATCH] KVM: PPC: Book3S HV: Handle virtual mode in XIVE VCPU push code Paul Mackerras
2019-04-29  8:57 ` Paul Mackerras
2019-04-30 10:07 ` Paul Mackerras [this message]
2019-04-30 10:07   ` Paul Mackerras

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=20190430100748.GG32205@blackberry \
    --to=paulus@ozlabs.org \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=sjitindarsingh@gmail.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 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.