Skip to content

Instantly share code, notes, and snippets.

@KeyofBlueS
Last active November 20, 2022 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KeyofBlueS/20a659c6bef7ceff2873e60b1eb6debb to your computer and use it in GitHub Desktop.
Save KeyofBlueS/20a659c6bef7ceff2873e60b1eb6debb to your computer and use it in GitHub Desktop.
Disable intel c-state c1e in intel_idle driver for Debian and Debian-installer. Disable intelppm service in Windows, Windows Recovery and Windows Installer.

Disable intel c-state c1e in intel_idle driver for Debian and Debian-installer.

Disable intelppm service in Windows, Windows Recovery and Windows Installer.

Author: KeyofBlueS

I thought to make a script to automate the process, but maybe it's better to just write a step by step tutorial.

When you use an intel cpu with LGA 771 socket (e.g. an Intel Xeon E5450) in a LGA 775 socket via sticker mod, often you need to disable intel c-state c1e in BIOS, otherwise you could get a very laggy os, or worst, stuck at the very initial os booting time. This can happen with any os such as Debian, Windows ecc...

Unfortunately BIOSes often lack the option to disable intel c-state c1e.

A workaround is to disable c-states at os level.

Debian

With Debian, and potentially any Linux distro that uses grub bootloader, it's easy as just passing the kernel option intel_idle.states_off=4 to grub (please do a research on how to set kernel parameters if you use a different distro/bootloader).

note: From the documentation of intel_idle driver, intel_idle.states_off seems to be the preferred way to disable idle states. If it doesn't work for you, try with intel_idle.max_cstate=1 instead.

Debian os

  • At boot time:

When grub starts, select an entry with the arrow keys and press e to edit it.

Go down to the line that starts with linux. At the end of this line add intel_idle.states_off=4, e.g.:

linux /boot/vmlinuz-6.0.8-amd64 root=UUID=7547945h-579d-254f-4510-7c8r7a6d4378 ro quiet intel_idle.states_off=4

Then press F10 or CTRL+X to boot the selected entry.

This is just a temporary change that will permit you to boot in the os.

  • Make the change permanent:

Method 1

If your distro has the ability to source local grub cfg files, this method is recommended, as the changes will survive grub upgrades.

When the os booted up, add the file /etc/default/grub.d/intel_idle_states_off.cfg as root. Here we'll use nano text editor:

sudo nano /etc/default/grub.d/intel_idle_states_off.cfg

Add the following line:

GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX intel_idle.states_off=4"

Now press CTRL+O then ENTER to save the file and CTRL+X then ENTER to exit.

Then update grub config:

sudo update-grub

Method 2

WARNING: grub upgrades could overwrite this configuration (however the user is asked whether to keep the current configuration or use the new one). In this case you need to do this step again before rebooting, otherwise you'll need to start from At boot time step.

When the os booted up, edit the file /etc/default/grub as root. Here we'll use nano text editor:

sudo nano /etc/default/grub

Go down to the line that starts with GRUB_CMDLINE_LINUX. At the end of this line add intel_idle.states_off=4, e.g.:

GRUB_CMDLINE_LINUX="intel_idle.states_off=4"

Now press CTRL+O then ENTER to save the file and CTRL+X then ENTER to exit.

Then update grub config:

sudo update-grub

Done.

Debian Installer

If you need to install Debian from scratch, you must set the kernel parameter intel_idle.states_off=4 in debian-installer too.

Once the debian-installer starts, at the installer menu, select an entry with the arrow keys, then press the TAB key to get an editable line at the very bottom of the screen.

At the end of this line add intel_idle.states_off=4, e.g.:

/install.amd/vmlinuz vga=788 initrd=install.amd/gtk/initrd.gz --- quiet intel_idle.states_off=4

Then press ENTER to boot the selected entry.

Done.

Windows

note: The following tutorial was tested with Windows 10 only.

With Windows it's a bit more complicated. If you are lucky enough to access the Windows os, just run regedit as administrator and edit the following value:

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Intelppm\Start

from 3 to 4, this will disable intelppm service in Windows.

note: In some tutorials you will find CurrentControlSet, not ControlSet001. In my system is ControlSet001.

However, if you get's stuck, like me, at booting time, there is a way to workaround this.

On the same machine in wich Windows is, you need to boot a Linux distro with chntpw, wimtools, fuse and ntfs-3g packages available. I have a dual boot setup with Debian Sid and Windows 10, so it was easy for me.

You could try with a Debian Live in which you must set the kernel parameter intel_idle.states_off=4, otherwise you could get stuck there too:

note: From the documentation of intel_idle driver, intel_idle.states_off seems to be the preferred way to disable idle states. If it doesn't work for you, try with intel_idle.max_cstate=1 instead.

Once at the Debian Live Main Menu, select an entry with the arrow keys, then press the TAB key to get an editable line at the very bottom of the screen.

At the end of this line add intel_idle.states_off=4, e.g.:

.linux /live/vmlinuz-5.10.0-18-amd64 initrd=/live/initrd.img-5.10.0-18-amd64 boot=live components splash quiet intel_idle.states_off=4

Then press ENTER to boot the selected entry.

Start with installing the tools:

Once your Linux distro booted up, open a terminal, update the packages list and install the tools:

sudo apt update
sudo apt install chntpw wimtools fuse ntfs-3g

Windows os

Now mount the Windows partition. In this example we will mount a Windows ntfs partition.

Create the mountpoint for the Windows ntfs partition:

sudo mkdir -p /mnt/win

Identify the ntfs partition:

sudo fdisk -l | grep -i ntfs

The output should be something like:

/dev/sdf4 * 211814400 500117503 288303104 137,5G 7 HPFS/NTFS/exFAT

So we will assume /dev/sdf4 is the Windows partition.

Check and eventually fix the partition with:

sudo ntfsfix /dev/sdf4

Mount it with:

sudo mount -t ntfs-3g /dev/sdf4 /mnt/win/

Start reged pointing to Windows registry hive SYSTEM:

sudo reged -e /mnt/win/Windows/System32/config/SYSTEM

Now we will edit the Windows registry. In reged prompt give (please remember ControlSet001 could ever be CurrentControlSet):

ed ControlSet001\Services\intelppm\Start

and when asked to enter a new value, insert 4, this will disable intelppm service in Windows. Then give q to quit and answer y to commit changes to registry.

$ sudo reged -e /mnt/win/Windows/System32/config/SYSTEM
reged version 0.1 140201, (c) Petter N Hagen
Simple registry editor. ? for help.

> ed ControlSet001\Services\intelppm\Start
EDIT: <ControlSet001\Services\intelppm\Start> of type REG_DWORD (4) with length 4 [0x4]
DWORD: Old value 3 [0x3], enter new value (prepend 0x if hex, empty to keep old value)
-> 4
DWORD: New value 4 [0x4], 
> q

Hives that have changed:
 #  Name
 0  </mnt/win/Windows/System32/config/SYSTEM>
Commit changes to registry? (y/n) [n] : y
 0  </mnt/win/Windows/System32/config/SYSTEM> - OK 

WARNING: Windows updates could reset the registry key Start value for intelppm without any advice, you will only notice at the next boot when you get a very laggy os or stuck at the very initial os booting time. In this case you'll need to do this whole process again.

Done. if you unmount the Windows partition and reboot to Windows, it should work fine. But I advice you to do an additional step, please go ahead reading.

Windows Recovery

If for some reason you need, or Windows decide (!) to boot in recovery mode, you'll be stuck again. Windows Recovery is a separate os and it doesn't follow the main os registry. So we will need to edit Windows Recovery's registry too.

While the Windows partition is still mounted from the previous step, create the mountpoint for the Windows Recovery image:

mkdir -p "$HOME/win_re"

Mount the Windows recovery image with wimmountrw:

wimmountrw /mnt/win/Recovery/WindowsRE/Winre.wim "$HOME/win_re"

Copy the Windows Recovery registry hive SYSTEM in /tmp (had to do this to workaround a permission issue):

cp $HOME/win_re/Windows/System32/config/SYSTEM /tmp

Start reged pointing to Windows Recovery registry hive SYSTEM:

sudo reged -e /tmp/SYSTEM

Now, as before, we will edit the Windows Recovery registry. In reged prompt give (please remember ControlSet001 could ever be CurrentControlSet):

ed ControlSet001\Services\intelppm\Start

and when asked to enter a new value, insert 4, this will disable intelppm service in Windows Recovery. Then give q to quit and answer y to commit changes to registry.

$ sudo reged -e /tmp/SYSTEM
reged version 0.1 140201, (c) Petter N Hagen
Simple registry editor. ? for help.

> ed ControlSet001\Services\intelppm\Start
EDIT: <ControlSet001\Services\intelppm\Start> of type REG_DWORD (4) with length 4 [0x4]
DWORD: Old value 3 [0x3], enter new value (prepend 0x if hex, empty to keep old value)
-> 4
DWORD: New value 4 [0x4], 
> q

Hives that have changed:
 #  Name
 0  </tmp/SYSTEM>
Commit changes to registry? (y/n) [n] : y
 0  </tmp/SYSTEM> - OK 

copy back the Windows Recovery registry hive SYSTEM:

cp /tmp/SYSTEM $HOME/win_re/Windows/System32/config/

Unmount the Windows recovery image with:

wimunmount --commit $HOME/win_re

And now unmount the Windows partition:

sudo umount /mnt/win

Done. Really? yes ...for an already installed Windows.

Windows Installation media

If you need to install Windows from scratch, or access to recovery from an installation media, it's the same story. You need to disable intelppm there too.

First make a usb windows installation media. There are plenty of tutorials on how to do it out there.

To disable intelppm on a windows installation media, the steps are quite similar to disabling it in Windows Recovery. Basically you need to edit boot.wim and install.wim images, but with a slightly difference. These images could contains multiple indexes, so you need to repeat the reged command for every index.

Create the mountpoint for the Windows Installation image:

mkdir -p "$HOME/win_im"

Let's assume your usb windows installation media is mounted in /mnt/usb.

Let's start with boot.wim. Check how many indexes boot.wim has with:

wiminfo /mnt/usb/sources/boot.wim

Let's assume we've found 2 indexes, take note.

Mount the Windows Install boot.wim image with wimmountrw:

wimmountrw /mnt/usb/sources/boot.wim 1 "$HOME/win_im"

where 1 is the index number.

Copy the boot.wmi Windows Install registry hive SYSTEM in /tmp (had to do this to workaround a permission issue):

cp $HOME/win_im/Windows/System32/config/SYSTEM /tmp

Start reged pointing to the boot.wmi Windows Install registry hive SYSTEM:

sudo reged -e /tmp/SYSTEM

Now, same steps as before, we will edit the boot.wmi Windows Install registry hive SYSTEM. In reged prompt give (please remember ControlSet001 could ever be CurrentControlSet):

ed ControlSet001\Services\intelppm\Start

and when asked to enter a new value, insert 4, this will disable intelppm service in Windows Recovery. Then give q to quit and answer y to commit changes to registry.

$ sudo reged -e /tmp/SYSTEM
reged version 0.1 140201, (c) Petter N Hagen
Simple registry editor. ? for help.

> ed ControlSet001\Services\intelppm\Start
EDIT: <ControlSet001\Services\intelppm\Start> of type REG_DWORD (4) with length 4 [0x4]
DWORD: Old value 3 [0x3], enter new value (prepend 0x if hex, empty to keep old value)
-> 4
DWORD: New value 4 [0x4], 
> q

Hives that have changed:
 #  Name
 0  </tmp/SYSTEM>
Commit changes to registry? (y/n) [n] : y
 0  </tmp/SYSTEM> - OK 

copy back the Windows Recovery registry hive SYSTEM:

cp /tmp/SYSTEM $HOME/win_im/Windows/System32/config/

Unmount the Windows recovery image with:

wimunmount --commit $HOME/win_im

Unless you know what you are doing, this procedure must be repeated for every index. Starting from wimmountrw command. This time the index value is 2:

wimmountrw /mnt/usb/sources/boot.wim 2 "$HOME/win_im"

and then proceed until wimunmount --commit $HOME/win_im.

Same thing with install.wim. check how many indexes install.wim has with:

wiminfo /mnt/usb/sources/install.wim

and do the same procedure on it for every index you've found, so:

wimmountrw /mnt/usb/sources/install.wim 1 "$HOME/win_im"

and then proceed until wimunmount --commit $HOME/win_im.

Done. For real now.

@KeyofBlueS
Copy link
Author

KeyofBlueS commented Nov 9, 2022

About this argument i've originally asked for help in www.bios-mods.com, specifically i've opened a new thread in the AMI BIOS Unlocking Requests section of the forum, asking for help, asking if it was possible to unlock the option to disable intel c-state c1e in my bios.

After some day i thought that the issues i was facing could have been caused by my inexperience in updating microcodes in my bios, in order to upgrade my cpu.
I've then opened a thread in the CPU Support Upgrade Requests section of the forum, the appropriate section for asking about microcodes.
The following day i've found out this second thread deleted and a PM from a staff member:
Viewing_PM_Don't_flood_1

What a kind and professional person...

After I replied with the same kindness, but more professional, to that PM:
Viewing_PM_Re_Don't_flood_1

i, then, posted the same question about microcodes in the first original thread (3rd post).
REQUEST _Acer_EG43M_AMI_BIOS_unlock_c1e_option_1
REQUEST _Acer_EG43M_AMI_BIOS_unlock_c1e_option_2
REQUEST _Acer_EG43M_AMI_BIOS_unlock_c1e_option_3

Shortly after, my first thread was merged with another thread in which the topic was about my motherboard and bios (which is right, i should have looked more carefully), but the post about microcodes was missing, i wonder why 👼
REQUEST Acer_EG43M _G43T-AM_BIOS_Unlock_1
REQUEST Acer_EG43M _G43T-AM_BIOS_Unlock_2

Meanwhile i've worked to solve my issues, and finally this tutorial was made.
When i tried to share it in that thread, in order to help other pepole in my same situation, surprise surprise, i knew it... i was suspended 🤣
Suspended

...fun times, fun times indeed.
Great power comes great responsibility, but often power goes to the head.

https://www.bios-mods.com/about-us/

Congratulations bios-mods.com, i can't believe you stooped so low. When before you earned a strong reputation because of your active community and dedicated moderation team, providing BIOS modifications and motherboard support for its users and guests at no charge, provide all modifications and resources at no cost and for free, now you have tyrants staff members who ask for money in private messages:
One_random_staff_member

I know what it means to be a user, a moderator and then an admin of a big community, and it isn't like that. This is your dedicated moderation team? Wow, i wonder if it was not dedicated.
I really wonder what the owners of bios-mods.com think about this, will see. Maybe i'll ask in some other and more appropriate place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment