From: "Leizhen (ThunderTown)" <thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
Cc: Jean-Philippe Brucker
<jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>,
linux-kernel
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
iommu
<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>,
linux-arm-kernel
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v2 0/2] iommu/arm-smmu-v3: make sure the kdump kernel can work well when smmu is enabled
Date: Fri, 19 Apr 2019 21:48:05 +0800 [thread overview]
Message-ID: <5CB9D195.7000707@huawei.com> (raw)
In-Reply-To: <5CB683D2.9010901-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
On 2019/4/17 9:39, Leizhen (ThunderTown) wrote:
>
>
> On 2019/4/16 17:14, Will Deacon wrote:
>> On Mon, Apr 08, 2019 at 10:31:47AM +0800, Leizhen (ThunderTown) wrote:
>>> On 2019/4/4 23:30, Will Deacon wrote:
>>>> On Mon, Mar 18, 2019 at 09:12:41PM +0800, Zhen Lei wrote:
>>>>> v1 --> v2:
>>>>> 1. Drop part2. Now, we only use the SMMUv3 hardware feature STE.config=0b000
>>>>> (Report abort to device, no event recorded) to suppress the event messages
>>>>> caused by the unexpected devices.
>>>>> 2. rewrite the patch description.
>>>>
>>>> This issue came up a while back:
>>>>
>>>> https://lore.kernel.org/linux-pci/20180302103032.GB19323-5wv7dgnIgG8@public.gmane.org/
>>>>
>>>> and I'd still prefer to solve it using the disable_bypass logic which we
>>>> already have. Something along the lines of the diff below?
>>>
>>> Yes, my patches also use disable_bypass=1(set ste.config=0b000). If
>>> SMMU_IDR0.ST_LEVEL=0(Linear Stream table supported), then all STE entries
>>> are allocated and initialized(set ste.config=0b000). But if SMMU_IDR0.ST_LEVEL=1
>>> (2-level Stream Table), we only allocated and initialized the first level tables,
>>> but leave level 2 tables dynamic allocated. That means, C_BAD_STREAMID(eventid=0x2)
>>> will be reported, if an unexpeted device access memory without reinitialized in
>>> kdump kernel.
>>
>> So is your problem just that the C_BAD_STREAMID events are noisy? If so,
>> perhaps we should be disabling fault reporting entirely in the kdump kernel.
>>
>> How about the update diff below? I'm keen to have this as simple as
>> possible, so we don't end up introducing rarely tested, complex code on
>> the crash path.
> In theory, it can solve the problem, let me test it.
Hi Will,
I have tested your patch on my board today. It works well.
>
> But then again, below patch will also disable the fault reporting come from the
> expected devices which are used in the kdump kernel. In fact, my patches have been
> merged into our interval version more than 2 months, no bug have been found yet.
>
> However, my patches do not support the case that the hardware does not support the
> "STE bypass" feature, I think your patch can also resolve it.
>
>>
>> Will
>>
>> --->8
>>
>> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
>> index d3880010c6cf..d8b73da6447d 100644
>> --- a/drivers/iommu/arm-smmu-v3.c
>> +++ b/drivers/iommu/arm-smmu-v3.c
>> @@ -2454,13 +2454,9 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass)
>> /* Clear CR0 and sync (disables SMMU and queue processing) */
>> reg = readl_relaxed(smmu->base + ARM_SMMU_CR0);
>> if (reg & CR0_SMMUEN) {
>> - if (is_kdump_kernel()) {
>> - arm_smmu_update_gbpa(smmu, GBPA_ABORT, 0);
>> - arm_smmu_device_disable(smmu);
>> - return -EBUSY;
>> - }
>> -
>> dev_warn(smmu->dev, "SMMU currently enabled! Resetting...\n");
>> + WARN_ON(is_kdump_kernel() && !disable_bypass);
>> + arm_smmu_update_gbpa(smmu, GBPA_ABORT, 0);
>> }
>>
>> ret = arm_smmu_device_disable(smmu);
>> @@ -2553,6 +2549,8 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass)
>> return ret;
>> }
>>
>> + if (is_kdump_kernel())
>> + enables &= ~(CR0_EVTQEN | CR0_PRIQEN);
>>
>> /* Enable the SMMU interface, or ensure bypass */
>> if (!bypass || disable_bypass) {
>>
>> .
>>
>
--
Thanks!
BestRegards
WARNING: multiple messages have this Message-ID (diff)
From: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
To: Will Deacon <will.deacon@arm.com>
Cc: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
iommu <iommu@lists.linux-foundation.org>,
Robin Murphy <robin.murphy@arm.com>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 0/2] iommu/arm-smmu-v3: make sure the kdump kernel can work well when smmu is enabled
Date: Fri, 19 Apr 2019 21:48:05 +0800 [thread overview]
Message-ID: <5CB9D195.7000707@huawei.com> (raw)
Message-ID: <20190419134805.J7tTZKk3VZRhOhD5PNdvePobWI8q9zx8--kxWjINNno@z> (raw)
In-Reply-To: <5CB683D2.9010901@huawei.com>
On 2019/4/17 9:39, Leizhen (ThunderTown) wrote:
>
>
> On 2019/4/16 17:14, Will Deacon wrote:
>> On Mon, Apr 08, 2019 at 10:31:47AM +0800, Leizhen (ThunderTown) wrote:
>>> On 2019/4/4 23:30, Will Deacon wrote:
>>>> On Mon, Mar 18, 2019 at 09:12:41PM +0800, Zhen Lei wrote:
>>>>> v1 --> v2:
>>>>> 1. Drop part2. Now, we only use the SMMUv3 hardware feature STE.config=0b000
>>>>> (Report abort to device, no event recorded) to suppress the event messages
>>>>> caused by the unexpected devices.
>>>>> 2. rewrite the patch description.
>>>>
>>>> This issue came up a while back:
>>>>
>>>> https://lore.kernel.org/linux-pci/20180302103032.GB19323@arm.com/
>>>>
>>>> and I'd still prefer to solve it using the disable_bypass logic which we
>>>> already have. Something along the lines of the diff below?
>>>
>>> Yes, my patches also use disable_bypass=1(set ste.config=0b000). If
>>> SMMU_IDR0.ST_LEVEL=0(Linear Stream table supported), then all STE entries
>>> are allocated and initialized(set ste.config=0b000). But if SMMU_IDR0.ST_LEVEL=1
>>> (2-level Stream Table), we only allocated and initialized the first level tables,
>>> but leave level 2 tables dynamic allocated. That means, C_BAD_STREAMID(eventid=0x2)
>>> will be reported, if an unexpeted device access memory without reinitialized in
>>> kdump kernel.
>>
>> So is your problem just that the C_BAD_STREAMID events are noisy? If so,
>> perhaps we should be disabling fault reporting entirely in the kdump kernel.
>>
>> How about the update diff below? I'm keen to have this as simple as
>> possible, so we don't end up introducing rarely tested, complex code on
>> the crash path.
> In theory, it can solve the problem, let me test it.
Hi Will,
I have tested your patch on my board today. It works well.
>
> But then again, below patch will also disable the fault reporting come from the
> expected devices which are used in the kdump kernel. In fact, my patches have been
> merged into our interval version more than 2 months, no bug have been found yet.
>
> However, my patches do not support the case that the hardware does not support the
> "STE bypass" feature, I think your patch can also resolve it.
>
>>
>> Will
>>
>> --->8
>>
>> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
>> index d3880010c6cf..d8b73da6447d 100644
>> --- a/drivers/iommu/arm-smmu-v3.c
>> +++ b/drivers/iommu/arm-smmu-v3.c
>> @@ -2454,13 +2454,9 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass)
>> /* Clear CR0 and sync (disables SMMU and queue processing) */
>> reg = readl_relaxed(smmu->base + ARM_SMMU_CR0);
>> if (reg & CR0_SMMUEN) {
>> - if (is_kdump_kernel()) {
>> - arm_smmu_update_gbpa(smmu, GBPA_ABORT, 0);
>> - arm_smmu_device_disable(smmu);
>> - return -EBUSY;
>> - }
>> -
>> dev_warn(smmu->dev, "SMMU currently enabled! Resetting...\n");
>> + WARN_ON(is_kdump_kernel() && !disable_bypass);
>> + arm_smmu_update_gbpa(smmu, GBPA_ABORT, 0);
>> }
>>
>> ret = arm_smmu_device_disable(smmu);
>> @@ -2553,6 +2549,8 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass)
>> return ret;
>> }
>>
>> + if (is_kdump_kernel())
>> + enables &= ~(CR0_EVTQEN | CR0_PRIQEN);
>>
>> /* Enable the SMMU interface, or ensure bypass */
>> if (!bypass || disable_bypass) {
>>
>> .
>>
>
--
Thanks!
BestRegards
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
WARNING: multiple messages have this Message-ID (diff)
From: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
To: Will Deacon <will.deacon@arm.com>
Cc: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>,
Joerg Roedel <joro@8bytes.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
iommu <iommu@lists.linux-foundation.org>,
Robin Murphy <robin.murphy@arm.com>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 0/2] iommu/arm-smmu-v3: make sure the kdump kernel can work well when smmu is enabled
Date: Fri, 19 Apr 2019 21:48:05 +0800 [thread overview]
Message-ID: <5CB9D195.7000707@huawei.com> (raw)
In-Reply-To: <5CB683D2.9010901@huawei.com>
On 2019/4/17 9:39, Leizhen (ThunderTown) wrote:
>
>
> On 2019/4/16 17:14, Will Deacon wrote:
>> On Mon, Apr 08, 2019 at 10:31:47AM +0800, Leizhen (ThunderTown) wrote:
>>> On 2019/4/4 23:30, Will Deacon wrote:
>>>> On Mon, Mar 18, 2019 at 09:12:41PM +0800, Zhen Lei wrote:
>>>>> v1 --> v2:
>>>>> 1. Drop part2. Now, we only use the SMMUv3 hardware feature STE.config=0b000
>>>>> (Report abort to device, no event recorded) to suppress the event messages
>>>>> caused by the unexpected devices.
>>>>> 2. rewrite the patch description.
>>>>
>>>> This issue came up a while back:
>>>>
>>>> https://lore.kernel.org/linux-pci/20180302103032.GB19323@arm.com/
>>>>
>>>> and I'd still prefer to solve it using the disable_bypass logic which we
>>>> already have. Something along the lines of the diff below?
>>>
>>> Yes, my patches also use disable_bypass=1(set ste.config=0b000). If
>>> SMMU_IDR0.ST_LEVEL=0(Linear Stream table supported), then all STE entries
>>> are allocated and initialized(set ste.config=0b000). But if SMMU_IDR0.ST_LEVEL=1
>>> (2-level Stream Table), we only allocated and initialized the first level tables,
>>> but leave level 2 tables dynamic allocated. That means, C_BAD_STREAMID(eventid=0x2)
>>> will be reported, if an unexpeted device access memory without reinitialized in
>>> kdump kernel.
>>
>> So is your problem just that the C_BAD_STREAMID events are noisy? If so,
>> perhaps we should be disabling fault reporting entirely in the kdump kernel.
>>
>> How about the update diff below? I'm keen to have this as simple as
>> possible, so we don't end up introducing rarely tested, complex code on
>> the crash path.
> In theory, it can solve the problem, let me test it.
Hi Will,
I have tested your patch on my board today. It works well.
>
> But then again, below patch will also disable the fault reporting come from the
> expected devices which are used in the kdump kernel. In fact, my patches have been
> merged into our interval version more than 2 months, no bug have been found yet.
>
> However, my patches do not support the case that the hardware does not support the
> "STE bypass" feature, I think your patch can also resolve it.
>
>>
>> Will
>>
>> --->8
>>
>> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
>> index d3880010c6cf..d8b73da6447d 100644
>> --- a/drivers/iommu/arm-smmu-v3.c
>> +++ b/drivers/iommu/arm-smmu-v3.c
>> @@ -2454,13 +2454,9 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass)
>> /* Clear CR0 and sync (disables SMMU and queue processing) */
>> reg = readl_relaxed(smmu->base + ARM_SMMU_CR0);
>> if (reg & CR0_SMMUEN) {
>> - if (is_kdump_kernel()) {
>> - arm_smmu_update_gbpa(smmu, GBPA_ABORT, 0);
>> - arm_smmu_device_disable(smmu);
>> - return -EBUSY;
>> - }
>> -
>> dev_warn(smmu->dev, "SMMU currently enabled! Resetting...\n");
>> + WARN_ON(is_kdump_kernel() && !disable_bypass);
>> + arm_smmu_update_gbpa(smmu, GBPA_ABORT, 0);
>> }
>>
>> ret = arm_smmu_device_disable(smmu);
>> @@ -2553,6 +2549,8 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass)
>> return ret;
>> }
>>
>> + if (is_kdump_kernel())
>> + enables &= ~(CR0_EVTQEN | CR0_PRIQEN);
>>
>> /* Enable the SMMU interface, or ensure bypass */
>> if (!bypass || disable_bypass) {
>>
>> .
>>
>
--
Thanks!
BestRegards
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
To: Will Deacon <will.deacon@arm.com>
Cc: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>,
Joerg Roedel <joro@8bytes.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
iommu <iommu@lists.linux-foundation.org>,
Robin Murphy <robin.murphy@arm.com>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 0/2] iommu/arm-smmu-v3: make sure the kdump kernel can work well when smmu is enabled
Date: Fri, 19 Apr 2019 21:48:05 +0800 [thread overview]
Message-ID: <5CB9D195.7000707@huawei.com> (raw)
In-Reply-To: <5CB683D2.9010901@huawei.com>
On 2019/4/17 9:39, Leizhen (ThunderTown) wrote:
>
>
> On 2019/4/16 17:14, Will Deacon wrote:
>> On Mon, Apr 08, 2019 at 10:31:47AM +0800, Leizhen (ThunderTown) wrote:
>>> On 2019/4/4 23:30, Will Deacon wrote:
>>>> On Mon, Mar 18, 2019 at 09:12:41PM +0800, Zhen Lei wrote:
>>>>> v1 --> v2:
>>>>> 1. Drop part2. Now, we only use the SMMUv3 hardware feature STE.config=0b000
>>>>> (Report abort to device, no event recorded) to suppress the event messages
>>>>> caused by the unexpected devices.
>>>>> 2. rewrite the patch description.
>>>>
>>>> This issue came up a while back:
>>>>
>>>> https://lore.kernel.org/linux-pci/20180302103032.GB19323@arm.com/
>>>>
>>>> and I'd still prefer to solve it using the disable_bypass logic which we
>>>> already have. Something along the lines of the diff below?
>>>
>>> Yes, my patches also use disable_bypass=1(set ste.config=0b000). If
>>> SMMU_IDR0.ST_LEVEL=0(Linear Stream table supported), then all STE entries
>>> are allocated and initialized(set ste.config=0b000). But if SMMU_IDR0.ST_LEVEL=1
>>> (2-level Stream Table), we only allocated and initialized the first level tables,
>>> but leave level 2 tables dynamic allocated. That means, C_BAD_STREAMID(eventid=0x2)
>>> will be reported, if an unexpeted device access memory without reinitialized in
>>> kdump kernel.
>>
>> So is your problem just that the C_BAD_STREAMID events are noisy? If so,
>> perhaps we should be disabling fault reporting entirely in the kdump kernel.
>>
>> How about the update diff below? I'm keen to have this as simple as
>> possible, so we don't end up introducing rarely tested, complex code on
>> the crash path.
> In theory, it can solve the problem, let me test it.
Hi Will,
I have tested your patch on my board today. It works well.
>
> But then again, below patch will also disable the fault reporting come from the
> expected devices which are used in the kdump kernel. In fact, my patches have been
> merged into our interval version more than 2 months, no bug have been found yet.
>
> However, my patches do not support the case that the hardware does not support the
> "STE bypass" feature, I think your patch can also resolve it.
>
>>
>> Will
>>
>> --->8
>>
>> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
>> index d3880010c6cf..d8b73da6447d 100644
>> --- a/drivers/iommu/arm-smmu-v3.c
>> +++ b/drivers/iommu/arm-smmu-v3.c
>> @@ -2454,13 +2454,9 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass)
>> /* Clear CR0 and sync (disables SMMU and queue processing) */
>> reg = readl_relaxed(smmu->base + ARM_SMMU_CR0);
>> if (reg & CR0_SMMUEN) {
>> - if (is_kdump_kernel()) {
>> - arm_smmu_update_gbpa(smmu, GBPA_ABORT, 0);
>> - arm_smmu_device_disable(smmu);
>> - return -EBUSY;
>> - }
>> -
>> dev_warn(smmu->dev, "SMMU currently enabled! Resetting...\n");
>> + WARN_ON(is_kdump_kernel() && !disable_bypass);
>> + arm_smmu_update_gbpa(smmu, GBPA_ABORT, 0);
>> }
>>
>> ret = arm_smmu_device_disable(smmu);
>> @@ -2553,6 +2549,8 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass)
>> return ret;
>> }
>>
>> + if (is_kdump_kernel())
>> + enables &= ~(CR0_EVTQEN | CR0_PRIQEN);
>>
>> /* Enable the SMMU interface, or ensure bypass */
>> if (!bypass || disable_bypass) {
>>
>> .
>>
>
--
Thanks!
BestRegards
next prev parent reply other threads:[~2019-04-19 13:48 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-18 13:12 [PATCH v2 0/2] iommu/arm-smmu-v3: make sure the kdump kernel can work well when smmu is enabled Zhen Lei
2019-03-18 13:12 ` Zhen Lei
2019-03-18 13:12 ` [PATCH v2 1/2] iommu/arm-smmu-v3: make sure the stale caching of L1STD are invalid Zhen Lei
2019-03-18 13:12 ` Zhen Lei
2019-03-18 13:12 ` [PATCH v2 2/2] iommu/arm-smmu-v3: to make smmu can be enabled in the kdump kernel Zhen Lei
2019-03-18 13:12 ` Zhen Lei
2019-04-04 15:30 ` [PATCH v2 0/2] iommu/arm-smmu-v3: make sure the kdump kernel can work well when smmu is enabled Will Deacon
2019-04-04 15:30 ` Will Deacon
2019-04-08 2:31 ` Leizhen (ThunderTown)
2019-04-08 2:31 ` Leizhen (ThunderTown)
2019-04-08 2:31 ` Leizhen (ThunderTown)
2019-04-16 9:14 ` Will Deacon
2019-04-16 9:14 ` Will Deacon
2019-04-16 9:14 ` Will Deacon
[not found] ` <20190416091410.GC31579-UDVVEH7NWB15pKCnmE3YQBJ8xKzm50AiAL8bYrjMMd8@public.gmane.org>
2019-04-17 1:39 ` Leizhen (ThunderTown)
2019-04-17 1:39 ` Leizhen (ThunderTown)
2019-04-17 1:39 ` Leizhen (ThunderTown)
2019-04-17 1:39 ` Leizhen (ThunderTown)
[not found] ` <5CB683D2.9010901-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2019-04-19 13:48 ` Leizhen (ThunderTown) [this message]
2019-04-19 13:48 ` Leizhen (ThunderTown)
2019-04-19 13:48 ` Leizhen (ThunderTown)
2019-04-19 13:48 ` Leizhen (ThunderTown)
2019-04-22 12:33 ` Bhupesh Sharma
2019-04-22 12:33 ` Bhupesh Sharma
2019-04-22 12:33 ` Bhupesh Sharma
2019-04-22 12:33 ` Bhupesh Sharma
2019-04-22 12:33 ` Bhupesh Sharma
2019-04-24 16:22 ` Matthias Brugger
2019-04-24 16:22 ` Matthias Brugger
2019-04-24 16:22 ` Matthias Brugger
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=5CB9D195.7000707@huawei.com \
--to=thunder.leizhen-hv44wf8li93qt0dzr+alfa@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robin.murphy-5wv7dgnIgG8@public.gmane.org \
--cc=will.deacon-5wv7dgnIgG8@public.gmane.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.