You are not logged in.

#1 2022-11-17 15:33:33

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

[SOLVED] 'naked' return found in RETHUNK and more when build....

Hi i get tons messages about:

/var/lib/dkms/nvidia/525.53/build/nvidia-modeset.o: warning: objtool: _nv000091kms+0x5: 'naked' return found in RETHUNK build
----
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv003472rm+0x1cc3: relocation to !ENDBR: _nv038100rm+0x0
----
/var/lib/dkms/nvidia/525.53/build/nvidia-modeset.o: warning: objtool: _nv002058kms+0xc60: data relocation to !ENDBR: _nv000730kms+0x0
----
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv022755rm+0x26: missing int3 after ret

(the ---- is a snip. in total 18Mb of log with such warnings)

the modules iself is builded, but when boot, the screen is freeze seconds after systemd start log in the screen, but not the machine. i can only enter to tty session and launch the wayland session by login bindtyped (i don't use any display manager). xorg not load

also happen when shutdown/reboot. after quit wayland session, the screen turns standby and not back until bios/uefi boot

tested from kernel 6.x (all from [core]). linux-lts (also from [core]) is not affected. i can see ttys and load xorg or wayland

gcc is `12.2.0` and i have added `ibt=off` to kernel parameters, (also reboot afte do that and rebuild the nvidia drivers). no sucsess

nvidia modesetting is set to 1. i cant change this because wayland hard requires it (?)

greetings

Last edited by sl1pkn07 (2022-12-30 02:31:14)

Offline

#2 2022-11-17 16:20:54

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,074

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

Do you have an integrated GPU that is not actually used and not disabled in your EFI firmware? If so disable it, if you think it's disabled, disable it harder There was a change in the kernel that blocks allocation of new non-framebuffer TTYs if a framebuffer TTY was detected, even if said frame buffer device is not actually attached anywhere.

If that isn't it post the journal from an affected session

sudo journalctl -b

https://wiki.archlinux.org/title/List_o … n_services

The DKMS warnings are likely normal and harmless.

Last edited by V1del (2022-11-17 16:23:17)

Offline

#3 2022-11-17 17:20:29

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

is not laptop or IGPU. is server grade (dual xeon) with dedicated gpu. then i think i found what happen (partial)

my processors is ES units (enginering samples), so no exist ucode for all mitigations enabled in the main kernel, in specific:

CONFIG_X86_KERNEL_IBT
CONFIG_RETHUNK
CONFIG_SLS

i tried disable it in `/usr/lib/modules/6.0.8-arch1-1/build/scripts/Makefile.lib` (lines #235, #239 and #240, just add `_` like `_CONFIG_X86_KERNEL_IBT` )

now  when build modules again,  all of warning is gone, but

/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv011382rm+0x5d: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv011385rm+0x57: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv011387rm+0x63: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv011390rm+0x58: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv011389rm+0x5b: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv011386rm+0x61: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv000558rm+0x65: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv000557rm+0x66: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv000572rm+0x6d: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv000578rm+0x6e: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv000570rm+0x6b: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv000576rm+0x60: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv000566rm+0x5f: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv020049rm+0x64: stack state mismatch: reg1[5]=-1+0 reg2[5]=-2-48
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv027996rm+0x122: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv037165rm+0xa9: return with modified stack frame
/var/lib/dkms/nvidia/525.53/build/nvidia.o: warning: objtool: _nv013154rm+0xd9: stack state mismatch: reg1[5]=-1+0 reg2[5]=-2-64

still appears. and i can't find what option silence it

yes. is unsafe, and a lot haky, but i think demostrate what happen

any hint to disabe it via kernel options instead of build the kernel and buy OEM processors (rigth now my processors (e5-2650-v4) is a lot cheap. but i think with full mitigations active convert it to i486 (lol), and the I wanted models, e5-2687W-v4, is still a lot expensive)  ?

> The DKMS warnings are likely normal and harmless.

the build with linux-lts have zero warnings about this warnings. only occour with linux 6.0.x. with linux-lts works, so, i thik is related

greetings

EDIT: journal -b https://paste.sh/fpGNl9m0#i92lCgOolCMdatATLYzRRLCV

Last edited by sl1pkn07 (2022-11-17 17:33:44)

Offline

#4 2022-11-17 17:22:08

d.ALT
Member
Registered: 2019-05-10
Posts: 943

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

sl1pkn07 wrote:

> The DKMS warnings are likely normal and harmless.

the build with linux-lts have zero warnings about this warnings. only occour with linux 6.0.x. with linux-lts works, so, i thik is related

Missing relaled *headers?


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#5 2022-11-17 17:31:11

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

linux-headers and linux-lts-headers are installed and updated

i have use the "bad" modules rigth now. so is not headers problem. but the black screen when boot/reboot/shutdown is here. also other posibble GPU malfunctions like gamescope segfault and something

└───╼  lsmod | grep nvidia
nvidia_drm             73728  70
nvidia_uvm           2904064  0
nvidia_modeset       1499136  39 nvidia_drm
nvidia              61120512  4239 nvidia_uvm,nvidia_modeset
┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~]|
└───╼  modinfo nvidia
filename:       /lib/modules/6.0.8-arch1-1/updates/dkms/nvidia.ko.zst
firmware:       nvidia/525.53/gsp_tu10x.bin
firmware:       nvidia/525.53/gsp_ad10x.bin
alias:          char-major-195-*
version:        525.53
supported:      external
license:        NVIDIA
srcversion:     901342B18504FCCE467C2C4
alias:          pci:v000010DEd*sv*sd*bc06sc80i00*
alias:          pci:v000010DEd*sv*sd*bc03sc02i00*
alias:          pci:v000010DEd*sv*sd*bc03sc00i00*
depends:        
retpoline:      Y
name:           nvidia
vermagic:       6.0.8-arch1-1 SMP preempt mod_unload 
sig_id:         PKCS#7
signer:         DKMS module signing key
sig_key:        31:E3:39:9C:06:9D:09:18:D2:07:F9:60:AE:E0:9D:32:33:13:A5:20
sig_hashalgo:   sha512
signature:      5B:CF:5B:B7:90:53:2A:D2:F9:9E:C7:05:C2:7C:FC:85:BE:08:8D:25:
                69:18:8F:D8:6B:71:58:F3:04:57:1F:A1:AE:E8:08:5F:30:E8:A6:D0:
                5D:8E:D3:C8:0D:DC:7F:53:8E:25:76:AD:1E:4F:67:C0:64:1D:73:77:
                CE:BA:01:24:F1:41:0F:4A:23:80:56:6C:CD:E5:FA:F6:2D:0E:62:F9:
                7D:3E:90:5D:BD:F6:56:A2:35:09:BC:57:74:58:F8:AA:24:AF:E1:7C:
                4D:1A:95:F5:3F:ED:41:38:00:DE:BD:DC:1E:DA:98:C4:BC:30:DB:9D:
                77:75:37:5C:A8:7C:99:E1:18:BB:FB:B3:DE:53:51:89:C1:4E:42:BC:
                64:0A:71:42:58:82:B5:FB:3C:F4:BE:E9:85:85:25:17:76:DB:B1:97:
                72:FA:49:77:06:B0:AE:EE:37:48:33:D6:E1:99:50:7D:DD:A0:77:B6:
                50:29:F9:FB:B0:7F:78:F4:42:F0:9A:57:DC:D4:5E:2E:D4:CF:85:2B:
                F2:F8:FE:5F:53:CA:13:91:DB:7C:FC:B0:FD:18:9E:5F:9F:D0:CC:EB:
                15:05:08:A9:68:46:19:83:D5:54:B3:53:D4:20:51:E9:2B:A2:15:84:
                3D:67:28:3F:FF:80:73:2E:88:E1:A5:76:CE:0D:F6:B2
parm:           NvSwitchRegDwords:NvSwitch regkey (charp)
parm:           NvSwitchBlacklist:NvSwitchBlacklist=uuid[,uuid...] (charp)
parm:           NVreg_ResmanDebugLevel:int
parm:           NVreg_RmLogonRC:int
parm:           NVreg_ModifyDeviceFiles:int
parm:           NVreg_DeviceFileUID:int
parm:           NVreg_DeviceFileGID:int
parm:           NVreg_DeviceFileMode:int
parm:           NVreg_InitializeSystemMemoryAllocations:int
parm:           NVreg_UsePageAttributeTable:int
parm:           NVreg_EnablePCIeGen3:int
parm:           NVreg_EnableMSI:int
parm:           NVreg_TCEBypassMode:int
parm:           NVreg_EnableStreamMemOPs:int
parm:           NVreg_RestrictProfilingToAdminUsers:int
parm:           NVreg_PreserveVideoMemoryAllocations:int
parm:           NVreg_EnableS0ixPowerManagement:int
parm:           NVreg_S0ixPowerManagementVideoMemoryThreshold:int
parm:           NVreg_DynamicPowerManagement:int
parm:           NVreg_DynamicPowerManagementVideoMemoryThreshold:int
parm:           NVreg_EnableGpuFirmware:int
parm:           NVreg_EnableGpuFirmwareLogs:int
parm:           NVreg_OpenRmEnableUnsupportedGpus:int
parm:           NVreg_EnableUserNUMAManagement:int
parm:           NVreg_MemoryPoolSize:int
parm:           NVreg_KMallocHeapMaxSize:int
parm:           NVreg_VMallocHeapMaxSize:int
parm:           NVreg_IgnoreMMIOCheck:int
parm:           NVreg_NvLinkDisable:int
parm:           NVreg_EnablePCIERelaxedOrderingMode:int
parm:           NVreg_RegisterPCIDriver:int
parm:           NVreg_EnableDbgBreakpoint:int
parm:           NVreg_RegistryDwords:charp
parm:           NVreg_RegistryDwordsPerDevice:charp
parm:           NVreg_RmMsg:charp
parm:           NVreg_GpuBlacklist:charp
parm:           NVreg_TemporaryFilePath:charp
parm:           NVreg_ExcludedGpus:charp
parm:           NVreg_DmaRemapPeerMmio:int
parm:           rm_firmware_active:charp

EDIT: tested boot with the "modified" modules. no sucess. the black/freeze screen is still here

Last edited by sl1pkn07 (2022-11-17 17:41:18)

Offline

#6 2022-11-21 21:48:03

loqs
Member
Registered: 2014-03-06
Posts: 18,001

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

From https://github.com/NVIDIA/open-gpu-kern … 1320935957 you have ruled out IBT SLS and RETHUNK as being the cause?
Have you looked at https://bbs.archlinux.org/viewtopic.php … 6#p2059606 and tried ensuring the nvidia modules are always loaded before any other module that uses a framebuffer?

Offline

#7 2022-11-23 15:36:11

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

loqs wrote:

From https://github.com/NVIDIA/open-gpu-kern … 1320935957 you have ruled out IBT SLS and RETHUNK as being the cause?

ibt=off do nothing. idk how disable RETHUNK and SLS with kernel command. only if do the posted on #3. and still get black screen

loqs wrote:

Have you looked at https://bbs.archlinux.org/viewtopic.php … 6#p2059606 and tried ensuring the nvidia modules are always loaded before any other module that uses a framebuffer?

you can enumerate what modules can take care the framebuffer? only have nvidia GPU. my mobo have integrated GPU (Aspeed AST2400) and is already disabled via hardware (pin jumper)

the only thing is i have 2 dedicated gpu, my main 1070ti and a Titan X maxwell binded to vfiopci module for VM VGA passtrought. but i'm pretty sure this not the issue

i have bad feeling if add the nvidia modules to mkinitcpio drivers section. because if not follow the order, (first load vfio modules and then nvidia) can break the VM and refuse load the system

greetings

Offline

#8 2022-11-23 22:17:47

loqs
Member
Registered: 2014-03-06
Posts: 18,001

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

6.0.9 with https://git.kernel.org/pub/scm/linux/ke … c05ed0c6ec reverted this should not be affected assuming it is the framebuffer issue
https://drive.google.com/file/d/1uG8Ltg … share_link linux-6.0.9.arch1-1.1-x86_64.pkg.tar.zst
https://drive.google.com/file/d/1-uaU7M … share_link linux-headers-6.0.9.arch1-1.1-x86_64.pkg.tar.zst

Offline

#9 2022-11-23 22:53:32

seth
Member
Registered: 2012-09-03
Posts: 58,240

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

You get the different objtool outputs because the different kernel(-header)s ship different versions of objtool.
Since wayland works, it's likely the fb console - either due to https://git.kernel.org/pub/scm/linux/ke … c05ed0c6ec and your second GPU (vfio hitting too late?)

https://git.kernel.org/pub/scm/linux/ke … c05ed0c6ec however was in 5.19 and https://forums.developer.nvidia.com/t/o … 2-0/234403 states that

kernels 5.xx no warnings and works normal in both wayland and xorg sessios, also TTYs

What exactly is 5.xx and does it include 5.19?

What output (hdmi, displayport, vga) do you use and does it matter?
Also https://paste.sh/fpGNl9m0#i92lCgOolCMdatATLYzRRLCV is 404 - please re-post the journal of an affected boot.

Offline

#10 2022-11-24 14:55:02

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

Hi

for parts:

@loqs in test. let me check

EDIT. same. the journalctl log https://gist.github.com/sl1pkn07/78028c … 777071a2a6

@seth

> What exactly is 5.xx and does it include 5.19?

no, only tested in linux-lts, and works fine

> What output (hdmi, displayport, vga) do you use and does it matter?
DP, i have no change the cable in ages

> Also https://paste.sh/fpGNl9m0#i92lCgOolCMdatATLYzRRLCV is 404 - please re-post the journal of an affected boot.
the (seems the link has expired) new one joirnalctl -b: https://gist.github.com/sl1pkn07/614a20 … c231f08ff2

Last edited by sl1pkn07 (2022-11-24 15:08:51)

Offline

#11 2022-11-24 15:12:22

seth
Member
Registered: 2012-09-03
Posts: 58,240

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

nov 24 15:27:45 archlinux kernel: Console: switching to colour frame buffer device 240x67
…
nov 24 15:27:46 archlinux kernel: VFIO - User Level meta-driver version: 0.3
nov 24 15:27:46 archlinux systemd[1]: Started Rule-based Manager for Device Events and Files.
nov 24 15:27:46 archlinux kernel: audit: type=1130 audit(1669300065.924:2): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-udevd comm="systemd" exe="/init" hostname=? addr=? terminal=? res=success'
nov 24 15:27:46 archlinux kernel: Console: switching to colour dummy device 80x25
nov 24 15:27:46 archlinux kernel: vfio-pci 0000:82:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=none
nov 24 15:27:46 archlinux kernel: vfio_pci: add [10de:17c2[ffffffff:ffffffff]] class 0x000000/00000000

So you get an fbcon, then, when vfio loads, end up w/ a dummy device… move vfio and vfio_pci into the initramfs to withdraw the device as early as possible.
Or remove/deactivate the GPU and see whether your problem remains.
Or disable vfio and see what happens then.

Offline

#12 2022-11-24 16:26:40

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

is already in initramfs

MODULES=(vfio vfio_iommu_type1 vfio_pci vfio_virqfd)

0000:82:00.0 is the VM gpu

82:00.0 VGA compatible controller: NVIDIA Corporation GM200 [GeForce GTX TITAN X] (rev a1)

0000:03:00.0 is the host gpu

03:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1070 Ti] (rev a1)

EDIT may be i hit this? https://lore.kernel.org/lkml/93acb310-e … tal.net/T/

greetings

Last edited by sl1pkn07 (2022-11-24 16:27:03)

Offline

#13 2022-11-24 16:38:01

seth
Member
Registered: 2012-09-03
Posts: 58,240

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

Did you try

vgaarb.bootdev=03:00.0

?

Offline

#14 2022-11-24 16:45:42

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

that link is a proposed patch. i need patch the kernel for use it

EDIT. builded, booted and... none. same issue. the kernel log say the same about the vgaarb boot device (set the correct device)

nov 24 19:06:30 archlinux kernel: pci 0000:03:00.0: vgaarb: setting as boot VGA device
nov 24 19:06:30 archlinux kernel: pci 0000:03:00.0: vgaarb: bridge control possible
nov 24 19:06:30 archlinux kernel: pci 0000:03:00.0: vgaarb: VGA device added: decodes=io+mem,owns=none,locks=none
nov 24 19:06:30 archlinux kernel: pci 0000:82:00.0: vgaarb: bridge control possible
nov 24 19:06:30 archlinux kernel: pci 0000:82:00.0: vgaarb: VGA device added: decodes=io+mem,owns=none,locks=none
nov 24 19:06:30 archlinux kernel: vgaarb: loaded

BUT something has changed.. before i get this:

nov 24 15:27:48 archlinux kernel: nvidia 0000:03:00.0: vgaarb: deactivate vga console

but now this message is gone

the new journalctl -b https://gist.github.com/sl1pkn07/f3813d … 20ba959793

i will try the kernel with VGAARB patch + revert the ee7a69aa38d87a3bbced7b8245c732c05ed0c6ec and pull #342 #346 from nvidia open modules

EDIT2: seems is 5e01376124309b4dbd30d413f43c0d9c2f60edea and ee7a69aa38d87a3bbced7b8245c732c05ed0c6ec
https://github.com/archlinux/linux/comm … 9c2f60edea

EDIT3: revert commits is not that simple. i don't have skill for fix it sad


greetings

Last edited by sl1pkn07 (2022-11-24 20:03:20)

Offline

#15 2022-11-29 21:58:24

loqs
Member
Registered: 2014-03-06
Posts: 18,001

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

Any change with 525.60.11 https://github.com/NVIDIA/open-gpu-kern … f6a3bR1231
Edit:

diff --git a/trunk/nvidia-open-gcc-ibt-sls.patch b/trunk/nvidia-open-gcc-ibt-sls.patch
index 258026c..368a6cc 100644
--- a/trunk/nvidia-open-gcc-ibt-sls.patch
+++ b/trunk/nvidia-open-gcc-ibt-sls.patch
@@ -1,10 +1,29 @@
+diff --git a/src/nvidia-modeset/Makefile b/src/nvidia-modeset/Makefile
+index 9ef3c62..a6e3dc7 100644
 --- a/src/nvidia-modeset/Makefile
 +++ b/src/nvidia-modeset/Makefile
-@@ -142,6 +142,7 @@ ifeq ($(TARGET_ARCH),x86_64)
+@@ -140,8 +140,11 @@ ifeq ($(TARGET_ARCH),x86_64)
+     CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fcf-protection=branch)
+   endif
    CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fno-jump-tables)
++  CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fno-asynchronous-unwind-tables)
    CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch=thunk-extern)
    CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch-register)
 +  CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mharden-sls=all)
++  CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mfunction-return=thunk-extern)
+ endif
+ 
+ CFLAGS += $(CONDITIONAL_CFLAGS)
+diff --git a/src/nvidia/Makefile b/src/nvidia/Makefile
+index b7ca09b..dc747bd 100644
+--- a/src/nvidia/Makefile
++++ b/src/nvidia/Makefile
+@@ -164,6 +164,8 @@ ifeq ($(TARGET_ARCH),x86_64)
+   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fno-jump-tables)
+   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch-register)
+   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch=thunk-extern)
++  CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mharden-sls=all)
++  CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mfunction-return=thunk-extern)
  endif
  
  CFLAGS += $(CONDITIONAL_CFLAGS)

which changes nvidia-open-gcc-ibt-sls.patch to

diff --git a/src/nvidia-modeset/Makefile b/src/nvidia-modeset/Makefile
index 9ef3c62..a6e3dc7 100644
--- a/src/nvidia-modeset/Makefile
+++ b/src/nvidia-modeset/Makefile
@@ -140,8 +140,11 @@ ifeq ($(TARGET_ARCH),x86_64)
     CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fcf-protection=branch)
   endif
   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fno-jump-tables)
+  CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fno-asynchronous-unwind-tables)
   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch=thunk-extern)
   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch-register)
+  CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mharden-sls=all)
+  CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mfunction-return=thunk-extern)
 endif
 
 CFLAGS += $(CONDITIONAL_CFLAGS)
diff --git a/src/nvidia/Makefile b/src/nvidia/Makefile
index b7ca09b..dc747bd 100644
--- a/src/nvidia/Makefile
+++ b/src/nvidia/Makefile
@@ -164,6 +164,8 @@ ifeq ($(TARGET_ARCH),x86_64)
   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fno-jump-tables)
   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch-register)
   CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch=thunk-extern)
+  CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mharden-sls=all)
+  CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mfunction-return=thunk-extern)
 endif
 
 CFLAGS += $(CONDITIONAL_CFLAGS)

Seems to make objtool happy with respect to IBT,  SLS and RETHUNK.

Last edited by loqs (2022-12-01 23:19:46)

Offline

#16 2022-12-29 17:41:34

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: [SOLVED] 'naked' return found in RETHUNK and more when build....

Hi

abemus patch for the problems with black TTY on kernel 6.x + nvidia

https://gitlab.com/cki-project/kernel-a … uests/1788

any chance for add this patch to arch kernel? @heftig

greetings

EDIT: backported patch

diff --git a/drivers/firmware/sysfb.c b/drivers/firmware/sysfb.c
index 2bfbb05f7d896912712679b9999060a2b04e4685..a504f7234f35289fa8b577f10b570ce25dbf28f3 100644
--- a/drivers/firmware/sysfb.c
+++ b/drivers/firmware/sysfb.c
@@ -34,6 +34,22 @@
 #include <linux/screen_info.h>
 #include <linux/sysfb.h>
 
+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 __init int sysfb_init(void)
 {
 	struct screen_info *si = &screen_info;
@@ -45,7 +61,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;

(if fail to apply, is because the tabs)

EDIT2: not works sad

EDIT3:

FINALLY works with this

https://github.com/NVIDIA/open-gpu-kern … 1363406676
https://github.com/NVIDIA/open-gpu-kern … 1367591000

so, because the nature of the patch, never be implemented on main kernel... ok lets custom kenet until nvidia fix teir driver

greetings and close

Last edited by sl1pkn07 (2022-12-30 02:30:29)

Offline

Board footer

Powered by FluxBB