<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://foss.coep.org.in/coepwiki/index.php?action=history&amp;feed=atom&amp;title=Linux_kernel_v6.16.2</id>
	<title>Linux kernel v6.16.2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://foss.coep.org.in/coepwiki/index.php?action=history&amp;feed=atom&amp;title=Linux_kernel_v6.16.2"/>
	<link rel="alternate" type="text/html" href="https://foss.coep.org.in/coepwiki/index.php?title=Linux_kernel_v6.16.2&amp;action=history"/>
	<updated>2026-04-03T19:03:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://foss.coep.org.in/coepwiki/index.php?title=Linux_kernel_v6.16.2&amp;diff=39&amp;oldid=prev</id>
		<title>612303017: Added a wiki entry explaining the CONFIG_X86_NATIVE_CPU flag issue in Linux 6.16+, its problems with virtualization (-march=native), and the fix (CONFIG_X86_NATIVE_CPU=n)</title>
		<link rel="alternate" type="text/html" href="https://foss.coep.org.in/coepwiki/index.php?title=Linux_kernel_v6.16.2&amp;diff=39&amp;oldid=prev"/>
		<updated>2025-08-30T10:08:16Z</updated>

		<summary type="html">&lt;p&gt;Added a wiki entry explaining the CONFIG_X86_NATIVE_CPU flag issue in Linux 6.16+, its problems with virtualization (-march=native), and the fix (CONFIG_X86_NATIVE_CPU=n)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;The CONFIG_X86_NATIVE_CPU Flag:&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- This is a CPU Virtualization error. Linux kernel 6.16+ versions introduce a new build time option, (&amp;lt;code&amp;gt;CONFIG_X86_NATIVE_CPU&amp;lt;/code&amp;gt;) in the .config file, created after running &amp;lt;sub&amp;gt;&amp;lt;code&amp;gt;make menuconfig&amp;lt;/code&amp;gt;&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When this option is enabled, i.e &amp;lt;code&amp;gt;CONFIG_X86_NATIVE_CPU=y&amp;lt;/code&amp;gt;, then it instructs the compiler gcc to use the &amp;lt;code&amp;gt;-march=native&amp;lt;/code&amp;gt; flag. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Now what does this flag mean or it&amp;#039;s significance?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Essentially it directs the compiler to detect a specific CPU model on which the compiler runs and generate optimized instructions which will be unique to the architecture.&lt;br /&gt;
&lt;br /&gt;
Now, on the host machine this option optimizes the code for the actual CPU but inside a VM (like VirtualBox), the compiler only sees the vCPU presented by the &amp;#039;&amp;#039;Virtual Environment&amp;#039;&amp;#039; which can be heavily restrictive and slightest modifications to the VM model via Host machine.&lt;br /&gt;
&lt;br /&gt;
- The kernel which is built will have runtime portability issues and any changes to the VM physical configuration (via Host Machine Software) creates a fault wherein the kernel ELF file uses instructions that the new vCPU doesn&amp;#039;t support!&lt;br /&gt;
&lt;br /&gt;
Hence results in -&amp;gt; (&amp;#039;&amp;#039;Illegal Instruction Faults&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
- Also with lower versions of GCC compiler, the flag &amp;lt;code&amp;gt;-march=native&amp;lt;/code&amp;gt; is not supported completely (classic issue of legacy compatibility) and throws make errors - (build-time error).&lt;br /&gt;
&lt;br /&gt;
Fix:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CONFIG_X86_NATIVE_CPU=y&amp;lt;/code&amp;gt; changed to &amp;lt;code&amp;gt;CONFIG_X86_NATIVE_CPU=&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Documentation on the merits/demerits of this feature: https://www.phoronix.com/review/linux-616-x86-native-cpu&lt;/div&gt;</summary>
		<author><name>612303017</name></author>
	</entry>
</feed>