From patchwork Tue Jan 9 05:10:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Makhalov X-Patchwork-Id: 13514297 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) (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 4C9DC185D 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="Yd0/q2Gg" Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-28cb3bc3fe7so1732303a91.1 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=1704777034; x=1705381834; 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=Yd0/q2GguiiZ8+5XODcN7sFWB1B6KSyHU/udal4ZytBDwYloVDVYpFwUznnoosPXjO 1hYM56X0v5mtMxadAu8l3X8gfbDSBOvE2wbOeu9KTQxGZPZVAMIeU5eFI2++hlcdfKgC pXMHsor9eiCVpJQra/MLUXlLt4Vxzw8qbLFCU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704777034; x=1705381834; 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=WARisFEor11Fgk6Te1E1HDEPUR6S/m6xB3lWn2vx0QtWsDTQKHn7GVqC5ho5xv8+Jn 7YW60VbCj5NwLezcK4LiFetMPn4RU/qKygHOdXYY2bhoteGwcIfbOl5KhultNI975RGa LGW/vityX8GjGdh08A6jkADhGmkglkuPMzHk2pBA+tmKH6bSKtor67QhQzvKi4i3fIRn yK5Qu84CTOAz24B7PeogRkMWtH35Scfl6calM5o2vC5e7DNL+tLOTNsvK891/luFIqpR VsQtI/DW0KA+uewOCEkYkW+j/jq1PCZ41QX7UKRSyEIXxANjkMilc1weijTC3q97+54y FbBg== X-Gm-Message-State: AOJu0YzZdL9g25ZQyJZnXZU8Oub5q+hjpAuF0uJRuSujh1o1qx+yEMQx 9E/FU+PHfoJuCBkHZBEfWtPbgVR3O8Ry X-Google-Smtp-Source: AGHT+IF8dZpjBWWe0z4dBottyxYx1ikBBs7WVJxcndsJDTAagxtQXlqQ+kLYDBJXFVwQ3s/k1DbpXw== 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-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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;