Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5202563ybe; Tue, 17 Sep 2019 04:29:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLSPQ82kx1W3cAlFYCnJg700AUFTZgBctel+0iTUCBMQgsd4/rjfZH3JQD3n2UNkIl4uwm X-Received: by 2002:a17:906:405b:: with SMTP id y27mr4387505ejj.18.1568719753059; Tue, 17 Sep 2019 04:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568719753; cv=none; d=google.com; s=arc-20160816; b=yaqPf1xuAep5d23XJ0JKPuXExgCYgrSduJsOScr+9yp1J3SiwuM6t15lwhbqJDP6gF ASH/tkkW/MVqJsJf2XThBG59cCxeDy/BAxKaCUSECM9oSA5dMyvJzksaM4n1WTytwC5X Y58DQ1Yx510r9ObTRoUT+vkB3SWsCbvWvGPO64BPNBZkZAyWPD6V9KO0+OfOwWGE/up4 HKlQ3iusiooG/Re2eLnYT1lWhekH06Aaq74cWOUHsdxhxMKwBqfX3XGxXFGxORz3eEVT iHjDXGOjArVkSrOjWKJfEMGGa5jheie65umJV0F4xJzv8dTccQV6uaaK5yfT3tWaST20 tQGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=0I3d0aaycVV+RXmJyIDkJEEtLkLviRp2bbGX5TnDIP8=; b=LP3CF/+DnJrkxMm4gWMKhoOyfeOPbbT1CvZbIm4dnM3uHw0E7wDrJ3206jM38C9aDQ ADLaBjLSZgq/aEHnjLXNoLvVWQoXQn4n4akUwJjRNq8X7mKbSzH7/cMB+SPDNqHl3Ces N4m+k1Y6612DwaD01yzRK6Hcrg9XI6Ju8nBIBBs/uOz1koZgYXSGuFza/FMO+7QI4gW4 XWhyI4wEXiRRni4SXtRlpPxN5KcoMsLHMlxcYn9YjDqSv82fc2EC+tiLWgkV3b9ckAsv LxfNXkAXS/LFlUrFk0UqTtOWeVIZuu8Q5vn7WIUlpkVTiv9iIPlK9AyfU9pmA9nqd8dH GJMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c48si1152153edc.169.2019.09.17.04.28.48; Tue, 17 Sep 2019 04:29:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727011AbfIQLZB (ORCPT + 99 others); Tue, 17 Sep 2019 07:25:01 -0400 Received: from foss.arm.com ([217.140.110.172]:54600 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbfIQLZB (ORCPT ); Tue, 17 Sep 2019 07:25:01 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8F0741000; Tue, 17 Sep 2019 04:25:00 -0700 (PDT) Received: from entos-d05.shanghai.arm.com (entos-d05.shanghai.arm.com [10.169.40.35]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5367F3F59C; Tue, 17 Sep 2019 04:24:57 -0700 (PDT) From: Jianyong Wu To: netdev@vger.kernel.org, pbonzini@redhat.com, sean.j.christopherson@intel.com, maz@kernel.org, richardcochran@gmail.com, Mark.Rutland@arm.com, Will.Deacon@arm.com, suzuki.poulose@arm.com Cc: linux-kernel@vger.kernel.org, Steve.Capper@arm.com, Kaly.Xin@arm.com, justin.he@arm.com, jianyong.wu@arm.com, nd@arm.com, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH v2 0/6] Enable ptp_kvm for arm64 Date: Tue, 17 Sep 2019 07:24:24 -0400 Message-Id: <20190917112430.45680-1-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kvm ptp targets to provide high precision time sync between guest and host in virtualization environment. This patch enable kvm ptp for arm64. This patch set base on [1][2][3] change log: from v1 to v2: (1) move arch-specific code from arch/ to driver/ptp/ (2) offer mechanism to inform userspace if ptp_kvm service is available. (3) separate ptp_kvm code for arm64 into hypervisor part and guest part. (4) add API to expose monotonic clock and counter value. (5) refine code: remove no necessary part and reconsitution. [1]https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/ commit/?h=kvm/hvc&id=125ea89e4a21e2fc5235410f966a996a1a7148bf [2]https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/ commit/?h=kvm/hvc&id=464f5a1741e5959c3e4d2be1966ae0093b4dce06 [3]https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/ commit/?h=kvm/hvc&id=6597490e005d0eeca8ed8c1c1d7b4318ee014681 Jianyong Wu (6): Export psci_ops.conduit symbol as modules will use it. reorganize ptp_kvm modules to make it arch-independent. Timer: expose monotonic clock and counter value arm64: Add hvc call service for ptp_kvm. Enable ptp_kvm for arm64 kvm: add kvm ptp capability extension for arm64 drivers/firmware/psci/psci.c | 6 ++ drivers/ptp/Kconfig | 2 +- drivers/ptp/Makefile | 1 + drivers/ptp/{ptp_kvm.c => kvm_ptp.c} | 77 ++++++------------------ drivers/ptp/ptp_kvm_arm64.c | 82 ++++++++++++++++++++++++++ drivers/ptp/ptp_kvm_x86.c | 87 ++++++++++++++++++++++++++++ include/asm-generic/ptp_kvm.h | 12 ++++ include/linux/arm-smccc.h | 14 ++++- include/linux/psci.h | 1 + include/linux/timekeeping.h | 3 + include/uapi/linux/kvm.h | 1 + kernel/time/timekeeping.c | 13 +++++ virt/kvm/arm/arm.c | 1 + virt/kvm/arm/psci.c | 17 ++++++ 14 files changed, 256 insertions(+), 61 deletions(-) rename drivers/ptp/{ptp_kvm.c => kvm_ptp.c} (63%) create mode 100644 drivers/ptp/ptp_kvm_arm64.c create mode 100644 drivers/ptp/ptp_kvm_x86.c create mode 100644 include/asm-generic/ptp_kvm.h -- 2.17.1