<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Cpu on inetshell</title><link>https://inet.sh/en/tags/cpu/</link><description>Recent content in Cpu on inetshell</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 25 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://inet.sh/en/tags/cpu/index.xml" rel="self" type="application/rss+xml"/><item><title>Proxmox: Windows is slow with CPU type host (md_clear and flush_l1d)</title><link>https://inet.sh/en/posts/proxmox/windows-slow-cpu-type-host/</link><pubDate>Fri, 25 Sep 2026 00:00:00 +0000</pubDate><guid>https://inet.sh/en/posts/proxmox/windows-slow-cpu-type-host/</guid><description>Why a Windows VM on Proxmox VE crawls and stutters with CPU type &amp;#39;host&amp;#39; and flies with x86-64-v2-AES: the md_clear and flush_l1d flags switch on the MDS and L1TF mitigations inside the guest and blow up memory latency. Which CPU type to pick and what happens if you insist on host.</description><content:encoded><![CDATA[<h2 id="tldr">TL;DR</h2>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">qm <span class="nb">set</span> <span class="m">102</span> --cpu x86-64-v2-AES    <span class="c1"># or x86-64-v3 if every host is Haswell / EPYC or newer</span>
</span></span><span class="line"><span class="cl">qm stop <span class="m">102</span> <span class="o">&amp;&amp;</span> qm start <span class="m">102</span>       <span class="c1"># a reboot from inside Windows does NOT apply the change</span>
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="symptoms">Symptoms</h2>
<p>Windows 10, 11, or Server with <code>cpu: host</code>: slow boot, stuttering desktop, multi-second freezes, anything that touches memory is bad. The same VM with <code>x86-64-v2-AES</code> responds normally. A Linux VM with <code>host</code> on the same node notices nothing.</p>
<h2 id="why-it-happens">Why it happens</h2>
<p><code>host</code> passes the VM <strong>every</strong> flag of the physical CPU, including two that exist for Intel vulnerability mitigations:</p>
<table>
  <thead>
      <tr>
          <th>Flag</th>
          <th>Mitigation</th>
          <th>What Windows does when it sees it</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>md_clear</code></td>
          <td>MDS (Microarchitectural Data Sampling)</td>
          <td>Runs <code>VERW</code> on every kernel ↔ user transition to flush buffers</td>
      </tr>
      <tr>
          <td><code>flush_l1d</code></td>
          <td>L1TF (L1 Terminal Fault)</td>
          <td>Flushes the L1D cache on every VM entry / context switch</td>
      </tr>
  </tbody>
</table>
<p>Inside a VM those operations are extremely expensive. The measurements from the <a href="https://forum.proxmox.com/threads/the-reasons-for-poor-performance-of-windows-when-the-cpu-type-is-host.163114/">original Proxmox forum thread</a>: on a Xeon E5-2667 v2 the RAM read latency goes from <strong>~100 ns to ~2000 ns</strong>; on an i9-13900K, from 30 to 90 ns. Windows, which touches kernel memory all the time, crawls.</p>
<p>The generic types (<code>x86-64-v2-AES</code>, <code>x86-64-v3</code>, <code>IvyBridge-IBRS</code>, …) do not expose those two flags, so Windows neither sees the vulnerability nor turns on the mitigation.</p>
<h2 id="which-type-to-pick">Which type to pick</h2>
<table>
  <thead>
      <tr>
          <th>Type</th>
          <th>Host requirement</th>
          <th>Notes</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>x86-64-v2-AES</code></td>
          <td>Intel Westmere / AMD Opteron 4th gen or newer</td>
          <td>GUI default since PVE 8. Migrates across different hosts</td>
      </tr>
      <tr>
          <td><code>x86-64-v3</code></td>
          <td>Intel Haswell / AMD EPYC or newer</td>
          <td>AVX2. Migrates across hosts that meet it</td>
      </tr>
      <tr>
          <td><code>x86-64-v4</code></td>
          <td>Skylake-SP / Zen 4 or newer</td>
          <td>AVX-512</td>
      </tr>
      <tr>
          <td><code>host</code></td>
          <td>All identical</td>
          <td>Maximum flags, but no migration across different CPUs and this Windows problem</td>
      </tr>
  </tbody>
</table>
<p>Pick the highest one that <strong>every</strong> node in the cluster supports:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">grep -o -w -E <span class="s1">&#39;avx2|avx512f&#39;</span> /proc/cpuinfo <span class="p">|</span> sort -u   <span class="c1"># avx2 → v3 ok; avx512f → v4 ok</span>
</span></span></code></pre></td></tr></table>
</div>
</div><p>That is the Proxmox staff recommendation in that same thread: use the <code>x86-64-v*</code> matching the hardware instead of blindly turning security flags off.</p>
<h2 id="if-you-insist-on-host">If you insist on host</h2>
<p>There are cases where <code>host</code> is needed: nested virtualization (Hyper-V, WSL2 inside the VM, an ESXi lab), because the <code>x86-64-v*</code> types do not expose <code>vmx</code>/<code>svm</code>. You can drop <code>md_clear</code> with the <code>flags</code> option:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">qm <span class="nb">set</span> <span class="m">102</span> --cpu host,flags<span class="o">=</span>-md-clear
</span></span></code></pre></td></tr></table>
</div>
</div><p>But <code>flush_l1d</code> is not in the list of flags Proxmox lets you touch, so you keep half of the problem. And hiding mitigations from the guest is a security decision: reasonable on a single-owner node, not on one with tenants you do not control.</p>
<h2 id="checking-from-inside-windows">Checking from inside Windows</h2>
<p>Microsoft&rsquo;s official module shows which mitigations the guest has active:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-powershell" data-lang="powershell"><span class="line"><span class="cl"><span class="nb">Install-Module</span> <span class="n">SpeculationControl</span> <span class="n">-Scope</span> <span class="n">CurrentUser</span>
</span></span><span class="line"><span class="cl"><span class="nb">Get-SpeculationControlSettings</span>
</span></span></code></pre></td></tr></table>
</div>
</div><p>With <code>host</code>, <code>MDSWindowsSupportEnabled</code> and <code>L1TFWindowsSupportEnabled</code> come out <code>True</code>; with <code>x86-64-v2-AES</code>, <code>False</code>. It is the quick way to confirm the change applied.</p>
<h2 id="traps">Traps</h2>
<ul>
<li><strong>The change needs stop/start.</strong> The CPU type is fixed when the QEMU process launches; a reboot from inside the guest does not touch it.</li>
<li><strong>It is an Intel thing.</strong> <code>md_clear</code> and <code>flush_l1d</code> do not exist on AMD; with <code>host</code> on EPYC/Ryzen you will not see this drop (though <code>host</code> still blocks migration across different CPUs).</li>
<li><strong>It applies to new VMs too.</strong> Templates created with <code>host</code> inherit the problem; change it in the template.</li>
<li><strong>Windows stays safe against what matters inside a VM with either type</strong>: the mitigations that count (Spectre v2, etc.) remain active; what goes away is the double mitigation of vulnerabilities the host already mitigates.</li>
</ul>
<p>References: <a href="https://forum.proxmox.com/threads/the-reasons-for-poor-performance-of-windows-when-the-cpu-type-is-host.163114/">Proxmox forum thread</a> and the <a href="https://pve.proxmox.com/pve-docs/chapter-qm.html#qm_cpu">CPU section</a> of the admin guide.</p>
]]></content:encoded></item></channel></rss>