mirror of
https://github.com/torvalds/linux
synced 2024-09-06 18:01:05 +00:00
ASoC: Intel: avs: Fixes and cleanups for 6.10
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>: Set of changes targeting the avs-driver only. No new features, patchset either fixes or fortifies existing code. Patchset starts off with a fix for debugbility on ICL+ platforms which I have forgotten to fixup when providing support for these initially. The next two address copier module initialization, most importantly, silence the gcc 'field-spanning write' false-positive. The following four: 6/13 ASoC: Intel: avs: Replace risky functions with safer variants 7/13 ASoC: Intel: avs: Fix potential integer overflow 8/13 ASoC: Intel: avs: Test result of avs_get_module_entry() 9/13 ASoC: Intel: avs: Remove dead code address problems found out by Coverity static analysis tool. The last two worth mentioning are: recommendation from the firmware team to wake subsystem from D0ix when starting any pipeline -and- shielding against invalid period/buffer sizes. Audio format shall be taken into consideration when calculating either of these. Amadeusz Sławiński (2): ASoC: Intel: avs: Restore stream decoupling on prepare ASoC: Intel: avs: Add assert_static to guarantee ABI sizes Cezary Rojewski (11): ASoC: Intel: avs: Fix debug-slot offset calculation ASoC: Intel: avs: Silence false-positive memcpy() warnings ASoC: Intel: avs: Fix config_length for config-less copiers ASoC: Intel: avs: Fix ASRC module initialization ASoC: Intel: avs: Replace risky functions with safer variants ASoC: Intel: avs: Fix potential integer overflow ASoC: Intel: avs: Test result of avs_get_module_entry() ASoC: Intel: avs: Remove dead code ASoC: Intel: avs: Wake from D0ix when starting streaming ASoC: Intel: avs: Init debugfs before booting firmware ASoC: Intel: avs: Rule invalid buffer and period sizes out sound/soc/intel/avs/avs.h | 1 + sound/soc/intel/avs/cldma.c | 2 +- sound/soc/intel/avs/core.c | 4 +-- sound/soc/intel/avs/icl.c | 12 ++++++--- sound/soc/intel/avs/loader.c | 6 +++-- sound/soc/intel/avs/messages.h | 47 ++++++++++++++++++++++++++++++++-- sound/soc/intel/avs/path.c | 13 ++++------ sound/soc/intel/avs/pcm.c | 34 +++++++++++++++++++++++- sound/soc/intel/avs/probes.c | 14 ++++++---- 9 files changed, 109 insertions(+), 24 deletions(-) -- 2.25.1
This commit is contained in:
commit
3018fdf7bd
6
.mailmap
6
.mailmap
|
@ -340,7 +340,8 @@ Lee Jones <lee@kernel.org> <joneslee@google.com>
|
|||
Lee Jones <lee@kernel.org> <lee.jones@canonical.com>
|
||||
Lee Jones <lee@kernel.org> <lee.jones@linaro.org>
|
||||
Lee Jones <lee@kernel.org> <lee@ubuntu.com>
|
||||
Leonard Crestez <leonard.crestez@nxp.com> Leonard Crestez <cdleonard@gmail.com>
|
||||
Leonard Crestez <cdleonard@gmail.com> <leonard.crestez@nxp.com>
|
||||
Leonard Crestez <cdleonard@gmail.com> <leonard.crestez@intel.com>
|
||||
Leonardo Bras <leobras.c@gmail.com> <leonardo@linux.ibm.com>
|
||||
Leonard Göhrs <l.goehrs@pengutronix.de>
|
||||
Leonid I Ananiev <leonid.i.ananiev@intel.com>
|
||||
|
@ -497,7 +498,8 @@ Prasad Sodagudi <quic_psodagud@quicinc.com> <psodagud@codeaurora.org>
|
|||
Punit Agrawal <punitagrawal@gmail.com> <punit.agrawal@arm.com>
|
||||
Qais Yousef <qyousef@layalina.io> <qais.yousef@imgtec.com>
|
||||
Qais Yousef <qyousef@layalina.io> <qais.yousef@arm.com>
|
||||
Quentin Monnet <quentin@isovalent.com> <quentin.monnet@netronome.com>
|
||||
Quentin Monnet <qmo@kernel.org> <quentin.monnet@netronome.com>
|
||||
Quentin Monnet <qmo@kernel.org> <quentin@isovalent.com>
|
||||
Quentin Perret <qperret@qperret.net> <quentin.perret@arm.com>
|
||||
Rafael J. Wysocki <rjw@rjwysocki.net> <rjw@sisk.pl>
|
||||
Rajeev Nandan <quic_rajeevny@quicinc.com> <rajeevny@codeaurora.org>
|
||||
|
|
|
@ -574,7 +574,7 @@ Memory b/w domain is L3 cache.
|
|||
MB:<cache_id0>=bandwidth0;<cache_id1>=bandwidth1;...
|
||||
|
||||
Memory bandwidth Allocation specified in MiBps
|
||||
---------------------------------------------
|
||||
----------------------------------------------
|
||||
|
||||
Memory bandwidth domain is L3 cache.
|
||||
::
|
||||
|
|
|
@ -178,7 +178,7 @@ yet. Bug reports are always welcome at the issue tracker below!
|
|||
- ``LLVM=1``
|
||||
* - s390
|
||||
- Maintained
|
||||
- ``CC=clang``
|
||||
- ``LLVM=1`` (LLVM >= 18.1.0), ``CC=clang`` (LLVM < 18.1.0)
|
||||
* - um (User Mode)
|
||||
- Maintained
|
||||
- ``LLVM=1``
|
||||
|
|
78
MAINTAINERS
78
MAINTAINERS
|
@ -3942,8 +3942,7 @@ F: kernel/bpf/ringbuf.c
|
|||
|
||||
BPF [SECURITY & LSM] (Security Audit and Enforcement using BPF)
|
||||
M: KP Singh <kpsingh@kernel.org>
|
||||
R: Florent Revest <revest@chromium.org>
|
||||
R: Brendan Jackman <jackmanb@chromium.org>
|
||||
R: Matt Bobrowski <mattbobrowski@google.com>
|
||||
L: bpf@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/bpf/prog_lsm.rst
|
||||
|
@ -3968,7 +3967,7 @@ F: kernel/bpf/bpf_lru*
|
|||
F: kernel/bpf/cgroup.c
|
||||
|
||||
BPF [TOOLING] (bpftool)
|
||||
M: Quentin Monnet <quentin@isovalent.com>
|
||||
M: Quentin Monnet <qmo@kernel.org>
|
||||
L: bpf@vger.kernel.org
|
||||
S: Maintained
|
||||
F: kernel/bpf/disasm.*
|
||||
|
@ -6157,7 +6156,6 @@ DEVICE-MAPPER (LVM)
|
|||
M: Alasdair Kergon <agk@redhat.com>
|
||||
M: Mike Snitzer <snitzer@kernel.org>
|
||||
M: Mikulas Patocka <mpatocka@redhat.com>
|
||||
M: dm-devel@lists.linux.dev
|
||||
L: dm-devel@lists.linux.dev
|
||||
S: Maintained
|
||||
Q: http://patchwork.kernel.org/project/dm-devel/list/
|
||||
|
@ -6173,7 +6171,6 @@ F: include/uapi/linux/dm-*.h
|
|||
|
||||
DEVICE-MAPPER VDO TARGET
|
||||
M: Matthew Sakai <msakai@redhat.com>
|
||||
M: dm-devel@lists.linux.dev
|
||||
L: dm-devel@lists.linux.dev
|
||||
S: Maintained
|
||||
F: Documentation/admin-guide/device-mapper/vdo*.rst
|
||||
|
@ -7941,6 +7938,7 @@ M: Gao Xiang <xiang@kernel.org>
|
|||
M: Chao Yu <chao@kernel.org>
|
||||
R: Yue Hu <huyue2@coolpad.com>
|
||||
R: Jeffle Xu <jefflexu@linux.alibaba.com>
|
||||
R: Sandeep Dhavale <dhavale@google.com>
|
||||
L: linux-erofs@lists.ozlabs.org
|
||||
S: Maintained
|
||||
W: https://erofs.docs.kernel.org
|
||||
|
@ -9653,7 +9651,9 @@ L: linux-input@vger.kernel.org
|
|||
S: Maintained
|
||||
F: drivers/hid/hid-logitech-hidpp.c
|
||||
|
||||
HIGH-RESOLUTION TIMERS, CLOCKEVENTS
|
||||
HIGH-RESOLUTION TIMERS, TIMER WHEEL, CLOCKEVENTS
|
||||
M: Anna-Maria Behnsen <anna-maria@linutronix.de>
|
||||
M: Frederic Weisbecker <frederic@kernel.org>
|
||||
M: Thomas Gleixner <tglx@linutronix.de>
|
||||
L: linux-kernel@vger.kernel.org
|
||||
S: Maintained
|
||||
|
@ -9661,9 +9661,13 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
|
|||
F: Documentation/timers/
|
||||
F: include/linux/clockchips.h
|
||||
F: include/linux/hrtimer.h
|
||||
F: include/linux/timer.h
|
||||
F: kernel/time/clockevents.c
|
||||
F: kernel/time/hrtimer.c
|
||||
F: kernel/time/timer_*.c
|
||||
F: kernel/time/timer.c
|
||||
F: kernel/time/timer_list.c
|
||||
F: kernel/time/timer_migration.*
|
||||
F: tools/testing/selftests/timers/
|
||||
|
||||
HIGH-SPEED SCC DRIVER FOR AX.25
|
||||
L: linux-hams@vger.kernel.org
|
||||
|
@ -13134,6 +13138,7 @@ F: drivers/net/ethernet/marvell/mvpp2/
|
|||
|
||||
MARVELL MWIFIEX WIRELESS DRIVER
|
||||
M: Brian Norris <briannorris@chromium.org>
|
||||
R: Francesco Dolcini <francesco@dolcini.it>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
S: Odd Fixes
|
||||
F: drivers/net/wireless/marvell/mwifiex/
|
||||
|
@ -15627,9 +15632,10 @@ F: drivers/misc/nsm.c
|
|||
F: include/uapi/linux/nsm.h
|
||||
|
||||
NOHZ, DYNTICKS SUPPORT
|
||||
M: Anna-Maria Behnsen <anna-maria@linutronix.de>
|
||||
M: Frederic Weisbecker <frederic@kernel.org>
|
||||
M: Thomas Gleixner <tglx@linutronix.de>
|
||||
M: Ingo Molnar <mingo@kernel.org>
|
||||
M: Thomas Gleixner <tglx@linutronix.de>
|
||||
L: linux-kernel@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/nohz
|
||||
|
@ -17590,15 +17596,20 @@ F: drivers/pnp/
|
|||
F: include/linux/pnp.h
|
||||
|
||||
POSIX CLOCKS and TIMERS
|
||||
M: Anna-Maria Behnsen <anna-maria@linutronix.de>
|
||||
M: Frederic Weisbecker <frederic@kernel.org>
|
||||
M: Thomas Gleixner <tglx@linutronix.de>
|
||||
L: linux-kernel@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
|
||||
F: fs/timerfd.c
|
||||
F: include/linux/time_namespace.h
|
||||
F: include/linux/timer*
|
||||
F: include/linux/timerfd.h
|
||||
F: include/uapi/linux/time.h
|
||||
F: include/uapi/linux/timerfd.h
|
||||
F: include/trace/events/timer*
|
||||
F: kernel/time/*timer*
|
||||
F: kernel/time/itimer.c
|
||||
F: kernel/time/posix-*
|
||||
F: kernel/time/namespace.c
|
||||
|
||||
POWER MANAGEMENT CORE
|
||||
|
@ -18645,18 +18656,21 @@ REALTEK WIRELESS DRIVER (rtlwifi family)
|
|||
M: Ping-Ke Shih <pkshih@realtek.com>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git https://github.com/pkshih/rtw.git
|
||||
F: drivers/net/wireless/realtek/rtlwifi/
|
||||
|
||||
REALTEK WIRELESS DRIVER (rtw88)
|
||||
M: Ping-Ke Shih <pkshih@realtek.com>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git https://github.com/pkshih/rtw.git
|
||||
F: drivers/net/wireless/realtek/rtw88/
|
||||
|
||||
REALTEK WIRELESS DRIVER (rtw89)
|
||||
M: Ping-Ke Shih <pkshih@realtek.com>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git https://github.com/pkshih/rtw.git
|
||||
F: drivers/net/wireless/realtek/rtw89/
|
||||
|
||||
REDPINE WIRELESS DRIVER
|
||||
|
@ -18727,13 +18741,24 @@ S: Supported
|
|||
F: Documentation/devicetree/bindings/i2c/renesas,iic-emev2.yaml
|
||||
F: drivers/i2c/busses/i2c-emev2.c
|
||||
|
||||
RENESAS ETHERNET DRIVERS
|
||||
RENESAS ETHERNET AVB DRIVER
|
||||
R: Sergey Shtylyov <s.shtylyov@omp.ru>
|
||||
L: netdev@vger.kernel.org
|
||||
L: linux-renesas-soc@vger.kernel.org
|
||||
F: Documentation/devicetree/bindings/net/renesas,*.yaml
|
||||
F: drivers/net/ethernet/renesas/
|
||||
F: include/linux/sh_eth.h
|
||||
F: Documentation/devicetree/bindings/net/renesas,etheravb.yaml
|
||||
F: drivers/net/ethernet/renesas/Kconfig
|
||||
F: drivers/net/ethernet/renesas/Makefile
|
||||
F: drivers/net/ethernet/renesas/ravb*
|
||||
|
||||
RENESAS ETHERNET SWITCH DRIVER
|
||||
R: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
|
||||
L: netdev@vger.kernel.org
|
||||
L: linux-renesas-soc@vger.kernel.org
|
||||
F: Documentation/devicetree/bindings/net/renesas,*ether-switch.yaml
|
||||
F: drivers/net/ethernet/renesas/Kconfig
|
||||
F: drivers/net/ethernet/renesas/Makefile
|
||||
F: drivers/net/ethernet/renesas/rcar_gen4*
|
||||
F: drivers/net/ethernet/renesas/rswitch*
|
||||
|
||||
RENESAS IDT821034 ASoC CODEC
|
||||
M: Herve Codina <herve.codina@bootlin.com>
|
||||
|
@ -18843,6 +18868,16 @@ S: Supported
|
|||
F: Documentation/devicetree/bindings/i2c/renesas,rzv2m.yaml
|
||||
F: drivers/i2c/busses/i2c-rzv2m.c
|
||||
|
||||
RENESAS SUPERH ETHERNET DRIVER
|
||||
R: Sergey Shtylyov <s.shtylyov@omp.ru>
|
||||
L: netdev@vger.kernel.org
|
||||
L: linux-renesas-soc@vger.kernel.org
|
||||
F: Documentation/devicetree/bindings/net/renesas,ether.yaml
|
||||
F: drivers/net/ethernet/renesas/Kconfig
|
||||
F: drivers/net/ethernet/renesas/Makefile
|
||||
F: drivers/net/ethernet/renesas/sh_eth*
|
||||
F: include/linux/sh_eth.h
|
||||
|
||||
RENESAS USB PHY DRIVER
|
||||
M: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
|
||||
L: linux-renesas-soc@vger.kernel.org
|
||||
|
@ -19186,12 +19221,14 @@ M: Hin-Tak Leung <hintak.leung@gmail.com>
|
|||
M: Larry Finger <Larry.Finger@lwfinger.net>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git https://github.com/pkshih/rtw.git
|
||||
F: drivers/net/wireless/realtek/rtl818x/rtl8187/
|
||||
|
||||
RTL8XXXU WIRELESS DRIVER (rtl8xxxu)
|
||||
M: Jes Sorensen <Jes.Sorensen@gmail.com>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git https://github.com/pkshih/rtw.git
|
||||
F: drivers/net/wireless/realtek/rtl8xxxu/
|
||||
|
||||
RTRS TRANSPORT DRIVERS
|
||||
|
@ -22261,13 +22298,20 @@ S: Supported
|
|||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
|
||||
F: include/linux/clocksource.h
|
||||
F: include/linux/time.h
|
||||
F: include/linux/timekeeper_internal.h
|
||||
F: include/linux/timekeeping.h
|
||||
F: include/linux/timex.h
|
||||
F: include/uapi/linux/time.h
|
||||
F: include/uapi/linux/timex.h
|
||||
F: kernel/time/alarmtimer.c
|
||||
F: kernel/time/clocksource.c
|
||||
F: kernel/time/ntp.c
|
||||
F: kernel/time/time*.c
|
||||
F: kernel/time/clocksource*
|
||||
F: kernel/time/ntp*
|
||||
F: kernel/time/time.c
|
||||
F: kernel/time/timeconst.bc
|
||||
F: kernel/time/timeconv.c
|
||||
F: kernel/time/timecounter.c
|
||||
F: kernel/time/timekeeping*
|
||||
F: kernel/time/time_test.c
|
||||
F: tools/testing/selftests/timers/
|
||||
|
||||
TIPC NETWORK LAYER
|
||||
|
|
2
Makefile
2
Makefile
|
@ -2,7 +2,7 @@
|
|||
VERSION = 6
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc1
|
||||
EXTRAVERSION = -rc2
|
||||
NAME = Hurr durr I'ma ninja sloth
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
|
14
arch/arm/include/asm/mman.h
Normal file
14
arch/arm/include/asm/mman.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef __ASM_MMAN_H__
|
||||
#define __ASM_MMAN_H__
|
||||
|
||||
#include <asm/system_info.h>
|
||||
#include <uapi/asm/mman.h>
|
||||
|
||||
static inline bool arch_memory_deny_write_exec_supported(void)
|
||||
{
|
||||
return cpu_architecture() >= CPU_ARCH_ARMv6;
|
||||
}
|
||||
#define arch_memory_deny_write_exec_supported arch_memory_deny_write_exec_supported
|
||||
|
||||
#endif /* __ASM_MMAN_H__ */
|
|
@ -943,7 +943,7 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
|
|||
emit(A64_UXTH(is64, dst, dst), ctx);
|
||||
break;
|
||||
case 32:
|
||||
emit(A64_REV32(is64, dst, dst), ctx);
|
||||
emit(A64_REV32(0, dst, dst), ctx);
|
||||
/* upper 32 bits already cleared */
|
||||
break;
|
||||
case 64:
|
||||
|
@ -1256,7 +1256,7 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
|
|||
} else {
|
||||
emit_a64_mov_i(1, tmp, off, ctx);
|
||||
if (sign_extend)
|
||||
emit(A64_LDRSW(dst, src_adj, off_adj), ctx);
|
||||
emit(A64_LDRSW(dst, src, tmp), ctx);
|
||||
else
|
||||
emit(A64_LDR32(dst, src, tmp), ctx);
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ SECTIONS
|
|||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
.hexagon.attributes 0 : { *(.hexagon.attributes) }
|
||||
|
||||
DISCARDS
|
||||
}
|
||||
|
|
|
@ -619,15 +619,6 @@ config MACH_EYEQ5
|
|||
|
||||
bool
|
||||
|
||||
config FIT_IMAGE_FDT_EPM5
|
||||
bool "Include FDT for Mobileye EyeQ5 development platforms"
|
||||
depends on MACH_EYEQ5
|
||||
default n
|
||||
help
|
||||
Enable this to include the FDT for the EyeQ5 development platforms
|
||||
from Mobileye in the FIT kernel image.
|
||||
This requires u-boot on the platform.
|
||||
|
||||
config MACH_NINTENDO64
|
||||
bool "Nintendo 64 console"
|
||||
select CEVT_R4K
|
||||
|
@ -1011,6 +1002,15 @@ config CAVIUM_OCTEON_SOC
|
|||
|
||||
endchoice
|
||||
|
||||
config FIT_IMAGE_FDT_EPM5
|
||||
bool "Include FDT for Mobileye EyeQ5 development platforms"
|
||||
depends on MACH_EYEQ5
|
||||
default n
|
||||
help
|
||||
Enable this to include the FDT for the EyeQ5 development platforms
|
||||
from Mobileye in the FIT kernel image.
|
||||
This requires u-boot on the platform.
|
||||
|
||||
source "arch/mips/alchemy/Kconfig"
|
||||
source "arch/mips/ath25/Kconfig"
|
||||
source "arch/mips/ath79/Kconfig"
|
||||
|
|
14
arch/parisc/include/asm/mman.h
Normal file
14
arch/parisc/include/asm/mman.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef __ASM_MMAN_H__
|
||||
#define __ASM_MMAN_H__
|
||||
|
||||
#include <uapi/asm/mman.h>
|
||||
|
||||
/* PARISC cannot allow mdwe as it needs writable stacks */
|
||||
static inline bool arch_memory_deny_write_exec_supported(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#define arch_memory_deny_write_exec_supported arch_memory_deny_write_exec_supported
|
||||
|
||||
#endif /* __ASM_MMAN_H__ */
|
|
@ -1463,6 +1463,22 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) {
|
||||
const struct btf_func_model *fm;
|
||||
int idx;
|
||||
|
||||
fm = bpf_jit_find_kfunc_model(ctx->prog, insn);
|
||||
if (!fm)
|
||||
return -EINVAL;
|
||||
|
||||
for (idx = 0; idx < fm->nr_args; idx++) {
|
||||
u8 reg = bpf_to_rv_reg(BPF_REG_1 + idx, ctx);
|
||||
|
||||
if (fm->arg_size[idx] == sizeof(int))
|
||||
emit_sextw(reg, reg, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
ret = emit_call(addr, fixed_addr, ctx);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
@ -516,11 +516,12 @@ static void bpf_skip(struct bpf_jit *jit, int size)
|
|||
* PLT for hotpatchable calls. The calling convention is the same as for the
|
||||
* ftrace hotpatch trampolines: %r0 is return address, %r1 is clobbered.
|
||||
*/
|
||||
extern const char bpf_plt[];
|
||||
extern const char bpf_plt_ret[];
|
||||
extern const char bpf_plt_target[];
|
||||
extern const char bpf_plt_end[];
|
||||
#define BPF_PLT_SIZE 32
|
||||
struct bpf_plt {
|
||||
char code[16];
|
||||
void *ret;
|
||||
void *target;
|
||||
} __packed;
|
||||
extern const struct bpf_plt bpf_plt;
|
||||
asm(
|
||||
".pushsection .rodata\n"
|
||||
" .balign 8\n"
|
||||
|
@ -531,15 +532,14 @@ asm(
|
|||
" .balign 8\n"
|
||||
"bpf_plt_ret: .quad 0\n"
|
||||
"bpf_plt_target: .quad 0\n"
|
||||
"bpf_plt_end:\n"
|
||||
" .popsection\n"
|
||||
);
|
||||
|
||||
static void bpf_jit_plt(void *plt, void *ret, void *target)
|
||||
static void bpf_jit_plt(struct bpf_plt *plt, void *ret, void *target)
|
||||
{
|
||||
memcpy(plt, bpf_plt, BPF_PLT_SIZE);
|
||||
*(void **)((char *)plt + (bpf_plt_ret - bpf_plt)) = ret;
|
||||
*(void **)((char *)plt + (bpf_plt_target - bpf_plt)) = target ?: ret;
|
||||
memcpy(plt, &bpf_plt, sizeof(*plt));
|
||||
plt->ret = ret;
|
||||
plt->target = target;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -662,9 +662,9 @@ static void bpf_jit_epilogue(struct bpf_jit *jit, u32 stack_depth)
|
|||
jit->prg = ALIGN(jit->prg, 8);
|
||||
jit->prologue_plt = jit->prg;
|
||||
if (jit->prg_buf)
|
||||
bpf_jit_plt(jit->prg_buf + jit->prg,
|
||||
bpf_jit_plt((struct bpf_plt *)(jit->prg_buf + jit->prg),
|
||||
jit->prg_buf + jit->prologue_plt_ret, NULL);
|
||||
jit->prg += BPF_PLT_SIZE;
|
||||
jit->prg += sizeof(struct bpf_plt);
|
||||
}
|
||||
|
||||
static int get_probe_mem_regno(const u8 *insn)
|
||||
|
@ -2040,9 +2040,6 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
|
|||
struct bpf_jit jit;
|
||||
int pass;
|
||||
|
||||
if (WARN_ON_ONCE(bpf_plt_end - bpf_plt != BPF_PLT_SIZE))
|
||||
return orig_fp;
|
||||
|
||||
if (!fp->jit_requested)
|
||||
return orig_fp;
|
||||
|
||||
|
@ -2148,14 +2145,11 @@ bool bpf_jit_supports_far_kfunc_call(void)
|
|||
int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t,
|
||||
void *old_addr, void *new_addr)
|
||||
{
|
||||
struct bpf_plt expected_plt, current_plt, new_plt, *plt;
|
||||
struct {
|
||||
u16 opc;
|
||||
s32 disp;
|
||||
} __packed insn;
|
||||
char expected_plt[BPF_PLT_SIZE];
|
||||
char current_plt[BPF_PLT_SIZE];
|
||||
char new_plt[BPF_PLT_SIZE];
|
||||
char *plt;
|
||||
char *ret;
|
||||
int err;
|
||||
|
||||
|
@ -2174,18 +2168,18 @@ int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t,
|
|||
*/
|
||||
} else {
|
||||
/* Verify the PLT. */
|
||||
plt = (char *)ip + (insn.disp << 1);
|
||||
err = copy_from_kernel_nofault(current_plt, plt, BPF_PLT_SIZE);
|
||||
plt = ip + (insn.disp << 1);
|
||||
err = copy_from_kernel_nofault(¤t_plt, plt,
|
||||
sizeof(current_plt));
|
||||
if (err < 0)
|
||||
return err;
|
||||
ret = (char *)ip + 6;
|
||||
bpf_jit_plt(expected_plt, ret, old_addr);
|
||||
if (memcmp(current_plt, expected_plt, BPF_PLT_SIZE))
|
||||
bpf_jit_plt(&expected_plt, ret, old_addr);
|
||||
if (memcmp(¤t_plt, &expected_plt, sizeof(current_plt)))
|
||||
return -EINVAL;
|
||||
/* Adjust the call address. */
|
||||
bpf_jit_plt(new_plt, ret, new_addr);
|
||||
s390_kernel_write(plt + (bpf_plt_target - bpf_plt),
|
||||
new_plt + (bpf_plt_target - bpf_plt),
|
||||
bpf_jit_plt(&new_plt, ret, new_addr);
|
||||
s390_kernel_write(&plt->target, &new_plt.target,
|
||||
sizeof(void *));
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ obj-y += net/
|
|||
|
||||
obj-$(CONFIG_KEXEC_FILE) += purgatory/
|
||||
|
||||
obj-y += virt/svm/
|
||||
obj-y += virt/
|
||||
|
||||
# for cleaning
|
||||
subdir- += boot tools
|
||||
|
|
|
@ -2439,6 +2439,8 @@ config USE_X86_SEG_SUPPORT
|
|||
# with named address spaces - see GCC PR sanitizer/111736.
|
||||
#
|
||||
depends on !KASAN
|
||||
# -fsanitize=thread (KCSAN) is also incompatible.
|
||||
depends on !KCSAN
|
||||
|
||||
config CC_HAS_SLS
|
||||
def_bool $(cc-option,-mharden-sls=all)
|
||||
|
|
|
@ -251,8 +251,6 @@ archheaders:
|
|||
|
||||
libs-y += arch/x86/lib/
|
||||
|
||||
core-y += arch/x86/virt/
|
||||
|
||||
# drivers-y are linked after core-y
|
||||
drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
|
||||
drivers-$(CONFIG_PCI) += arch/x86/pci/
|
||||
|
|
|
@ -15,10 +15,12 @@
|
|||
*/
|
||||
|
||||
#include <linux/linkage.h>
|
||||
#include <asm/asm-offsets.h>
|
||||
#include <asm/msr.h>
|
||||
#include <asm/page_types.h>
|
||||
#include <asm/processor-flags.h>
|
||||
#include <asm/segment.h>
|
||||
#include <asm/setup.h>
|
||||
|
||||
.code64
|
||||
.text
|
||||
|
@ -149,6 +151,7 @@ SYM_FUNC_END(__efi64_thunk)
|
|||
SYM_FUNC_START(efi32_stub_entry)
|
||||
call 1f
|
||||
1: popl %ecx
|
||||
leal (efi32_boot_args - 1b)(%ecx), %ebx
|
||||
|
||||
/* Clear BSS */
|
||||
xorl %eax, %eax
|
||||
|
@ -163,6 +166,7 @@ SYM_FUNC_START(efi32_stub_entry)
|
|||
popl %ecx
|
||||
popl %edx
|
||||
popl %esi
|
||||
movl %esi, 8(%ebx)
|
||||
jmp efi32_entry
|
||||
SYM_FUNC_END(efi32_stub_entry)
|
||||
#endif
|
||||
|
@ -239,8 +243,6 @@ SYM_FUNC_END(efi_enter32)
|
|||
*
|
||||
* Arguments: %ecx image handle
|
||||
* %edx EFI system table pointer
|
||||
* %esi struct bootparams pointer (or NULL when not using
|
||||
* the EFI handover protocol)
|
||||
*
|
||||
* Since this is the point of no return for ordinary execution, no registers
|
||||
* are considered live except for the function parameters. [Note that the EFI
|
||||
|
@ -266,9 +268,18 @@ SYM_FUNC_START_LOCAL(efi32_entry)
|
|||
leal (efi32_boot_args - 1b)(%ebx), %ebx
|
||||
movl %ecx, 0(%ebx)
|
||||
movl %edx, 4(%ebx)
|
||||
movl %esi, 8(%ebx)
|
||||
movb $0x0, 12(%ebx) // efi_is64
|
||||
|
||||
/*
|
||||
* Allocate some memory for a temporary struct boot_params, which only
|
||||
* needs the minimal pieces that startup_32() relies on.
|
||||
*/
|
||||
subl $PARAM_SIZE, %esp
|
||||
movl %esp, %esi
|
||||
movl $PAGE_SIZE, BP_kernel_alignment(%esi)
|
||||
movl $_end - 1b, BP_init_size(%esi)
|
||||
subl $startup_32 - 1b, BP_init_size(%esi)
|
||||
|
||||
/* Disable paging */
|
||||
movl %cr0, %eax
|
||||
btrl $X86_CR0_PG_BIT, %eax
|
||||
|
@ -294,8 +305,7 @@ SYM_FUNC_START(efi32_pe_entry)
|
|||
|
||||
movl 8(%ebp), %ecx // image_handle
|
||||
movl 12(%ebp), %edx // sys_table
|
||||
xorl %esi, %esi
|
||||
jmp efi32_entry // pass %ecx, %edx, %esi
|
||||
jmp efi32_entry // pass %ecx, %edx
|
||||
// no other registers remain live
|
||||
|
||||
2: popl %edi // restore callee-save registers
|
||||
|
|
|
@ -41,6 +41,7 @@ obj-$(CONFIG_X86_X32_ABI) += vdso-image-x32.o
|
|||
obj-$(CONFIG_COMPAT_32) += vdso-image-32.o vdso32-setup.o
|
||||
|
||||
OBJECT_FILES_NON_STANDARD_vdso-image-32.o := n
|
||||
OBJECT_FILES_NON_STANDARD_vdso-image-x32.o := n
|
||||
OBJECT_FILES_NON_STANDARD_vdso-image-64.o := n
|
||||
OBJECT_FILES_NON_STANDARD_vdso32-setup.o := n
|
||||
|
||||
|
|
|
@ -250,7 +250,7 @@ static const u64 amd_perfmon_event_map[PERF_COUNT_HW_MAX] =
|
|||
/*
|
||||
* AMD Performance Monitor Family 17h and later:
|
||||
*/
|
||||
static const u64 amd_f17h_perfmon_event_map[PERF_COUNT_HW_MAX] =
|
||||
static const u64 amd_zen1_perfmon_event_map[PERF_COUNT_HW_MAX] =
|
||||
{
|
||||
[PERF_COUNT_HW_CPU_CYCLES] = 0x0076,
|
||||
[PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
|
||||
|
@ -262,10 +262,39 @@ static const u64 amd_f17h_perfmon_event_map[PERF_COUNT_HW_MAX] =
|
|||
[PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = 0x0187,
|
||||
};
|
||||
|
||||
static const u64 amd_zen2_perfmon_event_map[PERF_COUNT_HW_MAX] =
|
||||
{
|
||||
[PERF_COUNT_HW_CPU_CYCLES] = 0x0076,
|
||||
[PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
|
||||
[PERF_COUNT_HW_CACHE_REFERENCES] = 0xff60,
|
||||
[PERF_COUNT_HW_CACHE_MISSES] = 0x0964,
|
||||
[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2,
|
||||
[PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3,
|
||||
[PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x00a9,
|
||||
};
|
||||
|
||||
static const u64 amd_zen4_perfmon_event_map[PERF_COUNT_HW_MAX] =
|
||||
{
|
||||
[PERF_COUNT_HW_CPU_CYCLES] = 0x0076,
|
||||
[PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
|
||||
[PERF_COUNT_HW_CACHE_REFERENCES] = 0xff60,
|
||||
[PERF_COUNT_HW_CACHE_MISSES] = 0x0964,
|
||||
[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2,
|
||||
[PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3,
|
||||
[PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x00a9,
|
||||
[PERF_COUNT_HW_REF_CPU_CYCLES] = 0x100000120,
|
||||
};
|
||||
|
||||
static u64 amd_pmu_event_map(int hw_event)
|
||||
{
|
||||
if (boot_cpu_data.x86 >= 0x17)
|
||||
return amd_f17h_perfmon_event_map[hw_event];
|
||||
if (cpu_feature_enabled(X86_FEATURE_ZEN4) || boot_cpu_data.x86 >= 0x1a)
|
||||
return amd_zen4_perfmon_event_map[hw_event];
|
||||
|
||||
if (cpu_feature_enabled(X86_FEATURE_ZEN2) || boot_cpu_data.x86 >= 0x19)
|
||||
return amd_zen2_perfmon_event_map[hw_event];
|
||||
|
||||
if (cpu_feature_enabled(X86_FEATURE_ZEN1))
|
||||
return amd_zen1_perfmon_event_map[hw_event];
|
||||
|
||||
return amd_perfmon_event_map[hw_event];
|
||||
}
|
||||
|
@ -904,8 +933,8 @@ static int amd_pmu_v2_handle_irq(struct pt_regs *regs)
|
|||
if (!status)
|
||||
goto done;
|
||||
|
||||
/* Read branch records before unfreezing */
|
||||
if (status & GLOBAL_STATUS_LBRS_FROZEN) {
|
||||
/* Read branch records */
|
||||
if (x86_pmu.lbr_nr) {
|
||||
amd_pmu_lbr_read();
|
||||
status &= ~GLOBAL_STATUS_LBRS_FROZEN;
|
||||
}
|
||||
|
|
|
@ -402,10 +402,12 @@ void amd_pmu_lbr_enable_all(void)
|
|||
wrmsrl(MSR_AMD64_LBR_SELECT, lbr_select);
|
||||
}
|
||||
|
||||
if (cpu_feature_enabled(X86_FEATURE_AMD_LBR_PMC_FREEZE)) {
|
||||
rdmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl);
|
||||
rdmsrl(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg);
|
||||
|
||||
wrmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl | DEBUGCTLMSR_FREEZE_LBRS_ON_PMI);
|
||||
}
|
||||
|
||||
rdmsrl(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg);
|
||||
wrmsrl(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg | DBG_EXTN_CFG_LBRV2EN);
|
||||
}
|
||||
|
||||
|
@ -418,11 +420,13 @@ void amd_pmu_lbr_disable_all(void)
|
|||
return;
|
||||
|
||||
rdmsrl(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg);
|
||||
rdmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl);
|
||||
|
||||
wrmsrl(MSR_AMD_DBG_EXTN_CFG, dbg_extn_cfg & ~DBG_EXTN_CFG_LBRV2EN);
|
||||
|
||||
if (cpu_feature_enabled(X86_FEATURE_AMD_LBR_PMC_FREEZE)) {
|
||||
rdmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl);
|
||||
wrmsrl(MSR_IA32_DEBUGCTLMSR, dbg_ctl & ~DEBUGCTLMSR_FREEZE_LBRS_ON_PMI);
|
||||
}
|
||||
}
|
||||
|
||||
__init int amd_pmu_lbr_init(void)
|
||||
{
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <asm/asm.h>
|
||||
#include <asm/fred.h>
|
||||
#include <asm/gsseg.h>
|
||||
#include <asm/nospec-branch.h>
|
||||
|
||||
#ifndef CONFIG_X86_CMPXCHG64
|
||||
extern void cmpxchg8b_emu(void);
|
||||
|
|
|
@ -91,8 +91,9 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
|
|||
CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 18, feature_bit) || \
|
||||
CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 19, feature_bit) || \
|
||||
CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 20, feature_bit) || \
|
||||
CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 21, feature_bit) || \
|
||||
REQUIRED_MASK_CHECK || \
|
||||
BUILD_BUG_ON_ZERO(NCAPINTS != 21))
|
||||
BUILD_BUG_ON_ZERO(NCAPINTS != 22))
|
||||
|
||||
#define DISABLED_MASK_BIT_SET(feature_bit) \
|
||||
( CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 0, feature_bit) || \
|
||||
|
@ -116,8 +117,9 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
|
|||
CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 18, feature_bit) || \
|
||||
CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 19, feature_bit) || \
|
||||
CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 20, feature_bit) || \
|
||||
CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 21, feature_bit) || \
|
||||
DISABLED_MASK_CHECK || \
|
||||
BUILD_BUG_ON_ZERO(NCAPINTS != 21))
|
||||
BUILD_BUG_ON_ZERO(NCAPINTS != 22))
|
||||
|
||||
#define cpu_has(c, bit) \
|
||||
(__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
/*
|
||||
* Defines x86 CPU feature bits
|
||||
*/
|
||||
#define NCAPINTS 21 /* N 32-bit words worth of info */
|
||||
#define NCAPINTS 22 /* N 32-bit words worth of info */
|
||||
#define NBUGINTS 2 /* N 32-bit bug flags */
|
||||
|
||||
/*
|
||||
|
@ -459,6 +459,14 @@
|
|||
#define X86_FEATURE_IBPB_BRTYPE (20*32+28) /* "" MSR_PRED_CMD[IBPB] flushes all branch type predictions */
|
||||
#define X86_FEATURE_SRSO_NO (20*32+29) /* "" CPU is not affected by SRSO */
|
||||
|
||||
/*
|
||||
* Extended auxiliary flags: Linux defined - for features scattered in various
|
||||
* CPUID levels like 0x80000022, etc.
|
||||
*
|
||||
* Reuse free bits when adding new feature flags!
|
||||
*/
|
||||
#define X86_FEATURE_AMD_LBR_PMC_FREEZE (21*32+ 0) /* AMD LBR and PMC Freeze */
|
||||
|
||||
/*
|
||||
* BUG word(s)
|
||||
*/
|
||||
|
|
|
@ -39,4 +39,6 @@ static inline unsigned long crash_low_size_default(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
#define HAVE_ARCH_ADD_CRASH_RES_TO_IOMEM_EARLY
|
||||
|
||||
#endif /* _X86_CRASH_RESERVE_H */
|
||||
|
|
|
@ -155,6 +155,7 @@
|
|||
#define DISABLED_MASK18 (DISABLE_IBT)
|
||||
#define DISABLED_MASK19 (DISABLE_SEV_SNP)
|
||||
#define DISABLED_MASK20 0
|
||||
#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 21)
|
||||
#define DISABLED_MASK21 0
|
||||
#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 22)
|
||||
|
||||
#endif /* _ASM_X86_DISABLED_FEATURES_H */
|
||||
|
|
|
@ -262,11 +262,20 @@
|
|||
.Lskip_rsb_\@:
|
||||
.endm
|
||||
|
||||
/*
|
||||
* The CALL to srso_alias_untrain_ret() must be patched in directly at
|
||||
* the spot where untraining must be done, ie., srso_alias_untrain_ret()
|
||||
* must be the target of a CALL instruction instead of indirectly
|
||||
* jumping to a wrapper which then calls it. Therefore, this macro is
|
||||
* called outside of __UNTRAIN_RET below, for the time being, before the
|
||||
* kernel can support nested alternatives with arbitrary nesting.
|
||||
*/
|
||||
.macro CALL_UNTRAIN_RET
|
||||
#if defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_MITIGATION_SRSO)
|
||||
#define CALL_UNTRAIN_RET "call entry_untrain_ret"
|
||||
#else
|
||||
#define CALL_UNTRAIN_RET ""
|
||||
ALTERNATIVE_2 "", "call entry_untrain_ret", X86_FEATURE_UNRET, \
|
||||
"call srso_alias_untrain_ret", X86_FEATURE_SRSO_ALIAS
|
||||
#endif
|
||||
.endm
|
||||
|
||||
/*
|
||||
* Mitigate RETBleed for AMD/Hygon Zen uarch. Requires KERNEL CR3 because the
|
||||
|
@ -282,8 +291,8 @@
|
|||
.macro __UNTRAIN_RET ibpb_feature, call_depth_insns
|
||||
#if defined(CONFIG_MITIGATION_RETHUNK) || defined(CONFIG_MITIGATION_IBPB_ENTRY)
|
||||
VALIDATE_UNRET_END
|
||||
ALTERNATIVE_3 "", \
|
||||
CALL_UNTRAIN_RET, X86_FEATURE_UNRET, \
|
||||
CALL_UNTRAIN_RET
|
||||
ALTERNATIVE_2 "", \
|
||||
"call entry_ibpb", \ibpb_feature, \
|
||||
__stringify(\call_depth_insns), X86_FEATURE_CALL_DEPTH
|
||||
#endif
|
||||
|
@ -342,6 +351,8 @@ extern void retbleed_return_thunk(void);
|
|||
static inline void retbleed_return_thunk(void) {}
|
||||
#endif
|
||||
|
||||
extern void srso_alias_untrain_ret(void);
|
||||
|
||||
#ifdef CONFIG_MITIGATION_SRSO
|
||||
extern void srso_return_thunk(void);
|
||||
extern void srso_alias_return_thunk(void);
|
||||
|
|
|
@ -99,6 +99,7 @@
|
|||
#define REQUIRED_MASK18 0
|
||||
#define REQUIRED_MASK19 0
|
||||
#define REQUIRED_MASK20 0
|
||||
#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 21)
|
||||
#define REQUIRED_MASK21 0
|
||||
#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 22)
|
||||
|
||||
#endif /* _ASM_X86_REQUIRED_FEATURES_H */
|
||||
|
|
|
@ -218,12 +218,12 @@ void early_snp_set_memory_private(unsigned long vaddr, unsigned long paddr,
|
|||
unsigned long npages);
|
||||
void early_snp_set_memory_shared(unsigned long vaddr, unsigned long paddr,
|
||||
unsigned long npages);
|
||||
void __init snp_prep_memory(unsigned long paddr, unsigned int sz, enum psc_op op);
|
||||
void snp_set_memory_shared(unsigned long vaddr, unsigned long npages);
|
||||
void snp_set_memory_private(unsigned long vaddr, unsigned long npages);
|
||||
void snp_set_wakeup_secondary_cpu(void);
|
||||
bool snp_init(struct boot_params *bp);
|
||||
void __noreturn snp_abort(void);
|
||||
void snp_dmi_setup(void);
|
||||
int snp_issue_guest_request(u64 exit_code, struct snp_req_data *input, struct snp_guest_request_ioctl *rio);
|
||||
void snp_accept_memory(phys_addr_t start, phys_addr_t end);
|
||||
u64 snp_get_unsupported_features(u64 status);
|
||||
|
@ -244,12 +244,12 @@ static inline void __init
|
|||
early_snp_set_memory_private(unsigned long vaddr, unsigned long paddr, unsigned long npages) { }
|
||||
static inline void __init
|
||||
early_snp_set_memory_shared(unsigned long vaddr, unsigned long paddr, unsigned long npages) { }
|
||||
static inline void __init snp_prep_memory(unsigned long paddr, unsigned int sz, enum psc_op op) { }
|
||||
static inline void snp_set_memory_shared(unsigned long vaddr, unsigned long npages) { }
|
||||
static inline void snp_set_memory_private(unsigned long vaddr, unsigned long npages) { }
|
||||
static inline void snp_set_wakeup_secondary_cpu(void) { }
|
||||
static inline bool snp_init(struct boot_params *bp) { return false; }
|
||||
static inline void snp_abort(void) { }
|
||||
static inline void snp_dmi_setup(void) { }
|
||||
static inline int snp_issue_guest_request(u64 exit_code, struct snp_req_data *input, struct snp_guest_request_ioctl *rio)
|
||||
{
|
||||
return -ENOTTY;
|
||||
|
|
|
@ -30,12 +30,13 @@ struct x86_init_mpparse {
|
|||
* @reserve_resources: reserve the standard resources for the
|
||||
* platform
|
||||
* @memory_setup: platform specific memory setup
|
||||
*
|
||||
* @dmi_setup: platform specific DMI setup
|
||||
*/
|
||||
struct x86_init_resources {
|
||||
void (*probe_roms)(void);
|
||||
void (*reserve_resources)(void);
|
||||
char *(*memory_setup)(void);
|
||||
void (*dmi_setup)(void);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -49,6 +49,7 @@ static const struct cpuid_bit cpuid_bits[] = {
|
|||
{ X86_FEATURE_BMEC, CPUID_EBX, 3, 0x80000020, 0 },
|
||||
{ X86_FEATURE_PERFMON_V2, CPUID_EAX, 0, 0x80000022, 0 },
|
||||
{ X86_FEATURE_AMD_LBR_V2, CPUID_EAX, 1, 0x80000022, 0 },
|
||||
{ X86_FEATURE_AMD_LBR_PMC_FREEZE, CPUID_EAX, 2, 0x80000022, 0 },
|
||||
{ 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
/*
|
||||
* EISA specific code
|
||||
*/
|
||||
#include <linux/cc_platform.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/eisa.h>
|
||||
#include <linux/io.h>
|
||||
|
@ -12,7 +13,7 @@ static __init int eisa_bus_probe(void)
|
|||
{
|
||||
void __iomem *p;
|
||||
|
||||
if (xen_pv_domain() && !xen_initial_domain())
|
||||
if ((xen_pv_domain() && !xen_initial_domain()) || cc_platform_has(CC_ATTR_GUEST_SEV_SNP))
|
||||
return 0;
|
||||
|
||||
p = ioremap(0x0FFFD9, 4);
|
||||
|
|
|
@ -580,7 +580,7 @@ EXPORT_SYMBOL_GPL(asm_exc_nmi_kvm_vmx);
|
|||
|
||||
static char *nmi_check_stall_msg[] = {
|
||||
/* */
|
||||
/* +--------- nsp->idt_seq_snap & 0x1: CPU is in NMI handler. */
|
||||
/* +--------- nmi_seq & 0x1: CPU is currently in NMI handler. */
|
||||
/* | +------ cpu_is_offline(cpu) */
|
||||
/* | | +--- nsp->idt_calls_snap != atomic_long_read(&nsp->idt_calls): */
|
||||
/* | | | NMI handler has been invoked. */
|
||||
|
@ -628,22 +628,26 @@ void nmi_backtrace_stall_check(const struct cpumask *btp)
|
|||
nmi_seq = READ_ONCE(nsp->idt_nmi_seq);
|
||||
if (nsp->idt_nmi_seq_snap + 1 == nmi_seq && (nmi_seq & 0x1)) {
|
||||
msgp = "CPU entered NMI handler function, but has not exited";
|
||||
} else if ((nsp->idt_nmi_seq_snap & 0x1) != (nmi_seq & 0x1)) {
|
||||
msgp = "CPU is handling NMIs";
|
||||
} else {
|
||||
idx = ((nsp->idt_seq_snap & 0x1) << 2) |
|
||||
} else if (nsp->idt_nmi_seq_snap == nmi_seq ||
|
||||
nsp->idt_nmi_seq_snap + 1 == nmi_seq) {
|
||||
idx = ((nmi_seq & 0x1) << 2) |
|
||||
(cpu_is_offline(cpu) << 1) |
|
||||
(nsp->idt_calls_snap != atomic_long_read(&nsp->idt_calls));
|
||||
msgp = nmi_check_stall_msg[idx];
|
||||
if (nsp->idt_ignored_snap != READ_ONCE(nsp->idt_ignored) && (idx & 0x1))
|
||||
modp = ", but OK because ignore_nmis was set";
|
||||
if (nmi_seq & 0x1)
|
||||
msghp = " (CPU currently in NMI handler function)";
|
||||
else if (nsp->idt_nmi_seq_snap + 1 == nmi_seq)
|
||||
if (nsp->idt_nmi_seq_snap + 1 == nmi_seq)
|
||||
msghp = " (CPU exited one NMI handler function)";
|
||||
else if (nmi_seq & 0x1)
|
||||
msghp = " (CPU currently in NMI handler function)";
|
||||
else
|
||||
msghp = " (CPU was never in an NMI handler function)";
|
||||
} else {
|
||||
msgp = "CPU is handling NMIs";
|
||||
}
|
||||
pr_alert("%s: CPU %d: %s%s%s, last activity: %lu jiffies ago.\n",
|
||||
__func__, cpu, msgp, modp, msghp, j - READ_ONCE(nsp->recv_jiffies));
|
||||
pr_alert("%s: CPU %d: %s%s%s\n", __func__, cpu, msgp, modp, msghp);
|
||||
pr_alert("%s: last activity: %lu jiffies ago.\n",
|
||||
__func__, j - READ_ONCE(nsp->recv_jiffies));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -203,16 +203,6 @@ void __init probe_roms(void)
|
|||
unsigned char c;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* The ROM memory range is not part of the e820 table and is therefore not
|
||||
* pre-validated by BIOS. The kernel page table maps the ROM region as encrypted
|
||||
* memory, and SNP requires encrypted memory to be validated before access.
|
||||
* Do that here.
|
||||
*/
|
||||
snp_prep_memory(video_rom_resource.start,
|
||||
((system_rom_resource.end + 1) - video_rom_resource.start),
|
||||
SNP_PAGE_STATE_PRIVATE);
|
||||
|
||||
/* video rom */
|
||||
upper = adapter_rom_resources[0].start;
|
||||
for (start = video_rom_resource.start; start < upper; start += 2048) {
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <linux/console.h>
|
||||
#include <linux/crash_dump.h>
|
||||
#include <linux/dma-map-ops.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/efi.h>
|
||||
#include <linux/ima.h>
|
||||
#include <linux/init_ohci1394_dma.h>
|
||||
|
@ -902,7 +901,7 @@ void __init setup_arch(char **cmdline_p)
|
|||
efi_init();
|
||||
|
||||
reserve_ibft_region();
|
||||
dmi_setup();
|
||||
x86_init.resources.dmi_setup();
|
||||
|
||||
/*
|
||||
* VMware detection requires dmi to be available, so this
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <linux/platform_device.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/psp-sev.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <uapi/linux/sev-guest.h>
|
||||
|
||||
#include <asm/init.h>
|
||||
|
@ -795,21 +796,6 @@ void __init early_snp_set_memory_shared(unsigned long vaddr, unsigned long paddr
|
|||
early_set_pages_state(vaddr, paddr, npages, SNP_PAGE_STATE_SHARED);
|
||||
}
|
||||
|
||||
void __init snp_prep_memory(unsigned long paddr, unsigned int sz, enum psc_op op)
|
||||
{
|
||||
unsigned long vaddr, npages;
|
||||
|
||||
vaddr = (unsigned long)__va(paddr);
|
||||
npages = PAGE_ALIGN(sz) >> PAGE_SHIFT;
|
||||
|
||||
if (op == SNP_PAGE_STATE_PRIVATE)
|
||||
early_snp_set_memory_private(vaddr, paddr, npages);
|
||||
else if (op == SNP_PAGE_STATE_SHARED)
|
||||
early_snp_set_memory_shared(vaddr, paddr, npages);
|
||||
else
|
||||
WARN(1, "invalid memory op %d\n", op);
|
||||
}
|
||||
|
||||
static unsigned long __set_pages_state(struct snp_psc_desc *data, unsigned long vaddr,
|
||||
unsigned long vaddr_end, int op)
|
||||
{
|
||||
|
@ -2136,6 +2122,17 @@ void __head __noreturn snp_abort(void)
|
|||
sev_es_terminate(SEV_TERM_SET_GEN, GHCB_SNP_UNSUPPORTED);
|
||||
}
|
||||
|
||||
/*
|
||||
* SEV-SNP guests should only execute dmi_setup() if EFI_CONFIG_TABLES are
|
||||
* enabled, as the alternative (fallback) logic for DMI probing in the legacy
|
||||
* ROM region can cause a crash since this region is not pre-validated.
|
||||
*/
|
||||
void __init snp_dmi_setup(void)
|
||||
{
|
||||
if (efi_enabled(EFI_CONFIG_TABLES))
|
||||
dmi_setup();
|
||||
}
|
||||
|
||||
static void dump_cpuid_table(void)
|
||||
{
|
||||
const struct snp_cpuid_table *cpuid_table = snp_cpuid_get_table();
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
*
|
||||
* For licencing details see kernel-base/COPYING
|
||||
*/
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/export.h>
|
||||
|
@ -66,6 +67,7 @@ struct x86_init_ops x86_init __initdata = {
|
|||
.probe_roms = probe_roms,
|
||||
.reserve_resources = reserve_standard_io_resources,
|
||||
.memory_setup = e820__memory_setup_default,
|
||||
.dmi_setup = dmi_setup,
|
||||
},
|
||||
|
||||
.mpparse = {
|
||||
|
|
|
@ -163,6 +163,7 @@ SYM_CODE_START_NOALIGN(srso_alias_untrain_ret)
|
|||
lfence
|
||||
jmp srso_alias_return_thunk
|
||||
SYM_FUNC_END(srso_alias_untrain_ret)
|
||||
__EXPORT_THUNK(srso_alias_untrain_ret)
|
||||
.popsection
|
||||
|
||||
.pushsection .text..__x86.rethunk_safe
|
||||
|
@ -224,10 +225,12 @@ SYM_CODE_START(srso_return_thunk)
|
|||
SYM_CODE_END(srso_return_thunk)
|
||||
|
||||
#define JMP_SRSO_UNTRAIN_RET "jmp srso_untrain_ret"
|
||||
#define JMP_SRSO_ALIAS_UNTRAIN_RET "jmp srso_alias_untrain_ret"
|
||||
#else /* !CONFIG_MITIGATION_SRSO */
|
||||
/* Dummy for the alternative in CALL_UNTRAIN_RET. */
|
||||
SYM_CODE_START(srso_alias_untrain_ret)
|
||||
RET
|
||||
SYM_FUNC_END(srso_alias_untrain_ret)
|
||||
#define JMP_SRSO_UNTRAIN_RET "ud2"
|
||||
#define JMP_SRSO_ALIAS_UNTRAIN_RET "ud2"
|
||||
#endif /* CONFIG_MITIGATION_SRSO */
|
||||
|
||||
#ifdef CONFIG_MITIGATION_UNRET_ENTRY
|
||||
|
@ -319,9 +322,7 @@ SYM_FUNC_END(retbleed_untrain_ret)
|
|||
#if defined(CONFIG_MITIGATION_UNRET_ENTRY) || defined(CONFIG_MITIGATION_SRSO)
|
||||
|
||||
SYM_FUNC_START(entry_untrain_ret)
|
||||
ALTERNATIVE_2 JMP_RETBLEED_UNTRAIN_RET, \
|
||||
JMP_SRSO_UNTRAIN_RET, X86_FEATURE_SRSO, \
|
||||
JMP_SRSO_ALIAS_UNTRAIN_RET, X86_FEATURE_SRSO_ALIAS
|
||||
ALTERNATIVE JMP_RETBLEED_UNTRAIN_RET, JMP_SRSO_UNTRAIN_RET, X86_FEATURE_SRSO
|
||||
SYM_FUNC_END(entry_untrain_ret)
|
||||
__EXPORT_THUNK(entry_untrain_ret)
|
||||
|
||||
|
|
|
@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
|
|||
for (; addr < end; addr = next) {
|
||||
pud_t *pud = pud_page + pud_index(addr);
|
||||
pmd_t *pmd;
|
||||
bool use_gbpage;
|
||||
|
||||
next = (addr & PUD_MASK) + PUD_SIZE;
|
||||
if (next > end)
|
||||
next = end;
|
||||
|
||||
/* if this is already a gbpage, this portion is already mapped */
|
||||
if (pud_leaf(*pud))
|
||||
continue;
|
||||
|
||||
/* Is using a gbpage allowed? */
|
||||
use_gbpage = info->direct_gbpages;
|
||||
|
||||
/* Don't use gbpage if it maps more than the requested region. */
|
||||
/* at the begining: */
|
||||
use_gbpage &= ((addr & ~PUD_MASK) == 0);
|
||||
/* ... or at the end: */
|
||||
use_gbpage &= ((next & ~PUD_MASK) == 0);
|
||||
|
||||
/* Never overwrite existing mappings */
|
||||
use_gbpage &= !pud_present(*pud);
|
||||
|
||||
if (use_gbpage) {
|
||||
if (info->direct_gbpages) {
|
||||
pud_t pudval;
|
||||
|
||||
if (pud_present(*pud))
|
||||
continue;
|
||||
|
||||
addr &= PUD_MASK;
|
||||
pudval = __pud((addr - info->offset) | info->page_flag);
|
||||
set_pud(pud, pudval);
|
||||
continue;
|
||||
|
|
|
@ -492,6 +492,24 @@ void __init sme_early_init(void)
|
|||
*/
|
||||
if (sev_status & MSR_AMD64_SEV_ENABLED)
|
||||
ia32_disable();
|
||||
|
||||
/*
|
||||
* Override init functions that scan the ROM region in SEV-SNP guests,
|
||||
* as this memory is not pre-validated and would thus cause a crash.
|
||||
*/
|
||||
if (sev_status & MSR_AMD64_SEV_SNP_ENABLED) {
|
||||
x86_init.mpparse.find_mptable = x86_init_noop;
|
||||
x86_init.pci.init_irq = x86_init_noop;
|
||||
x86_init.resources.probe_roms = x86_init_noop;
|
||||
|
||||
/*
|
||||
* DMI setup behavior for SEV-SNP guests depends on
|
||||
* efi_enabled(EFI_CONFIG_TABLES), which hasn't been
|
||||
* parsed yet. snp_dmi_setup() will run after that
|
||||
* parsing has happened.
|
||||
*/
|
||||
x86_init.resources.dmi_setup = snp_dmi_setup;
|
||||
}
|
||||
}
|
||||
|
||||
void __init mem_encrypt_free_decrypted_mem(void)
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
obj-y += vmx/
|
||||
obj-y += svm/ vmx/
|
||||
|
|
|
@ -726,7 +726,7 @@ static int ll_merge_requests_fn(struct request_queue *q, struct request *req,
|
|||
* which can be mixed are set in each bio and mark @rq as mixed
|
||||
* merged.
|
||||
*/
|
||||
void blk_rq_set_mixed_merge(struct request *rq)
|
||||
static void blk_rq_set_mixed_merge(struct request *rq)
|
||||
{
|
||||
blk_opf_t ff = rq->cmd_flags & REQ_FAILFAST_MASK;
|
||||
struct bio *bio;
|
||||
|
|
|
@ -770,17 +770,12 @@ static void req_bio_endio(struct request *rq, struct bio *bio,
|
|||
/*
|
||||
* Partial zone append completions cannot be supported as the
|
||||
* BIO fragments may end up not being written sequentially.
|
||||
* For such case, force the completed nbytes to be equal to
|
||||
* the BIO size so that bio_advance() sets the BIO remaining
|
||||
* size to 0 and we end up calling bio_endio() before returning.
|
||||
*/
|
||||
if (bio->bi_iter.bi_size != nbytes) {
|
||||
if (bio->bi_iter.bi_size != nbytes)
|
||||
bio->bi_status = BLK_STS_IOERR;
|
||||
nbytes = bio->bi_iter.bi_size;
|
||||
} else {
|
||||
else
|
||||
bio->bi_iter.bi_sector = rq->__sector;
|
||||
}
|
||||
}
|
||||
|
||||
bio_advance(bio, nbytes);
|
||||
|
||||
|
|
|
@ -146,8 +146,7 @@ static int blk_validate_limits(struct queue_limits *lim)
|
|||
max_hw_sectors = min_not_zero(lim->max_hw_sectors,
|
||||
lim->max_dev_sectors);
|
||||
if (lim->max_user_sectors) {
|
||||
if (lim->max_user_sectors > max_hw_sectors ||
|
||||
lim->max_user_sectors < PAGE_SIZE / SECTOR_SIZE)
|
||||
if (lim->max_user_sectors < PAGE_SIZE / SECTOR_SIZE)
|
||||
return -EINVAL;
|
||||
lim->max_sectors = min(max_hw_sectors, lim->max_user_sectors);
|
||||
} else {
|
||||
|
|
|
@ -339,7 +339,6 @@ int ll_back_merge_fn(struct request *req, struct bio *bio,
|
|||
bool blk_attempt_req_merge(struct request_queue *q, struct request *rq,
|
||||
struct request *next);
|
||||
unsigned int blk_recalc_rq_segments(struct request *rq);
|
||||
void blk_rq_set_mixed_merge(struct request *rq);
|
||||
bool blk_rq_merge_ok(struct request *rq, struct bio *bio);
|
||||
enum elv_merge blk_try_merge(struct request *rq, struct bio *bio);
|
||||
|
||||
|
|
|
@ -75,6 +75,9 @@ int mscode_note_digest_algo(void *context, size_t hdrlen,
|
|||
|
||||
oid = look_up_OID(value, vlen);
|
||||
switch (oid) {
|
||||
case OID_sha1:
|
||||
ctx->digest_algo = "sha1";
|
||||
break;
|
||||
case OID_sha256:
|
||||
ctx->digest_algo = "sha256";
|
||||
break;
|
||||
|
|
|
@ -227,6 +227,9 @@ int pkcs7_sig_note_digest_algo(void *context, size_t hdrlen,
|
|||
struct pkcs7_parse_context *ctx = context;
|
||||
|
||||
switch (ctx->last_oid) {
|
||||
case OID_sha1:
|
||||
ctx->sinfo->sig->hash_algo = "sha1";
|
||||
break;
|
||||
case OID_sha256:
|
||||
ctx->sinfo->sig->hash_algo = "sha256";
|
||||
break;
|
||||
|
@ -278,6 +281,7 @@ int pkcs7_sig_note_pkey_algo(void *context, size_t hdrlen,
|
|||
ctx->sinfo->sig->pkey_algo = "rsa";
|
||||
ctx->sinfo->sig->encoding = "pkcs1";
|
||||
break;
|
||||
case OID_id_ecdsa_with_sha1:
|
||||
case OID_id_ecdsa_with_sha224:
|
||||
case OID_id_ecdsa_with_sha256:
|
||||
case OID_id_ecdsa_with_sha384:
|
||||
|
|
|
@ -115,7 +115,8 @@ software_key_determine_akcipher(const struct public_key *pkey,
|
|||
*/
|
||||
if (!hash_algo)
|
||||
return -EINVAL;
|
||||
if (strcmp(hash_algo, "sha224") != 0 &&
|
||||
if (strcmp(hash_algo, "sha1") != 0 &&
|
||||
strcmp(hash_algo, "sha224") != 0 &&
|
||||
strcmp(hash_algo, "sha256") != 0 &&
|
||||
strcmp(hash_algo, "sha384") != 0 &&
|
||||
strcmp(hash_algo, "sha512") != 0 &&
|
||||
|
|
|
@ -115,7 +115,7 @@ EXPORT_SYMBOL_GPL(decrypt_blob);
|
|||
* Sign the specified data blob using the private key specified by params->key.
|
||||
* The signature is wrapped in an encoding if params->encoding is specified
|
||||
* (eg. "pkcs1"). If the encoding needs to know the digest type, this can be
|
||||
* passed through params->hash_algo (eg. "sha512").
|
||||
* passed through params->hash_algo (eg. "sha1").
|
||||
*
|
||||
* Returns the length of the data placed in the signature buffer or an error.
|
||||
*/
|
||||
|
|
|
@ -198,6 +198,10 @@ int x509_note_sig_algo(void *context, size_t hdrlen, unsigned char tag,
|
|||
default:
|
||||
return -ENOPKG; /* Unsupported combination */
|
||||
|
||||
case OID_sha1WithRSAEncryption:
|
||||
ctx->cert->sig->hash_algo = "sha1";
|
||||
goto rsa_pkcs1;
|
||||
|
||||
case OID_sha256WithRSAEncryption:
|
||||
ctx->cert->sig->hash_algo = "sha256";
|
||||
goto rsa_pkcs1;
|
||||
|
@ -214,6 +218,10 @@ int x509_note_sig_algo(void *context, size_t hdrlen, unsigned char tag,
|
|||
ctx->cert->sig->hash_algo = "sha224";
|
||||
goto rsa_pkcs1;
|
||||
|
||||
case OID_id_ecdsa_with_sha1:
|
||||
ctx->cert->sig->hash_algo = "sha1";
|
||||
goto ecdsa;
|
||||
|
||||
case OID_id_rsassa_pkcs1_v1_5_with_sha3_256:
|
||||
ctx->cert->sig->hash_algo = "sha3-256";
|
||||
goto rsa_pkcs1;
|
||||
|
|
|
@ -653,6 +653,30 @@ static const struct akcipher_testvec rsa_tv_template[] = {
|
|||
static const struct akcipher_testvec ecdsa_nist_p192_tv_template[] = {
|
||||
{
|
||||
.key =
|
||||
"\x04\xf7\x46\xf8\x2f\x15\xf6\x22\x8e\xd7\x57\x4f\xcc\xe7\xbb\xc1"
|
||||
"\xd4\x09\x73\xcf\xea\xd0\x15\x07\x3d\xa5\x8a\x8a\x95\x43\xe4\x68"
|
||||
"\xea\xc6\x25\xc1\xc1\x01\x25\x4c\x7e\xc3\x3c\xa6\x04\x0a\xe7\x08"
|
||||
"\x98",
|
||||
.key_len = 49,
|
||||
.params =
|
||||
"\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48"
|
||||
"\xce\x3d\x03\x01\x01",
|
||||
.param_len = 21,
|
||||
.m =
|
||||
"\xcd\xb9\xd2\x1c\xb7\x6f\xcd\x44\xb3\xfd\x63\xea\xa3\x66\x7f\xae"
|
||||
"\x63\x85\xe7\x82",
|
||||
.m_size = 20,
|
||||
.algo = OID_id_ecdsa_with_sha1,
|
||||
.c =
|
||||
"\x30\x35\x02\x19\x00\xba\xe5\x93\x83\x6e\xb6\x3b\x63\xa0\x27\x91"
|
||||
"\xc6\xf6\x7f\xc3\x09\xad\x59\xad\x88\x27\xd6\x92\x6b\x02\x18\x10"
|
||||
"\x68\x01\x9d\xba\xce\x83\x08\xef\x95\x52\x7b\xa0\x0f\xe4\x18\x86"
|
||||
"\x80\x6f\xa5\x79\x77\xda\xd0",
|
||||
.c_size = 55,
|
||||
.public_key_vec = true,
|
||||
.siggen_sigver_test = true,
|
||||
}, {
|
||||
.key =
|
||||
"\x04\xb6\x4b\xb1\xd1\xac\xba\x24\x8f\x65\xb2\x60\x00\x90\xbf\xbd"
|
||||
"\x78\x05\x73\xe9\x79\x1d\x6f\x7c\x0b\xd2\xc3\x93\xa7\x28\xe1\x75"
|
||||
"\xf7\xd5\x95\x1d\x28\x10\xc0\x75\x50\x5c\x1a\x4f\x3f\x8f\xa5\xee"
|
||||
|
@ -756,6 +780,32 @@ static const struct akcipher_testvec ecdsa_nist_p192_tv_template[] = {
|
|||
static const struct akcipher_testvec ecdsa_nist_p256_tv_template[] = {
|
||||
{
|
||||
.key =
|
||||
"\x04\xb9\x7b\xbb\xd7\x17\x64\xd2\x7e\xfc\x81\x5d\x87\x06\x83\x41"
|
||||
"\x22\xd6\x9a\xaa\x87\x17\xec\x4f\x63\x55\x2f\x94\xba\xdd\x83\xe9"
|
||||
"\x34\x4b\xf3\xe9\x91\x13\x50\xb6\xcb\xca\x62\x08\xe7\x3b\x09\xdc"
|
||||
"\xc3\x63\x4b\x2d\xb9\x73\x53\xe4\x45\xe6\x7c\xad\xe7\x6b\xb0\xe8"
|
||||
"\xaf",
|
||||
.key_len = 65,
|
||||
.params =
|
||||
"\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x08\x2a\x86\x48"
|
||||
"\xce\x3d\x03\x01\x07",
|
||||
.param_len = 21,
|
||||
.m =
|
||||
"\xc2\x2b\x5f\x91\x78\x34\x26\x09\x42\x8d\x6f\x51\xb2\xc5\xaf\x4c"
|
||||
"\x0b\xde\x6a\x42",
|
||||
.m_size = 20,
|
||||
.algo = OID_id_ecdsa_with_sha1,
|
||||
.c =
|
||||
"\x30\x46\x02\x21\x00\xf9\x25\xce\x9f\x3a\xa6\x35\x81\xcf\xd4\xe7"
|
||||
"\xb7\xf0\x82\x56\x41\xf7\xd4\xad\x8d\x94\x5a\x69\x89\xee\xca\x6a"
|
||||
"\x52\x0e\x48\x4d\xcc\x02\x21\x00\xd7\xe4\xef\x52\x66\xd3\x5b\x9d"
|
||||
"\x8a\xfa\x54\x93\x29\xa7\x70\x86\xf1\x03\x03\xf3\x3b\xe2\x73\xf7"
|
||||
"\xfb\x9d\x8b\xde\xd4\x8d\x6f\xad",
|
||||
.c_size = 72,
|
||||
.public_key_vec = true,
|
||||
.siggen_sigver_test = true,
|
||||
}, {
|
||||
.key =
|
||||
"\x04\x8b\x6d\xc0\x33\x8e\x2d\x8b\x67\xf5\xeb\xc4\x7f\xa0\xf5\xd9"
|
||||
"\x7b\x03\xa5\x78\x9a\xb5\xea\x14\xe4\x23\xd0\xaf\xd7\x0e\x2e\xa0"
|
||||
"\xc9\x8b\xdb\x95\xf8\xb3\xaf\xac\x00\x2c\x2c\x1f\x7a\xfd\x95\x88"
|
||||
|
@ -866,6 +916,36 @@ static const struct akcipher_testvec ecdsa_nist_p256_tv_template[] = {
|
|||
|
||||
static const struct akcipher_testvec ecdsa_nist_p384_tv_template[] = {
|
||||
{
|
||||
.key = /* secp384r1(sha1) */
|
||||
"\x04\x89\x25\xf3\x97\x88\xcb\xb0\x78\xc5\x72\x9a\x14\x6e\x7a\xb1"
|
||||
"\x5a\xa5\x24\xf1\x95\x06\x9e\x28\xfb\xc4\xb9\xbe\x5a\x0d\xd9\x9f"
|
||||
"\xf3\xd1\x4d\x2d\x07\x99\xbd\xda\xa7\x66\xec\xbb\xea\xba\x79\x42"
|
||||
"\xc9\x34\x89\x6a\xe7\x0b\xc3\xf2\xfe\x32\x30\xbe\xba\xf9\xdf\x7e"
|
||||
"\x4b\x6a\x07\x8e\x26\x66\x3f\x1d\xec\xa2\x57\x91\x51\xdd\x17\x0e"
|
||||
"\x0b\x25\xd6\x80\x5c\x3b\xe6\x1a\x98\x48\x91\x45\x7a\x73\xb0\xc3"
|
||||
"\xf1",
|
||||
.key_len = 97,
|
||||
.params =
|
||||
"\x30\x10\x06\x07\x2a\x86\x48\xce\x3d\x02\x01\x06\x05\x2b\x81\x04"
|
||||
"\x00\x22",
|
||||
.param_len = 18,
|
||||
.m =
|
||||
"\x12\x55\x28\xf0\x77\xd5\xb6\x21\x71\x32\x48\xcd\x28\xa8\x25\x22"
|
||||
"\x3a\x69\xc1\x93",
|
||||
.m_size = 20,
|
||||
.algo = OID_id_ecdsa_with_sha1,
|
||||
.c =
|
||||
"\x30\x66\x02\x31\x00\xf5\x0f\x24\x4c\x07\x93\x6f\x21\x57\x55\x07"
|
||||
"\x20\x43\x30\xde\xa0\x8d\x26\x8e\xae\x63\x3f\xbc\x20\x3a\xc6\xf1"
|
||||
"\x32\x3c\xce\x70\x2b\x78\xf1\x4c\x26\xe6\x5b\x86\xcf\xec\x7c\x7e"
|
||||
"\xd0\x87\xd7\xd7\x6e\x02\x31\x00\xcd\xbb\x7e\x81\x5d\x8f\x63\xc0"
|
||||
"\x5f\x63\xb1\xbe\x5e\x4c\x0e\xa1\xdf\x28\x8c\x1b\xfa\xf9\x95\x88"
|
||||
"\x74\xa0\x0f\xbf\xaf\xc3\x36\x76\x4a\xa1\x59\xf1\x1c\xa4\x58\x26"
|
||||
"\x79\x12\x2a\xb7\xc5\x15\x92\xc5",
|
||||
.c_size = 104,
|
||||
.public_key_vec = true,
|
||||
.siggen_sigver_test = true,
|
||||
}, {
|
||||
.key = /* secp384r1(sha224) */
|
||||
"\x04\x69\x6c\xcf\x62\xee\xd0\x0d\xe5\xb5\x2f\x70\x54\xcf\x26\xa0"
|
||||
"\xd9\x98\x8d\x92\x2a\xab\x9b\x11\xcb\x48\x18\xa1\xa9\x0d\xd5\x18"
|
||||
|
|
|
@ -550,8 +550,12 @@ acpi_db_walk_for_fields(acpi_handle obj_handle,
|
|||
ACPI_FREE(buffer.pointer);
|
||||
|
||||
buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
|
||||
acpi_evaluate_object(obj_handle, NULL, NULL, &buffer);
|
||||
|
||||
status = acpi_evaluate_object(obj_handle, NULL, NULL, &buffer);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
acpi_os_printf("Could Not evaluate object %p\n",
|
||||
obj_handle);
|
||||
return (AE_OK);
|
||||
}
|
||||
/*
|
||||
* Since this is a field unit, surround the output in braces
|
||||
*/
|
||||
|
|
|
@ -851,7 +851,7 @@ static int __init einj_probe(struct platform_device *pdev)
|
|||
return rc;
|
||||
}
|
||||
|
||||
static void __exit einj_remove(struct platform_device *pdev)
|
||||
static void einj_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct apei_exec_context ctx;
|
||||
|
||||
|
|
|
@ -712,10 +712,12 @@ void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap)
|
|||
ehc->saved_ncq_enabled |= 1 << devno;
|
||||
|
||||
/* If we are resuming, wake up the device */
|
||||
if (ap->pflags & ATA_PFLAG_RESUMING)
|
||||
if (ap->pflags & ATA_PFLAG_RESUMING) {
|
||||
dev->flags |= ATA_DFLAG_RESUMING;
|
||||
ehc->i.dev_action[devno] |= ATA_EH_SET_ACTIVE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ap->pflags |= ATA_PFLAG_EH_IN_PROGRESS;
|
||||
ap->pflags &= ~ATA_PFLAG_EH_PENDING;
|
||||
|
@ -3169,6 +3171,7 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,
|
|||
return 0;
|
||||
|
||||
err:
|
||||
dev->flags &= ~ATA_DFLAG_RESUMING;
|
||||
*r_failed_dev = dev;
|
||||
return rc;
|
||||
}
|
||||
|
|
|
@ -4730,6 +4730,7 @@ void ata_scsi_dev_rescan(struct work_struct *work)
|
|||
struct ata_link *link;
|
||||
struct ata_device *dev;
|
||||
unsigned long flags;
|
||||
bool do_resume;
|
||||
int ret = 0;
|
||||
|
||||
mutex_lock(&ap->scsi_scan_mutex);
|
||||
|
@ -4751,7 +4752,15 @@ void ata_scsi_dev_rescan(struct work_struct *work)
|
|||
if (scsi_device_get(sdev))
|
||||
continue;
|
||||
|
||||
do_resume = dev->flags & ATA_DFLAG_RESUMING;
|
||||
|
||||
spin_unlock_irqrestore(ap->lock, flags);
|
||||
if (do_resume) {
|
||||
ret = scsi_resume_device(sdev);
|
||||
if (ret == -EWOULDBLOCK)
|
||||
goto unlock;
|
||||
dev->flags &= ~ATA_DFLAG_RESUMING;
|
||||
}
|
||||
ret = scsi_rescan_device(sdev);
|
||||
scsi_device_put(sdev);
|
||||
spin_lock_irqsave(ap->lock, flags);
|
||||
|
|
|
@ -806,6 +806,8 @@ static int save_iaa_wq(struct idxd_wq *wq)
|
|||
return -EINVAL;
|
||||
|
||||
cpus_per_iaa = (nr_nodes * nr_cpus_per_node) / nr_iaa;
|
||||
if (!cpus_per_iaa)
|
||||
cpus_per_iaa = 1;
|
||||
out:
|
||||
return 0;
|
||||
}
|
||||
|
@ -821,10 +823,12 @@ static void remove_iaa_wq(struct idxd_wq *wq)
|
|||
}
|
||||
}
|
||||
|
||||
if (nr_iaa)
|
||||
if (nr_iaa) {
|
||||
cpus_per_iaa = (nr_nodes * nr_cpus_per_node) / nr_iaa;
|
||||
else
|
||||
cpus_per_iaa = 0;
|
||||
if (!cpus_per_iaa)
|
||||
cpus_per_iaa = 1;
|
||||
} else
|
||||
cpus_per_iaa = 1;
|
||||
}
|
||||
|
||||
static int wq_table_add_wqs(int iaa, int cpu)
|
||||
|
|
|
@ -144,17 +144,4 @@ config CXL_REGION_INVALIDATION_TEST
|
|||
If unsure, or if this kernel is meant for production environments,
|
||||
say N.
|
||||
|
||||
config CXL_PMU
|
||||
tristate "CXL Performance Monitoring Unit"
|
||||
default CXL_BUS
|
||||
depends on PERF_EVENTS
|
||||
help
|
||||
Support performance monitoring as defined in CXL rev 3.0
|
||||
section 13.2: Performance Monitoring. CXL components may have
|
||||
one or more CXL Performance Monitoring Units (CPMUs).
|
||||
|
||||
Say 'y/m' to enable a driver that will attach to performance
|
||||
monitoring units and provide standard perf based interfaces.
|
||||
|
||||
If unsure say 'm'.
|
||||
endif
|
||||
|
|
|
@ -84,10 +84,10 @@ static int sanitycheck(void *arg)
|
|||
return -ENOMEM;
|
||||
|
||||
chain = mock_chain(NULL, f, 1);
|
||||
if (!chain)
|
||||
err = -ENOMEM;
|
||||
|
||||
if (chain)
|
||||
dma_fence_enable_sw_signaling(chain);
|
||||
else
|
||||
err = -ENOMEM;
|
||||
|
||||
dma_fence_signal(f);
|
||||
dma_fence_put(f);
|
||||
|
|
|
@ -120,7 +120,7 @@ efi_status_t efi_random_alloc(unsigned long size,
|
|||
continue;
|
||||
}
|
||||
|
||||
target = round_up(max(md->phys_addr, alloc_min), align) + target_slot * align;
|
||||
target = round_up(max_t(u64, md->phys_addr, alloc_min), align) + target_slot * align;
|
||||
pages = size / EFI_PAGE_SIZE;
|
||||
|
||||
status = efi_bs_call(allocate_pages, EFI_ALLOCATE_ADDRESS,
|
||||
|
|
|
@ -496,6 +496,7 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
|
|||
hdr->vid_mode = 0xffff;
|
||||
|
||||
hdr->type_of_loader = 0x21;
|
||||
hdr->initrd_addr_max = INT_MAX;
|
||||
|
||||
/* Convert unicode cmdline to ascii */
|
||||
cmdline_ptr = efi_convert_cmdline(image, &options_size);
|
||||
|
|
|
@ -1083,10 +1083,20 @@ static u32 gpio_v2_line_config_debounce_period(struct gpio_v2_line_config *lc,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline char *make_irq_label(const char *orig)
|
||||
{
|
||||
return kstrdup_and_replace(orig, '/', ':', GFP_KERNEL);
|
||||
}
|
||||
|
||||
static inline void free_irq_label(const char *label)
|
||||
{
|
||||
kfree(label);
|
||||
}
|
||||
|
||||
static void edge_detector_stop(struct line *line)
|
||||
{
|
||||
if (line->irq) {
|
||||
free_irq(line->irq, line);
|
||||
free_irq_label(free_irq(line->irq, line));
|
||||
line->irq = 0;
|
||||
}
|
||||
|
||||
|
@ -1110,6 +1120,7 @@ static int edge_detector_setup(struct line *line,
|
|||
unsigned long irqflags = 0;
|
||||
u64 eflags;
|
||||
int irq, ret;
|
||||
char *label;
|
||||
|
||||
eflags = edflags & GPIO_V2_LINE_EDGE_FLAGS;
|
||||
if (eflags && !kfifo_initialized(&line->req->events)) {
|
||||
|
@ -1146,11 +1157,17 @@ static int edge_detector_setup(struct line *line,
|
|||
IRQF_TRIGGER_RISING : IRQF_TRIGGER_FALLING;
|
||||
irqflags |= IRQF_ONESHOT;
|
||||
|
||||
label = make_irq_label(line->req->label);
|
||||
if (!label)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Request a thread to read the events */
|
||||
ret = request_threaded_irq(irq, edge_irq_handler, edge_irq_thread,
|
||||
irqflags, line->req->label, line);
|
||||
if (ret)
|
||||
irqflags, label, line);
|
||||
if (ret) {
|
||||
free_irq_label(label);
|
||||
return ret;
|
||||
}
|
||||
|
||||
line->irq = irq;
|
||||
return 0;
|
||||
|
@ -1973,7 +1990,7 @@ static void lineevent_free(struct lineevent_state *le)
|
|||
blocking_notifier_chain_unregister(&le->gdev->device_notifier,
|
||||
&le->device_unregistered_nb);
|
||||
if (le->irq)
|
||||
free_irq(le->irq, le);
|
||||
free_irq_label(free_irq(le->irq, le));
|
||||
if (le->desc)
|
||||
gpiod_free(le->desc);
|
||||
kfree(le->label);
|
||||
|
@ -2114,6 +2131,7 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip)
|
|||
int fd;
|
||||
int ret;
|
||||
int irq, irqflags = 0;
|
||||
char *label;
|
||||
|
||||
if (copy_from_user(&eventreq, ip, sizeof(eventreq)))
|
||||
return -EFAULT;
|
||||
|
@ -2198,15 +2216,23 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip)
|
|||
if (ret)
|
||||
goto out_free_le;
|
||||
|
||||
label = make_irq_label(le->label);
|
||||
if (!label) {
|
||||
ret = -ENOMEM;
|
||||
goto out_free_le;
|
||||
}
|
||||
|
||||
/* Request a thread to read the events */
|
||||
ret = request_threaded_irq(irq,
|
||||
lineevent_irq_handler,
|
||||
lineevent_irq_thread,
|
||||
irqflags,
|
||||
le->label,
|
||||
label,
|
||||
le);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
free_irq_label(label);
|
||||
goto out_free_le;
|
||||
}
|
||||
|
||||
le->irq = irq;
|
||||
|
||||
|
|
|
@ -2397,6 +2397,11 @@ char *gpiochip_dup_line_label(struct gpio_chip *gc, unsigned int offset)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(gpiochip_dup_line_label);
|
||||
|
||||
static inline const char *function_name_or_default(const char *con_id)
|
||||
{
|
||||
return con_id ?: "(default)";
|
||||
}
|
||||
|
||||
/**
|
||||
* gpiochip_request_own_desc - Allow GPIO chip to request its own descriptor
|
||||
* @gc: GPIO chip
|
||||
|
@ -2425,10 +2430,11 @@ struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *gc,
|
|||
enum gpiod_flags dflags)
|
||||
{
|
||||
struct gpio_desc *desc = gpiochip_get_desc(gc, hwnum);
|
||||
const char *name = function_name_or_default(label);
|
||||
int ret;
|
||||
|
||||
if (IS_ERR(desc)) {
|
||||
chip_err(gc, "failed to get GPIO descriptor\n");
|
||||
chip_err(gc, "failed to get GPIO %s descriptor\n", name);
|
||||
return desc;
|
||||
}
|
||||
|
||||
|
@ -2438,8 +2444,8 @@ struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *gc,
|
|||
|
||||
ret = gpiod_configure_flags(desc, label, lflags, dflags);
|
||||
if (ret) {
|
||||
chip_err(gc, "setup of own GPIO %s failed\n", label);
|
||||
gpiod_free_commit(desc);
|
||||
chip_err(gc, "setup of own GPIO %s failed\n", name);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
|
@ -4153,19 +4159,17 @@ static struct gpio_desc *gpiod_find_by_fwnode(struct fwnode_handle *fwnode,
|
|||
enum gpiod_flags *flags,
|
||||
unsigned long *lookupflags)
|
||||
{
|
||||
const char *name = function_name_or_default(con_id);
|
||||
struct gpio_desc *desc = ERR_PTR(-ENOENT);
|
||||
|
||||
if (is_of_node(fwnode)) {
|
||||
dev_dbg(consumer, "using DT '%pfw' for '%s' GPIO lookup\n",
|
||||
fwnode, con_id);
|
||||
dev_dbg(consumer, "using DT '%pfw' for '%s' GPIO lookup\n", fwnode, name);
|
||||
desc = of_find_gpio(to_of_node(fwnode), con_id, idx, lookupflags);
|
||||
} else if (is_acpi_node(fwnode)) {
|
||||
dev_dbg(consumer, "using ACPI '%pfw' for '%s' GPIO lookup\n",
|
||||
fwnode, con_id);
|
||||
dev_dbg(consumer, "using ACPI '%pfw' for '%s' GPIO lookup\n", fwnode, name);
|
||||
desc = acpi_find_gpio(fwnode, con_id, idx, flags, lookupflags);
|
||||
} else if (is_software_node(fwnode)) {
|
||||
dev_dbg(consumer, "using swnode '%pfw' for '%s' GPIO lookup\n",
|
||||
fwnode, con_id);
|
||||
dev_dbg(consumer, "using swnode '%pfw' for '%s' GPIO lookup\n", fwnode, name);
|
||||
desc = swnode_find_gpio(fwnode, con_id, idx, lookupflags);
|
||||
}
|
||||
|
||||
|
@ -4181,6 +4185,7 @@ struct gpio_desc *gpiod_find_and_request(struct device *consumer,
|
|||
bool platform_lookup_allowed)
|
||||
{
|
||||
unsigned long lookupflags = GPIO_LOOKUP_FLAGS_DEFAULT;
|
||||
const char *name = function_name_or_default(con_id);
|
||||
/*
|
||||
* scoped_guard() is implemented as a for loop, meaning static
|
||||
* analyzers will complain about these two not being initialized.
|
||||
|
@ -4203,8 +4208,7 @@ struct gpio_desc *gpiod_find_and_request(struct device *consumer,
|
|||
}
|
||||
|
||||
if (IS_ERR(desc)) {
|
||||
dev_dbg(consumer, "No GPIO consumer %s found\n",
|
||||
con_id);
|
||||
dev_dbg(consumer, "No GPIO consumer %s found\n", name);
|
||||
return desc;
|
||||
}
|
||||
|
||||
|
@ -4226,15 +4230,14 @@ struct gpio_desc *gpiod_find_and_request(struct device *consumer,
|
|||
*
|
||||
* FIXME: Make this more sane and safe.
|
||||
*/
|
||||
dev_info(consumer,
|
||||
"nonexclusive access to GPIO for %s\n", con_id);
|
||||
dev_info(consumer, "nonexclusive access to GPIO for %s\n", name);
|
||||
return desc;
|
||||
}
|
||||
|
||||
ret = gpiod_configure_flags(desc, con_id, lookupflags, flags);
|
||||
if (ret < 0) {
|
||||
dev_dbg(consumer, "setup of GPIO %s failed\n", con_id);
|
||||
gpiod_put(desc);
|
||||
dev_dbg(consumer, "setup of GPIO %s failed\n", name);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
|
@ -4350,6 +4353,7 @@ EXPORT_SYMBOL_GPL(gpiod_get_optional);
|
|||
int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id,
|
||||
unsigned long lflags, enum gpiod_flags dflags)
|
||||
{
|
||||
const char *name = function_name_or_default(con_id);
|
||||
int ret;
|
||||
|
||||
if (lflags & GPIO_ACTIVE_LOW)
|
||||
|
@ -4393,7 +4397,7 @@ int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id,
|
|||
|
||||
/* No particular flag request, return here... */
|
||||
if (!(dflags & GPIOD_FLAGS_BIT_DIR_SET)) {
|
||||
gpiod_dbg(desc, "no flags found for %s\n", con_id);
|
||||
gpiod_dbg(desc, "no flags found for GPIO %s\n", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -4539,6 +4539,8 @@ int amdgpu_device_prepare(struct drm_device *dev)
|
|||
if (r)
|
||||
goto unprepare;
|
||||
|
||||
flush_delayed_work(&adev->gfx.gfx_off_delay_work);
|
||||
|
||||
for (i = 0; i < adev->num_ip_blocks; i++) {
|
||||
if (!adev->ip_blocks[i].status.valid)
|
||||
continue;
|
||||
|
|
|
@ -2237,6 +2237,7 @@ static int amdgpu_discovery_set_umsch_mm_ip_blocks(struct amdgpu_device *adev)
|
|||
{
|
||||
switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
|
||||
case IP_VERSION(4, 0, 5):
|
||||
case IP_VERSION(4, 0, 6):
|
||||
if (amdgpu_umsch_mm & 0x1) {
|
||||
amdgpu_device_ip_block_add(adev, &umsch_mm_v4_0_ip_block);
|
||||
adev->enable_umsch_mm = true;
|
||||
|
|
|
@ -524,46 +524,58 @@ static ssize_t amdgpu_debugfs_mqd_read(struct file *f, char __user *buf,
|
|||
{
|
||||
struct amdgpu_ring *ring = file_inode(f)->i_private;
|
||||
volatile u32 *mqd;
|
||||
int r;
|
||||
u32 *kbuf;
|
||||
int r, i;
|
||||
uint32_t value, result;
|
||||
|
||||
if (*pos & 3 || size & 3)
|
||||
return -EINVAL;
|
||||
|
||||
result = 0;
|
||||
kbuf = kmalloc(ring->mqd_size, GFP_KERNEL);
|
||||
if (!kbuf)
|
||||
return -ENOMEM;
|
||||
|
||||
r = amdgpu_bo_reserve(ring->mqd_obj, false);
|
||||
if (unlikely(r != 0))
|
||||
return r;
|
||||
goto err_free;
|
||||
|
||||
r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&mqd);
|
||||
if (r) {
|
||||
amdgpu_bo_unreserve(ring->mqd_obj);
|
||||
return r;
|
||||
}
|
||||
if (r)
|
||||
goto err_unreserve;
|
||||
|
||||
/*
|
||||
* Copy to local buffer to avoid put_user(), which might fault
|
||||
* and acquire mmap_sem, under reservation_ww_class_mutex.
|
||||
*/
|
||||
for (i = 0; i < ring->mqd_size/sizeof(u32); i++)
|
||||
kbuf[i] = mqd[i];
|
||||
|
||||
amdgpu_bo_kunmap(ring->mqd_obj);
|
||||
amdgpu_bo_unreserve(ring->mqd_obj);
|
||||
|
||||
result = 0;
|
||||
while (size) {
|
||||
if (*pos >= ring->mqd_size)
|
||||
goto done;
|
||||
break;
|
||||
|
||||
value = mqd[*pos/4];
|
||||
value = kbuf[*pos/4];
|
||||
r = put_user(value, (uint32_t *)buf);
|
||||
if (r)
|
||||
goto done;
|
||||
goto err_free;
|
||||
buf += 4;
|
||||
result += 4;
|
||||
size -= 4;
|
||||
*pos += 4;
|
||||
}
|
||||
|
||||
done:
|
||||
amdgpu_bo_kunmap(ring->mqd_obj);
|
||||
mqd = NULL;
|
||||
amdgpu_bo_unreserve(ring->mqd_obj);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
kfree(kbuf);
|
||||
return result;
|
||||
|
||||
err_unreserve:
|
||||
amdgpu_bo_unreserve(ring->mqd_obj);
|
||||
err_free:
|
||||
kfree(kbuf);
|
||||
return r;
|
||||
}
|
||||
|
||||
static const struct file_operations amdgpu_debugfs_mqd_fops = {
|
||||
|
|
|
@ -189,10 +189,13 @@ static void setup_vpe_queue(struct amdgpu_device *adev,
|
|||
mqd->rptr_val = 0;
|
||||
mqd->unmapped = 1;
|
||||
|
||||
if (adev->vpe.collaborate_mode)
|
||||
memcpy(++mqd, test->mqd_data_cpu_addr, sizeof(struct MQD_INFO));
|
||||
|
||||
qinfo->mqd_addr = test->mqd_data_gpu_addr;
|
||||
qinfo->csa_addr = test->ctx_data_gpu_addr +
|
||||
offsetof(struct umsch_mm_test_ctx_data, vpe_ctx_csa);
|
||||
qinfo->doorbell_offset_0 = (adev->doorbell_index.vpe_ring + 1) << 1;
|
||||
qinfo->doorbell_offset_0 = 0;
|
||||
qinfo->doorbell_offset_1 = 0;
|
||||
}
|
||||
|
||||
|
@ -287,7 +290,10 @@ static int submit_vpe_queue(struct amdgpu_device *adev, struct umsch_mm_test *te
|
|||
ring[5] = 0;
|
||||
|
||||
mqd->wptr_val = (6 << 2);
|
||||
// WDOORBELL32(adev->umsch_mm.agdb_index[CONTEXT_PRIORITY_LEVEL_NORMAL], mqd->wptr_val);
|
||||
if (adev->vpe.collaborate_mode)
|
||||
(++mqd)->wptr_val = (6 << 2);
|
||||
|
||||
WDOORBELL32(adev->umsch_mm.agdb_index[CONTEXT_PRIORITY_LEVEL_NORMAL], mqd->wptr_val);
|
||||
|
||||
for (i = 0; i < adev->usec_timeout; i++) {
|
||||
if (*fence == test_pattern)
|
||||
|
@ -571,6 +577,7 @@ int amdgpu_umsch_mm_init_microcode(struct amdgpu_umsch_mm *umsch)
|
|||
|
||||
switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
|
||||
case IP_VERSION(4, 0, 5):
|
||||
case IP_VERSION(4, 0, 6):
|
||||
fw_name = "amdgpu/umsch_mm_4_0_0.bin";
|
||||
break;
|
||||
default:
|
||||
|
@ -750,6 +757,7 @@ static int umsch_mm_early_init(void *handle)
|
|||
|
||||
switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
|
||||
case IP_VERSION(4, 0, 5):
|
||||
case IP_VERSION(4, 0, 6):
|
||||
umsch_mm_v4_0_set_funcs(&adev->umsch_mm);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -33,13 +33,6 @@ enum UMSCH_SWIP_ENGINE_TYPE {
|
|||
UMSCH_SWIP_ENGINE_TYPE_MAX
|
||||
};
|
||||
|
||||
enum UMSCH_SWIP_AFFINITY_TYPE {
|
||||
UMSCH_SWIP_AFFINITY_TYPE_ANY = 0,
|
||||
UMSCH_SWIP_AFFINITY_TYPE_VCN0 = 1,
|
||||
UMSCH_SWIP_AFFINITY_TYPE_VCN1 = 2,
|
||||
UMSCH_SWIP_AFFINITY_TYPE_MAX
|
||||
};
|
||||
|
||||
enum UMSCH_CONTEXT_PRIORITY_LEVEL {
|
||||
CONTEXT_PRIORITY_LEVEL_IDLE = 0,
|
||||
CONTEXT_PRIORITY_LEVEL_NORMAL = 1,
|
||||
|
@ -51,13 +44,15 @@ enum UMSCH_CONTEXT_PRIORITY_LEVEL {
|
|||
struct umsch_mm_set_resource_input {
|
||||
uint32_t vmid_mask_mm_vcn;
|
||||
uint32_t vmid_mask_mm_vpe;
|
||||
uint32_t collaboration_mask_vpe;
|
||||
uint32_t logging_vmid;
|
||||
uint32_t engine_mask;
|
||||
union {
|
||||
struct {
|
||||
uint32_t disable_reset : 1;
|
||||
uint32_t disable_umsch_mm_log : 1;
|
||||
uint32_t reserved : 30;
|
||||
uint32_t use_rs64mem_for_proc_ctx_csa : 1;
|
||||
uint32_t reserved : 29;
|
||||
};
|
||||
uint32_t uint32_all;
|
||||
};
|
||||
|
@ -78,15 +73,18 @@ struct umsch_mm_add_queue_input {
|
|||
uint32_t doorbell_offset_1;
|
||||
enum UMSCH_SWIP_ENGINE_TYPE engine_type;
|
||||
uint32_t affinity;
|
||||
enum UMSCH_SWIP_AFFINITY_TYPE affinity_type;
|
||||
uint64_t mqd_addr;
|
||||
uint64_t h_context;
|
||||
uint64_t h_queue;
|
||||
uint32_t vm_context_cntl;
|
||||
|
||||
uint32_t process_csa_array_index;
|
||||
uint32_t context_csa_array_index;
|
||||
|
||||
struct {
|
||||
uint32_t is_context_suspended : 1;
|
||||
uint32_t reserved : 31;
|
||||
uint32_t collaboration_mode : 1;
|
||||
uint32_t reserved : 30;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -94,6 +92,7 @@ struct umsch_mm_remove_queue_input {
|
|||
uint32_t doorbell_offset_0;
|
||||
uint32_t doorbell_offset_1;
|
||||
uint64_t context_csa_addr;
|
||||
uint32_t context_csa_array_index;
|
||||
};
|
||||
|
||||
struct MQD_INFO {
|
||||
|
@ -103,6 +102,7 @@ struct MQD_INFO {
|
|||
uint32_t wptr_val;
|
||||
uint32_t rptr_val;
|
||||
uint32_t unmapped;
|
||||
uint32_t vmid;
|
||||
};
|
||||
|
||||
struct amdgpu_umsch_mm;
|
||||
|
|
|
@ -396,6 +396,12 @@ static int vpe_hw_init(void *handle)
|
|||
struct amdgpu_vpe *vpe = &adev->vpe;
|
||||
int ret;
|
||||
|
||||
/* Power on VPE */
|
||||
ret = amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VPE,
|
||||
AMD_PG_STATE_UNGATE);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = vpe_load_microcode(vpe);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
@ -60,7 +60,7 @@ static int umsch_mm_v4_0_load_microcode(struct amdgpu_umsch_mm *umsch)
|
|||
|
||||
umsch->cmd_buf_curr_ptr = umsch->cmd_buf_ptr;
|
||||
|
||||
if (amdgpu_ip_version(adev, VCN_HWIP, 0) == IP_VERSION(4, 0, 5)) {
|
||||
if (amdgpu_ip_version(adev, VCN_HWIP, 0) >= IP_VERSION(4, 0, 5)) {
|
||||
WREG32_SOC15(VCN, 0, regUVD_IPX_DLDO_CONFIG,
|
||||
1 << UVD_IPX_DLDO_CONFIG__ONO0_PWR_CONFIG__SHIFT);
|
||||
SOC15_WAIT_ON_RREG(VCN, 0, regUVD_IPX_DLDO_STATUS,
|
||||
|
@ -248,7 +248,7 @@ static int umsch_mm_v4_0_ring_stop(struct amdgpu_umsch_mm *umsch)
|
|||
data = REG_SET_FIELD(data, VCN_UMSCH_RB_DB_CTRL, EN, 0);
|
||||
WREG32_SOC15(VCN, 0, regVCN_UMSCH_RB_DB_CTRL, data);
|
||||
|
||||
if (amdgpu_ip_version(adev, VCN_HWIP, 0) == IP_VERSION(4, 0, 5)) {
|
||||
if (amdgpu_ip_version(adev, VCN_HWIP, 0) >= IP_VERSION(4, 0, 5)) {
|
||||
WREG32_SOC15(VCN, 0, regUVD_IPX_DLDO_CONFIG,
|
||||
2 << UVD_IPX_DLDO_CONFIG__ONO0_PWR_CONFIG__SHIFT);
|
||||
SOC15_WAIT_ON_RREG(VCN, 0, regUVD_IPX_DLDO_STATUS,
|
||||
|
@ -271,6 +271,8 @@ static int umsch_mm_v4_0_set_hw_resources(struct amdgpu_umsch_mm *umsch)
|
|||
|
||||
set_hw_resources.vmid_mask_mm_vcn = umsch->vmid_mask_mm_vcn;
|
||||
set_hw_resources.vmid_mask_mm_vpe = umsch->vmid_mask_mm_vpe;
|
||||
set_hw_resources.collaboration_mask_vpe =
|
||||
adev->vpe.collaborate_mode ? 0x3 : 0x0;
|
||||
set_hw_resources.engine_mask = umsch->engine_mask;
|
||||
|
||||
set_hw_resources.vcn0_hqd_mask[0] = umsch->vcn0_hqd_mask;
|
||||
|
@ -346,6 +348,7 @@ static int umsch_mm_v4_0_add_queue(struct amdgpu_umsch_mm *umsch,
|
|||
add_queue.h_queue = input_ptr->h_queue;
|
||||
add_queue.vm_context_cntl = input_ptr->vm_context_cntl;
|
||||
add_queue.is_context_suspended = input_ptr->is_context_suspended;
|
||||
add_queue.collaboration_mode = adev->vpe.collaborate_mode ? 1 : 0;
|
||||
|
||||
add_queue.api_status.api_completion_fence_addr = umsch->ring.fence_drv.gpu_addr;
|
||||
add_queue.api_status.api_completion_fence_value = ++umsch->ring.fence_drv.sync_seq;
|
||||
|
|
|
@ -1523,7 +1523,7 @@ static int kfd_ioctl_get_dmabuf_info(struct file *filep,
|
|||
|
||||
/* Find a KFD GPU device that supports the get_dmabuf_info query */
|
||||
for (i = 0; kfd_topology_enum_kfd_devices(i, &dev) == 0; i++)
|
||||
if (dev)
|
||||
if (dev && !kfd_devcgroup_check_permission(dev))
|
||||
break;
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
|
@ -1545,7 +1545,7 @@ static int kfd_ioctl_get_dmabuf_info(struct file *filep,
|
|||
if (xcp_id >= 0)
|
||||
args->gpu_id = dmabuf_adev->kfd.dev->nodes[xcp_id]->id;
|
||||
else
|
||||
args->gpu_id = dmabuf_adev->kfd.dev->nodes[0]->id;
|
||||
args->gpu_id = dev->id;
|
||||
args->flags = flags;
|
||||
|
||||
/* Copy metadata buffer to user mode */
|
||||
|
|
|
@ -339,7 +339,8 @@ static void event_interrupt_wq_v10(struct kfd_node *dev,
|
|||
break;
|
||||
}
|
||||
kfd_signal_event_interrupt(pasid, context_id0 & 0x7fffff, 23);
|
||||
} else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE) {
|
||||
} else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE &&
|
||||
KFD_DBG_EC_TYPE_IS_PACKET(KFD_DEBUG_CP_BAD_OP_ECODE(context_id0))) {
|
||||
kfd_set_dbg_ev_from_interrupt(dev, pasid,
|
||||
KFD_DEBUG_DOORBELL_ID(context_id0),
|
||||
KFD_EC_MASK(KFD_DEBUG_CP_BAD_OP_ECODE(context_id0)),
|
||||
|
|
|
@ -328,7 +328,8 @@ static void event_interrupt_wq_v11(struct kfd_node *dev,
|
|||
/* CP */
|
||||
if (source_id == SOC15_INTSRC_CP_END_OF_PIPE)
|
||||
kfd_signal_event_interrupt(pasid, context_id0, 32);
|
||||
else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE)
|
||||
else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE &&
|
||||
KFD_DBG_EC_TYPE_IS_PACKET(KFD_CTXID0_CP_BAD_OP_ECODE(context_id0)))
|
||||
kfd_set_dbg_ev_from_interrupt(dev, pasid,
|
||||
KFD_CTXID0_DOORBELL_ID(context_id0),
|
||||
KFD_EC_MASK(KFD_CTXID0_CP_BAD_OP_ECODE(context_id0)),
|
||||
|
|
|
@ -388,7 +388,8 @@ static void event_interrupt_wq_v9(struct kfd_node *dev,
|
|||
break;
|
||||
}
|
||||
kfd_signal_event_interrupt(pasid, sq_int_data, 24);
|
||||
} else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE) {
|
||||
} else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE &&
|
||||
KFD_DBG_EC_TYPE_IS_PACKET(KFD_DEBUG_CP_BAD_OP_ECODE(context_id0))) {
|
||||
kfd_set_dbg_ev_from_interrupt(dev, pasid,
|
||||
KFD_DEBUG_DOORBELL_ID(context_id0),
|
||||
KFD_EC_MASK(KFD_DEBUG_CP_BAD_OP_ECODE(context_id0)),
|
||||
|
|
|
@ -1473,7 +1473,7 @@ static inline void kfd_flush_tlb(struct kfd_process_device *pdd,
|
|||
|
||||
static inline bool kfd_flush_tlb_after_unmap(struct kfd_dev *dev)
|
||||
{
|
||||
return KFD_GC_VERSION(dev) > IP_VERSION(9, 4, 2) ||
|
||||
return KFD_GC_VERSION(dev) >= IP_VERSION(9, 4, 2) ||
|
||||
(KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 1) && dev->sdma_fw_version >= 18) ||
|
||||
KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 0);
|
||||
}
|
||||
|
|
|
@ -6305,9 +6305,8 @@ create_stream_for_sink(struct drm_connector *connector,
|
|||
|
||||
if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A)
|
||||
mod_build_hf_vsif_infopacket(stream, &stream->vsp_infopacket);
|
||||
else if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT ||
|
||||
stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST ||
|
||||
stream->signal == SIGNAL_TYPE_EDP) {
|
||||
|
||||
if (stream->link->psr_settings.psr_feature_enabled || stream->link->replay_settings.replay_feature_enabled) {
|
||||
//
|
||||
// should decide stream support vsc sdp colorimetry capability
|
||||
// before building vsc info packet
|
||||
|
@ -6323,9 +6322,8 @@ create_stream_for_sink(struct drm_connector *connector,
|
|||
if (stream->out_transfer_func->tf == TRANSFER_FUNCTION_GAMMA22)
|
||||
tf = TRANSFER_FUNC_GAMMA_22;
|
||||
mod_build_vsc_infopacket(stream, &stream->vsc_infopacket, stream->output_color_space, tf);
|
||||
|
||||
if (stream->link->psr_settings.psr_feature_enabled)
|
||||
aconnector->psr_skip_count = AMDGPU_DM_PSR_ENTRY_DELAY;
|
||||
|
||||
}
|
||||
finish:
|
||||
dc_sink_release(sink);
|
||||
|
|
|
@ -141,9 +141,8 @@ bool amdgpu_dm_link_setup_psr(struct dc_stream_state *stream)
|
|||
* amdgpu_dm_psr_enable() - enable psr f/w
|
||||
* @stream: stream state
|
||||
*
|
||||
* Return: true if success
|
||||
*/
|
||||
bool amdgpu_dm_psr_enable(struct dc_stream_state *stream)
|
||||
void amdgpu_dm_psr_enable(struct dc_stream_state *stream)
|
||||
{
|
||||
struct dc_link *link = stream->link;
|
||||
unsigned int vsync_rate_hz = 0;
|
||||
|
@ -190,7 +189,10 @@ bool amdgpu_dm_psr_enable(struct dc_stream_state *stream)
|
|||
if (link->psr_settings.psr_version < DC_PSR_VERSION_SU_1)
|
||||
power_opt |= psr_power_opt_z10_static_screen;
|
||||
|
||||
return dc_link_set_psr_allow_active(link, &psr_enable, false, false, &power_opt);
|
||||
dc_link_set_psr_allow_active(link, &psr_enable, false, false, &power_opt);
|
||||
|
||||
if (link->ctx->dc->caps.ips_support)
|
||||
dc_allow_idle_optimizations(link->ctx->dc, true);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#define AMDGPU_DM_PSR_ENTRY_DELAY 5
|
||||
|
||||
void amdgpu_dm_set_psr_caps(struct dc_link *link);
|
||||
bool amdgpu_dm_psr_enable(struct dc_stream_state *stream);
|
||||
void amdgpu_dm_psr_enable(struct dc_stream_state *stream);
|
||||
bool amdgpu_dm_link_setup_psr(struct dc_stream_state *stream);
|
||||
bool amdgpu_dm_psr_disable(struct dc_stream_state *stream);
|
||||
bool amdgpu_dm_psr_disable_all(struct amdgpu_display_manager *dm);
|
||||
|
|
|
@ -73,6 +73,8 @@
|
|||
#define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_SEL_MASK 0x00000007L
|
||||
#define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_DIV_MASK 0x000F0000L
|
||||
|
||||
#define SMU_VER_THRESHOLD 0x5D4A00 //93.74.0
|
||||
|
||||
#define REG(reg_name) \
|
||||
(ctx->clk_reg_offsets[reg ## reg_name ## _BASE_IDX] + reg ## reg_name)
|
||||
|
||||
|
@ -411,9 +413,12 @@ static void dcn35_dump_clk_registers(struct clk_state_registers_and_bypass *regs
|
|||
|
||||
static void init_clk_states(struct clk_mgr *clk_mgr)
|
||||
{
|
||||
struct clk_mgr_internal *clk_mgr_int = TO_CLK_MGR_INTERNAL(clk_mgr);
|
||||
uint32_t ref_dtbclk = clk_mgr->clks.ref_dtbclk_khz;
|
||||
memset(&(clk_mgr->clks), 0, sizeof(struct dc_clocks));
|
||||
|
||||
if (clk_mgr_int->smu_ver >= SMU_VER_THRESHOLD)
|
||||
clk_mgr->clks.dtbclk_en = true; // request DTBCLK disable on first commit
|
||||
clk_mgr->clks.ref_dtbclk_khz = ref_dtbclk; // restore ref_dtbclk
|
||||
clk_mgr->clks.p_state_change_support = true;
|
||||
clk_mgr->clks.prev_p_state_change_support = true;
|
||||
|
@ -709,7 +714,7 @@ static void dcn35_clk_mgr_helper_populate_bw_params(struct clk_mgr_internal *clk
|
|||
clock_table->NumFclkLevelsEnabled;
|
||||
max_fclk = find_max_clk_value(clock_table->FclkClocks_Freq, num_fclk);
|
||||
|
||||
num_dcfclk = (clock_table->NumFclkLevelsEnabled > NUM_DCFCLK_DPM_LEVELS) ? NUM_DCFCLK_DPM_LEVELS :
|
||||
num_dcfclk = (clock_table->NumDcfClkLevelsEnabled > NUM_DCFCLK_DPM_LEVELS) ? NUM_DCFCLK_DPM_LEVELS :
|
||||
clock_table->NumDcfClkLevelsEnabled;
|
||||
for (i = 0; i < num_dcfclk; i++) {
|
||||
int j;
|
||||
|
|
|
@ -3024,6 +3024,7 @@ static void backup_planes_and_stream_state(
|
|||
scratch->blend_tf[i] = *status->plane_states[i]->blend_tf;
|
||||
}
|
||||
scratch->stream_state = *stream;
|
||||
if (stream->out_transfer_func)
|
||||
scratch->out_transfer_func = *stream->out_transfer_func;
|
||||
}
|
||||
|
||||
|
@ -3046,6 +3047,7 @@ static void restore_planes_and_stream_state(
|
|||
*status->plane_states[i]->blend_tf = scratch->blend_tf[i];
|
||||
}
|
||||
*stream = scratch->stream_state;
|
||||
if (stream->out_transfer_func)
|
||||
*stream->out_transfer_func = scratch->out_transfer_func;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
# Makefile for the 'controller' sub-component of DAL.
|
||||
# It provides the control and status of HW CRTC block.
|
||||
|
||||
CFLAGS_$(AMDDALPATH)/dc/dce110/dce110_resource.o = $(call cc-disable-warning, override-init)
|
||||
CFLAGS_$(AMDDALPATH)/dc/dce110/dce110_resource.o = -Wno-override-init
|
||||
|
||||
DCE110 = dce110_timing_generator.o \
|
||||
dce110_compressor.o dce110_opp_regamma_v.o \
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
# Makefile for the 'controller' sub-component of DAL.
|
||||
# It provides the control and status of HW CRTC block.
|
||||
|
||||
CFLAGS_$(AMDDALPATH)/dc/dce112/dce112_resource.o = $(call cc-disable-warning, override-init)
|
||||
CFLAGS_$(AMDDALPATH)/dc/dce112/dce112_resource.o = -Wno-override-init
|
||||
|
||||
DCE112 = dce112_compressor.o
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
# It provides the control and status of HW CRTC block.
|
||||
|
||||
|
||||
CFLAGS_$(AMDDALPATH)/dc/dce120/dce120_resource.o = $(call cc-disable-warning, override-init)
|
||||
CFLAGS_$(AMDDALPATH)/dc/dce120/dce120_resource.o = -Wno-override-init
|
||||
|
||||
DCE120 = dce120_timing_generator.o
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
# Makefile for the 'controller' sub-component of DAL.
|
||||
# It provides the control and status of HW CRTC block.
|
||||
|
||||
CFLAGS_$(AMDDALPATH)/dc/dce60/dce60_resource.o = $(call cc-disable-warning, override-init)
|
||||
CFLAGS_$(AMDDALPATH)/dc/dce60/dce60_resource.o = -Wno-override-init
|
||||
|
||||
DCE60 = dce60_timing_generator.o dce60_hw_sequencer.o \
|
||||
dce60_resource.o
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
# Makefile for the 'controller' sub-component of DAL.
|
||||
# It provides the control and status of HW CRTC block.
|
||||
|
||||
CFLAGS_$(AMDDALPATH)/dc/dce80/dce80_resource.o = $(call cc-disable-warning, override-init)
|
||||
CFLAGS_$(AMDDALPATH)/dc/dce80/dce80_resource.o = -Wno-override-init
|
||||
|
||||
DCE80 = dce80_timing_generator.o
|
||||
|
||||
|
|
|
@ -44,6 +44,36 @@
|
|||
#define NUM_ELEMENTS(a) (sizeof(a) / sizeof((a)[0]))
|
||||
|
||||
|
||||
void mpc3_mpc_init(struct mpc *mpc)
|
||||
{
|
||||
struct dcn30_mpc *mpc30 = TO_DCN30_MPC(mpc);
|
||||
int opp_id;
|
||||
|
||||
mpc1_mpc_init(mpc);
|
||||
|
||||
for (opp_id = 0; opp_id < MAX_OPP; opp_id++) {
|
||||
if (REG(MUX[opp_id]))
|
||||
/* disable mpc out rate and flow control */
|
||||
REG_UPDATE_2(MUX[opp_id], MPC_OUT_RATE_CONTROL_DISABLE,
|
||||
1, MPC_OUT_FLOW_CONTROL_COUNT, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void mpc3_mpc_init_single_inst(struct mpc *mpc, unsigned int mpcc_id)
|
||||
{
|
||||
struct dcn30_mpc *mpc30 = TO_DCN30_MPC(mpc);
|
||||
|
||||
mpc1_mpc_init_single_inst(mpc, mpcc_id);
|
||||
|
||||
/* assuming mpc out mux is connected to opp with the same index at this
|
||||
* point in time (e.g. transitioning from vbios to driver)
|
||||
*/
|
||||
if (mpcc_id < MAX_OPP && REG(MUX[mpcc_id]))
|
||||
/* disable mpc out rate and flow control */
|
||||
REG_UPDATE_2(MUX[mpcc_id], MPC_OUT_RATE_CONTROL_DISABLE,
|
||||
1, MPC_OUT_FLOW_CONTROL_COUNT, 0);
|
||||
}
|
||||
|
||||
bool mpc3_is_dwb_idle(
|
||||
struct mpc *mpc,
|
||||
int dwb_id)
|
||||
|
@ -80,25 +110,6 @@ void mpc3_disable_dwb_mux(
|
|||
MPC_DWB0_MUX, 0xf);
|
||||
}
|
||||
|
||||
void mpc3_set_out_rate_control(
|
||||
struct mpc *mpc,
|
||||
int opp_id,
|
||||
bool enable,
|
||||
bool rate_2x_mode,
|
||||
struct mpc_dwb_flow_control *flow_control)
|
||||
{
|
||||
struct dcn30_mpc *mpc30 = TO_DCN30_MPC(mpc);
|
||||
|
||||
REG_UPDATE_2(MUX[opp_id],
|
||||
MPC_OUT_RATE_CONTROL_DISABLE, !enable,
|
||||
MPC_OUT_RATE_CONTROL, rate_2x_mode);
|
||||
|
||||
if (flow_control)
|
||||
REG_UPDATE_2(MUX[opp_id],
|
||||
MPC_OUT_FLOW_CONTROL_MODE, flow_control->flow_ctrl_mode,
|
||||
MPC_OUT_FLOW_CONTROL_COUNT, flow_control->flow_ctrl_cnt1);
|
||||
}
|
||||
|
||||
enum dc_lut_mode mpc3_get_ogam_current(struct mpc *mpc, int mpcc_id)
|
||||
{
|
||||
/*Contrary to DCN2 and DCN1 wherein a single status register field holds this info;
|
||||
|
@ -1490,8 +1501,8 @@ static const struct mpc_funcs dcn30_mpc_funcs = {
|
|||
.read_mpcc_state = mpc3_read_mpcc_state,
|
||||
.insert_plane = mpc1_insert_plane,
|
||||
.remove_mpcc = mpc1_remove_mpcc,
|
||||
.mpc_init = mpc1_mpc_init,
|
||||
.mpc_init_single_inst = mpc1_mpc_init_single_inst,
|
||||
.mpc_init = mpc3_mpc_init,
|
||||
.mpc_init_single_inst = mpc3_mpc_init_single_inst,
|
||||
.update_blending = mpc2_update_blending,
|
||||
.cursor_lock = mpc1_cursor_lock,
|
||||
.get_mpcc_for_dpp = mpc1_get_mpcc_for_dpp,
|
||||
|
@ -1508,7 +1519,6 @@ static const struct mpc_funcs dcn30_mpc_funcs = {
|
|||
.set_dwb_mux = mpc3_set_dwb_mux,
|
||||
.disable_dwb_mux = mpc3_disable_dwb_mux,
|
||||
.is_dwb_idle = mpc3_is_dwb_idle,
|
||||
.set_out_rate_control = mpc3_set_out_rate_control,
|
||||
.set_gamut_remap = mpc3_set_gamut_remap,
|
||||
.program_shaper = mpc3_program_shaper,
|
||||
.acquire_rmu = mpcc3_acquire_rmu,
|
||||
|
|
|
@ -1007,6 +1007,13 @@ void dcn30_mpc_construct(struct dcn30_mpc *mpc30,
|
|||
int num_mpcc,
|
||||
int num_rmu);
|
||||
|
||||
void mpc3_mpc_init(
|
||||
struct mpc *mpc);
|
||||
|
||||
void mpc3_mpc_init_single_inst(
|
||||
struct mpc *mpc,
|
||||
unsigned int mpcc_id);
|
||||
|
||||
bool mpc3_program_shaper(
|
||||
struct mpc *mpc,
|
||||
const struct pwl_params *params,
|
||||
|
@ -1078,13 +1085,6 @@ bool mpc3_is_dwb_idle(
|
|||
struct mpc *mpc,
|
||||
int dwb_id);
|
||||
|
||||
void mpc3_set_out_rate_control(
|
||||
struct mpc *mpc,
|
||||
int opp_id,
|
||||
bool enable,
|
||||
bool rate_2x_mode,
|
||||
struct mpc_dwb_flow_control *flow_control);
|
||||
|
||||
void mpc3_power_on_ogam_lut(
|
||||
struct mpc *mpc, int mpcc_id,
|
||||
bool power_on);
|
||||
|
|
|
@ -47,7 +47,7 @@ void mpc32_mpc_init(struct mpc *mpc)
|
|||
struct dcn30_mpc *mpc30 = TO_DCN30_MPC(mpc);
|
||||
int mpcc_id;
|
||||
|
||||
mpc1_mpc_init(mpc);
|
||||
mpc3_mpc_init(mpc);
|
||||
|
||||
if (mpc->ctx->dc->debug.enable_mem_low_power.bits.mpc) {
|
||||
if (mpc30->mpc_mask->MPCC_MCM_SHAPER_MEM_LOW_PWR_MODE && mpc30->mpc_mask->MPCC_MCM_3DLUT_MEM_LOW_PWR_MODE) {
|
||||
|
@ -991,7 +991,7 @@ static const struct mpc_funcs dcn32_mpc_funcs = {
|
|||
.insert_plane = mpc1_insert_plane,
|
||||
.remove_mpcc = mpc1_remove_mpcc,
|
||||
.mpc_init = mpc32_mpc_init,
|
||||
.mpc_init_single_inst = mpc1_mpc_init_single_inst,
|
||||
.mpc_init_single_inst = mpc3_mpc_init_single_inst,
|
||||
.update_blending = mpc2_update_blending,
|
||||
.cursor_lock = mpc1_cursor_lock,
|
||||
.get_mpcc_for_dpp = mpc1_get_mpcc_for_dpp,
|
||||
|
@ -1008,7 +1008,6 @@ static const struct mpc_funcs dcn32_mpc_funcs = {
|
|||
.set_dwb_mux = mpc3_set_dwb_mux,
|
||||
.disable_dwb_mux = mpc3_disable_dwb_mux,
|
||||
.is_dwb_idle = mpc3_is_dwb_idle,
|
||||
.set_out_rate_control = mpc3_set_out_rate_control,
|
||||
.set_gamut_remap = mpc3_set_gamut_remap,
|
||||
.program_shaper = mpc32_program_shaper,
|
||||
.program_3dlut = mpc32_program_3dlut,
|
||||
|
|
|
@ -166,8 +166,8 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_5_soc = {
|
|||
.num_states = 5,
|
||||
.sr_exit_time_us = 28.0,
|
||||
.sr_enter_plus_exit_time_us = 30.0,
|
||||
.sr_exit_z8_time_us = 210.0,
|
||||
.sr_enter_plus_exit_z8_time_us = 320.0,
|
||||
.sr_exit_z8_time_us = 250.0,
|
||||
.sr_enter_plus_exit_z8_time_us = 350.0,
|
||||
.fclk_change_latency_us = 24.0,
|
||||
.usr_retraining_latency_us = 2,
|
||||
.writeback_latency_us = 12.0,
|
||||
|
|
|
@ -98,55 +98,114 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_51_soc = {
|
|||
.clock_limits = {
|
||||
{
|
||||
.state = 0,
|
||||
.dispclk_mhz = 1200.0,
|
||||
.dppclk_mhz = 1200.0,
|
||||
.dcfclk_mhz = 400.0,
|
||||
.fabricclk_mhz = 400.0,
|
||||
.socclk_mhz = 600.0,
|
||||
.dram_speed_mts = 3200.0,
|
||||
.dispclk_mhz = 600.0,
|
||||
.dppclk_mhz = 600.0,
|
||||
.phyclk_mhz = 600.0,
|
||||
.phyclk_d18_mhz = 667.0,
|
||||
.dscclk_mhz = 186.0,
|
||||
.dscclk_mhz = 200.0,
|
||||
.dtbclk_mhz = 600.0,
|
||||
},
|
||||
{
|
||||
.state = 1,
|
||||
.dispclk_mhz = 1200.0,
|
||||
.dppclk_mhz = 1200.0,
|
||||
.dcfclk_mhz = 600.0,
|
||||
.fabricclk_mhz = 1000.0,
|
||||
.socclk_mhz = 733.0,
|
||||
.dram_speed_mts = 6400.0,
|
||||
.dispclk_mhz = 800.0,
|
||||
.dppclk_mhz = 800.0,
|
||||
.phyclk_mhz = 810.0,
|
||||
.phyclk_d18_mhz = 667.0,
|
||||
.dscclk_mhz = 209.0,
|
||||
.dscclk_mhz = 266.7,
|
||||
.dtbclk_mhz = 600.0,
|
||||
},
|
||||
{
|
||||
.state = 2,
|
||||
.dispclk_mhz = 1200.0,
|
||||
.dppclk_mhz = 1200.0,
|
||||
.dcfclk_mhz = 738.0,
|
||||
.fabricclk_mhz = 1200.0,
|
||||
.socclk_mhz = 880.0,
|
||||
.dram_speed_mts = 7500.0,
|
||||
.dispclk_mhz = 800.0,
|
||||
.dppclk_mhz = 800.0,
|
||||
.phyclk_mhz = 810.0,
|
||||
.phyclk_d18_mhz = 667.0,
|
||||
.dscclk_mhz = 209.0,
|
||||
.dscclk_mhz = 266.7,
|
||||
.dtbclk_mhz = 600.0,
|
||||
},
|
||||
{
|
||||
.state = 3,
|
||||
.dispclk_mhz = 1200.0,
|
||||
.dppclk_mhz = 1200.0,
|
||||
.dcfclk_mhz = 800.0,
|
||||
.fabricclk_mhz = 1400.0,
|
||||
.socclk_mhz = 978.0,
|
||||
.dram_speed_mts = 7500.0,
|
||||
.dispclk_mhz = 960.0,
|
||||
.dppclk_mhz = 960.0,
|
||||
.phyclk_mhz = 810.0,
|
||||
.phyclk_d18_mhz = 667.0,
|
||||
.dscclk_mhz = 371.0,
|
||||
.dscclk_mhz = 320.0,
|
||||
.dtbclk_mhz = 600.0,
|
||||
},
|
||||
{
|
||||
.state = 4,
|
||||
.dcfclk_mhz = 873.0,
|
||||
.fabricclk_mhz = 1600.0,
|
||||
.socclk_mhz = 1100.0,
|
||||
.dram_speed_mts = 8533.0,
|
||||
.dispclk_mhz = 1066.7,
|
||||
.dppclk_mhz = 1066.7,
|
||||
.phyclk_mhz = 810.0,
|
||||
.phyclk_d18_mhz = 667.0,
|
||||
.dscclk_mhz = 355.6,
|
||||
.dtbclk_mhz = 600.0,
|
||||
},
|
||||
{
|
||||
.state = 5,
|
||||
.dcfclk_mhz = 960.0,
|
||||
.fabricclk_mhz = 1700.0,
|
||||
.socclk_mhz = 1257.0,
|
||||
.dram_speed_mts = 8533.0,
|
||||
.dispclk_mhz = 1200.0,
|
||||
.dppclk_mhz = 1200.0,
|
||||
.phyclk_mhz = 810.0,
|
||||
.phyclk_d18_mhz = 667.0,
|
||||
.dscclk_mhz = 417.0,
|
||||
.dscclk_mhz = 400.0,
|
||||
.dtbclk_mhz = 600.0,
|
||||
},
|
||||
{
|
||||
.state = 6,
|
||||
.dcfclk_mhz = 1067.0,
|
||||
.fabricclk_mhz = 1850.0,
|
||||
.socclk_mhz = 1257.0,
|
||||
.dram_speed_mts = 8533.0,
|
||||
.dispclk_mhz = 1371.4,
|
||||
.dppclk_mhz = 1371.4,
|
||||
.phyclk_mhz = 810.0,
|
||||
.phyclk_d18_mhz = 667.0,
|
||||
.dscclk_mhz = 457.1,
|
||||
.dtbclk_mhz = 600.0,
|
||||
},
|
||||
{
|
||||
.state = 7,
|
||||
.dcfclk_mhz = 1200.0,
|
||||
.fabricclk_mhz = 2000.0,
|
||||
.socclk_mhz = 1467.0,
|
||||
.dram_speed_mts = 8533.0,
|
||||
.dispclk_mhz = 1600.0,
|
||||
.dppclk_mhz = 1600.0,
|
||||
.phyclk_mhz = 810.0,
|
||||
.phyclk_d18_mhz = 667.0,
|
||||
.dscclk_mhz = 533.3,
|
||||
.dtbclk_mhz = 600.0,
|
||||
},
|
||||
},
|
||||
.num_states = 5,
|
||||
.num_states = 8,
|
||||
.sr_exit_time_us = 28.0,
|
||||
.sr_enter_plus_exit_time_us = 30.0,
|
||||
.sr_exit_z8_time_us = 210.0,
|
||||
.sr_enter_plus_exit_z8_time_us = 320.0,
|
||||
.sr_exit_z8_time_us = 250.0,
|
||||
.sr_enter_plus_exit_z8_time_us = 350.0,
|
||||
.fclk_change_latency_us = 24.0,
|
||||
.usr_retraining_latency_us = 2,
|
||||
.writeback_latency_us = 12.0,
|
||||
|
@ -177,6 +236,9 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_51_soc = {
|
|||
.do_urgent_latency_adjustment = 0,
|
||||
.urgent_latency_adjustment_fabric_clock_component_us = 0,
|
||||
.urgent_latency_adjustment_fabric_clock_reference_mhz = 0,
|
||||
.num_chans = 4,
|
||||
.dram_clock_change_latency_us = 11.72,
|
||||
.dispclk_dppclk_vco_speed_mhz = 2400.0,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -340,6 +402,8 @@ void dcn351_update_bw_bounding_box_fpu(struct dc *dc,
|
|||
clock_limits[i].socclk_mhz;
|
||||
dc->dml2_options.bbox_overrides.clks_table.clk_entries[i].memclk_mhz =
|
||||
clk_table->entries[i].memclk_mhz * clk_table->entries[i].wck_ratio;
|
||||
dc->dml2_options.bbox_overrides.clks_table.clk_entries[i].dtbclk_mhz =
|
||||
clock_limits[i].dtbclk_mhz;
|
||||
dc->dml2_options.bbox_overrides.clks_table.num_entries_per_clk.num_dcfclk_levels =
|
||||
clk_table->num_entries;
|
||||
dc->dml2_options.bbox_overrides.clks_table.num_entries_per_clk.num_fclk_levels =
|
||||
|
@ -352,6 +416,8 @@ void dcn351_update_bw_bounding_box_fpu(struct dc *dc,
|
|||
clk_table->num_entries;
|
||||
dc->dml2_options.bbox_overrides.clks_table.num_entries_per_clk.num_memclk_levels =
|
||||
clk_table->num_entries;
|
||||
dc->dml2_options.bbox_overrides.clks_table.num_entries_per_clk.num_dtbclk_levels =
|
||||
clk_table->num_entries;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -551,6 +617,7 @@ void dcn351_decide_zstate_support(struct dc *dc, struct dc_state *context)
|
|||
if (context->res_ctx.pipe_ctx[i].plane_state)
|
||||
plane_count++;
|
||||
}
|
||||
|
||||
/*dcn351 does not support z9/z10*/
|
||||
if (context->stream_count == 0 || plane_count == 0) {
|
||||
support = DCN_ZSTATE_SUPPORT_ALLOW_Z8_ONLY;
|
||||
|
@ -564,11 +631,9 @@ void dcn351_decide_zstate_support(struct dc *dc, struct dc_state *context)
|
|||
dc->debug.minimum_z8_residency_time > 0 ? dc->debug.minimum_z8_residency_time : 1000;
|
||||
bool allow_z8 = context->bw_ctx.dml.vba.StutterPeriod > (double)minmum_z8_residency;
|
||||
|
||||
|
||||
/*for psr1/psr-su, we allow z8 and z10 based on latency, for replay with IPS enabled, it will enter ips2*/
|
||||
if (is_pwrseq0 && (is_psr || is_replay))
|
||||
support = allow_z8 ? allow_z8 : DCN_ZSTATE_SUPPORT_DISALLOW;
|
||||
|
||||
}
|
||||
context->bw_ctx.bw.dcn.clk.zstate_support = support;
|
||||
}
|
||||
|
|
|
@ -228,17 +228,13 @@ void dml2_init_socbb_params(struct dml2_context *dml2, const struct dc *in_dc, s
|
|||
break;
|
||||
|
||||
case dml_project_dcn35:
|
||||
case dml_project_dcn351:
|
||||
out->num_chans = 4;
|
||||
out->round_trip_ping_latency_dcfclk_cycles = 106;
|
||||
out->smn_latency_us = 2;
|
||||
out->dispclk_dppclk_vco_speed_mhz = 3600;
|
||||
break;
|
||||
|
||||
case dml_project_dcn351:
|
||||
out->num_chans = 16;
|
||||
out->round_trip_ping_latency_dcfclk_cycles = 1100;
|
||||
out->smn_latency_us = 2;
|
||||
break;
|
||||
}
|
||||
/* ---Overrides if available--- */
|
||||
if (dml2->config.bbox_overrides.dram_num_chan)
|
||||
|
|
|
@ -1185,6 +1185,7 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
|
|||
if (dccg) {
|
||||
dccg->funcs->disable_symclk32_se(dccg, dp_hpo_inst);
|
||||
dccg->funcs->set_dpstreamclk(dccg, REFCLK, tg->inst, dp_hpo_inst);
|
||||
if (dccg && dccg->funcs->set_dtbclk_dto)
|
||||
dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
|
||||
}
|
||||
} else if (dccg && dccg->funcs->disable_symclk_se) {
|
||||
|
|
|
@ -69,29 +69,6 @@
|
|||
#define FN(reg_name, field_name) \
|
||||
hws->shifts->field_name, hws->masks->field_name
|
||||
|
||||
static int calc_mpc_flow_ctrl_cnt(const struct dc_stream_state *stream,
|
||||
int opp_cnt)
|
||||
{
|
||||
bool hblank_halved = optc2_is_two_pixels_per_containter(&stream->timing);
|
||||
int flow_ctrl_cnt;
|
||||
|
||||
if (opp_cnt >= 2)
|
||||
hblank_halved = true;
|
||||
|
||||
flow_ctrl_cnt = stream->timing.h_total - stream->timing.h_addressable -
|
||||
stream->timing.h_border_left -
|
||||
stream->timing.h_border_right;
|
||||
|
||||
if (hblank_halved)
|
||||
flow_ctrl_cnt /= 2;
|
||||
|
||||
/* ODM combine 4:1 case */
|
||||
if (opp_cnt == 4)
|
||||
flow_ctrl_cnt /= 2;
|
||||
|
||||
return flow_ctrl_cnt;
|
||||
}
|
||||
|
||||
static void update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)
|
||||
{
|
||||
struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc;
|
||||
|
@ -183,10 +160,6 @@ void dcn314_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx
|
|||
struct pipe_ctx *odm_pipe;
|
||||
int opp_cnt = 0;
|
||||
int opp_inst[MAX_PIPES] = {0};
|
||||
bool rate_control_2x_pclk = (pipe_ctx->stream->timing.flags.INTERLACE || optc2_is_two_pixels_per_containter(&pipe_ctx->stream->timing));
|
||||
struct mpc_dwb_flow_control flow_control;
|
||||
struct mpc *mpc = dc->res_pool->mpc;
|
||||
int i;
|
||||
|
||||
opp_cnt = get_odm_config(pipe_ctx, opp_inst);
|
||||
|
||||
|
@ -199,20 +172,6 @@ void dcn314_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx
|
|||
pipe_ctx->stream_res.tg->funcs->set_odm_bypass(
|
||||
pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing);
|
||||
|
||||
rate_control_2x_pclk = rate_control_2x_pclk || opp_cnt > 1;
|
||||
flow_control.flow_ctrl_mode = 0;
|
||||
flow_control.flow_ctrl_cnt0 = 0x80;
|
||||
flow_control.flow_ctrl_cnt1 = calc_mpc_flow_ctrl_cnt(pipe_ctx->stream, opp_cnt);
|
||||
if (mpc->funcs->set_out_rate_control) {
|
||||
for (i = 0; i < opp_cnt; ++i) {
|
||||
mpc->funcs->set_out_rate_control(
|
||||
mpc, opp_inst[i],
|
||||
true,
|
||||
rate_control_2x_pclk,
|
||||
&flow_control);
|
||||
}
|
||||
}
|
||||
|
||||
for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) {
|
||||
odm_pipe->stream_res.opp->funcs->opp_pipe_clock_control(
|
||||
odm_pipe->stream_res.opp,
|
||||
|
|
|
@ -966,29 +966,6 @@ void dcn32_init_hw(struct dc *dc)
|
|||
}
|
||||
}
|
||||
|
||||
static int calc_mpc_flow_ctrl_cnt(const struct dc_stream_state *stream,
|
||||
int opp_cnt)
|
||||
{
|
||||
bool hblank_halved = optc2_is_two_pixels_per_containter(&stream->timing);
|
||||
int flow_ctrl_cnt;
|
||||
|
||||
if (opp_cnt >= 2)
|
||||
hblank_halved = true;
|
||||
|
||||
flow_ctrl_cnt = stream->timing.h_total - stream->timing.h_addressable -
|
||||
stream->timing.h_border_left -
|
||||
stream->timing.h_border_right;
|
||||
|
||||
if (hblank_halved)
|
||||
flow_ctrl_cnt /= 2;
|
||||
|
||||
/* ODM combine 4:1 case */
|
||||
if (opp_cnt == 4)
|
||||
flow_ctrl_cnt /= 2;
|
||||
|
||||
return flow_ctrl_cnt;
|
||||
}
|
||||
|
||||
static void update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)
|
||||
{
|
||||
struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc;
|
||||
|
@ -1103,10 +1080,6 @@ void dcn32_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx *
|
|||
struct pipe_ctx *odm_pipe;
|
||||
int opp_cnt = 0;
|
||||
int opp_inst[MAX_PIPES] = {0};
|
||||
bool rate_control_2x_pclk = (pipe_ctx->stream->timing.flags.INTERLACE || optc2_is_two_pixels_per_containter(&pipe_ctx->stream->timing));
|
||||
struct mpc_dwb_flow_control flow_control;
|
||||
struct mpc *mpc = dc->res_pool->mpc;
|
||||
int i;
|
||||
|
||||
opp_cnt = get_odm_config(pipe_ctx, opp_inst);
|
||||
|
||||
|
@ -1119,20 +1092,6 @@ void dcn32_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx *
|
|||
pipe_ctx->stream_res.tg->funcs->set_odm_bypass(
|
||||
pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing);
|
||||
|
||||
rate_control_2x_pclk = rate_control_2x_pclk || opp_cnt > 1;
|
||||
flow_control.flow_ctrl_mode = 0;
|
||||
flow_control.flow_ctrl_cnt0 = 0x80;
|
||||
flow_control.flow_ctrl_cnt1 = calc_mpc_flow_ctrl_cnt(pipe_ctx->stream, opp_cnt);
|
||||
if (mpc->funcs->set_out_rate_control) {
|
||||
for (i = 0; i < opp_cnt; ++i) {
|
||||
mpc->funcs->set_out_rate_control(
|
||||
mpc, opp_inst[i],
|
||||
true,
|
||||
rate_control_2x_pclk,
|
||||
&flow_control);
|
||||
}
|
||||
}
|
||||
|
||||
for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) {
|
||||
odm_pipe->stream_res.opp->funcs->opp_pipe_clock_control(
|
||||
odm_pipe->stream_res.opp,
|
||||
|
|
|
@ -358,29 +358,6 @@ void dcn35_init_hw(struct dc *dc)
|
|||
}
|
||||
}
|
||||
|
||||
static int calc_mpc_flow_ctrl_cnt(const struct dc_stream_state *stream,
|
||||
int opp_cnt)
|
||||
{
|
||||
bool hblank_halved = optc2_is_two_pixels_per_containter(&stream->timing);
|
||||
int flow_ctrl_cnt;
|
||||
|
||||
if (opp_cnt >= 2)
|
||||
hblank_halved = true;
|
||||
|
||||
flow_ctrl_cnt = stream->timing.h_total - stream->timing.h_addressable -
|
||||
stream->timing.h_border_left -
|
||||
stream->timing.h_border_right;
|
||||
|
||||
if (hblank_halved)
|
||||
flow_ctrl_cnt /= 2;
|
||||
|
||||
/* ODM combine 4:1 case */
|
||||
if (opp_cnt == 4)
|
||||
flow_ctrl_cnt /= 2;
|
||||
|
||||
return flow_ctrl_cnt;
|
||||
}
|
||||
|
||||
static void update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)
|
||||
{
|
||||
struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc;
|
||||
|
@ -474,10 +451,6 @@ void dcn35_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx *
|
|||
struct pipe_ctx *odm_pipe;
|
||||
int opp_cnt = 0;
|
||||
int opp_inst[MAX_PIPES] = {0};
|
||||
bool rate_control_2x_pclk = (pipe_ctx->stream->timing.flags.INTERLACE || optc2_is_two_pixels_per_containter(&pipe_ctx->stream->timing));
|
||||
struct mpc_dwb_flow_control flow_control;
|
||||
struct mpc *mpc = dc->res_pool->mpc;
|
||||
int i;
|
||||
|
||||
opp_cnt = get_odm_config(pipe_ctx, opp_inst);
|
||||
|
||||
|
@ -490,20 +463,6 @@ void dcn35_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx *
|
|||
pipe_ctx->stream_res.tg->funcs->set_odm_bypass(
|
||||
pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing);
|
||||
|
||||
rate_control_2x_pclk = rate_control_2x_pclk || opp_cnt > 1;
|
||||
flow_control.flow_ctrl_mode = 0;
|
||||
flow_control.flow_ctrl_cnt0 = 0x80;
|
||||
flow_control.flow_ctrl_cnt1 = calc_mpc_flow_ctrl_cnt(pipe_ctx->stream, opp_cnt);
|
||||
if (mpc->funcs->set_out_rate_control) {
|
||||
for (i = 0; i < opp_cnt; ++i) {
|
||||
mpc->funcs->set_out_rate_control(
|
||||
mpc, opp_inst[i],
|
||||
true,
|
||||
rate_control_2x_pclk,
|
||||
&flow_control);
|
||||
}
|
||||
}
|
||||
|
||||
for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) {
|
||||
odm_pipe->stream_res.opp->funcs->opp_pipe_clock_control(
|
||||
odm_pipe->stream_res.opp,
|
||||
|
|
|
@ -67,7 +67,7 @@ static const struct hw_sequencer_funcs dcn351_funcs = {
|
|||
.prepare_bandwidth = dcn35_prepare_bandwidth,
|
||||
.optimize_bandwidth = dcn35_optimize_bandwidth,
|
||||
.update_bandwidth = dcn20_update_bandwidth,
|
||||
.set_drr = dcn10_set_drr,
|
||||
.set_drr = dcn35_set_drr,
|
||||
.get_position = dcn10_get_position,
|
||||
.set_static_screen_control = dcn35_set_static_screen_control,
|
||||
.setup_stereo = dcn10_setup_stereo,
|
||||
|
|
|
@ -700,6 +700,8 @@ static const struct dc_debug_options debug_defaults_drv = {
|
|||
.disable_dcc = DCC_ENABLE,
|
||||
.disable_dpp_power_gate = true,
|
||||
.disable_hubp_power_gate = true,
|
||||
.disable_optc_power_gate = true, /*should the same as above two*/
|
||||
.disable_hpo_power_gate = true, /*dmubfw force domain25 on*/
|
||||
.disable_clock_gate = false,
|
||||
.disable_dsc_power_gate = true,
|
||||
.vsr_support = true,
|
||||
|
@ -742,12 +744,13 @@ static const struct dc_debug_options debug_defaults_drv = {
|
|||
},
|
||||
.seamless_boot_odm_combine = DML_FAIL_SOURCE_PIXEL_FORMAT,
|
||||
.enable_z9_disable_interface = true, /* Allow support for the PMFW interface for disable Z9*/
|
||||
.minimum_z8_residency_time = 2100,
|
||||
.using_dml2 = true,
|
||||
.support_eDP1_5 = true,
|
||||
.enable_hpo_pg_support = false,
|
||||
.enable_legacy_fast_update = true,
|
||||
.enable_single_display_2to1_odm_policy = true,
|
||||
.disable_idle_power_optimizations = true,
|
||||
.disable_idle_power_optimizations = false,
|
||||
.dmcub_emulation = false,
|
||||
.disable_boot_optimizations = false,
|
||||
.disable_unbounded_requesting = false,
|
||||
|
@ -758,8 +761,10 @@ static const struct dc_debug_options debug_defaults_drv = {
|
|||
.disable_z10 = true,
|
||||
.ignore_pg = true,
|
||||
.psp_disabled_wa = true,
|
||||
.ips2_eval_delay_us = 200,
|
||||
.ips2_entry_delay_us = 400
|
||||
.ips2_eval_delay_us = 2000,
|
||||
.ips2_entry_delay_us = 800,
|
||||
.disable_dmub_reallow_idle = true,
|
||||
.static_screen_wait_frames = 2,
|
||||
};
|
||||
|
||||
static const struct dc_panel_config panel_config_defaults = {
|
||||
|
|
|
@ -147,15 +147,12 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
|
|||
}
|
||||
|
||||
/* VSC packet set to 4 for PSR-SU, or 2 for PSR1 */
|
||||
if (stream->link->psr_settings.psr_feature_enabled) {
|
||||
if (stream->link->psr_settings.psr_version == DC_PSR_VERSION_SU_1)
|
||||
vsc_packet_revision = vsc_packet_rev4;
|
||||
else if (stream->link->replay_settings.config.replay_supported)
|
||||
vsc_packet_revision = vsc_packet_rev4;
|
||||
else if (stream->link->psr_settings.psr_version == DC_PSR_VERSION_1)
|
||||
vsc_packet_revision = vsc_packet_rev2;
|
||||
}
|
||||
|
||||
if (stream->link->replay_settings.config.replay_supported)
|
||||
vsc_packet_revision = vsc_packet_rev4;
|
||||
|
||||
/* Update to revision 5 for extended colorimetry support */
|
||||
if (stream->use_vsc_sdp_for_colorimetry)
|
||||
|
|
|
@ -234,7 +234,8 @@ union UMSCHAPI__SET_HW_RESOURCES {
|
|||
uint32_t enable_level_process_quantum_check : 1;
|
||||
uint32_t is_vcn0_enabled : 1;
|
||||
uint32_t is_vcn1_enabled : 1;
|
||||
uint32_t reserved : 27;
|
||||
uint32_t use_rs64mem_for_proc_ctx_csa : 1;
|
||||
uint32_t reserved : 26;
|
||||
};
|
||||
uint32_t uint32_all;
|
||||
};
|
||||
|
@ -297,9 +298,12 @@ union UMSCHAPI__ADD_QUEUE {
|
|||
|
||||
struct {
|
||||
uint32_t is_context_suspended : 1;
|
||||
uint32_t reserved : 31;
|
||||
uint32_t collaboration_mode : 1;
|
||||
uint32_t reserved : 30;
|
||||
};
|
||||
struct UMSCH_API_STATUS api_status;
|
||||
uint32_t process_csa_array_index;
|
||||
uint32_t context_csa_array_index;
|
||||
};
|
||||
|
||||
uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
|
||||
|
@ -314,6 +318,7 @@ union UMSCHAPI__REMOVE_QUEUE {
|
|||
uint64_t context_csa_addr;
|
||||
|
||||
struct UMSCH_API_STATUS api_status;
|
||||
uint32_t context_csa_array_index;
|
||||
};
|
||||
|
||||
uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
|
||||
|
@ -337,6 +342,7 @@ union UMSCHAPI__SUSPEND {
|
|||
uint32_t suspend_fence_value;
|
||||
|
||||
struct UMSCH_API_STATUS api_status;
|
||||
uint32_t context_csa_array_index;
|
||||
};
|
||||
|
||||
uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
|
||||
|
@ -356,6 +362,7 @@ union UMSCHAPI__RESUME {
|
|||
enum UMSCH_ENGINE_TYPE engine_type;
|
||||
|
||||
struct UMSCH_API_STATUS api_status;
|
||||
uint32_t context_csa_array_index;
|
||||
};
|
||||
|
||||
uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
|
||||
|
@ -404,6 +411,7 @@ union UMSCHAPI__UPDATE_AFFINITY {
|
|||
union UMSCH_AFFINITY affinity;
|
||||
uint64_t context_csa_addr;
|
||||
struct UMSCH_API_STATUS api_status;
|
||||
uint32_t context_csa_array_index;
|
||||
};
|
||||
|
||||
uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
|
||||
|
@ -417,6 +425,7 @@ union UMSCHAPI__CHANGE_CONTEXT_PRIORITY_LEVEL {
|
|||
uint64_t context_quantum;
|
||||
uint64_t context_csa_addr;
|
||||
struct UMSCH_API_STATUS api_status;
|
||||
uint32_t context_csa_array_index;
|
||||
};
|
||||
|
||||
uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
|
||||
|
|
|
@ -54,14 +54,14 @@
|
|||
#define PPSMC_MSG_TestMessage 0x01 ///< To check if PMFW is alive and responding. Requirement specified by PMFW team
|
||||
#define PPSMC_MSG_GetPmfwVersion 0x02 ///< Get PMFW version
|
||||
#define PPSMC_MSG_GetDriverIfVersion 0x03 ///< Get PMFW_DRIVER_IF version
|
||||
#define PPSMC_MSG_SPARE0 0x04 ///< SPARE
|
||||
#define PPSMC_MSG_SPARE1 0x05 ///< SPARE
|
||||
#define PPSMC_MSG_PowerDownVcn 0x06 ///< Power down VCN
|
||||
#define PPSMC_MSG_PowerUpVcn 0x07 ///< Power up VCN; VCN is power gated by default
|
||||
#define PPSMC_MSG_SetHardMinVcn 0x08 ///< For wireless display
|
||||
#define PPSMC_MSG_PowerDownVcn1 0x04 ///< Power down VCN1
|
||||
#define PPSMC_MSG_PowerUpVcn1 0x05 ///< Power up VCN1; VCN1 is power gated by default
|
||||
#define PPSMC_MSG_PowerDownVcn0 0x06 ///< Power down VCN0
|
||||
#define PPSMC_MSG_PowerUpVcn0 0x07 ///< Power up VCN0; VCN0 is power gated by default
|
||||
#define PPSMC_MSG_SetHardMinVcn0 0x08 ///< For wireless display
|
||||
#define PPSMC_MSG_SetSoftMinGfxclk 0x09 ///< Set SoftMin for GFXCLK, argument is frequency in MHz
|
||||
#define PPSMC_MSG_SPARE2 0x0A ///< SPARE
|
||||
#define PPSMC_MSG_SPARE3 0x0B ///< SPARE
|
||||
#define PPSMC_MSG_SetHardMinVcn1 0x0A ///< For wireless display
|
||||
#define PPSMC_MSG_SetSoftMinVcn1 0x0B ///< Set soft min for VCN1 clocks (VCLK1 and DCLK1)
|
||||
#define PPSMC_MSG_PrepareMp1ForUnload 0x0C ///< Prepare PMFW for GFX driver unload
|
||||
#define PPSMC_MSG_SetDriverDramAddrHigh 0x0D ///< Set high 32 bits of DRAM address for Driver table transfer
|
||||
#define PPSMC_MSG_SetDriverDramAddrLow 0x0E ///< Set low 32 bits of DRAM address for Driver table transfer
|
||||
|
@ -71,7 +71,7 @@
|
|||
#define PPSMC_MSG_GetEnabledSmuFeatures 0x12 ///< Get enabled features in PMFW
|
||||
#define PPSMC_MSG_SetHardMinSocclkByFreq 0x13 ///< Set hard min for SOC CLK
|
||||
#define PPSMC_MSG_SetSoftMinFclk 0x14 ///< Set hard min for FCLK
|
||||
#define PPSMC_MSG_SetSoftMinVcn 0x15 ///< Set soft min for VCN clocks (VCLK and DCLK)
|
||||
#define PPSMC_MSG_SetSoftMinVcn0 0x15 ///< Set soft min for VCN0 clocks (VCLK0 and DCLK0)
|
||||
|
||||
#define PPSMC_MSG_EnableGfxImu 0x16 ///< Enable GFX IMU
|
||||
|
||||
|
@ -84,17 +84,17 @@
|
|||
|
||||
#define PPSMC_MSG_SetSoftMaxSocclkByFreq 0x1D ///< Set soft max for SOC CLK
|
||||
#define PPSMC_MSG_SetSoftMaxFclkByFreq 0x1E ///< Set soft max for FCLK
|
||||
#define PPSMC_MSG_SetSoftMaxVcn 0x1F ///< Set soft max for VCN clocks (VCLK and DCLK)
|
||||
#define PPSMC_MSG_SetSoftMaxVcn0 0x1F ///< Set soft max for VCN0 clocks (VCLK0 and DCLK0)
|
||||
#define PPSMC_MSG_spare_0x20 0x20
|
||||
#define PPSMC_MSG_PowerDownJpeg 0x21 ///< Power down Jpeg
|
||||
#define PPSMC_MSG_PowerUpJpeg 0x22 ///< Power up Jpeg; VCN is power gated by default
|
||||
#define PPSMC_MSG_PowerDownJpeg0 0x21 ///< Power down Jpeg of VCN0
|
||||
#define PPSMC_MSG_PowerUpJpeg0 0x22 ///< Power up Jpeg of VCN0; VCN0 is power gated by default
|
||||
|
||||
#define PPSMC_MSG_SetHardMinFclkByFreq 0x23 ///< Set hard min for FCLK
|
||||
#define PPSMC_MSG_SetSoftMinSocclkByFreq 0x24 ///< Set soft min for SOC CLK
|
||||
#define PPSMC_MSG_AllowZstates 0x25 ///< Inform PMFM of allowing Zstate entry, i.e. no Miracast activity
|
||||
#define PPSMC_MSG_Reserved 0x26 ///< Not used
|
||||
#define PPSMC_MSG_Reserved1 0x27 ///< Not used, previously PPSMC_MSG_RequestActiveWgp
|
||||
#define PPSMC_MSG_Reserved2 0x28 ///< Not used, previously PPSMC_MSG_QueryActiveWgp
|
||||
#define PPSMC_MSG_PowerDownJpeg1 0x26 ///< Power down Jpeg of VCN1
|
||||
#define PPSMC_MSG_PowerUpJpeg1 0x27 ///< Power up Jpeg of VCN1; VCN1 is power gated by default
|
||||
#define PPSMC_MSG_SetSoftMaxVcn1 0x28 ///< Set soft max for VCN1 clocks (VCLK1 and DCLK1)
|
||||
#define PPSMC_MSG_PowerDownIspByTile 0x29 ///< ISP is power gated by default
|
||||
#define PPSMC_MSG_PowerUpIspByTile 0x2A ///< This message is used to power up ISP tiles and enable the ISP DPM
|
||||
#define PPSMC_MSG_SetHardMinIspiclkByFreq 0x2B ///< Set HardMin by frequency for ISPICLK
|
||||
|
|
|
@ -115,6 +115,10 @@
|
|||
__SMU_DUMMY_MAP(PowerDownVcn), \
|
||||
__SMU_DUMMY_MAP(PowerUpJpeg), \
|
||||
__SMU_DUMMY_MAP(PowerDownJpeg), \
|
||||
__SMU_DUMMY_MAP(PowerUpJpeg0), \
|
||||
__SMU_DUMMY_MAP(PowerDownJpeg0), \
|
||||
__SMU_DUMMY_MAP(PowerUpJpeg1), \
|
||||
__SMU_DUMMY_MAP(PowerDownJpeg1), \
|
||||
__SMU_DUMMY_MAP(BacoAudioD3PME), \
|
||||
__SMU_DUMMY_MAP(ArmD3), \
|
||||
__SMU_DUMMY_MAP(RunDcBtc), \
|
||||
|
@ -135,6 +139,8 @@
|
|||
__SMU_DUMMY_MAP(PowerUpSdma), \
|
||||
__SMU_DUMMY_MAP(SetHardMinIspclkByFreq), \
|
||||
__SMU_DUMMY_MAP(SetHardMinVcn), \
|
||||
__SMU_DUMMY_MAP(SetHardMinVcn0), \
|
||||
__SMU_DUMMY_MAP(SetHardMinVcn1), \
|
||||
__SMU_DUMMY_MAP(SetAllowFclkSwitch), \
|
||||
__SMU_DUMMY_MAP(SetMinVideoGfxclkFreq), \
|
||||
__SMU_DUMMY_MAP(ActiveProcessNotify), \
|
||||
|
@ -150,6 +156,8 @@
|
|||
__SMU_DUMMY_MAP(SetPhyclkVoltageByFreq), \
|
||||
__SMU_DUMMY_MAP(SetDppclkVoltageByFreq), \
|
||||
__SMU_DUMMY_MAP(SetSoftMinVcn), \
|
||||
__SMU_DUMMY_MAP(SetSoftMinVcn0), \
|
||||
__SMU_DUMMY_MAP(SetSoftMinVcn1), \
|
||||
__SMU_DUMMY_MAP(EnablePostCode), \
|
||||
__SMU_DUMMY_MAP(GetGfxclkFrequency), \
|
||||
__SMU_DUMMY_MAP(GetFclkFrequency), \
|
||||
|
@ -161,6 +169,8 @@
|
|||
__SMU_DUMMY_MAP(SetSoftMaxSocclkByFreq), \
|
||||
__SMU_DUMMY_MAP(SetSoftMaxFclkByFreq), \
|
||||
__SMU_DUMMY_MAP(SetSoftMaxVcn), \
|
||||
__SMU_DUMMY_MAP(SetSoftMaxVcn0), \
|
||||
__SMU_DUMMY_MAP(SetSoftMaxVcn1), \
|
||||
__SMU_DUMMY_MAP(PowerGateMmHub), \
|
||||
__SMU_DUMMY_MAP(UpdatePmeRestore), \
|
||||
__SMU_DUMMY_MAP(GpuChangeState), \
|
||||
|
|
|
@ -1402,9 +1402,22 @@ int smu_v14_0_set_vcn_enable(struct smu_context *smu,
|
|||
if (adev->vcn.harvest_config & (1 << i))
|
||||
continue;
|
||||
|
||||
if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||
|
||||
amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) {
|
||||
if (i == 0)
|
||||
ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
|
||||
SMU_MSG_PowerUpVcn0 : SMU_MSG_PowerDownVcn0,
|
||||
i << 16U, NULL);
|
||||
else if (i == 1)
|
||||
ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
|
||||
SMU_MSG_PowerUpVcn1 : SMU_MSG_PowerDownVcn1,
|
||||
i << 16U, NULL);
|
||||
} else {
|
||||
ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
|
||||
SMU_MSG_PowerUpVcn : SMU_MSG_PowerDownVcn,
|
||||
i << 16U, NULL);
|
||||
}
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
@ -1415,9 +1428,34 @@ int smu_v14_0_set_vcn_enable(struct smu_context *smu,
|
|||
int smu_v14_0_set_jpeg_enable(struct smu_context *smu,
|
||||
bool enable)
|
||||
{
|
||||
return smu_cmn_send_smc_msg_with_param(smu, enable ?
|
||||
struct amdgpu_device *adev = smu->adev;
|
||||
int i, ret = 0;
|
||||
|
||||
for (i = 0; i < adev->jpeg.num_jpeg_inst; i++) {
|
||||
if (adev->jpeg.harvest_config & (1 << i))
|
||||
continue;
|
||||
|
||||
if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||
|
||||
amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) {
|
||||
if (i == 0)
|
||||
ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
|
||||
SMU_MSG_PowerUpJpeg0 : SMU_MSG_PowerDownJpeg0,
|
||||
i << 16U, NULL);
|
||||
else if (i == 1 && amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
|
||||
ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
|
||||
SMU_MSG_PowerUpJpeg1 : SMU_MSG_PowerDownJpeg1,
|
||||
i << 16U, NULL);
|
||||
} else {
|
||||
ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
|
||||
SMU_MSG_PowerUpJpeg : SMU_MSG_PowerDownJpeg,
|
||||
0, NULL);
|
||||
i << 16U, NULL);
|
||||
}
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int smu_v14_0_run_btc(struct smu_context *smu)
|
||||
|
|
|
@ -70,9 +70,12 @@ static struct cmn2asic_msg_mapping smu_v14_0_0_message_map[SMU_MSG_MAX_COUNT] =
|
|||
MSG_MAP(TestMessage, PPSMC_MSG_TestMessage, 1),
|
||||
MSG_MAP(GetSmuVersion, PPSMC_MSG_GetPmfwVersion, 1),
|
||||
MSG_MAP(GetDriverIfVersion, PPSMC_MSG_GetDriverIfVersion, 1),
|
||||
MSG_MAP(PowerDownVcn, PPSMC_MSG_PowerDownVcn, 1),
|
||||
MSG_MAP(PowerUpVcn, PPSMC_MSG_PowerUpVcn, 1),
|
||||
MSG_MAP(SetHardMinVcn, PPSMC_MSG_SetHardMinVcn, 1),
|
||||
MSG_MAP(PowerDownVcn0, PPSMC_MSG_PowerDownVcn0, 1),
|
||||
MSG_MAP(PowerUpVcn0, PPSMC_MSG_PowerUpVcn0, 1),
|
||||
MSG_MAP(SetHardMinVcn0, PPSMC_MSG_SetHardMinVcn0, 1),
|
||||
MSG_MAP(PowerDownVcn1, PPSMC_MSG_PowerDownVcn1, 1),
|
||||
MSG_MAP(PowerUpVcn1, PPSMC_MSG_PowerUpVcn1, 1),
|
||||
MSG_MAP(SetHardMinVcn1, PPSMC_MSG_SetHardMinVcn1, 1),
|
||||
MSG_MAP(SetSoftMinGfxclk, PPSMC_MSG_SetSoftMinGfxclk, 1),
|
||||
MSG_MAP(PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload, 1),
|
||||
MSG_MAP(SetDriverDramAddrHigh, PPSMC_MSG_SetDriverDramAddrHigh, 1),
|
||||
|
@ -83,7 +86,8 @@ static struct cmn2asic_msg_mapping smu_v14_0_0_message_map[SMU_MSG_MAX_COUNT] =
|
|||
MSG_MAP(GetEnabledSmuFeatures, PPSMC_MSG_GetEnabledSmuFeatures, 1),
|
||||
MSG_MAP(SetHardMinSocclkByFreq, PPSMC_MSG_SetHardMinSocclkByFreq, 1),
|
||||
MSG_MAP(SetSoftMinFclk, PPSMC_MSG_SetSoftMinFclk, 1),
|
||||
MSG_MAP(SetSoftMinVcn, PPSMC_MSG_SetSoftMinVcn, 1),
|
||||
MSG_MAP(SetSoftMinVcn0, PPSMC_MSG_SetSoftMinVcn0, 1),
|
||||
MSG_MAP(SetSoftMinVcn1, PPSMC_MSG_SetSoftMinVcn1, 1),
|
||||
MSG_MAP(EnableGfxImu, PPSMC_MSG_EnableGfxImu, 1),
|
||||
MSG_MAP(AllowGfxOff, PPSMC_MSG_AllowGfxOff, 1),
|
||||
MSG_MAP(DisallowGfxOff, PPSMC_MSG_DisallowGfxOff, 1),
|
||||
|
@ -91,9 +95,12 @@ static struct cmn2asic_msg_mapping smu_v14_0_0_message_map[SMU_MSG_MAX_COUNT] =
|
|||
MSG_MAP(SetHardMinGfxClk, PPSMC_MSG_SetHardMinGfxClk, 1),
|
||||
MSG_MAP(SetSoftMaxSocclkByFreq, PPSMC_MSG_SetSoftMaxSocclkByFreq, 1),
|
||||
MSG_MAP(SetSoftMaxFclkByFreq, PPSMC_MSG_SetSoftMaxFclkByFreq, 1),
|
||||
MSG_MAP(SetSoftMaxVcn, PPSMC_MSG_SetSoftMaxVcn, 1),
|
||||
MSG_MAP(PowerDownJpeg, PPSMC_MSG_PowerDownJpeg, 1),
|
||||
MSG_MAP(PowerUpJpeg, PPSMC_MSG_PowerUpJpeg, 1),
|
||||
MSG_MAP(SetSoftMaxVcn0, PPSMC_MSG_SetSoftMaxVcn0, 1),
|
||||
MSG_MAP(SetSoftMaxVcn1, PPSMC_MSG_SetSoftMaxVcn1, 1),
|
||||
MSG_MAP(PowerDownJpeg0, PPSMC_MSG_PowerDownJpeg0, 1),
|
||||
MSG_MAP(PowerUpJpeg0, PPSMC_MSG_PowerUpJpeg0, 1),
|
||||
MSG_MAP(PowerDownJpeg1, PPSMC_MSG_PowerDownJpeg1, 1),
|
||||
MSG_MAP(PowerUpJpeg1, PPSMC_MSG_PowerUpJpeg1, 1),
|
||||
MSG_MAP(SetHardMinFclkByFreq, PPSMC_MSG_SetHardMinFclkByFreq, 1),
|
||||
MSG_MAP(SetSoftMinSocclkByFreq, PPSMC_MSG_SetSoftMinSocclkByFreq, 1),
|
||||
MSG_MAP(PowerDownIspByTile, PPSMC_MSG_PowerDownIspByTile, 1),
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue