Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp121966rdd; Mon, 8 Jan 2024 21:11:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IEHZlzBxsoDjOUsEl0E7x21Aw11nlRO3vYOPhsGweGvx+hO5EeYpgZ1wx5UhVtmfR7Aedqy X-Received: by 2002:ac8:5943:0:b0:427:fa8c:e6b4 with SMTP id 3-20020ac85943000000b00427fa8ce6b4mr298601qtz.34.1704777109541; Mon, 08 Jan 2024 21:11:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704777109; cv=none; d=google.com; s=arc-20160816; b=kVQvUOI6jouw93+AnysE963DOzP/ekkYumhIrNqfZE/JdBYFzglLLVvKvZEVq7Peu8 bEc+cdekQW3hZM2TYz23buhDtpxt+ZSAKYMMz7eYtU8RN83UddR4FtrHD5RdRLOM/QR9 DhpUy3PB371lyA0tIJprVjEFj5e5A4Am/qdw0vmGvNYvgQk7wDOXad+mBS6ybGK/U3UH wGiScqsfBXj5Bz6WzjO/FvSnLTaLE5dIAoJ1LVoafO0fu+3+PWW52js/G/1q454gFDcq Jdq6B5aUlVk5/j0l2IP97+CFSrGhcFPv13A/E8cc1PcxMNO+CVFYGKbn8J87WDBYIEuA z/JQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=FPJVwuu4FbYV5iHDsqoRPE2dBrY067QdoWIAplCPCFE=; fh=6RQVJhUadVlbCYQO8WbwFdcKs3+SddxIKFPo/gACb1Y=; b=VBN33mNWnW6HW4LwMj8cD8q6bHrRnfNhD9J1szQ35isHVVQFPLmIQ5LJuBsB+mU+mg UccZeNeEF5oq6BfqDAHg2rr3Ng8ISPkMHY/EM2C3RX8q+bRRvmiyTb1m0cAwMSEp/uE/ gzi2zBB6eaT1irJo9nUIhp0/p7IR5efN4ia1N4JR0UjRkFeEhGWMDkdAxRJDTxmr2MEC TCumEYA85510hFuHFm7ufzM2OjelS2ZcWOsf7l2Jc5+OG8nd4vJBdZ2FNwHFn5paS4WW NQfSiF0vGenZ9ko98Gr+Y5u7Q5LAn7W7hoYaXWbQL/XbEPVf+fUFd1jt+rdZeyu5T4S1 aIvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=EmGEhqAy; spf=pass (google.com: domain of linux-kernel+bounces-20396-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20396-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f5-20020ac859c5000000b00429915367e4si1295924qtf.27.2024.01.08.21.11.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 21:11:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20396-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=EmGEhqAy; spf=pass (google.com: domain of linux-kernel+bounces-20396-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20396-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3461A1C235E7 for ; Tue, 9 Jan 2024 05:11:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4426134C3; Tue, 9 Jan 2024 05:10:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="EmGEhqAy" Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (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 CBA83B66B for ; Tue, 9 Jan 2024 05:10:35 +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-f177.google.com with SMTP id 41be03b00d2f7-5c66b093b86so2322905a12.0 for ; Mon, 08 Jan 2024 21:10:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1704777035; x=1705381835; 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=FPJVwuu4FbYV5iHDsqoRPE2dBrY067QdoWIAplCPCFE=; b=EmGEhqAyQlkwR0zjSk2C26nWvqD+SwXX50vz2RdmO7G/PWbBlk7kvAjPIZEhQMn3E4 NhmuL1Wms8t7/0Siz9EYlTLOsdfS0QbJNFcpNQGckrzv9PbSLU7UrEs2Dh8ifKi2Hd/o yTwtlVb4U2ZxlPqZB3SWOuzBGr494hgqzir4M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704777035; x=1705381835; 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=FPJVwuu4FbYV5iHDsqoRPE2dBrY067QdoWIAplCPCFE=; b=vCt0ZOBgxGPYn1eb0PV+8+CVDMEjzrke3f308wwfvMO7ZyvCVzykQlvE0QX4hXnbH7 odtPOjee+s7mVe1LG0qV4D0jB/NnId1gafNeoxSI685hR1oziDU7Kc88u7qF+OCvjMxR NITkftL8ceWMApYGwKzf387joydgt7+XcrSUIm3lKxjJNwkBsFSePeZ8ZpMkYFKXOzmy JT3QgviUHo4Xnavn0Gla6hNFX8kawC+u815MU4thEYP1GGWnP8yfBDqgXQFSkolVR0Xz s9cimM5n/mWRhJiPJn05u5I/dNl60Vbx7GKledxhoJcqvvuYlr5LXWXkscV943/eVeG4 DPcQ== X-Gm-Message-State: AOJu0YxLWZSX9T1ADdKz7OTsRBHcj6vtbZWA5kSB52qajjKJXhaOQpxx DsXl7r7mCmiJcMEAGEeILnZ7g+60nnQ5P6n0m79qRZBpHq9VFwqrzCD3RkfsSyp0lquSWQOuISO BAcV4DiwBk81+zx8dCujHmxhodfX0qVURfxdr99eaDwoFTqZ7UOih7Ne471Lv+cGtUVxo101/lF fMpigZe74EFW0sAUqEfYSkHVY= X-Received: by 2002:a17:90a:de0e:b0:28b:fee8:17e0 with SMTP id m14-20020a17090ade0e00b0028bfee817e0mr271922pjv.19.1704777034669; Mon, 08 Jan 2024 21:10:34 -0800 (PST) Received: from amakhalov-build-vm.eng.vmware.com ([128.177.82.146]) by smtp.gmail.com with ESMTPSA id u12-20020a17090ac88c00b0028aecd6b29fsm7344115pjt.3.2024.01.08.21.10.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 21:10:34 -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 v5 3/7] ptp/vmware: Use VMware hypercall API Date: Mon, 8 Jan 2024 21:10:13 -0800 Message-Id: <20240109051017.58167-4-amakhalov@vmware.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20240109051017.58167-1-amakhalov@vmware.com> References: <20240109051017.58167-1-amakhalov@vmware.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Switch from VMWARE_HYPERCALL macro to vmware_hypercall API. Eliminate arch specific code. No functional changes intended. Signed-off-by: Alexey Makhalov Reviewed-by: Nadav Amit Reviewed-by: Jeff Sipek --- drivers/ptp/ptp_vmw.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/ptp/ptp_vmw.c b/drivers/ptp/ptp_vmw.c index 279d191d2df9..e5bb521b9b82 100644 --- a/drivers/ptp/ptp_vmw.c +++ b/drivers/ptp/ptp_vmw.c @@ -14,7 +14,6 @@ #include #include -#define VMWARE_MAGIC 0x564D5868 #define VMWARE_CMD_PCLK(nr) ((nr << 16) | 97) #define VMWARE_CMD_PCLK_GETTIME VMWARE_CMD_PCLK(0) @@ -24,17 +23,10 @@ static struct ptp_clock *ptp_vmw_clock; static int ptp_vmw_pclk_read(u64 *ns) { - u32 ret, nsec_hi, nsec_lo, unused1, unused2, unused3; - - asm volatile (VMWARE_HYPERCALL : - "=a"(ret), "=b"(nsec_hi), "=c"(nsec_lo), "=d"(unused1), - "=S"(unused2), "=D"(unused3) : - [port] "i" (VMWARE_HYPERVISOR_PORT), - [mode] "m" (vmware_hypercall_mode), - "a"(VMWARE_MAGIC), "b"(0), - "c"(VMWARE_CMD_PCLK_GETTIME), "d"(0) : - "memory"); + u32 ret, nsec_hi, nsec_lo; + ret = vmware_hypercall3(VMWARE_CMD_PCLK_GETTIME, 0, + &nsec_hi, &nsec_lo); if (ret == 0) *ns = ((u64)nsec_hi << 32) | nsec_lo; return ret; -- 2.39.0