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: 13514313 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (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 6EEADB652 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-pg1-f173.google.com with SMTP id 41be03b00d2f7-5c66b093b86so2322902a12.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=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=f3xwfbD3xhsbxk5pUALX5ToNvo4bdeTaUO5hXusAINtQfCXYvY4VhrpvYNDCBpGGVi pyKnqJBLbC3QyxS7Q/OkfZDb0SPldMcZToG2gylIdCpjPkkbJo6Taerlf0CFl3UPW1Mo HhK2zw7i67PA/sNa6/YBbkp3QT1rBB572KZzEaEvDjX0PKRtQReHL00iSn/N9jkD//u7 Bg4s8e1hh8gIsuKaAtiutNAQY+k5MIWjagEb9pFqy7tlK7xSayHSbGxndZj+8PV1U0Wz mCNPbJafZ//ocZByEjNQ/JgKiApsJH/ewUonKsjpEsg5CCqYIdFs0N7a2l5P4nNGO5TF zfXA== X-Gm-Message-State: AOJu0YzimaIoY8//c+3m4UwGl4nIc0pNwD8QYraMWjUbXb8zapwGshqc q407hhWFi0z8Z7KvoU/5RKGD3Dgn26EV 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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org 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;