From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] arm64: KVM: add missing dsb before invalidating Stage-2 TLBs
Date: Fri, 19 Jul 2013 15:53:28 +0100 [thread overview]
Message-ID: <51E952E8.6020503@arm.com> (raw)
In-Reply-To: <20130719143229.GG18139@mudshark.cambridge.arm.com>
On 19/07/13 15:32, Will Deacon wrote:
> On Fri, Jul 19, 2013 at 02:53:53PM +0100, Marc Zyngier wrote:
>> When performing a Stage-2 TLB invalidation, it is necessary to
>> make sure the write to the page tables is observable by all CPUs.
>>
>> For this purpose, add a dsb instruction to __kvm_tlb_flush_vmid_ipa
>> before doing the TLB invalidation itself.
>>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
>> arch/arm64/kvm/hyp.S | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S
>> index 218802f..e1ccfcc 100644
>> --- a/arch/arm64/kvm/hyp.S
>> +++ b/arch/arm64/kvm/hyp.S
>> @@ -604,6 +604,8 @@ END(__kvm_vcpu_run)
>>
>> // void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
>> ENTRY(__kvm_tlb_flush_vmid_ipa)
>> + dsb ishst // Make sure previous writes are observable
>> +
>> kern_hyp_va x0
>> ldr x2, [x0, #KVM_VTTBR]
>> msr vttbr_el2, x2
>> --
>> 1.8.2.3
>
> I don't think the comment adds anything to this code. Also, why don't you
> need similar barriers for the cases where you clobber the entire TLB (e.g.
> __kvm_flush_vm_context)?
I think they are required as well. I'll respin the patch.
M.
--
Jazz is not dead. It just smells funny...
WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <marc.zyngier@arm.com>
To: Will Deacon <will.deacon@arm.com>
Cc: "christoffer.dall@linaro.org" <christoffer.dall@linaro.org>,
Catalin Marinas <Catalin.Marinas@arm.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>
Subject: Re: [PATCH 2/4] arm64: KVM: add missing dsb before invalidating Stage-2 TLBs
Date: Fri, 19 Jul 2013 15:53:28 +0100 [thread overview]
Message-ID: <51E952E8.6020503@arm.com> (raw)
In-Reply-To: <20130719143229.GG18139@mudshark.cambridge.arm.com>
On 19/07/13 15:32, Will Deacon wrote:
> On Fri, Jul 19, 2013 at 02:53:53PM +0100, Marc Zyngier wrote:
>> When performing a Stage-2 TLB invalidation, it is necessary to
>> make sure the write to the page tables is observable by all CPUs.
>>
>> For this purpose, add a dsb instruction to __kvm_tlb_flush_vmid_ipa
>> before doing the TLB invalidation itself.
>>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
>> arch/arm64/kvm/hyp.S | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S
>> index 218802f..e1ccfcc 100644
>> --- a/arch/arm64/kvm/hyp.S
>> +++ b/arch/arm64/kvm/hyp.S
>> @@ -604,6 +604,8 @@ END(__kvm_vcpu_run)
>>
>> // void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
>> ENTRY(__kvm_tlb_flush_vmid_ipa)
>> + dsb ishst // Make sure previous writes are observable
>> +
>> kern_hyp_va x0
>> ldr x2, [x0, #KVM_VTTBR]
>> msr vttbr_el2, x2
>> --
>> 1.8.2.3
>
> I don't think the comment adds anything to this code. Also, why don't you
> need similar barriers for the cases where you clobber the entire TLB (e.g.
> __kvm_flush_vm_context)?
I think they are required as well. I'll respin the patch.
M.
--
Jazz is not dead. It just smells funny...
next prev parent reply other threads:[~2013-07-19 14:53 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-19 13:53 [PATCH 0/4] KVM/arm64 fixes for 3.11 Marc Zyngier
2013-07-19 13:53 ` Marc Zyngier
2013-07-19 13:53 ` [PATCH 1/4] arm64: KVM: perform save/restore of PAR_EL1 Marc Zyngier
2013-07-19 13:53 ` Marc Zyngier
2013-07-20 21:51 ` Christoffer Dall
2013-07-20 21:51 ` Christoffer Dall
2013-07-19 13:53 ` [PATCH 2/4] arm64: KVM: add missing dsb before invalidating Stage-2 TLBs Marc Zyngier
2013-07-19 13:53 ` Marc Zyngier
2013-07-19 14:32 ` Will Deacon
2013-07-19 14:32 ` Will Deacon
2013-07-19 14:53 ` Marc Zyngier [this message]
2013-07-19 14:53 ` Marc Zyngier
2013-07-19 13:53 ` [PATCH 3/4] arm64: KVM: let other tasks run when hitting WFE Marc Zyngier
2013-07-19 13:53 ` Marc Zyngier
2013-07-19 14:25 ` Will Deacon
2013-07-19 14:25 ` Will Deacon
2013-07-19 14:29 ` Marc Zyngier
2013-07-19 14:29 ` Marc Zyngier
2013-07-20 22:04 ` Christoffer Dall
2013-07-20 22:04 ` Christoffer Dall
2013-07-22 7:36 ` Gleb Natapov
2013-07-22 7:36 ` Gleb Natapov
2013-07-22 8:53 ` Raghavendra KT
2013-07-22 8:53 ` Raghavendra KT
2013-07-22 12:51 ` Christoffer Dall
2013-07-22 12:51 ` Christoffer Dall
2013-07-22 13:01 ` Will Deacon
2013-07-22 13:01 ` Will Deacon
2013-07-22 13:57 ` Raghavendra K T
2013-07-22 13:57 ` Raghavendra K T
2013-07-28 20:55 ` Christoffer Dall
2013-07-28 20:55 ` Christoffer Dall
2013-07-29 7:35 ` Raghavendra K T
2013-07-29 7:35 ` Raghavendra K T
2013-07-23 10:41 ` Catalin Marinas
2013-07-23 10:41 ` Catalin Marinas
2013-07-23 16:04 ` Will Deacon
2013-07-23 16:04 ` Will Deacon
2013-07-19 13:53 ` [PATCH 4/4] arm64: KVM: remove __kvm_hyp_code_{start,end} from hyp.S Marc Zyngier
2013-07-19 13:53 ` Marc Zyngier
2013-07-22 7:36 ` Gleb Natapov
2013-07-22 7:36 ` Gleb Natapov
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=51E952E8.6020503@arm.com \
--to=marc.zyngier@arm.com \
--cc=linux-arm-kernel@lists.infradead.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.