All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Covington <cov@codeaurora.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Christoffer Dall" <christoffer.dall@linaro.org>,
	"Marc Zyngier" <marc.zyngier@arm.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will.deacon@arm.com>,
	kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org,
	shankerd@codeaurora.org, timur@codeaurora.org,
	"Jonathan Corbet" <corbet@lwn.net>,
	linux-doc@vger.kernel.org, "Jon Masters" <jcm@redhat.com>,
	"Neil Leeder" <nleeder@codeaurora.org>,
	"Mark Langsdorf" <mlangsdo@redhat.com>
Subject: Re: [PATCH v4 2/4] arm64: Work around Falkor erratum 1003
Date: Mon, 30 Jan 2017 17:09:34 -0500	[thread overview]
Message-ID: <f85f5b08-1f95-e008-b2e2-ca40d875efff@codeaurora.org> (raw)
In-Reply-To: <20170130105627.GA1160@leverpostej>

Hi Mark,

On 01/30/2017 05:56 AM, Mark Rutland wrote:
> Hi,
> 
> On Fri, Jan 27, 2017 at 04:52:23PM -0500, Christopher Covington wrote:
>> On 01/27/2017 09:38 AM, Mark Rutland wrote:
>>> On Wed, Jan 25, 2017 at 10:52:30AM -0500, Christopher Covington wrote:
> 
>>>> Replacing the above sequence with the one below will ensure that no TLB
>>>> entries with an incorrect ASID are used by software.
>>>>
>>>>   write reserved value to TTBRx_EL1[ASID]
>>>>   ISB
>>>>   write new value to TTBRx_EL1[BADDR]
>>>>   ISB
>>>>   write new value to TTBRx_EL1[ASID]
>>>>   ISB
>>>>
>>>> When the above sequence is used, page table entries using the new BADDR
>>>> value may still be incorrectly allocated into the TLB using the reserved
>>>> ASID. Yet this will not reduce functionality, since TLB entries incorrectly
>>>> tagged with the reserved ASID will never be hit by a later instruction.
>>>
>>> I agree that there should be no explicit accesses to the VAs for these
>>> entries. So tasks should not see erroneous VAs, and we shouldn't see
>>> synchronous TLB conflict aborts.
>>>
>>> Regardless, can this allow conflicting TLB entries to be allocated to
>>> the reserved ASID? e.g. if one task has a 4K mapping at a given VA, and
>>> another has a 2M mapping which covers that VA, can both be allocated
>>> into the TLBs under the reserved ASID?
>>>
>>> Can that have any effect on asynchronous TLB lookups or page table
>>> walks, e.g. for speculated accesses?
>>
>> A speculative access that inserts an entry into the TLB could
>> possibly find the conflict but will not signal it. Does that answer
>> your question?
> 
> Yes!
> 
> The other case I was worried about was intermediate caching. I take it
> the values in TLBs are not used as part of subsequent page table walks?
> 
> If so, the above sounds fine to me.
> 
> Otherwise, we'll need additional TLB maintenance.

Errant TLB entries will not be used for any legitimate subsequent page
table walks.

I have some minor changes which I'll send as v5 based on
kernel/git/arm64/linux.git for-next/core.

Thanks,
Cov

-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code
Aurora Forum, a Linux Foundation Collaborative Project.

WARNING: multiple messages have this Message-ID (diff)
From: Christopher Covington <cov@codeaurora.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Mark Langsdorf <mlangsdo@redhat.com>,
	linux-doc@vger.kernel.org, kvm@vger.kernel.org,
	Marc Zyngier <marc.zyngier@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	timur@codeaurora.org, Jonathan Corbet <corbet@lwn.net>,
	Will Deacon <will.deacon@arm.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Neil Leeder <nleeder@codeaurora.org>,
	Jon Masters <jcm@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>,
	kvmarm@lists.cs.columbia.edu
Subject: Re: [PATCH v4 2/4] arm64: Work around Falkor erratum 1003
Date: Mon, 30 Jan 2017 17:09:34 -0500	[thread overview]
Message-ID: <f85f5b08-1f95-e008-b2e2-ca40d875efff@codeaurora.org> (raw)
In-Reply-To: <20170130105627.GA1160@leverpostej>

Hi Mark,

On 01/30/2017 05:56 AM, Mark Rutland wrote:
> Hi,
> 
> On Fri, Jan 27, 2017 at 04:52:23PM -0500, Christopher Covington wrote:
>> On 01/27/2017 09:38 AM, Mark Rutland wrote:
>>> On Wed, Jan 25, 2017 at 10:52:30AM -0500, Christopher Covington wrote:
> 
>>>> Replacing the above sequence with the one below will ensure that no TLB
>>>> entries with an incorrect ASID are used by software.
>>>>
>>>>   write reserved value to TTBRx_EL1[ASID]
>>>>   ISB
>>>>   write new value to TTBRx_EL1[BADDR]
>>>>   ISB
>>>>   write new value to TTBRx_EL1[ASID]
>>>>   ISB
>>>>
>>>> When the above sequence is used, page table entries using the new BADDR
>>>> value may still be incorrectly allocated into the TLB using the reserved
>>>> ASID. Yet this will not reduce functionality, since TLB entries incorrectly
>>>> tagged with the reserved ASID will never be hit by a later instruction.
>>>
>>> I agree that there should be no explicit accesses to the VAs for these
>>> entries. So tasks should not see erroneous VAs, and we shouldn't see
>>> synchronous TLB conflict aborts.
>>>
>>> Regardless, can this allow conflicting TLB entries to be allocated to
>>> the reserved ASID? e.g. if one task has a 4K mapping at a given VA, and
>>> another has a 2M mapping which covers that VA, can both be allocated
>>> into the TLBs under the reserved ASID?
>>>
>>> Can that have any effect on asynchronous TLB lookups or page table
>>> walks, e.g. for speculated accesses?
>>
>> A speculative access that inserts an entry into the TLB could
>> possibly find the conflict but will not signal it. Does that answer
>> your question?
> 
> Yes!
> 
> The other case I was worried about was intermediate caching. I take it
> the values in TLBs are not used as part of subsequent page table walks?
> 
> If so, the above sounds fine to me.
> 
> Otherwise, we'll need additional TLB maintenance.

Errant TLB entries will not be used for any legitimate subsequent page
table walks.

I have some minor changes which I'll send as v5 based on
kernel/git/arm64/linux.git for-next/core.

Thanks,
Cov

-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code
Aurora Forum, a Linux Foundation Collaborative Project.

WARNING: multiple messages have this Message-ID (diff)
From: cov@codeaurora.org (Christopher Covington)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/4] arm64: Work around Falkor erratum 1003
Date: Mon, 30 Jan 2017 17:09:34 -0500	[thread overview]
Message-ID: <f85f5b08-1f95-e008-b2e2-ca40d875efff@codeaurora.org> (raw)
In-Reply-To: <20170130105627.GA1160@leverpostej>

Hi Mark,

On 01/30/2017 05:56 AM, Mark Rutland wrote:
> Hi,
> 
> On Fri, Jan 27, 2017 at 04:52:23PM -0500, Christopher Covington wrote:
>> On 01/27/2017 09:38 AM, Mark Rutland wrote:
>>> On Wed, Jan 25, 2017 at 10:52:30AM -0500, Christopher Covington wrote:
> 
>>>> Replacing the above sequence with the one below will ensure that no TLB
>>>> entries with an incorrect ASID are used by software.
>>>>
>>>>   write reserved value to TTBRx_EL1[ASID]
>>>>   ISB
>>>>   write new value to TTBRx_EL1[BADDR]
>>>>   ISB
>>>>   write new value to TTBRx_EL1[ASID]
>>>>   ISB
>>>>
>>>> When the above sequence is used, page table entries using the new BADDR
>>>> value may still be incorrectly allocated into the TLB using the reserved
>>>> ASID. Yet this will not reduce functionality, since TLB entries incorrectly
>>>> tagged with the reserved ASID will never be hit by a later instruction.
>>>
>>> I agree that there should be no explicit accesses to the VAs for these
>>> entries. So tasks should not see erroneous VAs, and we shouldn't see
>>> synchronous TLB conflict aborts.
>>>
>>> Regardless, can this allow conflicting TLB entries to be allocated to
>>> the reserved ASID? e.g. if one task has a 4K mapping at a given VA, and
>>> another has a 2M mapping which covers that VA, can both be allocated
>>> into the TLBs under the reserved ASID?
>>>
>>> Can that have any effect on asynchronous TLB lookups or page table
>>> walks, e.g. for speculated accesses?
>>
>> A speculative access that inserts an entry into the TLB could
>> possibly find the conflict but will not signal it. Does that answer
>> your question?
> 
> Yes!
> 
> The other case I was worried about was intermediate caching. I take it
> the values in TLBs are not used as part of subsequent page table walks?
> 
> If so, the above sounds fine to me.
> 
> Otherwise, we'll need additional TLB maintenance.

Errant TLB entries will not be used for any legitimate subsequent page
table walks.

I have some minor changes which I'll send as v5 based on
kernel/git/arm64/linux.git for-next/core.

Thanks,
Cov

-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code
Aurora Forum, a Linux Foundation Collaborative Project.

  reply	other threads:[~2017-01-30 22:09 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 15:52 [PATCH v4 1/4] arm64: Define Falkor v1 CPU Christopher Covington
2017-01-25 15:52 ` Christopher Covington
2017-01-25 15:52 ` Christopher Covington
2017-01-25 15:52 ` [PATCH v4 2/4] arm64: Work around Falkor erratum 1003 Christopher Covington
2017-01-25 15:52   ` Christopher Covington
2017-01-25 15:52   ` Christopher Covington
2017-01-27 14:38   ` Mark Rutland
2017-01-27 14:38     ` Mark Rutland
2017-01-27 14:38     ` Mark Rutland
2017-01-27 14:43     ` Mark Rutland
2017-01-27 14:43       ` Mark Rutland
2017-01-27 14:43       ` Mark Rutland
2017-01-27 21:52     ` Christopher Covington
2017-01-27 21:52       ` Christopher Covington
2017-01-27 21:52       ` Christopher Covington
2017-01-30 10:56       ` Mark Rutland
2017-01-30 10:56         ` Mark Rutland
2017-01-30 10:56         ` Mark Rutland
2017-01-30 22:09         ` Christopher Covington [this message]
2017-01-30 22:09           ` Christopher Covington
2017-01-30 22:09           ` Christopher Covington
2017-01-27 19:18   ` Timur Tabi
2017-01-27 19:18     ` Timur Tabi
2017-01-27 19:18     ` Timur Tabi
2017-01-31 12:37   ` Mark Rutland
2017-01-31 12:37     ` Mark Rutland
2017-01-31 12:37     ` Mark Rutland
2017-01-31 17:48     ` Christopher Covington
2017-01-31 17:48       ` Christopher Covington
2017-01-31 17:48       ` Christopher Covington
2017-01-31 17:56       ` Marc Zyngier
2017-01-31 17:56         ` Marc Zyngier
2017-01-31 17:56         ` Marc Zyngier
2017-02-01 16:29         ` Christopher Covington
2017-02-01 16:29           ` Christopher Covington
2017-02-01 16:33           ` Will Deacon
2017-02-01 16:33             ` Will Deacon
2017-02-01 16:33             ` Will Deacon
2017-02-01 17:36             ` Catalin Marinas
2017-02-01 17:36               ` Catalin Marinas
2017-02-01 17:41               ` Will Deacon
2017-02-01 17:41                 ` Will Deacon
2017-02-01 17:41                 ` Will Deacon
2017-02-01 17:49                 ` Catalin Marinas
2017-02-01 17:49                   ` Catalin Marinas
2017-02-01 17:49                   ` Catalin Marinas
2017-02-01 17:51                   ` Catalin Marinas
2017-02-01 17:51                     ` Catalin Marinas
2017-02-01 17:59                   ` Will Deacon
2017-02-01 17:59                     ` Will Deacon
2017-02-01 18:22                     ` Catalin Marinas
2017-02-01 18:22                       ` Catalin Marinas
2017-02-01 18:34                       ` Will Deacon
2017-02-01 18:34                         ` Will Deacon
2017-02-01 18:34                         ` Will Deacon
2017-02-01 18:38                         ` Catalin Marinas
2017-02-01 18:38                           ` Catalin Marinas
2017-02-08  0:36                           ` Christopher Covington
2017-02-08  0:36                             ` Christopher Covington
2017-02-08  0:36                             ` Christopher Covington
2017-01-25 15:52 ` [PATCH v4 3/4] arm64: Use __tlbi() macros in KVM code Christopher Covington
2017-01-25 15:52   ` Christopher Covington
2017-01-25 15:52   ` Christopher Covington
2017-01-25 19:39   ` Christoffer Dall
2017-01-25 19:39     ` Christoffer Dall
2017-01-27 13:53     ` Will Deacon
2017-01-27 13:53       ` Will Deacon
2017-01-27 13:53       ` Will Deacon
2017-02-01 17:02       ` Punit Agrawal
2017-02-01 17:02         ` Punit Agrawal
2017-02-01 17:02         ` Punit Agrawal
2017-02-01 17:08         ` Will Deacon
2017-02-01 17:08           ` Will Deacon
2017-02-01 17:08           ` Will Deacon
2017-02-01 17:14           ` Punit Agrawal
2017-02-01 17:14             ` Punit Agrawal
2017-02-01 17:14             ` Punit Agrawal
2017-01-27 15:03   ` Will Deacon
2017-01-27 15:03     ` Will Deacon
2017-01-27 15:03     ` Will Deacon
2017-01-25 15:52 ` [PATCH v4 4/4] arm64: Work around Falkor erratum 1009 Christopher Covington
2017-01-25 15:52   ` Christopher Covington
2017-01-25 15:52   ` Christopher Covington
2017-01-27 15:07   ` Will Deacon
2017-01-27 15:07     ` Will Deacon
2017-01-27 15:07     ` Will Deacon

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=f85f5b08-1f95-e008-b2e2-ca40d875efff@codeaurora.org \
    --to=cov@codeaurora.org \
    --cc=catalin.marinas@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=corbet@lwn.net \
    --cc=jcm@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=mlangsdo@redhat.com \
    --cc=nleeder@codeaurora.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=shankerd@codeaurora.org \
    --cc=timur@codeaurora.org \
    --cc=will.deacon@arm.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.