Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp199600rdd; Tue, 9 Jan 2024 00:58:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmxYYMk9Fx2+lMUwoSP9WUk9QYewnqlHYp+KsD0kfbWZocb+svL/ykdFYQJ2qPvewHy+1f X-Received: by 2002:a05:6a21:3d88:b0:199:f5ef:5a8d with SMTP id bj8-20020a056a213d8800b00199f5ef5a8dmr408884pzc.116.1704790725035; Tue, 09 Jan 2024 00:58:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704790725; cv=none; d=google.com; s=arc-20160816; b=BSVBeyWwBi6qJ+d7D1q84FHnwgtmE7jj1Qv1cxqwFZMV791bpmyTPQT5FNwAKR48fv RLJS2qmBMxpPt/tcsrJecYZWcCD0kNxmrt7W3chl3OhlFSfaYl5+Td5hM/tIIRahFFQV XUTaIOynS6u2jYPXzjLGpMQDxHrrqecHZNK+EEHyUcWdYM07atHYKBlU91dOqHmqZC3a sfcd6WjSBiE9BDoXVc1XzXpKXBzZ5gq35RCqe0SNm5iFlrscQeL973D43nW8obKmJiFF GW1F7NLYXpAOchcpPzvNpvfUfFllTRYy01SFYPq95SZkEwti107O3sUJ7zDBoL9ewCUf CJHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=9wYpp3OYvmWsAtzJnbqql3qjVLEUjHL49vz1VsGi0Ho=; fh=6RQVJhUadVlbCYQO8WbwFdcKs3+SddxIKFPo/gACb1Y=; b=R5dkV4YI3DApfYOvrhOrQcJnF3KsKjkOYt8rFr5ZC+3yvnuy3q8NdvmTfLVR6cSIM/ 95EhRmjfngDd4bKIoWZJd8LXeYB7Y44hbImkyaJGiGDEg2EbhkdtPfZqFuseOPkxqVG2 1cwGFk6+Imb2KCQRsWwi+x2v/wEFoqwv8aSD9/tLtHzkahVp+reSjFvMUJNOVr/bxwo3 Baq5vdjYlpxTeGTf+CLMMePjr96wWMNU9Cb0op+RLMNatpS8fKzTPk6zERx985OHek6r n+bkbCXYvlLDrr4uDlo0bqz04WAnwkywqBkyvrH/Fg93v019sxozaCFA0PbTNNe60vJf skKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=GBgiEdZv; spf=pass (google.com: domain of linux-kernel+bounces-20601-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20601-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id fi39-20020a056a0039a700b006d9ab6f62fdsi1136150pfb.235.2024.01.09.00.58.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 00:58:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20601-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=GBgiEdZv; spf=pass (google.com: domain of linux-kernel+bounces-20601-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20601-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A2547B228BF for ; Tue, 9 Jan 2024 08:42:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 380813608F; Tue, 9 Jan 2024 08:41:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="GBgiEdZv" Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (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 0B5BA29CF2 for ; Tue, 9 Jan 2024 08:41:01 +0000 (UTC) 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 Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-53fbf2c42bfso1997373a12.3 for ; Tue, 09 Jan 2024 00:41:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1704789661; x=1705394461; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9wYpp3OYvmWsAtzJnbqql3qjVLEUjHL49vz1VsGi0Ho=; b=GBgiEdZvwzE+UCjGpmZoGz7OPscaF1+ok0YSnaNGirSA05VG0Kuh+MiQOOPczijwiQ iZHtDPGB3s0GB4To1gfO8/bMu1/8jQyJu3xSMj7O+pmYUb6d3Id7R5CjseO+bE+dUz78 YcsvCre7b6vAPfyagRLerD1TQzF2G7SJOneZ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704789661; x=1705394461; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9wYpp3OYvmWsAtzJnbqql3qjVLEUjHL49vz1VsGi0Ho=; b=kSDsQLUnsljA0C9V7JaWvRwMOVZIC8o041NAM9TGGhWHKvN8et5oT9RMFRg4o91hRt WZXHNgwBBB7qqBJT5YU/ksTslo+KubMVDqT6AmsEeXYQqGYx65BEpc9dXJ8OhJCRNS5V rEG4rX8vJ3357MUnJkqmOjG/kxy22W4rEsSoDsV/uGBD+uIHbO1QseOzimUJ3prZB0Gd fQIf1tHmuxIdvJECmnB5kXAhkUxCelGfO5+9woMv5c9Tiya/Kh/3kDSq9HiC4POME6DO lpdmze/tyOXDRy5YSHH05+h5Rvb6OVsVdgxSxYqYmse2sMdKdqQxYJsg0RBdvgcCXia6 GaUA== X-Gm-Message-State: AOJu0YyaLirxFHgr7NMlINPcJbvcvVdzVPHewAi2npdB1zdur0jqBNfU llEuY/kYStBNXhW11qhDZwl5NxH38u+7RzCMBboRcskGJ7WZxPOPrGZXpXm3XkPYsRFdlSzmVUz 4TXyiDtdatOqDqoWFsfl7stCumTs+0X1teYUGcuhRl55GSdg8B/Ca6Cp/j1cR048TGPbm0KsgbA K5IhCNxqlzehaF97HKO9y7hEc= X-Received: by 2002:a05:6a20:1446:b0:199:c5b5:8f18 with SMTP id a6-20020a056a20144600b00199c5b58f18mr2129019pzi.14.1704789660801; Tue, 09 Jan 2024 00:41:00 -0800 (PST) Received: from amakhalov-build-vm.eng.vmware.com ([128.177.82.146]) by smtp.gmail.com with ESMTPSA id sf15-20020a17090b51cf00b0028d435cc2cbsm4772293pjb.15.2024.01.09.00.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 00:41:00 -0800 (PST) From: Alexey Makhalov X-Google-Original-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, namit@vmware.com, timothym@vmware.com, akaher@vmware.com, jsipek@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 Subject: [PATCH v6 0/7] VMware hypercalls enhancements Date: Tue, 9 Jan 2024 00:40:45 -0800 Message-Id: <20240109084052.58661-1-amakhalov@vmware.com> X-Mailer: git-send-email 2.39.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit VMware hypercalls invocations were all spread out across the kernel implementing same ABI as in-place asm-inline. With encrypted memory and confidential computing it became harder to maintain every changes in these hypercall implementations. Intention of this patchset is to introduce arch independent VMware hypercall API layer other subsystems such as device drivers can call to, while hiding architecture specific implementation behind. Second patch introduces the vmware_hypercall low and high bandwidth families of functions, with little enhancements there. Sixth patch adds tdx hypercall support arm64 implementation of vmware_hypercalls is in drivers/gpu/drm/ vmwgfx/vmwgfx_msg_arm64.h and going to be moved to arch/arm64 with a separate patchset with the introduction of VMware Linux guest support for arm64. No functional changes in drivers/input/mouse/vmmouse.c and drivers/ptp/ptp_vmw.c v5->v6 change: - Added ack by Kirill A. Shutemov in patch 7. v4->v5 changes: [patch 2]: - Fixed the problem reported by Simon Horman where build fails after patch 2 application. Do not undefine VMWARE_HYPERCALL for now, and update vmwgfx, vmmouse and ptp_vmw code for new VMWARE_HYPERCALL macro. - Introduce new patch 6 to undefine VMWARE_HYPERCALL, which is safe to do after patches 3 to 5. - [patch 7 (former patch 6)]: Add missing r15 (CPL) initialization. v3->v4 changes: (no functional changes in patches 1-5) [patch 2]: - Added the comment with VMware hypercall ABI description. [patch 6]: - vmware_tdx_hypercall_args remove in6/out6 arguments as excessive. - vmware_tdx_hypercall return ULONG_MAX on error to mimic bad hypercall command error from the hypervisor. - Replaced pr_warn by pr_warn_once as pointed by Kirill Shutemov. - Fixed the warning reported by Intel's kernel test robot. - Added the comment describing VMware TDX hypercall ABI. v2->v3 changes: (no functional changes in patches 1-5) - Improved commit message in patches 1, 2 and 5 as was suggested by Borislav Petkov. - To address Dave Hansen's concern, patch 6 was reorganized to avoid exporting bare __tdx_hypercall and to make exported vmware_tdx_hypercall VMWare guest specific. v1->v2 changes (no functional changes): - Improved commit message in patches 2 and 5. - Added Reviewed-by for all patches. - Added Ack from Dmitry Torokhov in patch 4. No fixes regarding reported by Simon Horman gcc error in this patch. Alexey Makhalov (7): x86/vmware: Move common macros to vmware.h x86/vmware: Introduce VMware hypercall API ptp/vmware: Use VMware hypercall API input/vmmouse: Use VMware hypercall API drm/vmwgfx: Use VMware hypercall API x86/vmware: Undefine VMWARE_HYPERCALL x86/vmware: Add TDX hypercall support arch/x86/include/asm/vmware.h | 364 ++++++++++++++++++++-- arch/x86/kernel/cpu/vmware.c | 117 +++---- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 173 ++++------ drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h | 197 ++++++++---- drivers/gpu/drm/vmwgfx/vmwgfx_msg_x86.h | 185 ----------- drivers/input/mouse/vmmouse.c | 76 ++--- drivers/ptp/ptp_vmw.c | 12 +- 7 files changed, 599 insertions(+), 525 deletions(-) -- 2.39.0