From: Avi Kivity <avi@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: kvm-ppc@vger.kernel.org, kvm list <kvm@vger.kernel.org>,
Marcelo Tosatti <mtosatti@redhat.com>,
Scott Wood <scottwood@freescale.com>
Subject: Re: [PATCH 01/14] KVM: PPC: e500: don't translate gfn to pfn with preemption disabled
Date: Mon, 31 Oct 2011 14:50:40 +0200 [thread overview]
Message-ID: <4EAE99A0.7050903@redhat.com> (raw)
In-Reply-To: <1320047596-20577-2-git-send-email-agraf@suse.de>
On 10/31/2011 09:53 AM, Alexander Graf wrote:
> From: Scott Wood <scottwood@freescale.com>
>
> Delay allocation of the shadow pid until we're ready to disable
> preemption and write the entry.
>
> @@ -507,21 +507,16 @@ static inline void kvmppc_e500_deliver_tlb_miss(struct kvm_vcpu *vcpu,
> vcpu_e500->mas7 = 0;
> }
>
> +/* TID must be supplied by the caller */
> static inline void kvmppc_e500_setup_stlbe(struct kvmppc_vcpu_e500 *vcpu_e500,
> struct tlbe *gtlbe, int tsize,
> struct tlbe_priv *priv,
> u64 gvaddr, struct tlbe *stlbe)
> {
> pfn_t pfn = priv->pfn;
> - unsigned int stid;
> -
> - stid = kvmppc_e500_get_sid(vcpu_e500, get_tlb_ts(gtlbe),
> - get_tlb_tid(gtlbe),
> - get_cur_pr(&vcpu_e500->vcpu), 0);
>
> /* Force TS=1 IPROT=0 for all guest mappings. */
> - stlbe->mas1 = MAS1_TSIZE(tsize)
> - | MAS1_TID(stid) | MAS1_TS | MAS1_VALID;
> + stlbe->mas1 = MAS1_TSIZE(tsize) | MAS1_TS | MAS1_VALID;
> stlbe->mas2 = (gvaddr & MAS2_EPN)
> | e500_shadow_mas2_attrib(gtlbe->mas2,
> vcpu_e500->vcpu.arch.shared->msr & MSR_PR);
> @@ -816,6 +811,24 @@ int kvmppc_e500_emul_tlbsx(struct kvm_vcpu *vcpu, int rb)
> return EMULATE_DONE;
> }
>
> +/* sesel is index into the set, not the whole array */
> +static void write_stlbe(struct kvmppc_vcpu_e500 *vcpu_e500,
> + struct tlbe *gtlbe,
> + struct tlbe *stlbe,
> + int stlbsel, int sesel)
> +{
> + int stid;
> +
> + preempt_disable();
> + stid = kvmppc_e500_get_sid(vcpu_e500, get_tlb_ts(gtlbe),
> + get_tlb_tid(gtlbe),
> + get_cur_pr(&vcpu_e500->vcpu), 0);
> +
> + stlbe->mas1 |= MAS1_TID(stid);
> + write_host_tlbe(vcpu_e500, stlbsel, sesel, stlbe);
> + preempt_enable();
> +}
> +
>
This naked preempt_disable() is fishy. What happens if we're migrated
immediately afterwards? we fault again and redo?
I realize that the patch doesn't introduce this.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2011-10-31 12:50 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-31 7:53 [PULL 00/14] ppc patch queue 2011-10-31 Alexander Graf
2011-10-31 7:53 ` [PATCH 01/14] KVM: PPC: e500: don't translate gfn to pfn with preemption disabled Alexander Graf
2011-10-31 12:50 ` Avi Kivity [this message]
2011-10-31 18:52 ` Scott Wood
2011-11-01 9:00 ` Avi Kivity
2011-10-31 7:53 ` [PATCH 02/14] KVM: PPC: e500: Eliminate preempt_disable in local_sid_destroy_all Alexander Graf
2011-10-31 7:53 ` [PATCH 03/14] KVM: PPC: e500: clear up confusion between host and guest entries Alexander Graf
2011-10-31 7:53 ` [PATCH 04/14] KVM: PPC: e500: MMU API Alexander Graf
2011-10-31 13:24 ` Avi Kivity
2011-10-31 20:12 ` Scott Wood
2011-11-01 8:58 ` Avi Kivity
2011-11-01 9:55 ` Avi Kivity
2011-11-01 16:16 ` Scott Wood
2011-11-02 10:33 ` Avi Kivity
2011-11-10 14:20 ` Alexander Graf
2011-11-10 14:16 ` Avi Kivity
2011-10-31 7:53 ` [PATCH 05/14] KVM: PPC: e500: tlbsx: fix tlb0 esel Alexander Graf
2011-10-31 7:53 ` [PATCH 06/14] KVM: PPC: e500: Don't hardcode PIR=0 Alexander Graf
2011-10-31 13:27 ` Avi Kivity
2011-10-31 7:53 ` [PATCH 07/14] KVM: PPC: Fix build failure with HV KVM and CBE Alexander Graf
2011-10-31 7:53 ` [PATCH 08/14] Revert "KVM: PPC: Add support for explicit HIOR setting" Alexander Graf
2011-10-31 13:30 ` Avi Kivity
2011-10-31 23:49 ` Alexander Graf
2011-10-31 7:53 ` [PATCH 09/14] KVM: PPC: Add generic single register ioctls Alexander Graf
2011-10-31 13:36 ` Avi Kivity
2011-10-31 17:26 ` Jan Kiszka
2011-11-10 14:22 ` Alexander Graf
2011-11-10 16:05 ` Marcelo Tosatti
2011-11-10 16:49 ` Alexander Graf
2011-11-10 17:35 ` Marcelo Tosatti
2011-11-15 23:45 ` Alexander Graf
2011-11-23 12:47 ` Marcelo Tosatti
2011-12-19 12:58 ` Alexander Graf
2011-12-19 17:29 ` Marcelo Tosatti
2011-10-31 7:53 ` [PATCH 10/14] KVM: PPC: Add support for explicit HIOR setting Alexander Graf
2011-10-31 7:53 ` [PATCH 11/14] KVM: PPC: Whitespace fix for kvm.h Alexander Graf
2011-10-31 7:53 ` [PATCH 12/14] KVM: Fix whitespace in kvm_para.h Alexander Graf
2011-10-31 7:53 ` [PATCH 13/14] KVM: PPC: E500: Support hugetlbfs Alexander Graf
2011-10-31 13:38 ` Avi Kivity
2011-11-10 14:24 ` Alexander Graf
2011-10-31 7:53 ` [PATCH 14/14] PPC: Fix race in mtmsr paravirt implementation 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=4EAE99A0.7050903@redhat.com \
--to=avi@redhat.com \
--cc=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=scottwood@freescale.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;
as well as URLs for NNTP newsgroup(s).