Explaining Intel Rapid Start Technology
Jul. 2nd, 2013 03:50 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Recent Intel-based systems often implement something called Intel Rapid Start Technology. Like many things with the word "Technology" in the name, there's a large part of this that's marketing. The relatively small amount of technical documentation available implies that it's tied to your motherboard chipset and CPU, but as far as I can tell it's entirely implemented in firmware and could work just as well on, say, a Cyrix on a circa 1996 SIS-based motherboard if someone wrote the BIOS code[1]. But since nobody has, we're stuck with the vendors who've met Intel's requirements and licensed the code.
The concept of IRST is pretty simple. There's a firmware mechanism for setting a sleep timeout. If you suspend your computer and this timeout expires, it'll resume. However, instead of handing control back to the OS, the firmware just copies the entire contents of RAM to a special partition and turns the computer off. Next time you hit the power button, the firmware dumps the partition contents back into RAM and resumes as if nothing had changed. This takes a few seconds longer than resume from S3 but is far faster than resume from hibernation since it starts the moment the system gets power.
At a more technical level, it's a little more complicated. The first thing to know about this feature is that it's entirely invisible unless your hard drive is set up correctly. There needs to be a partition that's at least the size of your system's physical RAM. For GPT systems, this needs to have a type GUID of D3BFE2DE-3DAF-11DF-BA-40-E3A556D89593. For MBR systems, you need a partition type of 0x84[2]. If the firmware doesn't find an appropriate partition then the OS will get no indication that the firmware supports it. Boo.
(The second thing is that it seems like it really does have to be on an SSD, and if you try to do this on spinning media your firmware will ignore it anyway)
If all the prerequisites are in place, an ACPI device with an HID of INT3392 will exist. It has four methods associated with it: GFFS, SFFS, GFTV and SFTV. GFFS returns an integer representing the events that will cause the system to wake up from S3 and suspend to SSD. The system will wake after the timeout expires if bit 0 is set, and will wake when the battery becomes critically low if bit 1 is set. The other bits appear to be unused at the moment[3]. SFFS sets the wakeup events, using the same bit values as GFFS. GFTV returns an integer containing the current wakeup timeout in minutes. SFTV sets it. Values above 1440 (ie, 24 hours) seem to be considered invalid - if I set them the value instead ends up as 10 and the timeout flag gets cleared from the wakeup events field.
I've submitted a patch that adds a sysfs interface for setting these values, and unless anyone objects it'll probably end up in 3.11. There's still the remaining question of how userspace should make use of these, and also how installers should behave when it comes to systems that support IRST. As previously mentioned, there's no obvious indication to the OS that the feature is supported unless the appropriate partition already exists. The easiest way to deal with this is for installers to default to retaining any partitions with the magic IDs, but I'm still looking into whether it's possible to get the firmware to cough up some more information so it can be created automatically even if the drive's entirely blank.
And now, having got this working on a test machine, I just need to split my Thinkpad's swap partition in half and make sure it works here as well. Woo.
[1] Note: I am not going to do this.
[2] Conveniently, the same as the partition type that APM systems used for suspend to disk back when dubstep hadn't been invented yet
[3] At least, if you attempt to set them they get ignored.
The concept of IRST is pretty simple. There's a firmware mechanism for setting a sleep timeout. If you suspend your computer and this timeout expires, it'll resume. However, instead of handing control back to the OS, the firmware just copies the entire contents of RAM to a special partition and turns the computer off. Next time you hit the power button, the firmware dumps the partition contents back into RAM and resumes as if nothing had changed. This takes a few seconds longer than resume from S3 but is far faster than resume from hibernation since it starts the moment the system gets power.
At a more technical level, it's a little more complicated. The first thing to know about this feature is that it's entirely invisible unless your hard drive is set up correctly. There needs to be a partition that's at least the size of your system's physical RAM. For GPT systems, this needs to have a type GUID of D3BFE2DE-3DAF-11DF-BA-40-E3A556D89593. For MBR systems, you need a partition type of 0x84[2]. If the firmware doesn't find an appropriate partition then the OS will get no indication that the firmware supports it. Boo.
(The second thing is that it seems like it really does have to be on an SSD, and if you try to do this on spinning media your firmware will ignore it anyway)
If all the prerequisites are in place, an ACPI device with an HID of INT3392 will exist. It has four methods associated with it: GFFS, SFFS, GFTV and SFTV. GFFS returns an integer representing the events that will cause the system to wake up from S3 and suspend to SSD. The system will wake after the timeout expires if bit 0 is set, and will wake when the battery becomes critically low if bit 1 is set. The other bits appear to be unused at the moment[3]. SFFS sets the wakeup events, using the same bit values as GFFS. GFTV returns an integer containing the current wakeup timeout in minutes. SFTV sets it. Values above 1440 (ie, 24 hours) seem to be considered invalid - if I set them the value instead ends up as 10 and the timeout flag gets cleared from the wakeup events field.
I've submitted a patch that adds a sysfs interface for setting these values, and unless anyone objects it'll probably end up in 3.11. There's still the remaining question of how userspace should make use of these, and also how installers should behave when it comes to systems that support IRST. As previously mentioned, there's no obvious indication to the OS that the feature is supported unless the appropriate partition already exists. The easiest way to deal with this is for installers to default to retaining any partitions with the magic IDs, but I'm still looking into whether it's possible to get the firmware to cough up some more information so it can be created automatically even if the drive's entirely blank.
And now, having got this working on a test machine, I just need to split my Thinkpad's swap partition in half and make sure it works here as well. Woo.
[1] Note: I am not going to do this.
[2] Conveniently, the same as the partition type that APM systems used for suspend to disk back when dubstep hadn't been invented yet
[3] At least, if you attempt to set them they get ignored.
Threat to dm-crypt
Date: 2013-07-03 06:31 pm (UTC)Re: Threat to dm-crypt
Date: 2013-07-03 06:43 pm (UTC)Re: Threat to dm-crypt
From: (Anonymous) - Date: 2013-07-03 07:26 pm (UTC) - ExpandRe: Threat to dm-crypt
From:Re: Threat to dm-crypt
From: (Anonymous) - Date: 2013-07-03 08:07 pm (UTC) - ExpandRe: Threat to dm-crypt
From:Re: Threat to dm-crypt
From: (Anonymous) - Date: 2013-07-05 12:02 am (UTC) - ExpandRe: Threat to dm-crypt
From: (Anonymous) - Date: 2013-07-05 11:55 am (UTC) - ExpandRe: Threat to dm-crypt
From: (Anonymous) - Date: 2013-07-08 03:03 am (UTC) - ExpandRe: Threat to dm-crypt
From: (Anonymous) - Date: 2013-07-03 08:14 pm (UTC) - ExpandRe: Threat to dm-crypt
From: (Anonymous) - Date: 2013-07-04 01:08 am (UTC) - ExpandRe: Threat to dm-crypt
From: (Anonymous) - Date: 2013-07-04 10:13 am (UTC) - ExpandRe: Threat to dm-crypt
From:Re: Threat to dm-crypt
Date: 2013-07-04 05:13 pm (UTC)Also, many SSDs these days have strong encryption tied to your BIOS disk password. Not as safe as dm-crypt, but still decent.
What goes around comes around
Date: 2013-07-03 07:12 pm (UTC)Re: What goes around comes around
Date: 2013-07-04 05:56 am (UTC)Re: What goes around comes around
Date: 2013-07-09 07:24 pm (UTC)Re: What goes around comes around
From: (Anonymous) - Date: 2013-07-09 07:27 pm (UTC) - ExpandRequires SSD?
Date: 2013-07-03 11:08 pm (UTC)Sounds like an effort to goose the sales of SSDs. I can't think of any technical reason that IRST wouldn't work on a spining disk. I can think of a marketing reason, though -- it won't feel so rapid any more.
Re: Requires SSD?
Date: 2013-07-03 11:55 pm (UTC)Re: Requires SSD?
From: (Anonymous) - Date: 2013-07-04 10:34 am (UTC) - ExpandRe: Requires SSD?
Date: 2013-07-04 09:07 am (UTC)Interesting post
Date: 2013-07-04 12:15 am (UTC)You brought up a point relating to trusting your firmware. Since it's probably proprietary, and since it's not possible to trust proprietary stuff, maybe you can get in on the coreboot team and give the world a Free Software BIOS? Wouldn't that be awesome?
The bonus is that you wouldn't have to fight with arbitrary binary code, and you could implement awesome things!
Cheers,
James
Re: Interesting post
Date: 2013-07-04 12:23 am (UTC)Quirks?
Date: 2013-07-04 12:33 am (UTC)Re: Quirks?
Date: 2013-07-04 12:36 am (UTC)Intel Rapid Start Technology
Date: 2013-07-04 06:28 am (UTC)The fujitsu service is telling me that the disk is OK! but they are working on found out why the SSD partition has been disappeared.
Is it possible that this feature (intel rapid start technology) is being glued with the specific board or is it possible that a UEFI setting exist that tells the board the specs of the disk ?
It seems idiotic to me to exist such a connection but its being 3 weeks now and none of the fujitsu technicians cant reply to me on this.
btw This is my second UH572. I had the same problem with the board on the first but they have replaced it as the problem occurred 3 days after the purchase of it
Re: Intel Rapid Start Technology
Date: 2013-07-04 01:59 pm (UTC)Thanks for this!
Date: 2013-07-04 06:54 am (UTC)I have an SSD in my machine that is currently blank while I try to figure out what to use it for. So I think I will leave this enabled for a bit and see how it goes. So far so good.
Unfortunately, the firmware only allows for up to 3 hours before the IRST kicks in. You say that 24 hours is invalid, but does adjustment with your patch allow you to go over the bios listed max at all?
PS D'oh, I got the anti-spam question wrong...
Re: Thanks for this!
Date: 2013-07-04 01:58 pm (UTC)Re: Thanks for this!
From:Re: Thanks for this!
From: (Anonymous) - Date: 2013-07-04 07:56 pm (UTC) - ExpandRe: Thanks for this!
From: (Anonymous) - Date: 2013-07-04 09:43 pm (UTC) - ExpandCritical level
Date: 2013-07-05 03:00 am (UTC)But what is the "critical level"? Can I set this myself, or is it hard coded into the firmware?
Re: Critical level
Date: 2013-07-05 03:10 am (UTC)Re: Critical level
From: (Anonymous) - Date: 2013-07-05 11:24 pm (UTC) - Expandsysfs Patches
Date: 2013-07-05 07:42 am (UTC)Re: sysfs Patches
Date: 2013-07-05 03:08 pm (UTC)Working only with UEFI?
Date: 2013-07-11 11:35 am (UTC)Sorry if this is a stupid question. Does this stuff only work when you boot in UEFI mode, or also with legacy BIOS? Asking because I am using a Samsung laptop, and I am forced booting with legacy BIOS if I want to load the samsung-laptop-module.
Second question, should I create some filesystem on the partition, or it does not matter?
Cheers,
Alessandro
Re: Working only with UEFI?
Date: 2013-07-11 11:53 am (UTC)Re: Working only with UEFI?
From: (Anonymous) - Date: 2013-07-11 11:58 am (UTC) - ExpandRe: Working only with UEFI?
From: (Anonymous) - Date: 2013-07-11 08:55 pm (UTC) - ExpandJust Works
From: (Anonymous) - Date: 2013-07-13 02:50 pm (UTC) - ExpandJust Works
From:Re: Just Works
From:Re: Just Works
From:Re: Just Works
From:Was working with a Medion Akoya i7
Date: 2013-07-15 08:49 am (UTC)The good thing about it is that it is working totally separate from the OS. The bad thing - if you change your RAM size you have to grow the partition!
I have tested it but it wasn't really quicker as normal hibernate and hibernating 8 Gig or more takes a while (~20 seconds). Booting the system from scratch is faster (~10 seconds). So I stick with suspend-to-ram (~1 sec) or just plain boot on SSD anyway.
HP
Testing in other kernels than mainline
Date: 2013-07-21 10:46 pm (UTC)I was anxiously waiting for someone with some insight on this tech to develop some way of setting up the timeout value on linux, thanks a lot!
Since I didn't want to build the whole kernel to test the module, I isolated it and set up a dkms script for it along with some upstart script to set values on boot.
https://kassick@bitbucket.org/kassick/intel-rst.git
(clone and run setup.sh )
I've just installed it on Quantal/3.5.0-31-generic, seems to work fine; I'll keep you posted.
Kassick.
Re: Testing in other kernels than mainline
Date: 2013-07-21 11:06 pm (UTC)Re: Testing in other kernels than mainline
From: (Anonymous) - Date: 2013-07-22 02:21 pm (UTC) - ExpandHow is this anything new?
Date: 2013-09-26 05:36 pm (UTC)Re: How is this anything new?
Date: 2013-09-26 05:38 pm (UTC)Re: How is this anything new?
Date: 2013-09-27 03:20 pm (UTC)This other document I found here: http://software.intel.com/en-us/articles/what-is-intel-rapid-start-technology
Says that the software takes steps to reduce the set of pages that must be saved. Is there an as yet undescribed acpi method to send the bios a memory usage map before entering S3, and it defaults to saving all of system ram under Linux, which would make it slower than software hibernate?
Re: How is this anything new?
Date: 2013-09-27 03:52 pm (UTC)Re: How is this anything new?
From:Re: How is this anything new?
From:Re: How is this anything new?
From:Re: How is this anything new?
From:Re: How is this anything new?
From: (Anonymous) - Date: 2013-10-21 08:28 pm (UTC) - ExpandWorks with rotary disc
Date: 2014-03-07 11:21 am (UTC)I'm rather happy to say that on my brand new laptop, IRST works with a rotating disk. I'm less happy to say that my bios+disk need 80s to save and restore the RAM. I hope I'll find, as PSUSI says above, an . The idea is to suspend to disk using (u)swsusp or TuxOnIce and instead of turning off the computer, just writing the kernel image and a few MB (kB ?) of memory to disk using IRST.
Loïc
Re: Works with rotary disc
Date: 2014-03-07 01:25 pm (UTC)Loïc
Small question about performance of IRS
Date: 2014-08-19 12:03 am (UTC)first of all, thanks for this.
I have a small question. Is this faster than a normal hibernation for you?
I'm asking because a manual hibernation is way faster for me. My laptop takes a while to write the image into the IRS partition, something like 20 seconds, and the same amount of time to write it back in RAM on resume. I also noticed that it doesn't depend on how much RAM I'm using, unlike the normal hibernation, which in the same conditions allows me to resume the laptop in 10 seconds (including bootloader etc).
Is there a difference for you between this Intel Rapid Start hibernation and a regular hibernation? To me it looks like that the firmware simply copies the whole RAM, no matter what.
Thanks again.
Re: Small question about performance of IRS
Date: 2014-08-21 09:01 pm (UTC)I think the firmware writes into the partition all the non-zero bytes in RAM.
Manually zeroing the free RAM considerably improves the speed.