1
0
Fork 0
alistair23-linux/drivers/gpu/drm/nouveau/nvkm/subdev/pmu
Karol Herbst fe9748b7b4 drm/nouveau/pmu/fuc: don't use movw directly anymore
Fixes failure to compile with recent envyas as a result of the 'movw'
alias being removed for v5.

A bit of history:

v3 only has a 16-bit sign-extended immediate mov op. In order to set
the high bits, there's a separate 'sethi' op. envyas validates that
the value passed to mov(imm) is between -0x8000 and 0x7fff. In order
to simplify macros that load both the low and high word, a 'movw'
alias was added which takes an unsigned 16-bit immediate. However the
actual hardware op still sign extends.

v5 has a full 32-bit immediate mov op. The v3 16-bit immediate mov op
is gone (loads 0 into the dst reg). However due to a bug in envyas,
the movw alias still existed, and selected the no-longer-present v3
16-bit immediate mov op. As a result usage of movw on v5 is the same
as mov with a 0x0 argument.

The proper fix throughout is to only ever use the 'movw' alias in
combination with 'sethi'. Anything else should get the sign-extended
validation to ensure that the intended value ends up in the
destination register.

Changes in fuc3 binaries is the result of a different encoding being
selected for a mov with an 8-bit value.

v2: added commit message written by Ilia, thanks for that!
v3: messed up rebasing, now it should apply

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2018-02-02 15:24:03 +10:00
..
fuc drm/nouveau/pmu/fuc: don't use movw directly anymore 2018-02-02 15:24:03 +10:00
Kbuild drm/nouveau/gm20b: add dummy PMU device 2017-02-17 15:14:31 +10:00
base.c drm/nouveau/pmu/gt215-: abstract detection of whether reset is needed 2017-08-22 18:04:31 +10:00
gf100.c drm/nouveau/pmu/gt215-: abstract detection of whether reset is needed 2017-08-22 18:04:31 +10:00
gf119.c drm/nouveau/pmu/gt215-: abstract detection of whether reset is needed 2017-08-22 18:04:31 +10:00
gk20a.c drm/nouveau/pmu/gt215-: abstract detection of whether reset is needed 2017-08-22 18:04:31 +10:00
gk104.c drm/nouveau/pmu/gt215-: abstract detection of whether reset is needed 2017-08-22 18:04:31 +10:00
gk110.c drm/nouveau/pmu/gt215-: abstract detection of whether reset is needed 2017-08-22 18:04:31 +10:00
gk208.c drm/nouveau/pmu/gt215-: abstract detection of whether reset is needed 2017-08-22 18:04:31 +10:00
gm20b.c drm/nouveau/pmu/gt215-: abstract detection of whether reset is needed 2017-08-22 18:04:31 +10:00
gm107.c drm/nouveau/pmu/gt215-: abstract detection of whether reset is needed 2017-08-22 18:04:31 +10:00
gp100.c drm/nouveau/pmu/gt215-: abstract detection of whether reset is needed 2017-08-22 18:04:31 +10:00
gp102.c drm/nouveau/pmu/gt215-: abstract detection of whether reset is needed 2017-08-22 18:04:31 +10:00
gt215.c drm/nouveau/pmu/gt215-: abstract detection of whether reset is needed 2017-08-22 18:04:31 +10:00
memx.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
priv.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00