Skip to contentSkip to conversation

iommu/quirk: disable shared EPT for Sandybridge and earlier processors.

PATCH Andrew Cooper 2 participants 4 messages Aug 28, 2015 – Sep 1, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andrew Cooper

author Reviewed-by
#1 lore raw
Quoted 9 lines · On 28/08/15 16:41, "Anshul Makkar anshul.makkar"@citrix.com wrote:

From: anshulma <[email protected]>

Sandybridge or earlier processors don't have huge page support for IOTLB which leads to fallback on 4k pages and causes performance issues.

Shared EPT will be disabled only if the user has not provided explicit choice on the command line.

As a note concerning the performance issues, for some IO workloads, this nets a 40% throughput improvement.

We did not observe any IO workloads which had a worse performance as a result of disabling shared ept.

~Andrew

#2 lore raw
In reply to a message not in the archive

docs/misc/xen-command-line.markdown debug hypervisor only). · line 899

Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 28.08.15 at 17:41, <Anshul Makkar [email protected]> wrote:
docs/misc/xen-command-line.markdown +1 -1
@@ -896,7 +896,7 @@ debug hypervisor only).
 
 > `sharept`
 
-> Default: `true`
+> Default: `true` if newer than SandyBridge or `false` if Sandybridge or earlier.

This neglects the AMD side.

xen/drivers/passthrough/iommu.c bool_t __read_mostly iommu_intremap = 1; · line 57

Quoted 7 lines
xen/drivers/passthrough/iommu.c +1 -0
@@ -54,6 +54,7 @@ bool_t __read_mostly iommu_intremap = 1;
 bool_t __read_mostly iommu_hap_pt_share = 1;
 bool_t __read_mostly iommu_debug;
 bool_t __read_mostly amd_iommu_perdev_intremap = 1;
+bool_t __read_mostly iommu_sharept_set = 0;

_If_ you really want to introduce a new variable, it ought to be __initdata (since only __init functions reference it). My preference though would be to make the existing variable a tristate, starting out with a value of -1 (and having type s8).

Quoted 9 lines
xen/drivers/passthrough/vtd/quirks.c +3 -0
@@ -320,6 +320,19 @@ void __init platform_quirks_init(void)
     /* Tylersburg interrupt remap quirk */
     if ( iommu_intremap )
         tylersburg_intremap_quirk();
+
+    /*
+     * Disable shared EPT ("sharept") on Sandybridge and older processors

xen/drivers/passthrough/vtd/quirks.c void __init platform_quirks_init(void) · line 335

Quoted 10 lines
xen/drivers/passthrough/vtd/quirks.c +10 -0
+     * by default.
+     * SandyBridge has no huge page support for IOTLB which leads to fallback
+     * on 4k pages and leads to performance degradation.
+     *
+     * Shared EPT ("sharept") will be disabled only if user has not
+     * provided explicit choice on the command line.
+     */
+    if ( (boot_cpu_data.x86 == 6) &&
+         (boot_cpu_data.x86_model <= 0x2a) && !iommu_sharept_set )
+        iommu_hap_pt_share = 0;

Model 0x2d certainly is also Sandybridge. Models 0x2c, 0x2e, and 0x2f are even older architectures. And then there are various Atoms at higher numbers which I'm not sure can be considered "newer than Sandybridge" architecture wise. I.e. I don't think you can get away with a simple, single relation here.

Jan

#3 lore raw
Quoted 10 lines · Jan Beulich

docs/misc/xen-command-line.markdown debug hypervisor only). · line 899

Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 28.08.15 at 17:41, <Anshul Makkar [email protected]> wrote:
docs/misc/xen-command-line.markdown +1 -1
@@ -896,7 +896,7 @@ debug hypervisor only).
 
 > `sharept`
 
-> Default: `true`
+> Default: `true` if newer than SandyBridge or `false` if Sandybridge or earlier.

This neglects the AMD side.

The AMD side has iommu_hap_pt_share unconditionally disabled, for reasons pertaining to grant mapped frames.

~Andrew

#4 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 01.09.15 at 16:18, <[email protected]> wrote:
Quoted 5 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 28.08.15 at 17:41, <Anshul Makkar [email protected]> wrote:
docs/misc/xen-command-line.markdown +0 -0
@@ -896,7 +896,7 @@ debug hypervisor only).
 
Quoted 8 lines
Quoted 5 lines

docs/misc/xen-command-line.markdown debug hypervisor only). · line 899

Quoted 4 lines
docs/misc/xen-command-line.markdown +1 -1
 > `sharept`
 
-> Default: `true`
+> Default: `true` if newer than SandyBridge or `false` if Sandybridge or earlier.

This neglects the AMD side.

The AMD side has iommu_hap_pt_share unconditionally disabled, for reasons pertaining to grant mapped frames.

Yet that doesn't eliminate the desire to have the correct default spelled out here.

Jan