A laptop that can withstand coreboot and QubesOS

I am using coreboot installed on x230. After installing coreboot, my laptop started heating up abnormally. I tried reapplying the CPU grease, but I reached the limit, so I decided to buy a new one.

So please tell me a laptop that won’t shut down due to heat even if I use coreboot and QubesOS. Even if I look at HCL, I only see if it works.For example, there is no information on lenovo x230 that if I install QubesOS and coreboot and set default qube to kicksecure, the temperature will exceed 100 degrees Celsius just by watching YouTube.

1 Like

I didn’t have a thermal camera when writing my review, but this laptop does not burn my laps when using Qubes OS

1 Like

nice!! you have NovaCustom.

1 Like

I have a Purism Librem 14v1, 64Gb of RAM, I barely hear the fans spinning. It’s working great for me and I’m really happy with it. I never had issues with the hardware or the brand but I saw that some people had a lot of troubles with customer support.

3 Likes

I use the Purism Librem 14 v1, and it never shuts down due to heat.

1 Like

OP probably knows all this, but for some who do not. I apologize for repeating what he probably knows.

Fellow in my local computer shop was telling me that some:
Do not clean the area where the Thermal Paste will go, which restricts keeping computer cool.
A lot of people put on too much Thermal Paste, which actually interferes with cooling properly.

I notice some SSD’s, and some RAM come with something to help them cool better. Might not fit in all laptops, and, I am guessing, only helps a bit with cooling specific components.

Someone was once telling me that after -several years, one should replace the fans, as they are not as efficient as when new.

If the thing has already overheated a few times, might be a problem is already insolvable.

When I last took a drive out of my X-230, I could smell the effect of overheating. (I don’t use Core Boot, and right now, not Qubes, in the X230.) I think getting my local computer shop to replace fans and redo paste would cost more than buying another X-230. Sigh.

Cheers.

1 Like

Usually the fan doesn’t age much, but the thermal paste does, especially on laptop in which the stock thermal paste isn’t great and is “cooked” and become rigid after ~5 years.

Replacing the thermal paste isn’t super hard, you just need 1 or 2 screwdrivers (I’m using a swiss army knife :smiley: ), and a new tube of thermal paste (this costs something like 10$€). Just be patient when opening the laptop, don’t lose screws and be gentle when manipulating parts.

3 Likes

@kzlz
Do you build the coreboot image for the x230 by yourself or flashing a prebuild image like skulls? GitHub - merge/skulls: pre-built coreboot images and documentation on how to flash them for Thinkpad Laptops

I have been using the Skulls Coreboot images for years on an x230 without any heat problems.

1 Like

I used skulls.

1 Like

An effective fix would be to enable thermal throttling.

I run Qubes on ThinkPad W530 with coreboot, have an i7-3940XM CPU with Noctua NT-H2 thermal paste, overclocked to 41-41-41-41, and it never goes above 90 degrees C. Under load the CPU heats up quickly and adaptively drops clocks via thermal throttling, down to 3.2-3.4 GHz if running Prime95 AVX on all cores. However, the CPU never goes above 90C - in Linux, Windows, etc.

The lowest thermal ceiling you can set on Sandy Bridge, Ivy Bridge CPUs (ThinkPad xx20, xx30 series) is 90C = 105 - 15.

To do this, you need to set bits 31:24 of the MSR 0x1A2 (MSR_TEMPERATURE_TARGET) to 0x0F, after every boot and every wake-up from S3 sleep.

In regular Linux you can run this (if the kernel hasn’t been tightened down to disallow direct register access):

	wrmsr 0x1A2 0x000000000f691200

In Windows you can run:

	msr-cmd.exe write 0x1A2 00000000 0f691200

(You only need to set the 3rd byte, so you should read the current register value, set 3rd byte to 0x0F, write it back.)

However, on Qubes you don’t have direct register access in dom0, Xen doesn’t allow it. Suggest you should patch coreboot - then your thermal and overclocking settings will work in all operating systems.

Attaching my coreboot patch in the next message. It’s for older coreboot version, you can adapt it to the current coreboot version Heads is using. You should be able to use this logic in coreboot on any ThinkPad xx20, xx30 laptops, or any other laptops with Sandy Bridge, Ivy Bridge CPUs. (I think it should also apply for Haswell, Broadwell family - their init logic in coreboot is similar, but I don’t have any hardware from that generation to test.)

You don’t need all of the overclocking logic from the patch, you can only copy the “conf->tcc_offset = 15;” line into coreboot/src/cpu/intel/model_206ax/model_206ax_init.c. I think that’s all you need to enable the Tcc throttling - I don’t remember for sure. Maybe you need to set more registers - then you’ll need to copy more from the patch.

1 Like
--- coreboot-4.13/src/cpu/intel/model_206ax/model_206ax_init.c.orig	2020-11-20 06:01:35.000000000 -0600
+++ coreboot-4.13/src/cpu/intel/model_206ax/model_206ax_init.c	2022-12-29 07:00:25.666000000 -0600
@@ -4,6 +4,7 @@
 #include <device/device.h>
 #include <acpi/acpi.h>
 #include <arch/cpu.h>
+#include <bootmode.h>
 #include <cpu/cpu.h>
 #include <cpu/x86/mtrr.h>
 #include <cpu/x86/msr.h>
@@ -174,14 +175,17 @@
  */
 void set_power_limits(u8 power_limit_1_time)
 {
+	// used to detect the processor model and set model-specific clock profile
+	char processor_name[49];
+
 	msr_t msr = rdmsr(MSR_PLATFORM_INFO);
-	msr_t limit;
+	msr_t limit, turbo_ratio_limit;
 	unsigned int power_unit;
 	unsigned int tdp, min_power, max_power, max_time;
 	u8 power_limit_1_val;
 
 	if (power_limit_1_time >= ARRAY_SIZE(power_limit_time_sec_to_msr))
-		return;
+		power_limit_1_time = ARRAY_SIZE(power_limit_time_sec_to_msr) - 1;
 
 	if (!(msr.lo & PLATFORM_INFO_SET_TDP))
 		return;
@@ -208,21 +212,31 @@
 	if (max_power > 0 && tdp > max_power)
 		tdp = max_power;
 
-	power_limit_1_val = power_limit_time_sec_to_msr[power_limit_1_time];
+	// Vlad-overclock: hardcode PL1 time to 28 sec
+	printk(BIOS_DEBUG,
+		"Vlad-overclock: %s : %s() at line %d: %s%s%s\n",
+		__FILE__, __func__, __LINE__, CONFIG_LOCALVERSION,
+		(acpi_is_wakeup_s3() ? ", acpi_is_wakeup_s3" : ""),
+		(platform_is_resuming() ? ", platform_is_resuming" : ""));
+	//power_limit_1_val = power_limit_time_sec_to_msr[power_limit_1_time];
+	power_limit_1_val = power_limit_time_sec_to_msr[28];
 
 	/* Set long term power limit to TDP */
-	limit.lo = 0;
+/*	limit.lo = 0;
 	limit.lo |= tdp & PKG_POWER_LIMIT_MASK;
 	limit.lo |= PKG_POWER_LIMIT_EN;
 	limit.lo |= (power_limit_1_val & PKG_POWER_LIMIT_TIME_MASK) <<
 		PKG_POWER_LIMIT_TIME_SHIFT;
-
+*/
 	/* Set short term power limit to 1.25 * TDP */
-	limit.hi = 0;
+/*	limit.hi = 0;
 	limit.hi |= ((tdp * 125) / 100) & PKG_POWER_LIMIT_MASK;
-	limit.hi |= PKG_POWER_LIMIT_EN;
+	limit.hi |= PKG_POWER_LIMIT_EN;*/
 	/* Power limit 2 time is only programmable on SNB EP/EX */
 
+	// Vlad-overclock: hardcode TDP 56W_68W
+	limit.lo = 0x00dc81c0;
+	limit.hi = 0x00008220;
 	wrmsr(MSR_PKG_POWER_LIMIT, limit);
 
 	/* Use nominal TDP values for CPUs with configurable TDP */
@@ -232,6 +246,31 @@
 		limit.lo = msr.lo & 0xff;
 		wrmsr(MSR_TURBO_ACTIVATION_RATIO, limit);
 	}
+
+	// Vlad-overclock: hardcode turbo ratio limit
+
+	turbo_ratio_limit.lo = 0;
+	fill_processor_name(processor_name);
+	// W520 i7-3720QM limited unlocking (all bins +4)
+	// stock turbo ratio for i7-3720QM: 0x22222324
+	// turbo_ratio_limit.lo = 0x26262728;
+	if (strstr(processor_name, "i7-3720QM"))		// W520: 40-41-41-41
+		turbo_ratio_limit.lo = 0x28292929;
+	else if (strstr(processor_name, "i7-3940XM"))	// W530: 41-42-42-42
+		turbo_ratio_limit.lo = 0x292a2a2a;
+
+	if (turbo_ratio_limit.lo) {
+		turbo_ratio_limit.hi = 0;
+		wrmsr(MSR_TURBO_RATIO_LIMIT, turbo_ratio_limit);
+		printk(BIOS_INFO,
+			"Vlad-overclock: %s : %s() at line %d: hardcoded turbo ratio limit 0x %08X %08X (%02u-%02u-%02u-%02u)\n",
+			__FILE__, __func__, __LINE__,
+			turbo_ratio_limit.hi, turbo_ratio_limit.lo,
+			(turbo_ratio_limit.lo >> 24) & 0xFF,
+			(turbo_ratio_limit.lo >> 16) & 0xFF,
+			(turbo_ratio_limit.lo >> 8) & 0xFF,
+			turbo_ratio_limit.lo & 0xFF);
+	}
 }
 
 static void configure_c_states(void)
@@ -309,12 +348,22 @@
 	conf = lapic->chip_info;
 
 	/* Set TCC activation offset if supported */
+	// Vlad-overclock: hardcode TCC 90 = 105 - 15
+	conf->tcc_offset = 15;
 	msr = rdmsr(MSR_PLATFORM_INFO);
+
+	// Vlad-overclock TODO create a constant for Programmable TJ OFFSET in:
+	//		cpu/intel/model_206ax/model_206ax.h
+	//		cpu/intel/haswell/haswell.h
 	if ((msr.lo & (1 << 30)) && conf->tcc_offset) {
 		msr = rdmsr(MSR_TEMPERATURE_TARGET);
 		msr.lo &= ~(0xf << 24); /* Bits 27:24 */
 		msr.lo |= (conf->tcc_offset & 0xf) << 24;
 		wrmsr(MSR_TEMPERATURE_TARGET, msr);
+		printk(BIOS_INFO,
+			"Vlad-overclock: %s : %s() at line %d: set tcc_offset to %d\n",
+			__FILE__, __func__, __LINE__,
+			conf->tcc_offset);
 	}
 }
 
@@ -430,6 +479,10 @@
 
 	/* Clear out pending MCEs */
 	configure_mca();
+	printk(BIOS_INFO,
+		"Vlad-overclock: %s at line %d: Started %s. Clearing out pending MCEs - this should only be done on a cold boot%s\n",
+		__FILE__, __LINE__, __func__,
+		(acpi_is_wakeup_s3() ? ". acpi_is_wakeup_s3" : ""));
 
 	/* Print infos */
 	model_206ax_report();
--- coreboot-4.13/src/northbridge/intel/sandybridge/northbridge.c.orig	2020-11-20 06:01:35.000000000 -0600
+++ coreboot-4.13/src/northbridge/intel/sandybridge/northbridge.c	2022-12-29 06:35:57.820000000 -0600
@@ -411,11 +411,21 @@
 	 * CPUs with configurable TDP also need power limits set in MCHBAR.
 	 * Use the same values from MSR_PKG_POWER_LIMIT.
 	 */
-	if (cpu_config_tdp_levels()) {
+	// Vlad-overclock: we're setting it unconditionally anyway
+//	if (cpu_config_tdp_levels()) {
 		msr_t msr = rdmsr(MSR_PKG_POWER_LIMIT);
 		MCHBAR32(MCH_PKG_POWER_LIMIT_LO) = msr.lo;
 		MCHBAR32(MCH_PKG_POWER_LIMIT_HI) = msr.hi;
-	}
+
+		// Vlad-overclock: hardcoded
+		printk(BIOS_INFO,
+			"Vlad-overclock: %s : %s() at line %d: unconditionally copied from MSR_PKG_POWER_LIMIT "
+			"to MCHBAR MCH_PKG_POWER_LIMIT_LO/HI 0x%X 0x%X%s\n",
+			__FILE__, __func__, __LINE__,
+			MCH_PKG_POWER_LIMIT_LO,
+			MCH_PKG_POWER_LIMIT_HI,
+			(acpi_is_wakeup_s3() ? ". acpi_is_wakeup_s3" : ""));
+//	}
 
 	/* Set here before graphics PM init */
 	MCHBAR32(PAVP_MSG) = 0x00100001;
1 Like

Good to know, because the Star Labs StarBooks I just got (32 RAM btw) gets nuclear HOT even just sitting at the UEFI login be it Coreboot or AMI

1 Like

Also for Librem laptops, make sure to Install librem-ec-acpi-dkms in Qubes ($1170) · Snippets · Snippets · GitLab for better battery handlings whatnot.

2 Likes