Commit ec4ae62c authored by Gu Zitao's avatar Gu Zitao Committed by Zheng Zengkai
Browse files

sw64: gpu/drm: solve driver load cause kernel crash

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD


CVE: NA

-------------------------------

It causes kernel to crash when loading AMD video card driver on sw64
arch showing as follows:

Unable to handle kernel paging request at virtual address 0000000000000060
CPU 0 kworker/0:1(56): Oops 0
pc = [<ffffffff809a4b14>]  ra = [<ffffffff80923440>]  ps = 0000    Not tainted
pc is at up_read+0x14/0x80
ra is at do_page_fault+0x380/0x610
v0 = 0000000000000000  t0 = 0000000000000001  t1 = 0000000000000001
t2 = fff0000fd8bbf000  t3 = 0000000000000060  t4 = 00038c3001804009
t5 = 0000002000038d30  t6 = fff0888000040080  t7 = fff0000fd8e48000
s0 = fff0000fd1df8000  s1 = fff0888000040000  s2 = 0000000000000001
s3 = 0000000000000000  s4 = 0000000000000007  s5 = 0000000000000060
s6 = fff0000fd8e4ba60
a0 = 0000000000000060  a1 = 0000000000000000  a2 = 0000000000000001
a3 = fff0000fd8e4ba60  a4 = 0000000000000000  a5 = 0000000000000177
t8 = 0000000000000029  t9 = ffffffff82974bc0  t10= 0000000000000000
t11= 0000000000000178  pv = ffffffff809a4b00  at = 0000000000000007
gp = ffffffff82944bc0  sp = (____ptAMD video card driver on sw_64 arch show as follows:

Disabling lock debugging due to kernel taint
Trace:
[<ffffffff80923440>] do_page_fault+0x380/0x610
[<ffffffff80910f70>] entMM+0x90/0xc0
[<ffffffff813da9bc>] dev_printk_emit+0x4c/0x60
[<ffffffff81189180>] radeon_uvd_resume+0x40/0xa0
[<ffffffff81a56eb0>] memcpy+0x0/0x2f0
[<ffffffff81a56fb0>] memcpy+0x100/0x2f0
[<ffffffff81121e04>] cik_startup+0x3a64/0x3c70

It's the reason that we use SIMD intruction to implement memset/memcpy
hooks, which will cause some problems on I/O memory. Sigh, let's correct
it.

Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor
Signed-off-by: default avatarLaibin Qiu <qiulaibin@huawei.com>
Reviewed-by: default avatarHanjun Guo <guohanjun@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 43258797
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment