From 84f28d6e76a1c6aadaf3082012b49bf37ee12d6c Mon Sep 17 00:00:00 2001 From: Tk-Glitch Date: Sun, 13 Aug 2023 23:37:55 +0200 Subject: [PATCH] 6.4.y: Refresh defconfig and add simpledrm hack for Nvidia drivers https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/blob/main/config https://github.com/archlinux/linux/commits/dc9328184cef9109dd57d4b28b2b4af393023d63 --- linux-tkg-config/6.4/config.x86_64 | 15 ++-- .../6.4/0012-misc-additions.patch | 87 +++++++++++++++++++ 2 files changed, 96 insertions(+), 6 deletions(-) diff --git a/linux-tkg-config/6.4/config.x86_64 b/linux-tkg-config/6.4/config.x86_64 index 5b1515d..206a7c1 100644 --- a/linux-tkg-config/6.4/config.x86_64 +++ b/linux-tkg-config/6.4/config.x86_64 @@ -1,15 +1,15 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86 6.4.4-arch1 Kernel Configuration +# Linux/x86 6.4.9-arch1 Kernel Configuration # -CONFIG_CC_VERSION_TEXT="gcc (GCC) 13.1.1 20230714" +CONFIG_CC_VERSION_TEXT="gcc (GCC) 13.2.1 20230801" CONFIG_CC_IS_GCC=y -CONFIG_GCC_VERSION=130101 +CONFIG_GCC_VERSION=130201 CONFIG_CLANG_VERSION=0 CONFIG_AS_IS_GNU=y -CONFIG_AS_VERSION=24000 +CONFIG_AS_VERSION=24100 CONFIG_LD_IS_BFD=y -CONFIG_LD_VERSION=24000 +CONFIG_LD_VERSION=24100 CONFIG_LLD_VERSION=0 CONFIG_CC_CAN_LINK=y CONFIG_CC_CAN_LINK_STATIC=y @@ -544,7 +544,9 @@ CONFIG_CALL_DEPTH_TRACKING=y # CONFIG_CALL_THUNKS_DEBUG is not set CONFIG_CPU_IBPB_ENTRY=y CONFIG_CPU_IBRS_ENTRY=y +CONFIG_CPU_SRSO=y CONFIG_SLS=y +# CONFIG_GDS_FORCE_MITIGATION is not set CONFIG_ARCH_HAS_ADD_PAGES=y CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y @@ -794,6 +796,7 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_ARCH_HAS_FORTIFY_SOURCE=y CONFIG_ARCH_HAS_SET_MEMORY=y CONFIG_ARCH_HAS_SET_DIRECT_MAP=y +CONFIG_ARCH_HAS_CPU_FINALIZE_INIT=y CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y CONFIG_ARCH_WANTS_NO_INSTR=y @@ -2335,7 +2338,7 @@ CONFIG_ISCSI_IBFT=m CONFIG_FW_CFG_SYSFS=m # CONFIG_FW_CFG_SYSFS_CMDLINE is not set CONFIG_SYSFB=y -# CONFIG_SYSFB_SIMPLEFB is not set +CONFIG_SYSFB_SIMPLEFB=y CONFIG_FW_CS_DSP=m CONFIG_GOOGLE_FIRMWARE=y # CONFIG_GOOGLE_SMI is not set diff --git a/linux-tkg-patches/6.4/0012-misc-additions.patch b/linux-tkg-patches/6.4/0012-misc-additions.patch index 2204487..ef8e4fc 100644 --- a/linux-tkg-patches/6.4/0012-misc-additions.patch +++ b/linux-tkg-patches/6.4/0012-misc-additions.patch @@ -235,3 +235,90 @@ index 61949f374..11ef58204 100644 if (native_hba) { if (fib->flags & FIB_CONTEXT_FLAG_NATIVE_HBA_TMF) { +From e65a5fe09577d17e2fded61067f759f2bf02f6c0 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Thu, 19 May 2022 14:40:07 +0200 +Subject: [PATCH] drivers/firmware: skip simpledrm if nvidia-drm.modeset=1 is + set + +The Nvidia proprietary driver has some bugs that leads to issues if used +with the simpledrm driver. The most noticeable is that does not register +an emulated fbdev device. + +It just relies on a fbdev to be registered by another driver, that could +be that could be attached to the framebuffer console. On UEFI machines, +this is the efifb driver. + +This means that disabling the efifb driver will cause virtual consoles to +not be present in the system when using the Nvidia driver. Legacy BIOS is +not affected just because fbcon is not used there, but instead vgacon. + +Unless a VGA mode is specified using the vga= kernel command line option, +in that case the vesafb driver is used instead and its fbdev attached to +the fbcon. + +This is a problem because with CONFIG_SYSFB_SIMPLEFB=y, the sysfb platform +code attempts to register a "simple-framebuffer" platform device (that is +matched against simpledrm) and only registers either an "efi-framebuffer" +or "vesa-framebuffer" if this fails to be registered due the video modes +not being compatible. + +The Nvidia driver relying on another driver to register the fbdev is quite +fragile, since it can't really assume those will stick around. For example +there are patches posted to remove the EFI and VESA platform devices once +a real DRM or fbdev driver probes. + +But in any case, moving to a simpledrm + emulated fbdev only breaks this +assumption and causes users to not have VT if the Nvidia driver is used. + +So to prevent this, let's add a workaround and make the sysfb to skip the +"simple-framebuffer" registration when nvidia-drm.modeset=1 option is set. + +This is quite horrible, but honestly I can't think of any other approach. + +For this to work, the CONFIG_FB_EFI and CONFIG_FB_VESA config options must +be enabled besides CONFIG_DRM_SIMPLEDRM. + +Signed-off-by: Javier Martinez Canillas +(cherry picked from commit 811fe0e4dcfd86a0db5135d3bfef4936794efdb6) +For: https://bugs.archlinux.org/task/73720 +--- + drivers/firmware/sysfb.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/drivers/firmware/sysfb.c b/drivers/firmware/sysfb.c +index 3c197db42c9d93..16e4a2e90fae2a 100644 +--- a/drivers/firmware/sysfb.c ++++ b/drivers/firmware/sysfb.c +@@ -34,6 +34,22 @@ + #include + #include + ++static int skip_simpledrm; ++ ++static int __init simpledrm_disable(char *opt) ++{ ++ if (!opt) ++ return -EINVAL; ++ ++ get_option(&opt, &skip_simpledrm); ++ ++ if (skip_simpledrm) ++ pr_info("The simpledrm driver will not be probed\n"); ++ ++ return 0; ++} ++early_param("nvidia-drm.modeset", simpledrm_disable); ++ + static struct platform_device *pd; + static DEFINE_MUTEX(disable_lock); + static bool disabled; +@@ -85,7 +101,7 @@ static __init int sysfb_init(void) + + /* try to create a simple-framebuffer device */ + compatible = sysfb_parse_mode(si, &mode); +- if (compatible) { ++ if (compatible && !skip_simpledrm) { + pd = sysfb_create_simplefb(si, &mode); + if (!IS_ERR(pd)) + goto unlock_mutex;