Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp239335lqh; Mon, 6 May 2024 18:32:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWYtWbenyJelAgqVvVayYy/U4/0/Ow5M+feRphGjTmRM5fw4ocgJq3U9E9i5sYTCO6iwg2ewbDlmnrwrqobjy0UaIZXjJN9o8o8DLFNkA== X-Google-Smtp-Source: AGHT+IExDznnmlkn9nrsKAMDbLSbvaJTH6GZY4sBhdq4djRe5oIGbRTklGl5VFRBgeg1eHx1w+SK X-Received: by 2002:a17:907:944d:b0:a59:cc9b:d6ea with SMTP id dl13-20020a170907944d00b00a59cc9bd6eamr3802656ejc.22.1715045529371; Mon, 06 May 2024 18:32:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715045529; cv=pass; d=google.com; s=arc-20160816; b=qckQr6yeLD/Zun0YER05XmThVs+0lAr/KWGE5FSvRvjhq5KGV7hV744LqxwFocanbg JM/NRMwbnFnxLTquxOVMovRGD65ucM8ZCahTZw95Fw/MiGDKPZDx4nshwL4T2jmY7P+B tvXNocN7rkMWpPBc++Hdn36Lf2xx5YEpc4jUh3YjNp5kf/Q4oy7rVnMT4ue3+e0kIU1e qYNCc5wl31Ttm8fcwUcBG7oengmmodE2FJi5WN4PA+8qCJagZdHZb3g4pOJhf7aQ9Pwm MkVy+Iv9z1QgkVzWj6u0XgGnrluonkSc1H/p13tH1EBrgs64sOCvjX4QLnx3KrEfcKwv ePAQ== 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=qbe175V7J4mZKX1qbMhvDPfRMOR41WhVMQTZgQjYbwc=; fh=7JryvYbTbmnXOna5Oo/VgQz8BLaLgfBJWaNR0GsR4g4=; b=yyxz5O00bMiU/Qp6Ja9mViYMwi2hoiFQ/2LKNwkyELVoFBsELhjLfO1iEoHx1kgDot dKOjvAySiiDwqJlK/EB+JGbCJ8051+CaLLvSHJYhek2oKBP0YngIenRfOXMwQl66Gcyy 1CNnsXD7ySUm0iiz7vIPZq7ODLFUTErmzqBi555aHSfK1WE92EOQ3DtEVHesqVMDUTZy 1wtYTJV7WOibgzq1tFYyG3ZwcHK5SUuewat2ipj0h1Q/C10HFxYQc+a0WIqTlGqZKfE7 OieRK/fkctqbHvWs2UmGb3V154+03ec4ZD5g5hmqK7AK6ClXKj+ZHPFH2GAtnFt9kOFJ KSYw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=dIh36Gbt; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-170457-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170457-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id go9-20020a1709070d8900b00a5995cc8339si4678437ejc.236.2024.05.06.18.32.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 18:32:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170457-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=dIh36Gbt; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-170457-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170457-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7A76E1F23F50 for ; Mon, 6 May 2024 21:55:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8787215ECC5; Mon, 6 May 2024 21:53:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="dIh36Gbt" Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.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 7080815E80B for ; Mon, 6 May 2024 21:53:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715032428; cv=none; b=oELYVPiT3rOaWZ15PGUP/bkj6Qj9/x3kNB1xxoWZ/Yr0CkeorKN8Lso6R/MlAMGdnWwOviQ7ljUD+SMSzud9mbnw1SyWSADsffmwrwpUG++PFFYuEkld1mLASoN6g+lzjTj9t8mQcBREzU/orMWeTvqzHbSDc3wJEntMhp2nYSg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715032428; c=relaxed/simple; bh=oNDqfcadVCBv1NHKCDbX55nWD61GnGcAsAeavqpXrsE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ixdMArKjREEYySJa96ZKyLnkbZbV9lLGfE7LmuoBU6AGb1rwmU2ORbfnpg0K8I8ki5iP5PWSQvL3IjDb4DpT4SDW5/WXjgMVw5QkAoCIgEhwtpAxXtvlcrtGIwWrgih5wDRbwvIf+tY2/nyOjGO8q5yPE5tPua42c99MKJuBbGs= 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=dIh36Gbt; arc=none smtp.client-ip=209.85.214.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-pl1-f181.google.com with SMTP id d9443c01a7336-1ecd3867556so17075725ad.0 for ; Mon, 06 May 2024 14:53:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1715032426; x=1715637226; 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=qbe175V7J4mZKX1qbMhvDPfRMOR41WhVMQTZgQjYbwc=; b=dIh36Gbtu4ES/52Sx3Cp+uv0rkWVj1Eg5vgVZDpvw6aPlmLixWNzmTYgY3rqirY1gu iglBGIg1weqhiW/jJGYsvYBHOHPqGMkkmbyiBCRJ/VTV/rBx5cNfhxYsvw5QcV2lsj4z bVAI9x41T7H1mGh/o0jueWUFgPt9Ed3x15QZg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715032426; x=1715637226; 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=qbe175V7J4mZKX1qbMhvDPfRMOR41WhVMQTZgQjYbwc=; b=Byb6Gm/oAk2jhCrF8pkbqdhxfk9GJ5YMvjgxbrN7Eq4EL/hKlvABdAlIKPCuIW2Aay Bk2Lx1zBGrIVp5KltJA2X8zEbU39yoaV5SOmEEpMg5uOdaOclY/MAHVsoGOO0viwxcTn tYoFndkovLBzIuRUI7dRXxRtSrtJ/LGLTm9Nrrex9+EQYyrW+DNvkxMmaDeE7tUrJA/E xC+hJXwhA9W4OJDBWzU5ESq+hOqDkzdps9clN8LFcwXbvmseLjiQ9AAky3pSjr4s5ktp p3ikrXFC6RkCkDNZXQMnt9v4x3uJg1VxEvDkUMdqa6kAy3xa4TFroD3oLZ/7ICxK0ynn PuMQ== X-Gm-Message-State: AOJu0YznsxWqc6+mKO+xe6xzkxXMUuv3Zjw41I6s/Es5kK8jOxj6dlZ2 zhKFbi4EHIxxLsk4u8leXoc1UpdIUt0LqGWoNbrz2ALRFGY8NVbWti3kCf7gjztwaN+aGlpyk1f +9gSBcyE0T1V2RY2huupv60POc2563vjDfbBJLJpWPQ9HgGqAoq5OEua4ay26Npkk9hz3tvXyMC jttsQTTfLzOB6CqMTtzPvgNWpDvShs5gTg00U5xFoiC6zGZEECVlTq X-Received: by 2002:a17:902:ab8b:b0:1eb:156f:8d01 with SMTP id f11-20020a170902ab8b00b001eb156f8d01mr9782604plr.40.1715032426230; Mon, 06 May 2024 14:53:46 -0700 (PDT) Received: from amakhalov-build-vm.eng.vmware.com ([128.177.82.146]) by smtp.gmail.com with ESMTPSA id h8-20020a170902f54800b001ed6868e257sm5664008plf.123.2024.05.06.14.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 14:53:45 -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 , Nadav Amit , Jeff Sipek Subject: [PATCH v9 4/8] ptp/vmware: Use VMware hypercall API Date: Mon, 6 May 2024 14:53:01 -0700 Message-Id: <20240506215305.30756-5-alexey.makhalov@broadcom.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20240506215305.30756-1-alexey.makhalov@broadcom.com> References: <20240505182829.GBZjfPzeEijTsBUth5@fat_crate.local> <20240506215305.30756-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 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