Performance Effects of Meltdown and Partial Spectre Fixes on Intel Core i7-7500U Laptop

I have a fairly recent vintage HP Spectre x360-13w023dx laptop (slightly over a year old) that has an Intel Core i7-7500U (Kaby Lake-U) processor, 16GB of DDR4 RAM, and a 512GB Samsung PM961 M.2 NVMe SSD that is running Windows 10 Professional Version 1709.

Last night, I installed the Windows 10 January 2018 Security Update (KB4056892) on this system, and then used PowerShell to check my status, with the results as shown in Figure 1. These are the relevant results:

Speculation control settings for CVE-2017-5715 [branch target injection] (This is Spectre variant 2)

Hardware support for branch target injection mitigation is present: False

Windows OS support for branch target injection mitigation is present: True

Windows OS support for branch target injection mitigation is enabled: False

Windows OS support for branch target injection mitigation is disabled by system policy: False

Windows OS support for branch target injection mitigation is disabled by absence of hardware support: True

Speculation control settings for CVE-2017-5754 [rogue data cache load] (This is Meltdown)

Hardware requires kernel VA shadowing: True

Windows OS support for kernel VA shadow is present: True

Windows OS support for kernel VA shadow is enabled: True

Windows OS support for PCID performance optimization is enabled: True [not required for security]

Suggested actions

* Install BIOS/firmware update provided by your device OEM that enables hardware support for the branch target injection mitigation mitigation


image

Figure 1: After Windows 10 Security Update, but before BIOS Update


After I had installed the Windows 10 January 2018 Security Update (KB4056892) on this system, I ran both the CPU-Z 1.82.1 CPU benchmark and the CrystalDiskMark 6.0.0 synthetic disk benchmark three times, to get a performance baseline before I installed the new BIOS (that has the microcode update to enable the Spectre variant 2 fixes). Some results from these test runs are shown in Figures 3 and 5 below.


Following Microsoft’s guidance, I located and installed the latest BIOS for my HP Spectre x360 laptop, which is version F.42. Then, I again used PowerShell to check my status, with the results as shown in Figure 2. These are the relevant results:

Speculation control settings for CVE-2017-5715 [branch target injection] (This is Spectre variant 2)

Hardware support for branch target injection mitigation is present: True

Windows OS support for branch target injection mitigation is present: True

Windows OS support for branch target injection mitigation is enabled: True

Speculation control settings for CVE-2017-5754 [rogue data cache load] (This is Meltdown)

Hardware requires kernel VA shadowing: True

Windows OS support for kernel VA shadow is present: True

Windows OS support for kernel VA shadow is enabled: True

Windows OS support for PCID performance optimization is enabled: True [not required for security]


image

Figure 2: After Windows 10 Security Update and BIOS Update


Figure 3 shows one of the CPU-Z 1.82.1 benchmark run results before the BIOS update, showing a CPU Single Thread score of 373.9, and a CPU Multi Thread score of 1000.2.


image

Figure 3: After Windows 10 Security Update, but before BIOS Update


Figure 4 shows one of the CPU-Z 1.82.1 benchmark run results after the BIOS update, showing a CPU Single Thread score of 317.5, and a CPU Multi Thread score of 971.8. That is about a 15.1% reduction in single-threaded CPU performance and a 2.8% reduction in multi-threaded CPU performance, at least on this quick synthetic CPU benchmark.


image

Figure 4: After Windows 10 Security Update and BIOS Update


Figure 5 shows one of the CrystalDiskMark 6.0.0 benchmark run results before the BIOS update.


image

Figure 5: After Windows 10 Security Update, but before BIOS Update


Figure 6 shows one of the CrystalDiskMark 6.0.0 benchmark run results after the BIOS update.


image

Figure 6: After Windows 10 Security Update and BIOS Update


What these limited synthetic benchmark test results show is that installing the CPU microcode updates (which are a required part of the Spectre variant 2 fix) seems to have a pretty significant effect on single-threaded CPU performance in the CPU-Z benchmark. We also see a very significant effect on random I/O performance in CrystalDiskMark 6.0.0 using the default test settings with a 4GB test file.

Microsoft’s Terry Myerson has a pretty detailed post on this subject

Understanding the performance impact of Spectre and Meltdown mitigations on Windows Systems

Intel has published some client benchmark results for 6th, 7th, and 8th Generation Core processors, as shown here:

Intel Security Issue Update: Initial Performance Data Results for Client Systems




SQL Server 2017 CU3 Released on January 4, 2018

On January 4, 2018, Microsoft released SQL Server 2017 CU3, which is Build 14.0.3015.40. By my count, this CU has sixteen public hotfixes, many of which are for the SQL Engine or SQL performance. There are also some new manageability and programmability features that have been added, such as support for the MAXDOP option for CREATE STATISTICS and UPDATE STATISTICS.

In addition, Microsoft has included the security fixes from the January 3 SQL Server security update in this Cumulative Update. Microsoft has very detailed guidance on how this may affect SQL Server here. One important item to note is that SQL Server 2017 CU3 may have been offered and deployed as an important update by Microsoft Update, depending on how your Microsoft Update settings are configured or whether you are using WSUS.

Since SQL Server 2017 won’t be using Service Packs as part of its servicing mechanism, you will need to start testing and deploying Cumulative Updates on a schedule that makes sense for your organization.

As always, I think it is a good idea to make an effort to stay current on Cumulative Updates, as does Microsoft.

Microsoft SQL Server Updates for Meltdown and Spectre Exploits

Over the last couple of days, you have probably heard quite a bit of chatter and speculation about some newly disclosed ways to attack various processors. The initial reports were that only Intel processors were affected, but some sources indicate that some AMD and ARM processors are also vulnerable.

Security researchers at Graz University (who were involved with the initial discovery of these issues) have put up a site, complete with cute logos, with some useful information about these two exploits. The most detailed information so far about the attack methods comes from Google Project Zero, as shown here: Reading privileged memory with a side-channel. Their testing shows some limited vulnerability for some older AMD processors.

AMD is pretty adamant that their processors are not vulnerable to these exploits, as shown by this statement from AMD’s Tom Lendacky:

“AMD processors are not subject to the types of attacks that the kernel
page table isolation feature protects against. The AMD microarchitecture
does not allow memory references, including speculative references, that
access higher privileged data when running in a lesser privileged mode
when that access would result in a page fault.
Disable page table isolation by default on AMD processors by not setting
the X86_BUG_CPU_INSECURE feature, which controls whether X86_FEATURE_PTI
is set.”

Linus Torvalds also seems pretty confident that AMD is not affected, as witnessed by his comments in a recent code check-in:

“Exclude AMD from the PTI enforcement. Not necessarily a fix, but if AMD is so confident that they are not affected, then we should not burden users with the overhead”

Paul Alcorn has a pretty good write-up about this issue here. Yesterday, Phoronix published some early benchmark results against a patched version of Linux that were pretty alarming for some use cases (synthetic IO benchmarks and PostgreSQL database performance).

Redhat has published some information about the performance impact of OS fixes on several different workload types. The most notable is what they define as

“Measureable: 8-19% – Highly cached random memory, with buffered I/O, OLTP database workloads, and benchmarks with high kernel-to-user space transitions are impacted between 8-19%. Examples include OLTP Workloads (tpc), sysbench, pgbench, netperf (< 256 byte), and fio (random I/O to NvME)”

More details about these findings and some mitigation methods for RHEL are available in these links:

Speculative Execution Exploit Performance Impacts – Describing the performance impacts to security patches for CVE-2017-5754 CVE-2017-5753 and CVE-2017-5715

Controlling the Performance Impact of Microcode and Security Patches for CVE-2017-5754 CVE-2017-5715 and CVE-2017-5753 using Red Hat Enterprise Linux Tunables

It seems like the various fixes for these issues are going to hit database and virtualization performance harder than most other use cases.  I wonder whether it will be possible for Intel to at least partially fix the issue with a stepping change on any Intel processors that are still in production (i.e. they make an actual hardware fix using the same existing processor design) that lets them send out replacement processors that work in some existing servers.

If you are old enough to remember the old Pentium FDIV bug in 1994, Intel initially tried to minimize the issue, saying that it was very rare. Then, they tried to make people prove that they were hitting the bug by running an Intel utility. Finally, they caved in to bad PR and ended up sending out replacement CPUs to a lot of people, no questions asked, which cost them $475 million back in the day. I remember swapping out my CPU, because I was a geek back then too!

Early this morning, Microsoft published this KB article: SQL Server Guidance to protect against speculative execution side-channel vulnerabilities. According to Microsoft, the following versions of SQL Server are impacted when running on x86 and x64 processor systems: SQL Server 2008, SQL Server 2008R2, SQL Server 2012, SQL Server 2014, SQL Server 2016, SQL Server 2017.

Microsoft has already issued two Cumulative Updates that include fixes to help mitigate this issue (along with the other important hotfixes included in each CU).

Cumulative Update 3 for SQL Server 2017

Cumulative Update 7 for SQL Server 2016 SP1

I suspect that there will be an out of band CU or hotfix for SQL Server 2014 SP2 relatively soon, since it is still in Mainstream support. Even though SQL Server 2012 and older are out of Mainstream support, Microsoft will probably develop and release hotfixes for those releases relatively soon since this is a security issue.

Microsoft has also started pushing out an out of band OS update for Windows 10 (KB4056892) that is meant to mitigate this issue. There are similar updates for most other supported Microsoft operating systems. Here is the current information for Windows Server:

Windows Server guidance to protect against speculative execution side-channel vulnerabilities

Here is Microsoft’s current security advisory advice:

ADV180002 | Guidance to mitigate speculative execution side-channel vulnerabilities

Microsoft has also released this statement about how they have been handling this for Microsoft Azure

Securing Azure customers from CPU vulnerability

Here is what I plan on doing over the next couple of weeks as this starts to shake out:

Here is what I think you should be doing:

Plan on getting your database servers patched as soon as possible, which will include OS patches, SQL Server patches, and possible firmware or BIOS/UEFI updates as they become available.

Be ready to do some workload and query tuning as necessary if your workload performance is negatively affected by these various patches and updates.

Think harder about upgrading to new hardware, a newer version of your OS, and a newer version of SQL Server that is still fully supported.

For personal and client workstation systems, you should be checking to see if there are any firmware or BIOS/UEFI updates that become available, both for these issues and as a general best practice.

                  Windows Client Guidance for IT Pros to protect against speculative execution side-channel vulnerabilities


I am collecting some resources about this issue from the server vendors as shown in the links below:

Cisco

CPU Side-Channel Information Disclosure Vulnerabilities

Dell

Microprocessor Side-Channel Attacks (CVE-2017-5715, CVE-2017-5753, CVE-2017-5754): Impact on Dell EMC products (Dell Enterprise Servers, Storage and Networking)

Microprocessor Side-Channel Attacks (CVE-2017-5715, CVE-2017-5753, CVE-2017-5754): Impact on Dell products  (This is for client hardware)

Fujitsu

CPU hardware vulnerable to side-channel attacks (CVE-2017-5715, CVE-2017-5753, CVE-2017-5754)

HPE

Side Channel Analysis Method allows information disclosure in Microprocessors (CVE-2017-5715, CVE-2017-5753, CVE-2017-5754)

Huawei

Security Notice – Statement on the Media Disclosure of the Security Vulnerabilities in the Intel CPU Architecture Design

IBM

Potential CPU Security Issue

Lenovo

Reading Privileged Memory with a Side Channel