[ACC-0316]sync mainline kernel 5.6rc6 ACC patchset into ubuntu HWE kernel branch

Bug #1867591 reported by Fred Kimmy
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kunpeng920
Fix Released
Undecided
Ike Panhc
Ubuntu-18.04-hwe
Invalid
Undecided
Ike Panhc
Ubuntu-20.04
Invalid
Undecided
Ike Panhc
Ubuntu-20.04-hwe
Fix Released
Undecided
Taihsiang Ho
Upstream-kernel
Fix Released
Undecided
Unassigned
linux (Ubuntu)
Fix Released
Undecided
Ike Panhc

Bug Description

[Bug Description]
roce patchset have merged into mainline 5.6rc2 kernel.

[Steps to Reproduce]
  1)
  2)
  3)

[Actual Results]

[Expected Results]

[Reproducibility]

[Additional information]
  (Firmware version, kernel version, affected hardware, etc. if required):

[Resolution]
crypto: hisilicon/sec2 - Add pbuffer mode for SEC driver
crypto: hisilicon/sec2 - Update IV and MAC operation
crypto: hisilicon/sec2 - Add iommu status check
crypto: hisilicon/sec2 - Add workqueue for SEC driver.
crypto: hisilicon - Use one workqueue per qm instead of per qp
crypto: hisilicon - qm depends on UACCE
crypto: hisilicon - remove redundant assignment of pointer ctx
hisilicon - register zip engine to uacce
hisilicon - Remove module_param uacce_mode
uacce: add uacce driver
uacce: Add documents for uacce
crypto: hisilicon - Fix duplicate print when qm occur multiple errors
crypto: hisilicon - Unify error detect process into qm
crypto: hisilicon - Configure zip RAS error type
crypto: hisilicon - Unify hardware error init/uninit into QM

Revision history for this message
Ike Panhc (ikepanhc) wrote :

All patches not hit mainline kernel yet.

Changed in kunpeng920:
status: New → Incomplete
Changed in kunpeng920:
assignee: nobody → Taihsiang Ho (taihsiangho)
Taihsiang Ho (tai271828)
tags: added: tairadar
Revision history for this message
Taihsiang Ho (tai271828) wrote :

The latest discussion shows it may be in the mainline. We will check later.

Revision history for this message
Taihsiang Ho (tai271828) wrote :

I checked the upstream source today and none of patch from this patchset has landed in the upstream source tree.

Revision history for this message
Taihsiang Ho (tai271828) wrote :

I checked the upstream source today and none of patch from this patchset has landed in the upstream source tree. However, I think they are on the way and may be delivered in the recent 5.7 merge window, e.g. here is a part of SEC driver related patches https://www.spinics.net/lists/linux-crypto/msg46555.html

Changed in kunpeng920:
assignee: Taihsiang Ho (taihsiangho) → Ike Panhc (ikepanhc)
Ike Panhc (ikepanhc)
tags: added: ikeradar
Revision history for this message
Ike Panhc (ikepanhc) wrote :

All patches has been merged into mainline kernel.

Changed in kunpeng920:
status: Incomplete → In Progress
Changed in linux (Ubuntu):
status: New → In Progress
assignee: nobody → Ike Panhc (ikepanhc)
Revision history for this message
Ike Panhc (ikepanhc) wrote :

Kernel oops when uacce loaded. Please see the attachment oops.txt for details.

The test kernel is available at http://kernel.ubuntu.com/~ikepanhc/lp1867591
and the git branch is available at https://kernel.ubuntu.com/git/ikepanhc/public.git/commit/?h=kunpeng920_wip&id=10299705bb0bb45f8513b31fbad1f20b5b2627ef

Revision history for this message
Fred Kimmy (kongzizaixian) wrote :

from log: Hardware name: Huawei XA320 V2 /BC82HPNB, BIOS 0.95 08/15/2019

this server is x6000, I think that it is not enabled sec driver. Can you provide this lscpi information.

Revision history for this message
Ike Panhc (ikepanhc) wrote :

Same oops happens on d061(kreiken) and x6000(segers).

Here is the lspci output of segers

Revision history for this message
Ike Panhc (ikepanhc) wrote :

oops log on kreiken

Revision history for this message
Ike Panhc (ikepanhc) wrote :

lspci output on kreiken (d061)

Revision history for this message
Ike Panhc (ikepanhc) wrote : Re: [Bug 1867591] [NEW] [ACC-0316]sync mainline kernel 5.6rc6 ACC patchset into ubuntu HWE kernel branch

Hi Xinwei,

Can you tell me which patches are for acce and which are for uacce? They looks mixed to me.

--
Ike

On 3/16/20 4:04 PM, Fred Kimmy wrote:
> [Resolution]
> crypto: hisilicon/sec2 - Add pbuffer mode for SEC driver
> crypto: hisilicon/sec2 - Update IV and MAC operation
> crypto: hisilicon/sec2 - Add iommu status check
> crypto: hisilicon/sec2 - Add workqueue for SEC driver.
> crypto: hisilicon - Use one workqueue per qm instead of per qp
> crypto: hisilicon - qm depends on UACCE
> crypto: hisilicon - remove redundant assignment of pointer ctx
> hisilicon - register zip engine to uacce
> hisilicon - Remove module_param uacce_mode
> uacce: add uacce driver
> uacce: Add documents for uacce
> crypto: hisilicon - Fix duplicate print when qm occur multiple errors
> crypto: hisilicon - Unify error detect process into qm
> crypto: hisilicon - Configure zip RAS error type
> crypto: hisilicon - Unify hardware error init/uninit into QM

Revision history for this message
Fred Kimmy (kongzizaixian) wrote :

crypto: hisilicon/sec2 - Add pbuffer mode for SEC driver
 crypto: hisilicon/sec2 - Update IV and MAC operation
 crypto: hisilicon/sec2 - Add iommu status check
 crypto: hisilicon/sec2 - Add workqueue for SEC driver.

this aboving sec2 optimize code have a small bug, we have fixing it and can you revert aboving four patches?

crypto: hisilicon - Use one workqueue per qm instead of per qp
 crypto: hisilicon - qm depends on UACCE
 crypto: hisilicon - remove redundant assignment of pointer ctx
 hisilicon - register zip engine to uacce
 hisilicon - Remove module_param uacce_mode
 uacce: add uacce driver
 uacce: Add documents for uacce
 crypto: hisilicon - Fix duplicate print when qm occur multiple errors
 crypto: hisilicon - Unify error detect process into qm
 crypto: hisilicon - Configure zip RAS error type
 crypto: hisilicon - Unify hardware error init/uninit into QM

this aboving 11 ACC patches is not problem and you merge it.

Revision history for this message
Ike Panhc (ikepanhc) wrote :

[ 34.456012] hisi_dma 0000:7b:00.0: Adding to iommu group 51
[ 34.457088] hisi_dma 0000:7b:00.0: enabling device (0000 -> 0002)
[ 34.471321] hisi_hpre 0000:79:00.0: Adding to iommu group 52
[ 34.472683] hisi_hpre 0000:79:00.0: fail to alloc uacce (-22)
[ 34.472694] hisi_hpre 0000:79:00.0: enabling device (0000 -> 0002)
[ 34.498524] hisi_dma 0000:bb:00.0: Adding to iommu group 53
[ 34.499459] hisi_dma 0000:bb:00.0: enabling device (0000 -> 0002)
[ 34.505307] hisi_hpre 0000:b9:00.0: Adding to iommu group 54
[ 34.510790] hisi_zip 0000:75:00.0: Adding to iommu group 55
[ 34.512105] hisi_zip 0000:75:00.0: fail to alloc uacce (-22)
[ 34.512113] hisi_zip 0000:75:00.0: enabling device (0000 -> 0002)
[ 34.514789] hisi_sec2 0000:76:00.0: Adding to iommu group 56
[ 34.516596] hisi_sec2 0000:76:00.0: fail to alloc uacce (-22)
[ 34.516604] hisi_sec2 0000:76:00.0: enabling device (0000 -> 0002)
[ 34.520416] hisi_hpre 0000:b9:00.0: fail to alloc uacce (-22)
[ 34.520427] hisi_hpre 0000:b9:00.0: enabling device (0000 -> 0002)
[ 34.522426] hisi_zip 0000:b5:00.0: Adding to iommu group 57
[ 34.523552] hisi_zip 0000:b5:00.0: fail to alloc uacce (-22)
[ 34.523557] hisi_zip 0000:b5:00.0: enabling device (0000 -> 0002)
[ 34.540976] IPMI message handler: version 39.2
[ 34.573254] ipmi device interface
[ 34.577557] hisi_sec2 0000:b6:00.0: Adding to iommu group 58
[ 34.578736] hisi_sec2 0000:b6:00.0: fail to alloc uacce (-22)
[ 34.578744] hisi_sec2 0000:b6:00.0: enabling device (0000 -> 0002)

In dmesg it says uacce can not link with those crypto drivers.

Looks like these drivers are not ready and we don't have test case yet.
I believe we shall submit after driver is mature and also work on its test case.

Revision history for this message
Andrew Cloke (andrew-cloke) wrote :

Marking as incomplete while waiting for a test case for the uacce driver module from HiSilicon.

Changed in kunpeng920:
status: In Progress → Incomplete
Revision history for this message
Fred Kimmy (kongzizaixian) wrote :

this following patch will fix sec2 boot bug:

crypto: hisilicon/sec2 - modify the SEC probe process
https://www.spinics.net/lists/linux-crypto/msg47550.html

can you open CONFIG_CRYPTO_TEST=m and CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=m to test acc driver?

Revision history for this message
Ike Panhc (ikepanhc) wrote :

I will test the patch. However, since this patch is very new (4 days on mailing list only), I will start backport process after it is merged into mainline kernel.

Revision history for this message
Ike Panhc (ikepanhc) wrote :

Another cherry-pick is needed for patch "crypto: hisilicon/sec2 - modify the SEC probe process"

/home/ubuntu/focal/drivers/crypto/hisilicon/sec2/sec_main.c: In function ‘sec_qm_init’:
/home/ubuntu/focal/drivers/crypto/hisilicon/sec2/sec_main.c:770:5: error: ‘struct hisi_qm’ has no member named ‘qm_list’
   qm->qm_list = &sec_devices;
     ^~
/home/ubuntu/focal/drivers/crypto/hisilicon/sec2/sec_main.c:770:18: error: ‘sec_devices’ undeclared (first use in this function); did you mean ‘sec_dev_ids’?
   qm->qm_list = &sec_devices;
                  ^~~~~~~~~~~
                  sec_dev_ids

Revision history for this message
Andrew Cloke (andrew-cloke) wrote :

Xinwei has commented that this patchset may also fix bug# 1867900

Revision history for this message
Ike Panhc (ikepanhc) wrote :

Cherry-pick all patches from mainline kernel for drivers/crypto/hisilicon but patch ("crypto:hisilicon/sec2 -modify the SEC probe process") mentioned in #17 still causes build failure.

/home/ubuntu/focal/drivers/crypto/hisilicon/sec2/sec_main.c: In function ‘sec_qm_init’:
/home/ubuntu/focal/drivers/crypto/hisilicon/sec2/sec_main.c:750:7: error: ‘struct hisi_qm’ has no member named ‘qm_list’; did you mean ‘list’?
   qm->qm_list = &sec_devices;
       ^~~~~~~
       list
/home/ubuntu/focal/scripts/Makefile.build:273: recipe for target 'drivers/crypto/hisilicon/sec2/sec_main.o' failed
make[6]: *** [drivers/crypto/hisilicon/sec2/sec_main.o] Error 1

There is no qm_list in 'struct qm'. Is there any patch in kernel mailing list I shall also cherry-pick?

Here are the patches I cherry-picked from mainline kernel.

2ecc5dbe1be2 crypto: hisilicon - Fix build error
050edd48773c crypto: hisilicon/sec2 - Add new create qp process
866208000dc5 crypto: hisilicon/hpre - Optimize finding hpre device process
2d5c3b667630 crypto: hisilicon/zip - Use hisi_qm_alloc_qps_node() when init ctx
f9b281b9d419 crypto: hisilicon/qm - Put device finding logic into QM
41fb76b52f88 crypto: hisilicon/sec2 - Add pbuffer mode for SEC driver
a498705a1413 crypto: hisilicon/sec2 - Update IV and MAC operation
0d96187b2254 crypto: hisilicon/sec2 - Add iommu status check
4bd0e47188d5 crypto: hisilicon/sec2 - Add workqueue for SEC driver.
e446154072f6 crypto: hisilicon - Use one workqueue per qm instead of per qp
1c50a05a8175 crypto: hisilicon - qm depends on UACCE
830f9ba1bd19 crypto: hisilicon - remove redundant assignment of pointer ctx
890db5d419c6 crypto: hisilicon - register zip engine to uacce
dd057c5c9923 crypto: hisilicon - Remove module_param uacce_mode
392303395a8f uacce: add uacce driver
aac67f627ed7 uacce: Add documents for uacce
ec8710741e72 crypto: hisilicon - Fix duplicate print when qm occur multiple errors
4eec3fe442fe crypto: hisilicon - Unify error detect process into qm
0fe67e5b898e crypto: hisilicon - Configure zip RAS error type
f70dbcab45dd crypto: hisilicon - Unify hardware error init/uninit into QM

Revision history for this message
dann frazier (dannf) wrote :

@Ike: it looks like that patch depends on this other patch set, which is currently in linux-next:
  https://www.spinics.net/lists/linux-crypto/msg46951.html

To avoid backporting that, perhaps you could drop the qm_list assignment.

That said, I don't see a valid SRU justification for any of these.

Revision history for this message
Ike Panhc (ikepanhc) wrote :

Thanks for suggestion but I do not feel comfortable drop a line from a patch before perfectly understanding everything in drivers. If Hisilicon can help on backporting or test case, that will be much helpful.

Revision history for this message
Ike Panhc (ikepanhc) wrote :

Cherry-pick patches in #21 and solve build issue as suggestion in #22. The test kernel can boot without error in dmesg.

But bug 1867900 still exist with the test kernel.

I will provide kernel debs and git branch later.

Revision history for this message
Ike Panhc (ikepanhc) wrote :
Revision history for this message
Andrew Cloke (andrew-cloke) wrote :

Next step is to wait for the patch described in comment #17 to be integrated into the upstream kernel.

Ike Panhc (ikepanhc)
tags: removed: ikeradar
Revision history for this message
Taihsiang Ho (tai271828) wrote :

All commits[1] including the patch in comment#17[2] are now in Focal hwe-5.8 tree. According to the above discussion, I would suggest we may re-verify the patch set.

[1]

Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 74b58db8b7ed crypto: hisilicon/sec2 - Add pbuffer mode for SEC driver
Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 2514f5595db7 crypto: hisilicon/sec2 - Update IV and MAC operation
Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 8824bc5ed1e7 crypto: hisilicon/sec2 - Add iommu status check
Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 a13c97118749 crypto: hisilicon/sec2 - Add workqueue for SEC driver.
Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 57ca81245f4d crypto: hisilicon - Use one workqueue per qm instead of per qp
Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 b5f13031cd8d crypto: hisilicon - qm depends on UACCE
Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 1b44f93eb3e5 crypto: hisilicon - remove redundant assignment of pointer ctx
Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 9e00df7156e4 hisilicon - register zip engine to uacce
Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 18bead70e991 hisilicon - Remove module_param uacce_mode
Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 015d239ac014 uacce: add uacce driver
Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 aa017ab97a22 uacce: Add documents for uacce
Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 00e62e868ccd crypto: hisilicon - Fix duplicate print when qm occur multiple errors
Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 f826e6efb42b crypto: hisilicon - Unify error detect process into qm
Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 de3daf4b4ad5 crypto: hisilicon - Configure zip RAS error type
Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 eaebf4c3b103 crypto: hisilicon - Unify hardware error init/uninit into QM

[2]

Ubuntu-hwe-5.8-5.8.0-25.26_20.04.1 18614230f430 modify the SEC probe process

Revision history for this message
Taihsiang Ho (tai271828) wrote :

Upstream have all the commits including the patch in comment#17[1][2].

[1] the following landed in v5.7.

crypto: hisilicon/sec2 - Add pbuffer mode for SEC driver
crypto: hisilicon/sec2 - Update IV and MAC operation
crypto: hisilicon/sec2 - Add iommu status check
crypto: hisilicon/sec2 - Add workqueue for SEC driver.
crypto: hisilicon - Use one workqueue per qm instead of per qp
crypto: hisilicon - qm depends on UACCE
crypto: hisilicon - remove redundant assignment of pointer ctx
hisilicon - register zip engine to uacce
hisilicon - Remove module_param uacce_mode
uacce: add uacce driver
uacce: Add documents for uacce
crypto: hisilicon - Fix duplicate print when qm occur multiple errors
crypto: hisilicon - Unify error detect process into qm
crypto: hisilicon - Configure zip RAS error type
crypto: hisilicon - Unify hardware error init/uninit into QM

[2] This commit landed in v5.8

modify the SEC probe process

Taihsiang Ho (tai271828)
tags: removed: tairadar
Revision history for this message
Ike Panhc (ikepanhc) wrote :

All patches hits 20.04.2 HWE kernel.

Changed in linux (Ubuntu):
status: In Progress → Fix Released
Changed in kunpeng920:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.