Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp193017lqb; Thu, 23 May 2024 15:15:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZOKrWpoaRkHZl6FysqgdkdmtS+luGXwjHEQNsTM3wDQJreBEl3DEkM4NrqpT76aY6DmdFHYiaVTh/WXZ0cT0/1xrfaaenM20UifQvBA== X-Google-Smtp-Source: AGHT+IHtzKo0MB4yq3QDYkbabo6J6s4pX6MgrKpUEXvr2weNpoiIkb8G4T2+stGpFyK7QG5InosB X-Received: by 2002:a17:90b:4b4e:b0:2be:b9:da18 with SMTP id 98e67ed59e1d1-2bf5e13707cmr523447a91.2.1716502552998; Thu, 23 May 2024 15:15:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716502552; cv=pass; d=google.com; s=arc-20160816; b=V/3JrfCPKKsV+l2ljih2pG4ndyzxYtJYTnSNhvtUTkWKh7TNMvAu+3vsMlT3zcfQle DgRLuJf7/znyWd9vcJL15Gg8qmElgOo7uCHIcrRSSBZoG5shGMczbXOCfsaUy+VBfQUp OeK8NyarFNkGRkHgEFoatpV0cJ0HSPKGu+tcPX1qS7eLe3IbT+6XwdButZ6XjyGkkxTe by+91iB/v1+xr/+d5HvVa3lKwHIUAly9cXuKNoxiOzcJeBuqsgav6SQ/H4qcuvENPiz6 LR8x772YiDDAlhbhGc552sojDYhHaZWHE5i3lOcE7FzVha4jiEr8eb8K1xYn6aD7mPbb hucA== 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=uHMYUJYhS9fLzUcof3ntSmUnLahUe/mGFjgJPys0Prk=; fh=CqxT77qf7v0cyxcEfKNOSCPmdYyfEe8xwwY3GXvpCv4=; b=Kz4AgTLPWRTC10XppEwoOZTmnUInN/5yIWozbeI6uFMloVoCj1WMb1Re7twVemHdRk Hdpdt4dszD/zAN/USNB7EBt1R6Emt6COyjBjt6NpmVePkkpvxm7dHZuEUlq/SogJ7d56 bSBnxXl2TOS3jVXzudn/pAlfGw/rQ0wOWnx37TAxthRPuENQofBnf5tEdvoFBuuzc7bC iAMDFBHUEAWYqcAzNvEBTUdqUmGylzrG7AznBcS1tXknihMyRgyYEhQACASqrrVYhnEO 31dizrSYKneJBG0JzB0NnrfUC3ITRr8jqZp1ICNYQdWM18NDSIT4GDby1QYeIGn642Ms H1YQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=bd50bKIk; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-187914-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187914-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bdd9ef31afsi1365279a91.72.2024.05.23.15.15.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 15:15:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187914-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=bd50bKIk; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-187914-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187914-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DF374283C8C for ; Thu, 23 May 2024 19:16:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0588C84D04; Thu, 23 May 2024 19:15:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="bd50bKIk" Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (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 AB7D684A4D for ; Thu, 23 May 2024 19:15:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716491719; cv=none; b=mIUOmIAPu26sOZt9wAG5uH6CRRv/cmwPXekUdeuvRVU25XpdpQ52qgRVPoyeqodu1Cu6tcH62D3qpwKnNWHkB1nVdEZRakYv1KwVeuUEoN6+J8ZULmJXDNCyCe1LXQawJpTkhMXcNoAKC4aT0RaeFg3fez9dX1nLZ3WOC0eN4IU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716491719; c=relaxed/simple; bh=ZNBT2utWr+CWbtzicSB/YTCRG247E6qB9Nr+UR8KY4w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=a7HGKrmb8DuRDDA/cJk2WWXkLovKfmfMHoi3ruBzu+xvGdicMbteGWR/yO1pgTAjd9H/UlmmXkUtOx4XSpM+mpt7/oH+NISuTIgMz/dGZJOP27MtQ4VMaDXjmtZFKR4I7zMDPCcLVg28vNNl8WvGVp2gcyjKVFy+IETcPRbe2tI= 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=bd50bKIk; arc=none smtp.client-ip=209.85.160.181 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-qt1-f181.google.com with SMTP id d75a77b69052e-43f84f53f56so14782481cf.0 for ; Thu, 23 May 2024 12:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1716491716; x=1717096516; 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=uHMYUJYhS9fLzUcof3ntSmUnLahUe/mGFjgJPys0Prk=; b=bd50bKIkRwXLQxULEQWGR+nR3UqUK0g5w2iYso3P9yndASTik4vNTo5/exgOhKNIon +s+0RDuDOro9h/xqzhPCMwQ5nZIdKPhAOsEhL6A4r/KTky6RHka41eMmt0DTQKrkr6Qx iO9Ewzsb/+xxlEyhZjgjwReSqUDZnhFPjqmsM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716491716; x=1717096516; 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=uHMYUJYhS9fLzUcof3ntSmUnLahUe/mGFjgJPys0Prk=; b=Wychi/HG9ih1KM2qg4lIGP1p8rC6yBdO5DBsIkICu9KNmaPxsggvwzZn1/ZHA1XM5V cBx6RR+feW9DwLS0nSlzBv3Gb6qG4xuVXR+ddYx9fKQrAILejbNwlyas0l9U8W8CGqsF OFI0sB2ICtUOQlObVBlwewCzZ2wM+8rkgdsClwjUSXvGVHORQMSq7F8Ffz/GmfMsdzVw XBpXiS5AskfUnJjogdBTav7NMMEVpFI7dFjx20YEcMuyB4V6bspjcKHuDBCsDLq1MWbx kBES+jjOFczh4wHEmP1YaD+YKH/D7n8vBC+Xz2wCH+VDrKFQCpu5V1FIxSNxDsd09tvG hgEg== X-Gm-Message-State: AOJu0Yzw3D+2R9o/R3cG9r+CfYi6CbCozJyOkCruWoPHP/MH1OIHtPb3 MdkJWn8G0Cgkdvoqq/LnuEt8uqimBvEQWC0z0zxozPaxFzCvKFvvY6fzHAQ+JFF9NQ4YEhSztkY dp+fp5NAvp4zGT3QVHnU6Sg7v7c7KQZkujwCuSVP/SXEbJyp6E0J9kAx2CGVDk73v8jSOIFfQT4 7Lxxi+qM+6+fK5Nr77oKJiqpUHo9kcrDCzmdi8OvUw1QT0HdEmpHdF X-Received: by 2002:a05:622a:1650:b0:43a:f441:75ab with SMTP id d75a77b69052e-43fb0e64ca6mr342501cf.22.1716491715608; Thu, 23 May 2024 12:15:15 -0700 (PDT) Received: from amakhalov-build-vm.eng.vmware.com ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-43e4a89b61dsm21219821cf.45.2024.05.23.12.15.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 12:15:15 -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 v10 2/8] ptp/vmware: Use VMware hypercall API Date: Thu, 23 May 2024 12:14:40 -0700 Message-Id: <20240523191446.54695-3-alexey.makhalov@broadcom.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20240523191446.54695-1-alexey.makhalov@broadcom.com> References: <20240523191446.54695-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.0