You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I spent some effort to enable KVM for Linux on Surface Pro X but didn't succeed so far.
Maybe this deserves its own issue.
By default Linux boots in Exception Level 1 (Supervisor Level).
In order to enable KVM, Linux must execute in Exception Level 2 (Hypervisor Level).
My guess is that the UEFI Firmware is configured to boot every image (Windows Bootloader, USB Media, etc) in exception level 1.
However Windows for ARM includes a functional Hyper-V (which requires execution in EL2).
There must be a channel to unlock instruction execution in EL2.
The boot procedure on Surface Pro X looks similar to x86_64.
UEFI FIRWMARE -> bootmgrfw.efi -> winload.efi -> hvloader.dll ...
_xeroxz describes it here https://git.back.engineering/_xeroxz/Voyager
There is a lot of assumption below:
The first method to execute arbitrary code in EL2 would to via a synchronous exception call to EL2 (HVC). Instruction address can be passed via general purpose register. This require a specific exception handler at EL2 which branches to the instruction address.
The second method is similar to the first but via the secure monitor in EL3 (hvc)
I see a lot of hvc and smc calls from hvloader.dll in Ghidra however Windows does not provide public symbols for hvloader.dll, which complicate its reverse engineering .
UEFI firmware
Edit: A good starting point would be to dump the content of the exception tables in EL3 and EL2.
However this can not be done from EL1 because VBAR_EL2,3 can't be accessed from EL1.
I will see if this can be extracted from a UEFI firmware update and analyze them offline
Thanks for your contribution to making Linux usable on SPX.
I have no experience in making Adreno GPU work in Linux, can you provide more detailed steps to guide us.
Currently, I installed the xf86-video-freedreno package in Arch Linux ARM and face a problem:
Xorg.0.log: NO msm DRM/KMS, fallingback to fbdev/kgsl
GUI can show up without freedreno -> no GPU acceleration.
The kernel was compiled using spx/next-20220607 branch/ and boot up with DT.
Can you post a full dmesg log? Also what's the putput of ls -l /sys/class/drm?
In terms of user-space software, I only explicitly installed mesa (next to gnome on Arch, which may have pulled in some other dependencies). I haven't tried with xorg yet (only Wayland), but that shouldn't really make a difference.
There are no files under /sys/class/drm directory. My SPX cannot connect to the internet via a USB ethernet port, that's a bit hard to post the log. I will try to use mesa driver to see if anything will work.
That means that no devices (that have drivers) wait on other drivers to load. I can't seem to find any reference to pretty much anything GPU related in your dmesg log. Can you post your kernel config?
Set this up yesterday, finished setting up hyprland today. This rocks man! A few things still not working but this is to be expected with what is ultimately a niche device to want to have Linux on. Never mind the the hoops to get everything that is working working! Thank you, this breaths new life into my little machine.
The last thing to do to make this perfect is to figure out how to get iptsd to start via a udev rule. I applied the one from the repo, along with the unit file. Udev rules are a bit of a mystery for me, I tend to get them working and it isn't an issue until I have to setup a new system. I have to be missing something silly.
I am able to get this to run manually by simply using this run line sudo iptsd $( sudo iptsd-find-hidraw) and it works as you would expect. Alas the udev rules do not run, and I am not entirely sure why just yet.
If you have an idea, thanks! If you need more info, no problem. If you are unable to help, also ok, I will update if I figure it out.
$ sudo iptsd-find-hidraw
[10:16:55.752] [warning] iptsd-find-hidraw is deprecated, please use iptsd-foreach
/dev/hidraw0
To the udev rule. iptsd-check-device exits with a 0 if the device is the hidraw we are after and a 1 if not. The udev rule appears to be checking every single hidraw${N} in /dev/ and should only attempting to start the service for a good device.
eg via journalctl
hidraw4: Process '/usr/bin/iptsd-check-device --quiet /dev/hidraw4' failed with exit code 1.
The provided udev rule appears to be trying and failing to find the device before launching hyprland. I do not have it booting into a graphical login.
hidraw0: Process '/usr/bin/iptsd-check-device --quiet /dev/hidraw0' failed with exit code 1.
If ran manually after starting a wayland session, in this case hyprland, it looks like it should have worked just fine.
/dev/hidraw0 is an IPTS device!
$ sudo /usr/bin/iptsd-check-device /dev/hidraw0
[10:24:01.548] [info] Loading config /etc/iptsd.conf.
[10:24:01.548] [info] Connected to device 045E:0C21
[10:24:01.548] [info] Running in Touchscreen mode
[10:24:01.548] [info] /dev/hidraw0 is an IPTS device!
# Another hidraw device for good measure.
$ sudo /usr/bin/iptsd-check-device /dev/hidraw4
[10:24:04.209] [error] ipts: /dev/hidraw4 is not an IPTS device!
I expect the issue may be with when the rule is triggered, because the command will exit with an error if I try it from a tty. Going to play with attempt to adjust how it is triggered, and see if it can be triggered when wayland starts.
On a side note about the unit file. I have tried manually running the unit file but was finding it would kill the process immediately. I had started to remove parts to see if any particular setting was an issue. Removing the BindTo directive in the unit file seems to keep it running. Not sure why yet as the device exists. The %i is the escaped device path eg dev-hidraw0 in this case, and my understanding is that should be correct.
I am an idiot, the rule was never triggering unless I manually ran udevadm trigger manually, and had mistaken the few instances in journalctl's output as had happened during boot.
Will have to tackle the triggering issue later. For now going to trigger via udevadm.
To your point, good idea. I cannot output to standard out because the output is used as the value for $result. Redirecting the output to a file is the way here. I modified the udev rule to be the following
/dev/hidraw0
[20:12:17.358] [error] core: linux: IOCTL 3229108231 failed: No such device
/dev/hidraw2
/dev/hidraw1
[23:59:26.861] [error] ipts: /dev/hidraw2 is not an IPTS device!
[23:59:26.861] [error] ipts: /dev/hidraw1 is not an IPTS device!
/dev/hidraw3
[23:59:26.872] [error] ipts: /dev/hidraw3 is not an IPTS device!
/dev/hidraw4
[23:59:26.971] [error] ipts: /dev/hidraw4 is not an IPTS device!
/dev/hidraw4
[23:59:27.024] [error] ipts: /dev/hidraw4 is not an IPTS device!
Interesting result, it appears hidraw0 is not found at all when ran by a udev rule. Has to be a funky permission issue. Ultimately also may be why the job is not triggering. Going to shove a whoami into that and see if it isn't root tomorrow.
Thanks again, I think you have me pointed in the correct direction here.
:edit: The rules are running as root, guess it is not a permissions issue. Will continue to dig.
Hmm, if triggering it manually late after boot still doesn't work then it shouldn't be a driver initialization issue. Maybe you can ask on the IPTSd repo directly, @StollD might have a better idea about what could be going wrong.
Hi, this is fantastic! I managed to get arch running smoothly on my SPX but there is one thing I just cannot get working which is Bluetooth. I've followed the wiki and have all firmware installed. Using bluetoothctl I'm not able to see the controller. Any pointers as to what else I need to do?
Hi, this is fantastic! I managed to get arch running smoothly on my SPX but there is one thing I just cannot get working which is Bluetooth. I've followed the wiki and have all firmware installed. Using bluetoothctl I'm not able to see the controller. Any pointers as to what else I need to do?
hi there, after a long and frustrating month i managed to install arch onto my spq1!
however, i am having issues with the sound and bluetooth. i get dummy output for sound and for bluetooth even though i see it i cant get it to connect.
it also appears as though i have problems with the graphics card as with some apps i get the scrambled colours.
Hello there.. is it at all possible for someone to give me an image they made or build me a working image to use.. while arch is not my first choice i would very much enjoy using linux on my device with the current state of windows and cannot find any images on the internet, i do not wish to build my own if possible
Activity
jhaxhiaj commentedon Jun 7, 2022
I spent some effort to enable KVM for Linux on Surface Pro X but didn't succeed so far.
Maybe this deserves its own issue.
By default Linux boots in Exception Level 1 (Supervisor Level).
In order to enable KVM, Linux must execute in Exception Level 2 (Hypervisor Level).
My guess is that the UEFI Firmware is configured to boot every image (Windows Bootloader, USB Media, etc) in exception level 1.
However Windows for ARM includes a functional Hyper-V (which requires execution in EL2).
There must be a channel to unlock instruction execution in EL2.
The boot procedure on Surface Pro X looks similar to x86_64.
UEFI FIRWMARE -> bootmgrfw.efi -> winload.efi -> hvloader.dll ...
_xeroxz describes it here https://git.back.engineering/_xeroxz/Voyager
There is a lot of assumption below:
The first method to execute arbitrary code in EL2 would to via a synchronous exception call to EL2 (HVC). Instruction address can be passed via general purpose register. This require a specific exception handler at EL2 which branches to the instruction address.
The second method is similar to the first but via the secure monitor in EL3 (hvc)
I see a lot of
hvcandsmccalls from hvloader.dll in Ghidra however Windows does not provide public symbols for hvloader.dll, which complicate its reverse engineering .UEFI firmware
Edit: A good starting point would be to dump the content of the exception tables in EL3 and EL2.
However this can not be done from EL1 because VBAR_EL2,3 can't be accessed from EL1.
I will see if this can be extracted from a UEFI firmware update and analyze them offline
qzed commentedon Jun 7, 2022
Feel free to open a new issue for that! Unfortunately, this is something I know practically nothing about. But having KVM support would be awesome.
liuyishengalan commentedon Jun 12, 2022
Thanks for your contribution to making Linux usable on SPX.
I have no experience in making Adreno GPU work in Linux, can you provide more detailed steps to guide us.
Currently, I installed the xf86-video-freedreno package in Arch Linux ARM and face a problem:
Xorg.0.log:
NO msm DRM/KMS, fallingback to fbdev/kgslGUI can show up without freedreno -> no GPU acceleration.
The kernel was compiled using spx/next-20220607 branch/ and boot up with DT.
qzed commentedon Jun 12, 2022
Can you post a full dmesg log? Also what's the putput of
ls -l /sys/class/drm?In terms of user-space software, I only explicitly installed
mesa(next tognomeon Arch, which may have pulled in some other dependencies). I haven't tried with xorg yet (only Wayland), but that shouldn't really make a difference.liuyishengalan commentedon Jun 12, 2022
There are no files under
/sys/class/drmdirectory. My SPX cannot connect to the internet via a USB ethernet port, that's a bit hard to post the log. I will try to use mesa driver to see if anything will work.qzed commentedon Jun 13, 2022
In that case, I don't think mesa will work either. Does
/sys/bus/platform/devices/2c00000.gpuexist?liuyishengalan commentedon Jun 13, 2022
2c00000.gpu does exist.
qzed commentedon Jun 13, 2022
Do you have an SQ1 or SQ2? Also at this point I think we need a dmesg log.
liuyishengalan commentedon Jun 13, 2022
SQ1 dmesg info
qzed commentedon Jun 13, 2022
Okay, so might be a difference between SQ1 and SQ2. What about
cat /sys/kernel/debug/devices_deferred?liuyishengalan commentedon Jun 13, 2022
/sys/kernel/debug/devices_deferredis a blank fileqzed commentedon Jun 13, 2022
That means that no devices (that have drivers) wait on other drivers to load. I can't seem to find any reference to pretty much anything GPU related in your dmesg log. Can you post your kernel config?
liuyishengalan commentedon Jun 13, 2022
The config I used is spx-5.19.rc1-arch.config
24 remaining items
matterhorn103 commentedon Jan 16, 2024
Ah, that does seem like a quite a lot of hoops still yeah...
superxkooda commentedon Mar 11, 2025
Set this up yesterday, finished setting up hyprland today. This rocks man! A few things still not working but this is to be expected with what is ultimately a niche device to want to have Linux on. Never mind the the hoops to get everything that is working working! Thank you, this breaths new life into my little machine.
The last thing to do to make this perfect is to figure out how to get iptsd to start via a udev rule. I applied the one from the repo, along with the unit file. Udev rules are a bit of a mystery for me, I tend to get them working and it isn't an issue until I have to setup a new system. I have to be missing something silly.
and the unit file looks like the following:
I am able to get this to run manually by simply using this run line
sudo iptsd $( sudo iptsd-find-hidraw)and it works as you would expect. Alas the udev rules do not run, and I am not entirely sure why just yet.If you have an idea, thanks! If you need more info, no problem. If you are unable to help, also ok, I will update if I figure it out.
qzed commentedon Mar 11, 2025
Does running
iptsd-check-devicemanually work? I guess ifiptsd-find-hidrawworks it should...superxkooda commentedon Mar 12, 2025
iptsd-find-hidrawappears to be depreciated.To the udev rule.
iptsd-check-deviceexits with a 0 if the device is the hidraw we are after and a 1 if not. The udev rule appears to be checking every single hidraw${N} in /dev/ and should only attempting to start the service for a good device.eg via journalctl
The provided udev rule appears to be trying and failing to find the device before launching hyprland. I do not have it booting into a graphical login.
If ran manually after starting a wayland session, in this case hyprland, it looks like it should have worked just fine.
without the quiet option
I expect the issue may be with when the rule is triggered, because the command will exit with an error if I try it from a tty. Going to play with attempt to adjust how it is triggered, and see if it can be triggered when wayland starts.
On a side note about the unit file. I have tried manually running the unit file but was finding it would kill the process immediately. I had started to remove parts to see if any particular setting was an issue. Removing the BindTo directive in the unit file seems to keep it running. Not sure why yet as the device exists. The %i is the escaped device path eg dev-hidraw0 in this case, and my understanding is that should be correct.
qzed commentedon Mar 12, 2025
Can you try removing
--quietoption? Any chance it could be a permission error (e.g., udev not running iptsd-check-device as root)?superxkooda commentedon Mar 13, 2025
I am an idiot, the rule was never triggering unless I manually ran
udevadm triggermanually, and had mistaken the few instances in journalctl's output as had happened during boot.Will have to tackle the triggering issue later. For now going to trigger via udevadm.
To your point, good idea. I cannot output to standard out because the output is used as the value for $result. Redirecting the output to a file is the way here. I modified the udev rule to be the following
The output in /tmp/iptsd.rule.out
Interesting result, it appears hidraw0 is not found at all when ran by a udev rule. Has to be a funky permission issue. Ultimately also may be why the job is not triggering. Going to shove a whoami into that and see if it isn't root tomorrow.
Thanks again, I think you have me pointed in the correct direction here.
:edit: The rules are running as root, guess it is not a permissions issue. Will continue to dig.
qzed commentedon Mar 13, 2025
Hmm, if triggering it manually late after boot still doesn't work then it shouldn't be a driver initialization issue. Maybe you can ask on the IPTSd repo directly, @StollD might have a better idea about what could be going wrong.
superxkooda commentedon Mar 18, 2025
Thank you, I will to do that. Much appreciated.
almenscorner commentedon Jul 27, 2025
Hi, this is fantastic! I managed to get arch running smoothly on my SPX but there is one thing I just cannot get working which is Bluetooth. I've followed the wiki and have all firmware installed. Using
bluetoothctlI'm not able to see the controller. Any pointers as to what else I need to do?denysvitali commentedon Jul 27, 2025
See #47
jglathe commentedon Jul 27, 2025
Hmm on sc8280xp I have a default MAC address set by the dt to avoid issues bringing up the BT host controller.
Maybe something similar?
denysvitali commentedon Jul 27, 2025
Yes, it's the same issue
almenscorner commentedon Jul 28, 2025
I just reinstalled firmware and it popped up in bluez without issues. Maybe I poked around to much
gibfesta commentedon Nov 20, 2025
hi there, after a long and frustrating month i managed to install arch onto my spq1!
however, i am having issues with the sound and bluetooth. i get dummy output for sound and for bluetooth even though i see it i cant get it to connect.
it also appears as though i have problems with the graphics card as with some apps i get the scrambled colours.
any thoughts on this?
thanks
McGeoMetro0045 commentedon Feb 21, 2026
Hello there.. is it at all possible for someone to give me an image they made or build me a working image to use.. while arch is not my first choice i would very much enjoy using linux on my device with the current state of windows and cannot find any images on the internet, i do not wish to build my own if possible