From patchwork Thu Dec 20 12:11:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1016738 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bVd+y6Yk"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43L9h42JFrz9sCh for ; Thu, 20 Dec 2018 23:15:31 +1100 (AEDT) Received: from localhost ([::1]:36971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZxEe-0001kT-O5 for incoming@patchwork.ozlabs.org; Thu, 20 Dec 2018 07:15:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZxAc-0007UX-Lj for qemu-devel@nongnu.org; Thu, 20 Dec 2018 07:11:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZxAZ-00068Z-FQ for qemu-devel@nongnu.org; Thu, 20 Dec 2018 07:11:18 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:39393) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZxAZ-00065l-8p for qemu-devel@nongnu.org; Thu, 20 Dec 2018 07:11:15 -0500 Received: by mail-wr1-x444.google.com with SMTP id t27so1499788wra.6 for ; Thu, 20 Dec 2018 04:11:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=MZDZ+TXjUsu56GLWVGGTH/UlVRv/wneji8e/2GKDVjk=; b=bVd+y6YkscfEoyPfxrOlAKWn2N+UbGxFew55wydMOmaMSBR/zhpOE4lFP86bXklnO1 K9HbHDKU7nhCK4PwbDqt2kr4M+e91DELkcQZJoRjGVJqm+x6hwEj2ZXY757jt+XtkSqQ ht1EJGzK78LnHe8Sw49Do8ceXBuLpk25hOc5pMiritrQ1ZQ77uqGRzunmkpKi1RQQt0g UetZUDgTq7T/inYVxaDZlwyq2r43LunLXCiiyeHnaNDt/CMIuSHILaSwL0iOQWXpVqIe sstpeIcbX7FiwBDX5L5ilrNvUFjXoyhgBnDVoyRKiqByETjX47LaTlVa8oqRCrWoSGng 2OlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version:content-transfer-encoding; bh=MZDZ+TXjUsu56GLWVGGTH/UlVRv/wneji8e/2GKDVjk=; b=jOQJOgCap1VJOjHcY7w5VVvMLLb0/4eIcoOrtMbOo5pj3gxxhf5P3hGiO3Aw3dJEn+ 2yAbPtagbQvSwtzQhOnhha6XmoHIDxnA13uS4djywC4cu0I87DY/ar8Su48DMf6S5k+s RkecL30tr9XgJTzf/6tketVgCcjRTtGX9bYfbhew7qSbx3XvTxEeBmeC0HcUkn9PztqB bUFro0qF6oTfPOxoO/ApgNs+fZ/vU5ZN5WhE8YphCN60BJoUw4+dYMQaHBgmcXCEgFyM YHXZGc9NsLpcblAorA1xE4UuGnZeTd/3AEkiPMe8TEZv1IwyiMNBg5KgcV3LPf47nmXp +bVw== X-Gm-Message-State: AA+aEWbdFW2LeYHOeCUSLTd15tt0Oyq2dJtoLdmiQhIJhLz0WaJKlA4s Vd9QWR3lzW3BYg+XEJy4doIMZVwk X-Google-Smtp-Source: AFSGD/V4hNSeGiStNxPcq7o+Ac4XjORbUczsLs/0Qs6EVjV7QQNpzAacRFG+XFxplEW8KRcl5qjqug== X-Received: by 2002:adf:ef50:: with SMTP id c16mr22438438wrp.198.1545307873844; Thu, 20 Dec 2018 04:11:13 -0800 (PST) Received: from donizetti.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id r64sm9788978wmg.5.2018.12.20.04.11.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Dec 2018 04:11:13 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 20 Dec 2018 13:11:12 +0100 Message-Id: <20181220121112.21667-1-pbonzini@redhat.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PATCH] target-i386: hvf: remove MPX support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" MPX support is being phased out by Intel and actually I am not sure that OS X has ever enabled it in XCR0. Drop it from the Hypervisor.framework acceleration. Signed-off-by: Paolo Bonzini Reviewed-by: Roman Bolshakov --- target/i386/hvf/x86_cpuid.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/target/i386/hvf/x86_cpuid.c b/target/i386/hvf/x86_cpuid.c index 9874a46e92..4d957fe896 100644 --- a/target/i386/hvf/x86_cpuid.c +++ b/target/i386/hvf/x86_cpuid.c @@ -38,16 +38,6 @@ static uint64_t xgetbv(uint32_t xcr) return (((uint64_t)edx) << 32) | eax; } -static bool vmx_mpx_supported() -{ - uint64_t cap_exit, cap_entry; - - hv_vmx_read_capability(HV_VMX_CAP_ENTRY, &cap_entry); - hv_vmx_read_capability(HV_VMX_CAP_EXIT, &cap_exit); - - return ((cap_exit & (1 << 23)) && (cap_entry & (1 << 16))); -} - uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_t idx, int reg) { @@ -92,11 +82,8 @@ uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_t idx, CPUID_7_0_EBX_CLFLUSHOPT | CPUID_7_0_EBX_CLWB | CPUID_7_0_EBX_AVX512DQ | CPUID_7_0_EBX_SHA_NI | CPUID_7_0_EBX_AVX512BW | CPUID_7_0_EBX_AVX512VL | - CPUID_7_0_EBX_INVPCID | CPUID_7_0_EBX_MPX; + CPUID_7_0_EBX_INVPCID; - if (!vmx_mpx_supported()) { - ebx &= ~CPUID_7_0_EBX_MPX; - } hv_vmx_read_capability(HV_VMX_CAP_PROCBASED2, &cap); if (!(cap & CPU_BASED2_INVPCID)) { ebx &= ~CPUID_7_0_EBX_INVPCID; @@ -119,9 +106,6 @@ uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_t idx, XSTATE_BNDCSR_MASK | XSTATE_OPMASK_MASK | XSTATE_ZMM_Hi256_MASK | XSTATE_Hi16_ZMM_MASK); eax &= supp_xcr0; - if (!vmx_mpx_supported()) { - eax &= ~(XSTATE_BNDREGS_MASK | XSTATE_BNDCSR_MASK); - } } else if (idx == 1) { hv_vmx_read_capability(HV_VMX_CAP_PROCBASED2, &cap); eax &= CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XGETBV1;