XNU 10.8.3 Haswell Compatibility

The mach_kernel for OS X 10.9 Mavericks has built-in support for Haswell and Haswell ULT processors, but since that is not released yet. Not for a long time, you may as well want to patch the XNU (10.8.3) source code. And here is what you need to add:

xnu/osfmk/i386/cpuid.h

+ #define CPUID_MODEL_HASWELL	0x3C
+ #define CPUID_MODEL_HASWELL_ULT	0x45

xnu/osfmk/i386/cpuid.c

+		case CPUID_MODEL_HASWELL:
+			cpufamily = CPUFAMILY_INTEL_HASWELL;
+			break;
+		case CPUID_MODEL_HASWELL_ULT:
+			cpufamily = CPUFAMILY_INTEL_HASWELL_ULT;
+			break;

xnu/osfmk/i386/tsc.c

	switch (cpuid_cpufamily()) {
	case CPUFAMILY_INTEL_IVYBRIDGE:
	case CPUFAMILY_INTEL_SANDYBRIDGE:
	case CPUFAMILY_INTEL_WESTMERE:
	case CPUFAMILY_INTEL_NEHALEM:
+	case CPUFAMILY_INTEL_HASWELL:
+	case CPUFAMILY_INTEL_HASWELL_ULT: {

xnu/osfmk/mach/machine.h

+ #define CPUFAMILY_INTEL_HASWELL 0x78EA4FBC
+ #define CPUFAMILY_INTEL_HASWELL_ULT 0x10B282DC

Note: If you don’t know what to do with it, forget it. No support here.

Edit: Filename error corrected. Thanks to necrophagous for the tip.

Advertisements

2 thoughts on “XNU 10.8.3 Haswell Compatibility

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s