Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp367409lqs; Thu, 13 Jun 2024 12:18:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXQS3zszENXsPuqeLqvV/1a18XJDFbE7Xz5/yvvXGXNtucREUj37XUCTxgkfAJyFnMCVj/GnlGdZp7krG7hho3sXtAS6cJ+r66g74UYAA== X-Google-Smtp-Source: AGHT+IGcA3G+h42rsXWDp26qFbnbREx1EGahBufr349LWYGFKKRzOs0vfJboCWX46yN6UN7jST8S X-Received: by 2002:a05:6870:718a:b0:254:8d79:d7b7 with SMTP id 586e51a60fabf-2584297b84bmr635014fac.26.1718306320170; Thu, 13 Jun 2024 12:18:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718306320; cv=pass; d=google.com; s=arc-20160816; b=M9AWfbeHX9VHx26TLZlgI52aKuuwqYJ1S96xW6j6K+KDLZB8DL9AHmlugTDRe4ZMc7 vBDXx3D4Jg/wY4AmcVZR+GBUaF21aEooXlYEckDCa+QhExV1af8BW1tQg/0zq7xRvp3D J8KS0CMtDB4ILdmpFACxHa4kS95mgr+yri3x7uQZJXp/mRLdcITezwzgQe/xROmSUQhO Ext0KYKJta/UsZYY0Z4q/9BeX6m0UfMEwk6Jas/C46vX86tgT+w4k9dB0ifXeCYreSqm VR9x/M3FGhA5nlLoENP/obhvqxvzj79zvqMnlb5l/pxRbySHHrpq3IMlIF3TCzUMyW8K CDyA== ARC-Message-Signature: i=2; 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=Ax+3nG0Kdev/eny6WkBwEporcnkaWtjPbwWuGAk8XSQ=; fh=CqxT77qf7v0cyxcEfKNOSCPmdYyfEe8xwwY3GXvpCv4=; b=Xh4kkkOvTezwQtamajd702fd2Z9vz6n2TvfcFW/wg8tUOI/b872zvp+TCgLcbGI8BQ CkeJlfKIHIYVACmUh8KMayppNuwZOWh9JpuRlsKUH/PA1lBBFgfNcbNGOA6KJPmcUTQL 1ryWsKvnQ62OZDNDVSd5SUFlza02bHOwonPF0E7608GuiEE3PKiDvh/z0pRBOGIO10dB 5zurJzYKrBBa8V/25R4tYe18hWIhj7jerhPrUb5kKaaAxEB32xHVwUAPgQWOVc+wBliL oRs7XExteg88n9WUPDDHieaNPkzZHewC7KAR+yzns5E+KE/d2VR0PS9JKB6DqECeaQcG B2CA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=T8jrUKnd; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-213899-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213899-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. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-798abe621c5si195565785a.666.2024.06.13.12.18.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 12:18:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213899-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=T8jrUKnd; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-213899-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213899-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 CCFAE1C21CFB for ; Thu, 13 Jun 2024 19:18:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5181156246; Thu, 13 Jun 2024 19:17:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="T8jrUKnd" Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 6B9AE154C00 for ; Thu, 13 Jun 2024 19:17:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718306243; cv=none; b=Hzd7MJm+qiAhX1RFUHaK+LVIuOFazsPJbyUe2KXeFFxKSeycy0xvaDNa76ugQQYpQujRZ6i2qAbvA7x7XXDl0H0pKm2iJLUgSYwtwm69bdwIH7uNMQz7vglB3cZzfLKlRjTIYe8x3o7XqNcokY4LdO+5VfVFVWZ8p8O7a+1lZ6w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718306243; c=relaxed/simple; bh=OG42qfwazXtBgUNMq966TfvZjei0oGY3S3mxCfCH66M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=c/Kl3SN1eIQl492erc5rfpZR9AkRktc45ErIb7jmZEMPuQFZ33V8tWrvkHm2zaoT2kjNEMzvDaZx8Y8kIoK6MKMUgAvNyg8HDHzDRDE1vmZQSSOihUgg0dfb+kQMApjH3TqH/BrmDtyXW6vcyQaW5hxqIep/JC2DZVamOTLYVzA= 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=T8jrUKnd; arc=none smtp.client-ip=209.85.219.54 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-qv1-f54.google.com with SMTP id 6a1803df08f44-6b06446f667so7669916d6.2 for ; Thu, 13 Jun 2024 12:17:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1718306241; x=1718911041; 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=Ax+3nG0Kdev/eny6WkBwEporcnkaWtjPbwWuGAk8XSQ=; b=T8jrUKndskGgDsjjBNYoP+Plp13pv28s75zjE3iUgNPXd360QIALyezv/4cT9qoYZv xkQee6vzNhG+Aj2UMZX2ePkeIiDjCh1q91Bd7XO0/4vEGDWn6pPnu9z10bLj3EAVPTDC d6pVbmN8owwexJiVR2HSEgGah64BmH9vTulxA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718306241; x=1718911041; 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=Ax+3nG0Kdev/eny6WkBwEporcnkaWtjPbwWuGAk8XSQ=; b=UR4sJYGyXFewIjQyTLtl6qsByAu5kO32dKxKmF9ewQiTgdA+LqcU8PL915ECtYP3Ws gX/UOjfdknkqi2l0rhe0g4JZm3lDJDwR46VAqT0KkdQ4flGyTAnWVO0s7gptnjEaTFGR v9mvrKm36YPLgKd/JyjPqvo4nWvMEmPK4lWwOKbkTnf5jNLVG5eazkX9MMt9Yj2vCbCf YIrbf9LSy29vH4Ajzu0UuYIrlE5bLXyA6HIYQJp606yF09WewTvL2Zloq3KLQM5VdAzz 8CV/uC6hM/p69ZbtZvXrvY0kDqhGhyy75UJFkjhCiHvBtvABY3IBJXV9I2MCLjeIVMZg HtJA== X-Gm-Message-State: AOJu0Yxfd8LvS2IyrKbXCw4SMJdFMwShWaCkoLgJv5NSdBeELd85rsvE wnsMK+ZDUtC0kwaet+UWR3xdzThq8zm1NqYk38nJmeStB84mVJqo5RszIdfruG7tGO5VtnEt5FW e0VEEpNLG8RIgXcNwSKSbNimhmgVFzGxRYOFlO+/E6nDgavICq+8Ow9/LGO9idYgcDcsmjWa9eJ teZtum9CTxAxCY//ov5zrV3oNokx+Ka4vEY0boCrFNIMiAyY6iyEoq X-Received: by 2002:ad4:5a03:0:b0:6b2:b054:c64a with SMTP id 6a1803df08f44-6b2b054c6c8mr4382156d6.1.1718306240532; Thu, 13 Jun 2024 12:17:20 -0700 (PDT) Received: from amakhalov-build-vm.eng.vmware.com ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b2a5eb47f6sm9714106d6.82.2024.06.13.12.17.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 12:17:20 -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 v11 2/8] ptp/vmware: Use VMware hypercall API Date: Thu, 13 Jun 2024 12:16:44 -0700 Message-Id: <20240613191650.9913-3-alexey.makhalov@broadcom.com> X-Mailer: git-send-email 2.39.4 In-Reply-To: <20240613191650.9913-1-alexey.makhalov@broadcom.com> References: <20240613191650.9913-1-alexey.makhalov@broadcom.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 --- drivers/ptp/ptp_vmw.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/ptp/ptp_vmw.c b/drivers/ptp/ptp_vmw.c index 7ec90359428a..20ab05c4daa8 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,15 +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) : - "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.4