-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for the S0ix sleep state #6411
Comments
@marmarek I believe this has to do with the current kernel Qubes is using? |
That would not surprise me. R4.1 has several advantages here, including being able to include multiple kernels in the install ISO. |
@DemiMarie, does that mean R4.1 will support Tiger Lake? Sorry if I'm being obtuse. |
@e6lk7dqzm83p that’s a question that @marmarek would be better positioned to answer, sorry. |
No problem; I appreciate the insight! |
I believe this is close related to #5374, which this time is more about Xen than Linux. @e6lk7dqzm83p do you see some specific error message? |
Apologies, I do not. I was talking to System76 about about their Qubes support with the newer chipsets and was informed that Tiger Lake was not currently supported due to a kernel issue (I'm trying to ensure Qubes support before I purchase my new computer). I was trying to see what the status of that issue was and couldn't find any documentation here so I opened the request. Sorry if that was in error/off protocol. |
Generally, for Intel systems >=10th gen I'd recommend trying Qubes 4.1. Some may work with Qubes 4.0.x too, but backporting some of the hardware support parts (especially on Xen part) is impractical. |
This fixes "IO-APIC + timer doesn't work!" boot crash Fixes QubesOS/qubes-issues#6372 Fixes QubesOS/qubes-issues#5374 Related to QubesOS/qubes-issues#6411
Any chance of seeing a new testing release of 4.1 built soon? The last one I know of in the repo is 6+ months old, especially with the HPET fix just landed, it'd be great to have an updated installer. |
Managed to find https://openqa.qubes-os.org/group_overview/1 Not documented anywhere that I can find, but it does appear to be the output of the automated build system from time to time. Last build for 4.1 was ~7 days ago, won't contain these fixes, and failed. What is the current channel for getting the latest 4.1 iso, if any other than this or the kernel.org mirrors? |
openQA is the right place for looking for test builds. But note the CI system is not a trusted build environment, so do not use those builds for anything else than testing. |
@marmarek when I tested TGL system76 hardware with qubes 4.0 I was able to boot it via modification of the coreboot firmware. Checkout this patch: system76/coreboot#42 |
Sadly, not. |
I wonder if we should reconsider staying on a single Xen version for an entire release. This leads to rather awkward hardware support problems. Does Xen 4.15 support s0ix? |
No, and I'm just learning how absurdly unfriendly to virtualization power management on newest Intel platform is. |
Initial version (the thing discussed in the last few comments) is merged and available in current-testing repository.
Then, the feature is opt-in. To use it, you need to:
Ensure The system is expected to sleep about 90% of the time (not 100% as native Linux does on some systems), which will affect how long it will stay suspended on battery. We will work on the remaining 10%, but in the meantime it is what it is. |
Many thanks for working on this. I have tried it on my HP 845 G10 with a Ryzen 7840U (similar platform as the framework 13) . These is my environment:
I do not have the sys dir The power consumption in suspend did not change after the process of updating qubes-core-agent, qubes-core-dom0, enabling the qvm feature and rebooting. What should be the result of these changes? Suspend was working before even though s2idle was reported in As I said I was using the latest kernel before because in March I have reported here that the power consumption in suspend with Qubes OS was 3.6 Watt, but now it is measured on the AC adapter between 2.78 and 2.86 Watt. Let me know what else is relevant or if I should test something. |
The current iteration focuses on Intel. AMD might get some improvements as a "side effect", but no promises...
AMD has it somewhere else, check
The main expected result is that system can suspend and successfully wakeup. The secondary effect should be that suspended system uses ~90% less power than non-suspended one. So, if I understand correctly, you get the first one (even before this update), but not the second one. |
Yes, true, that does exists and it has an When I check the same value on another Ryzen system with a regular Linux distribution it reports quite high values, so I guess s0ix sleep state is not really supported yet on Xen with AMD cpus but I was wondering what kind of suspend is then used in QubesOS?
Yes, the amd_s2idle.py script reports some MSR related issue. And of course it complains about missing Thunderbold support, but I have commented out the check.
That is correct, suspend and resume was working after I have removed the USB 4 entries from sys-usb. |
Another data point: HP EliteBook 1040 G9 Note the laptop has Mediatek LTE modem (14c3:4d75) that gave quite a bit of troubles with suspend, even on native Linux, but a recent-ish firmware update made it work. It was left in dom0 for this test (attached to its proper driver: mtk_t7xx), but the interface was down. This may or may not matter for this test. |
@marmarek: is it possible to disable the modem in firmware? |
And libvirt and stubdom, but just enabling current-testing and updating should get all you need.
All the time values there are in µs (10**-6 seconds). |
Thanks for testing. That's a 12th gen Core i, based on a quick online search, right?
Can you test with leaving the xHCI controller for the Thunderbolt ports assigned to dom0 and handled by the xhci driver there. |
That sounds like you are using suspend to idle, but just don't get S0ix low power mode residency. A bit simplified: With S3 the OS requested from the firmware to put the system in the suspend mode. On the other hand with S0ix the OS needs to put all devices in their required low power state via the devices' drivers and then let the CPU idle. The power management controller of the CPU/chipset/SoC will then detect that all requirements for the lower power states (S0ix) are met and put the system in it. But if for some reason the requirements are not met the system will just idle, until it gets a wakeup and resumes. As noted for the moment we will first focus on Intel systems. If you want to debug your AMD system, the first thing I would check if the CPU reaches it's lowest package C-state and getting all MSR access allowed that's needed for AMD's pmc debug output.
Just FYI: The part needed for correct wakeup (at least on the tested Intel systems), was already merged earlier than the test, see QubesOS/qubes-linux-kernel#826 |
qubes-core-dom0 has versioned dependencies on them
yes
No improvement.
Yes. Doesn't help. |
Thanks for working on this, I have tried it on my Thinkpad X1 Carbon Gen 12, so far it looks like suspend is functioning correctly, including all usb devices and network devices(including LET devices) keyboards, mice, etc. after waking up. |
rk on the remaining 10%, but in the meantime it is what it is. The amount of time the system was in the proper suspend state can be seen in
Same machine here, but I'm curious if @slchris is getting residency values above zero. I am not, however suspend seems to work (slow breathing blinken lights). @marmarek I'm not sure if the PCI backend suspend not enabled messages are expected from dom0 dmesg. But I have pulled all NMI devices from sys-usb/net and remaining devices are USB controllers and WIFI respectively. Followed all remaining steps quoted.
Substate requirements:
|
@scsich is the requirements file dump after suspend? if so, it didn't really suspended... the thing that ultimately matter is how much power it uses in this state, with S0ix the blinking LED is even less reliable indicator of that than it was before :/ |
It is the various internal power meter values you want to monitor in the Note that your exact platform values, provided monitor endpoints, and accuray may vary -- I would also recommend referring to the |
Just as a heads up. I know that you are not working on AMD systems yet, but it seems that enabling I did not debug it yet, because I just realized it. I have enabled But what I realized now is that if you suspend, that sys-usb loses all the USB devices, like the webcam or externally connected. At least they are not shown in the UI anymore. If I restart Initially I thought it was related to the latest kernel, but the same happened even with the stable kernel. Let me know if you need any data, but since you are not working on AMD yet and it should be easily reproducible with the Framework 13, this is more a heads up to not enable the option by default or add a hardware recognition. |
I'm running on Intel Raptor Lake, sleep doesn't work for me. In fact, it seems VMs don't sleep at all now. Waking from sleep my USB-peripherals all work immediately, without confirmingattachment. my setup:
I detached all but a generic USB-controller from sys-usb and furthermore tried sleeping after manually shutting down sys-usb and sys-net. Reading |
Check also `/sys/power/mem_sleep` if it has s2idle set.
If that isn't it, take a look at the substate_requirements file in
pmc_core sysfs dir - it should have hints why it didn't work.
…--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
|
sorry, yes, s2idle is set:
substate_requirements (sorry, can't interpret any of this):
|
Another datapoint: HP EliteBook 650 G9 i5-1235U With S3 sleep - all the same symptoms as marmarek has with 1040 G9 (so S3 not working at all in Windows/Linux/Qubes) The strange thing is, that /sys/kernel/debug/pmc_core/substate_residencies and substate_requirements does not even list S0i3 state for me:
Also these counters are zero after 60 minutes suspend. Also all requirements for the lonely S0i2.0 state are "Required", and the last column Status is all empty. But the system suspends, led is blinking and wakes up without a problem. Edit: Actually there is a problem as after the wakeup the network doesn't work anymore. In the sys-net console there are some errors from iwlwifi (RFIm is deactivated, reason = 4) and e1000e (Failed to disable ULP). Maybe they are not errors, but notifications that devices are going to sleep. Nevertheless, network icon in the tray is red and unclickable after suspend. Also in sys-usb there are a lot of errors Edit2: Sorry, I have had Thunderbolt 4 NHI and USB devices attached to sys-usb, but I have removed them already. The situation is still the same even with the current-testing kernel-latest and kernel-latest-qubes-vm 6.9.4-1 - the system seems does not sleep for real, even when the power led slowly blinks, so residency is zero and the laptop stays hot. I also get the "Backend-side device suspend not enabled" errors from xen_pciback. |
The `substate_requirements` file lists what is required for each state,
but also in the final column what requirements were actually met. Empty
means they weren't...
…--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
|
So here are my logs after suspend:
After suspend the network tray icon is red and if I try to restart the sys-net (I shutdown the sys-firewall first) it errors out after about a minute
And if I reboot Qubes after that it is waiting very long time on |
If S0ix isn't explicitly enabled, default to S3. This means also writing 'deep' to /sys/power/mem_sleep (some systems defaults to s2idle nowadays). Try to not override user choice done via mem_sleep_default= kernel option (if 'enable-s0ix' is not set). At some point, S0ix will be automatically enabled if hardware expects it, but it isn't this time yet. QubesOS/qubes-issues#6411
If S0ix isn't explicitly enabled, default to S3. This means also writing 'deep' to /sys/power/mem_sleep (some systems defaults to s2idle nowadays). Try to not override user choice done via mem_sleep_default= kernel option (if 'enable-s0ix' is not set). At some point, S0ix will be automatically enabled if hardware expects it, but it isn't this time yet. QubesOS/qubes-issues#6411 (cherry picked from commit 9c2405a)
Current status
Initial support of S0ix is available for testing; see #6411 (comment).
Editor's note: The original issue description below is somewhat out-of-date. This issue is now narrowly focused on support for the S0ix sleep state (aka "Modern Standby," "Low Power S0 Idle," "InstantGo," "Connected Standby," etc.) found in newer CPUs (especially Tiger Lake and later).
The problem you're addressing (if any)
It appears Qubes does not support Intel's latest version of processors.
Describe the solution you'd like
Support for Intel's latest version of their processors (i.e., tiger lake)
Where is the value to a user, and who might that user be?
People who want to benefit from the significant performance upgrades of Tiger Lake
Describe alternatives you've considered
N/A
Additional context
N/A
Relevant documentation you've consulted
N/A (I've checked GitHub for any open issues on this but either I've missed it or my SearchFu is weak)
Related, non-duplicate issues
N/A
The text was updated successfully, but these errors were encountered: