From patchwork Wed Apr 24 23:14:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Makhalov X-Patchwork-Id: 13642651 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 718F116EC1C for ; Wed, 24 Apr 2024 23:14:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714000470; cv=none; b=XOVISnQ44GGGZuv6bIjZnaY37/zCcuHHntep8N6R41L6/p93ADud5oHj8kOHQxkfJoD5e1q3PcnSy1hlIdgUg1BVVJKm6U5Szsq0cNL7g7OrDQIXlfmAECoAtL3rXiuV0NU0yTk53FrNs52Vvp2rolYftr7FSPOXtXPn/4zhI24= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714000470; c=relaxed/simple; bh=nJNB/KulTbCbDLeJblQkEeFfKzMceokVHJqyrs68Oh0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kxFPDBKZ4UZE6+/40DFz5uTIwaJkugAxPK43zu5pl2F1hs1facIiHTCSyBWkvLXaHB22hgEWk4vNKsqQzk67a2PIuptyYnJuPaZgbCibxrBlKrnKj6lnSIDPWpEv1Hb6owOB2wM5f5Wsb9O7ecIo4UdJdBQUBtQFYXdiDVowzfQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=JqJZdzQb; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="JqJZdzQb" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-6f074520c8cso505722b3a.0 for ; Wed, 24 Apr 2024 16:14:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1714000468; x=1714605268; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aunCHk/+21TGD3cC0MnOgjQi+s2AopaplDfw/uAJlwA=; b=JqJZdzQbSohu/89dhfXhTNj7gs5YdC8wjHzTqDNLdfrVgq3nyoMLWophfN5m2Bkp9U qK9/KC04TqYLYDnGkeyzNGUlOEDGzPrgJt4ShPN+lOZ0d06FVXMAGVAmiGvOa2D7QgIU X7Z0pe3Hsa746LArh/yCisnoDMFc4vTFPMM4w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714000468; x=1714605268; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aunCHk/+21TGD3cC0MnOgjQi+s2AopaplDfw/uAJlwA=; b=TP1S6+chlh8UAUuwXba6ZKA0pdsWEYonZh9pzyojdB3o7Um71Lci4p+BLekCYGUw0a uVsN/FYS5qzo0bVlxoRdvX2jBEGJi3MWcd2Vc0j/CwC2WAeANpPwldasQhr/WQlEJ9Ce JFdT32E/7rQIEDDlV/zH1oQHbn3YMr/vluyNG1R8xdB2s20/Gx5EXDIFaenD7ADHySvv x57WalOwY1yzHOHrcCdOPZnpcRzW7fc3hPjfk1uL5xzduFzS2kNQfaLVyPc7HV1Emp1y bfehsXBj8I5JDeTvgn9M1Klk0d8lHF3kOK30t4KAlXYao4JRNiQkAVNnCphTaKoYtEj+ CKGg== X-Forwarded-Encrypted: i=1; AJvYcCWTYFo48JMaa3LrKAjhUTuN/x8vh7RIJhUxEx7waBuZjfm4dcaIcfjaTDzRPRtYD0ru/qnuGpizHLMwkXG0uUXmMsXBE9u7 X-Gm-Message-State: AOJu0Yyxr14h4Age0MU4lta54gtyBQHfDtFh8x2rmOTlXS5s42TE0kdM LqjTcfktJs25BGMNlvJv5Re2P/9/na/aBz+tyXdBlioZij0BTmp2n4xnqemrFQ== X-Google-Smtp-Source: AGHT+IHHdzGAXQ8gL0olZCSpi68pN5CG8/dpakkeGHeT/XAiJRJCeztoRovHlbGUOJO8Jirtf9fuow== X-Received: by 2002:a05:6a20:9c8f:b0:1a9:8836:ae37 with SMTP id mj15-20020a056a209c8f00b001a98836ae37mr4530009pzb.12.1714000467703; Wed, 24 Apr 2024 16:14:27 -0700 (PDT) Received: from amakhalov-build-vm.eng.vmware.com ([64.186.27.43]) by smtp.gmail.com with ESMTPSA id n17-20020a170903111100b001e520495f51sm12383936plh.124.2024.04.24.16.14.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 16:14:27 -0700 (PDT) From: Alexey Makhalov To: linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, bp@alien8.de, hpa@zytor.com, dave.hansen@linux.intel.com, mingo@redhat.com, tglx@linutronix.de Cc: x86@kernel.org, netdev@vger.kernel.org, richardcochran@gmail.com, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com, zackr@vmware.com, linux-graphics-maintainer@vmware.com, pv-drivers@vmware.com, timothym@vmware.com, akaher@vmware.com, dri-devel@lists.freedesktop.org, daniel@ffwll.ch, airlied@gmail.com, tzimmermann@suse.de, mripard@kernel.org, maarten.lankhorst@linux.intel.com, horms@kernel.org, kirill.shutemov@linux.intel.com, Alexey Makhalov Subject: [PATCH v9 1/8] x86/vmware: Correct macro names Date: Wed, 24 Apr 2024 16:14:06 -0700 Message-Id: <20240424231407.14098-1-alexey.makhalov@broadcom.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 VCPU_RESERVED and LEGACY_X2APIC are not VMware hypercall commands. These are bits in return value of VMWARE_CMD_GETVCPU_INFO command. Change VMWARE_CMD_ prefix to GETVCPU_INFO_ one. And move bit-shift operation to the macro body. Signed-off-by: Alexey Makhalov --- arch/x86/kernel/cpu/vmware.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c index 11f83d07925e..f58c8d669bd3 100644 --- a/arch/x86/kernel/cpu/vmware.c +++ b/arch/x86/kernel/cpu/vmware.c @@ -49,10 +49,11 @@ #define VMWARE_CMD_GETVERSION 10 #define VMWARE_CMD_GETHZ 45 #define VMWARE_CMD_GETVCPU_INFO 68 -#define VMWARE_CMD_LEGACY_X2APIC 3 -#define VMWARE_CMD_VCPU_RESERVED 31 #define VMWARE_CMD_STEALCLOCK 91 +#define GETVCPU_INFO_LEGACY_X2APIC BIT(3) +#define GETVCPU_INFO_VCPU_RESERVED BIT(31) + #define STEALCLOCK_NOT_AVAILABLE (-1) #define STEALCLOCK_DISABLED 0 #define STEALCLOCK_ENABLED 1 @@ -476,8 +477,8 @@ static bool __init vmware_legacy_x2apic_available(void) { uint32_t eax, ebx, ecx, edx; VMWARE_CMD(GETVCPU_INFO, eax, ebx, ecx, edx); - return !(eax & BIT(VMWARE_CMD_VCPU_RESERVED)) && - (eax & BIT(VMWARE_CMD_LEGACY_X2APIC)); + return !(eax & GETVCPU_INFO_VCPU_RESERVED) && + (eax & GETVCPU_INFO_LEGACY_X2APIC); } #ifdef CONFIG_AMD_MEM_ENCRYPT From patchwork Wed Apr 24 23:14:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Makhalov X-Patchwork-Id: 13642652 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00B6016F0DF for ; Wed, 24 Apr 2024 23:14:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714000472; cv=none; b=jJL6n2UL18H2Dd+rHQD1eMrPAK96lyFCnkY2mjW/1Hes2udPKv1KgT4n6dt7+OCHNuxsztuoezsaAb2aRR4GU0trSPi9Bv5gWsfTfCbBP0b4Cvnv48U8TNijLyWYmBWZLcWbGv7Bfe1wTye7Fdl3esdvjc2J6NxOpiEc+AIkvsc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714000472; c=relaxed/simple; bh=RjqHHh8+OvvgHWX6skeosEzS4N2AwclxB9HYRka+bGI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gpgDIAzYCYLgJjNm6XpDHkjon4c9uj18YrxVqN4brhLn6Vg8WzsxiQGhDG4kJK7qWPH9bigS/HzFv6Gr0D0sEXXn4mxDPRAiuIIo5c+Vdc6RPVebkDkgEoLwkeAK71VWxdkBuHqm1kLOIMPMn+LKB5q0LS2p84/zx6qeJDpq6+4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=V6WKQAwp; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="V6WKQAwp" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1e8bbcbc2b7so3728715ad.0 for ; Wed, 24 Apr 2024 16:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1714000470; x=1714605270; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yW3rWzRu2U3mMza79f2YiFDKKLiYjn35V/dUh+fOfas=; b=V6WKQAwp44pm6l8lFwzXWMuvXTnpqtJVjYEmNEK4PgbJxXevetq0K6Z7r1xYaLSbO+ Lgi06LH3J3wUxwQu9VoFQtcfcmAElwWQSRvESKc6uo9AxKDaY2lxP2i/W3xosn8GIK2K Susknq3PgCubXRfj6MnYmTZRWuUHJ8A6HDVtU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714000470; x=1714605270; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yW3rWzRu2U3mMza79f2YiFDKKLiYjn35V/dUh+fOfas=; b=rSmOg1KftZmFZAetTwa/izi70a13oQlyrrZMcRT8r2cQemI1VGoQUJUNT3INQi4Pt6 GKGSO+miWMeIBVciHxiaxTK+Vw0J+nzKURXg8dFMSa/rkAoodJ3dclnIsVj9qtcRlGwK IGrYB48RF3eCwlo8vSLm0TBwAK2vnBn4g+/ANzZVOXAbkjR06/Lrug3VQ7IUbYlKaXmV oZbcs98l8rfWvLJDLRr3xS6pDTDNNsmfU51WNWmyAhsRw0BI5CpgGzJpZy0x2HaAi4qn oeV1xnVD4qoU5hjIs25cVaLQRW+GErfbI4MEhzJ40LIGNFh/F2+A/xMDplgr9shCQT/W QbVg== X-Forwarded-Encrypted: i=1; AJvYcCWFBxgVSCmMQ70XW+Z8bAzpqzj8OAEAxIoOY7rMAhNzgjz4G6m8zYU/ocBvR4idGJcSxqRq+r9tfdKFAhfFd2i0JILyJJSk X-Gm-Message-State: AOJu0YwU+aDxmVgLZCaK7TDIGTzN0Duq3VsCymu+uHvD14/XIih0Vjwu W/D26viCLCnni3/9xZ+NdiKMHTDo51GFGRJpdKQR5NX+15vCWHHnJi9DbDqqxw== X-Google-Smtp-Source: AGHT+IEr4i3DB4r3Qkm4dkUw7/0uwv+gx9Lch3vZC0mX7eYJ4jMuT6PuvlXOirfn5+jM9r3f/0CttQ== X-Received: by 2002:a17:903:18d:b0:1e0:b689:950b with SMTP id z13-20020a170903018d00b001e0b689950bmr5683142plg.16.1714000470208; Wed, 24 Apr 2024 16:14:30 -0700 (PDT) Received: from amakhalov-build-vm.eng.vmware.com ([64.186.27.43]) by smtp.gmail.com with ESMTPSA id n17-20020a170903111100b001e520495f51sm12383936plh.124.2024.04.24.16.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 16:14:29 -0700 (PDT) From: Alexey Makhalov To: linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, bp@alien8.de, hpa@zytor.com, dave.hansen@linux.intel.com, mingo@redhat.com, tglx@linutronix.de Cc: x86@kernel.org, netdev@vger.kernel.org, richardcochran@gmail.com, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com, zackr@vmware.com, linux-graphics-maintainer@vmware.com, pv-drivers@vmware.com, timothym@vmware.com, akaher@vmware.com, dri-devel@lists.freedesktop.org, daniel@ffwll.ch, airlied@gmail.com, tzimmermann@suse.de, mripard@kernel.org, maarten.lankhorst@linux.intel.com, horms@kernel.org, kirill.shutemov@linux.intel.com, Alexey Makhalov , Nadav Amit Subject: [PATCH v9 2/8] x86/vmware: Move common macros to vmware.h Date: Wed, 24 Apr 2024 16:14:07 -0700 Message-Id: <20240424231407.14098-2-alexey.makhalov@broadcom.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20240424231407.14098-1-alexey.makhalov@broadcom.com> References: <20240424231407.14098-1-alexey.makhalov@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Move VMware hypercall macros to vmware.h. This is a prerequisite for the introduction of vmware_hypercall API. No functional changes besides exporting vmware_hypercall_mode symbol. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit --- arch/x86/include/asm/vmware.h | 72 +++++++++++++++++++++++++++++------ arch/x86/kernel/cpu/vmware.c | 43 +-------------------- 2 files changed, 62 insertions(+), 53 deletions(-) diff --git a/arch/x86/include/asm/vmware.h b/arch/x86/include/asm/vmware.h index ac9fc51e2b18..de2533337611 100644 --- a/arch/x86/include/asm/vmware.h +++ b/arch/x86/include/asm/vmware.h @@ -8,25 +8,34 @@ /* * The hypercall definitions differ in the low word of the %edx argument - * in the following way: the old port base interface uses the port - * number to distinguish between high- and low bandwidth versions. + * in the following way: the old I/O port based interface uses the port + * number to distinguish between high- and low bandwidth versions, and + * uses IN/OUT instructions to define transfer direction. * * The new vmcall interface instead uses a set of flags to select * bandwidth mode and transfer direction. The flags should be loaded * into %dx by any user and are automatically replaced by the port - * number if the VMWARE_HYPERVISOR_PORT method is used. - * - * In short, new driver code should strictly use the new definition of - * %dx content. + * number if the I/O port method is used. */ -/* Old port-based version */ -#define VMWARE_HYPERVISOR_PORT 0x5658 -#define VMWARE_HYPERVISOR_PORT_HB 0x5659 +#define VMWARE_HYPERVISOR_HB BIT(0) +#define VMWARE_HYPERVISOR_OUT BIT(1) + +#define VMWARE_HYPERVISOR_PORT 0x5658 +#define VMWARE_HYPERVISOR_PORT_HB (VMWARE_HYPERVISOR_PORT | \ + VMWARE_HYPERVISOR_HB) + +#define VMWARE_HYPERVISOR_MAGIC 0x564d5868U + +#define VMWARE_CMD_GETVERSION 10 +#define VMWARE_CMD_GETHZ 45 +#define VMWARE_CMD_GETVCPU_INFO 68 +#define VMWARE_CMD_STEALCLOCK 91 + +#define CPUID_VMWARE_FEATURES_ECX_VMMCALL BIT(0) +#define CPUID_VMWARE_FEATURES_ECX_VMCALL BIT(1) -/* Current vmcall / vmmcall version */ -#define VMWARE_HYPERVISOR_HB BIT(0) -#define VMWARE_HYPERVISOR_OUT BIT(1) +extern u8 vmware_hypercall_mode; /* The low bandwidth call. The low word of edx is presumed clear. */ #define VMWARE_HYPERCALL \ @@ -54,4 +63,43 @@ "rep insb", \ "vmcall", X86_FEATURE_VMCALL, \ "vmmcall", X86_FEATURE_VMW_VMMCALL) + +#define VMWARE_PORT(cmd, eax, ebx, ecx, edx) \ + __asm__("inl (%%dx), %%eax" : \ + "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ + "a"(VMWARE_HYPERVISOR_MAGIC), \ + "c"(VMWARE_CMD_##cmd), \ + "d"(VMWARE_HYPERVISOR_PORT), "b"(UINT_MAX) : \ + "memory") + +#define VMWARE_VMCALL(cmd, eax, ebx, ecx, edx) \ + __asm__("vmcall" : \ + "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ + "a"(VMWARE_HYPERVISOR_MAGIC), \ + "c"(VMWARE_CMD_##cmd), \ + "d"(0), "b"(UINT_MAX) : \ + "memory") + +#define VMWARE_VMMCALL(cmd, eax, ebx, ecx, edx) \ + __asm__("vmmcall" : \ + "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ + "a"(VMWARE_HYPERVISOR_MAGIC), \ + "c"(VMWARE_CMD_##cmd), \ + "d"(0), "b"(UINT_MAX) : \ + "memory") + +#define VMWARE_CMD(cmd, eax, ebx, ecx, edx) do { \ + switch (vmware_hypercall_mode) { \ + case CPUID_VMWARE_FEATURES_ECX_VMCALL: \ + VMWARE_VMCALL(cmd, eax, ebx, ecx, edx); \ + break; \ + case CPUID_VMWARE_FEATURES_ECX_VMMCALL: \ + VMWARE_VMMCALL(cmd, eax, ebx, ecx, edx); \ + break; \ + default: \ + VMWARE_PORT(cmd, eax, ebx, ecx, edx); \ + break; \ + } \ + } while (0) + #endif diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c index f58c8d669bd3..acd9658f7c4b 100644 --- a/arch/x86/kernel/cpu/vmware.c +++ b/arch/x86/kernel/cpu/vmware.c @@ -41,8 +41,6 @@ #define CPUID_VMWARE_INFO_LEAF 0x40000000 #define CPUID_VMWARE_FEATURES_LEAF 0x40000010 -#define CPUID_VMWARE_FEATURES_ECX_VMMCALL BIT(0) -#define CPUID_VMWARE_FEATURES_ECX_VMCALL BIT(1) #define VMWARE_HYPERVISOR_MAGIC 0x564D5868 @@ -58,44 +56,6 @@ #define STEALCLOCK_DISABLED 0 #define STEALCLOCK_ENABLED 1 -#define VMWARE_PORT(cmd, eax, ebx, ecx, edx) \ - __asm__("inl (%%dx), %%eax" : \ - "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ - "a"(VMWARE_HYPERVISOR_MAGIC), \ - "c"(VMWARE_CMD_##cmd), \ - "d"(VMWARE_HYPERVISOR_PORT), "b"(UINT_MAX) : \ - "memory") - -#define VMWARE_VMCALL(cmd, eax, ebx, ecx, edx) \ - __asm__("vmcall" : \ - "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ - "a"(VMWARE_HYPERVISOR_MAGIC), \ - "c"(VMWARE_CMD_##cmd), \ - "d"(0), "b"(UINT_MAX) : \ - "memory") - -#define VMWARE_VMMCALL(cmd, eax, ebx, ecx, edx) \ - __asm__("vmmcall" : \ - "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \ - "a"(VMWARE_HYPERVISOR_MAGIC), \ - "c"(VMWARE_CMD_##cmd), \ - "d"(0), "b"(UINT_MAX) : \ - "memory") - -#define VMWARE_CMD(cmd, eax, ebx, ecx, edx) do { \ - switch (vmware_hypercall_mode) { \ - case CPUID_VMWARE_FEATURES_ECX_VMCALL: \ - VMWARE_VMCALL(cmd, eax, ebx, ecx, edx); \ - break; \ - case CPUID_VMWARE_FEATURES_ECX_VMMCALL: \ - VMWARE_VMMCALL(cmd, eax, ebx, ecx, edx); \ - break; \ - default: \ - VMWARE_PORT(cmd, eax, ebx, ecx, edx); \ - break; \ - } \ - } while (0) - struct vmware_steal_time { union { uint64_t clock; /* stolen time counter in units of vtsc */ @@ -109,7 +69,8 @@ struct vmware_steal_time { }; static unsigned long vmware_tsc_khz __ro_after_init; -static u8 vmware_hypercall_mode __ro_after_init; +u8 vmware_hypercall_mode __ro_after_init; +EXPORT_SYMBOL_GPL(vmware_hypercall_mode); static inline int __vmware_platform(void) {