From patchwork Wed Nov 22 23:30:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Makhalov X-Patchwork-Id: 13465571 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=vmware.com header.i=@vmware.com header.b="zHFVLMBi" Received: from DM4PR02CU002.outbound.protection.outlook.com (mail-centralusazon11013021.outbound.protection.outlook.com [52.101.64.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E926E112; Wed, 22 Nov 2023 15:31:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fhgizPRVQ0kTssHMnEnv3HXZgASe/YEkOUzWB9Q3AWiCmdxTy1zuZSfDdZZwqAV1vaJYiVoM/UqJqckSHYJyOrbiESbF6/FRFpjRkct8cd8BFQNmoq+QqkAhSkYnPgFbKmvQuQb/GaHfFyQfEt3flCyuJA1HWj0sIuaKZ2OJb7uMJrjj/bck9ppW9LWQpsPs88YUTbReglFaGFYpSj/BdYJBrCh4b1HieUO8oSopBVoXogw0TEZ6TL1uFxZPUoMNRe/Hl2JwS9CI0YwvkdoRrSyu6D8Z8Z/acvyHUB2fdbLOYKNVsupwwx/lHfgRMjbO+bBJHru5aTocVJZWK2dlpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9X+iO1QmTuqf+eDzj8IyX2iYLWS7QsP/WGHqbRswu9c=; b=cIBsKPlVM78eIDVasf2OioIrzEAGOHe33Ea+vJbcE2D38sZLxjt429u0kRo+hNqfkTrO0KKMxJqyFxswIaYmIylzSuGk2Q06p6n1kUNxgOvjUIGk0kF/YNtgqM+rVGJPpnF3jtEdQGenk5PK0gfrYSplYDVcFDymHyula3oZ+anGvrO//65DnRCOzzqzm8aphT6kTbpZljTca/fhSwMY+K43LNfC0tnyJa0p1ySCjHp+PDBZPtr3D277kvrUeZZ3VVzQAV+KszYKYbHzZulEDTX9q5uSjdM1MNaIeE9cqkH+OrQABcvnkmXkCggPWMN3L1vnyFqtBctis/eFAT7c3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9X+iO1QmTuqf+eDzj8IyX2iYLWS7QsP/WGHqbRswu9c=; b=zHFVLMBiUM/G+WBMqhA6ut621BLhSh9KSk9peGICK+krsrwnGFwPW2ira45xILZB5HCNW4iR09vIo/bWC/t+QnBOPW+vwH+8TsKkMOFTnkqbh0atym3neBCm4uFsm/Z7u0phlYEY/zSv3QUHGuguvvTuDJUi045W+2FLBbkZNLo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vmware.com; Received: from MWHPR05MB3648.namprd05.prod.outlook.com (2603:10b6:301:45::23) by BY3PR05MB8275.namprd05.prod.outlook.com (2603:10b6:a03:3b6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Wed, 22 Nov 2023 23:31:16 +0000 Received: from MWHPR05MB3648.namprd05.prod.outlook.com ([fe80::10f0:590a:708:4ad7]) by MWHPR05MB3648.namprd05.prod.outlook.com ([fe80::10f0:590a:708:4ad7%2]) with mapi id 15.20.7025.019; Wed, 22 Nov 2023 23:31:15 +0000 From: Alexey Makhalov To: linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, hpa@zytor.com, x86@kernel.org, dave.hansen@linux.intel.co, bp@alien8.d, mingo@redhat.com, tglx@linutronix.de, zackr@vmware.com, timothym@vmware.com, dri-devel@lists.freedesktop.org, daniel@ffwll.ch, airlied@gmail.com, tzimmermann@suse.de, mripard@kernel.org, maarten.lankhorst@linux.intel.com Cc: netdev@vger.kernel.org, richardcochran@gmail.com, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com, linux-graphics-maintainer@vmware.com, pv-drivers@vmware.com, namit@vmware.com, akaher@vmware.com, jsipek@vmware.com, Alexey Makhalov Subject: [PATCH 0/6] VMware hypercalls enhancements Date: Wed, 22 Nov 2023 15:30:45 -0800 Message-Id: <20231122233058.185601-1-amakhalov@vmware.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: BYAPR05CA0039.namprd05.prod.outlook.com (2603:10b6:a03:74::16) To MWHPR05MB3648.namprd05.prod.outlook.com (2603:10b6:301:45::23) Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR05MB3648:EE_|BY3PR05MB8275:EE_ X-MS-Office365-Filtering-Correlation-Id: c8bf9d12-8a32-4472-3940-08dbebb31e6a X-LD-Processed: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vV8vuqWHmiO/tsNXq5qrTzblLJdHv3pRDBPcRwzjVXDhW8pzS4jBMKzFu4im9QQnvIpBY8d9NnJqgbVaIIYVYVlrbPiIzW/sCMnw5UwfaSsvPlJB3hBFSH0SzolvRa2h7vmF6MM8PQ5UR00GEkaxGcqaHeB706+Z/0DGmUU2b9WRPm9EtsC5dAcab6YvxPQ/+2xtHcOmlzJa3MLKrWsc5T/uuhyjd6mYiQEy8DPL3iK3PAZZtcivGkajzex1/FB8BBBXTFrTz0F8tj91dVO8NvPO9/XptVI8Je/qEtEIarA7Hhxb7zi5xvV8bYxkm6f086FYWP3Ub7m7UuUOeCijA3fO04Qe9Mq4k/XXyudj9kZDdEFg6VvDqeLTbbbaJPZBBsA07UeTtuttXLW4uI2RIbWmYch2a7uJTDcjQFCfMcCBsk2RXToOICQejlGd7d+IzXYKZrRgRkzdguEDax3GiKAoTSQyUP/aS8xxu3Q3oRRpsgbQYXDfbe8gNv7xRXndFdg73lDuPyC5zQgAvRxZWj4SqSccojwAdwYW/sM6ae8T1j6kYB00BkI9QFBFHqrkR3Vf6UL9lJM80OKsliW0Q64id86G4c+RDtTRChxaTpczZE7yDV4szHi0UE06xAPjafYKt0DXRgzcKekucG3c9tkXbSNoascTPiL2+WRh8CkdYRdz3UM8HKnMX4pNdQ/r X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR05MB3648.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(366004)(376002)(136003)(39860400002)(346002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6486002)(4326008)(8676002)(8936002)(5660300002)(7416002)(2616005)(107886003)(478600001)(83380400001)(38350700005)(6666004)(2906002)(66946007)(66556008)(66476007)(38100700002)(316002)(41300700001)(6506007)(6512007)(52116002)(26005)(36756003)(86362001)(921008)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: r4R/D5TldzVrLQcJvetj83dPh3Q7JfGEwbPFVJCYDs//ABIt/01A8ReAav6EDZVhI0AaDYahZWOAHs97APnw5QzeSApbGjAderzsmmwJf1Ma6Ucl58z8fBCA6OuqsK73lpBtOh7RMPzpfXJWBSw4iFFLwXxfD+yh0j91SBS8HHVVBul2FGQNBCXMWKRpN1mrSjS+ixvebsB6r3TEXVJu0f7GZ6Mc3xEk0QD/bQ72TPq0zuHxPsBl/8QkaiSP73obTw/IG1gRn5Q7D3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3gnzKc+j3UlZ4eNDf6MU5RKMS9JvWcbqSt8CGIqmbtm6ep9Z0ZiESql+GTeTrDa5FRhbUh+Mhp1+dCrWN7eq/nEUgqElx3UcyglHG9/6in8snIcY663un4doSh8wzEiLgcCLp3vku/L1rgwLxVAMjNQhLc2t4PvJ/Z4ebRtfUXG7L0rXiUtK/gGHFKhZ+CieKR/Mk4uPVZ3ORP1sxjdj4Iq/JQdcSrMGm5AtNi19UqYYO85tnHl4HV X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8bf9d12-8a32-4472-3940-08dbebb31e6a X-MS-Exchange-CrossTenant-AuthSource: MWHPR05MB3648.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2023 23:31:15.0662 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0fkFUwQ3dw6DF43LdPfxPVB/nAXYEwlf9eT3XOMkNKR8EziizpRAbrAMN88asZMUQ7XlAqKFiy6sSKsBY7XVCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR05MB8275 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 Alexey Makhalov (6): 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: Add TDX hypercall support arch/x86/include/asm/vmware.h | 327 ++++++++++++++++++++-- arch/x86/kernel/cpu/vmware.c | 101 ++----- 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, 551 insertions(+), 520 deletions(-)