Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3998284pxb; Mon, 8 Feb 2021 05:42:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkUEww9Mh8jS/0ojoeze5AnE+k9pb/6Qfvl+4rWdWWHCxKatmkykVRAuu8WO6DSq+nelN2 X-Received: by 2002:a05:6402:30a3:: with SMTP id df3mr5971338edb.237.1612791736694; Mon, 08 Feb 2021 05:42:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612791736; cv=none; d=google.com; s=arc-20160816; b=fwiEUHYEzcCP/Qy1U4yUVvY+vnWFyYnn1SlME28cstn9UW92viBpT0EEiuhxUgxQZ3 v5AErDozajPZJYMVger9F9LMj5xqFuys632QaZ/K6LB83XcazcEaR1UNSQ54az8YDhL+ K+vxMKS0z1WByqzTmes2N3OWRE6vHnqRYXV0te715wVHs+3wdh30WgbY/f6fLJCvWfA7 3rW0vxZh9JAx21vV0YoeC9VFbpy3Fx7Ui+TM38/2d9CQbYJ8O0PYW5fEKzmbax1v/Mrn 3E9PiCcy/zyvp4Xv5Af/QnUoOpv3ATD9ump92kHxWwndlX5oKGk37h9/dSR9gYW1K73S +6CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=WoQRuF0vfRGWZdAm+PKH04MGComhG+vSf0mP8NRZhU4=; b=b5IaLh0WhHrS65JKZ9Yb2Yod9zef6CofKkCTJH4rW9KQ5NpaY5Iiicgo3AnZcswqdh MVPyL1ItNmJj3p3es5urmuvgAzslZbwq1AFe7mjFjkU/sU06BjMuDCgtxFQdrYDXc6y9 8C0gAinlIgnXx4oGOmI9dtqDlGIJlFhOd/AhhcFQRzzzWPOXomyEueLjXKzhRwNvr39x mJ09q+7dYqKEDUaMLpbvgKtoo/CYl6EQtS+Dpt9BhI3Fdhe6SFFgNa5ZCvEYx4KC5Ge/ NFGEYAJYKZ1Aei11HqiGGpgVGJ2BfOyR/ErIhGj2FRrYk3MmCkri0dLg+nAmvv055OmT gg9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w16si11578487edi.602.2021.02.08.05.41.51; Mon, 08 Feb 2021 05:42:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230264AbhBHNlW (ORCPT + 99 others); Mon, 8 Feb 2021 08:41:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:59002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbhBHNlQ (ORCPT ); Mon, 8 Feb 2021 08:41:16 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B8746186A; Mon, 8 Feb 2021 13:40:35 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1l96mH-00Cn0C-9k; Mon, 08 Feb 2021 13:40:33 +0000 From: Marc Zyngier To: netdev@vger.kernel.org, yangbo.lu@nxp.com, john.stultz@linaro.org, tglx@linutronix.de, pbonzini@redhat.com, seanjc@google.com, richardcochran@gmail.com, Mark.Rutland@arm.com, will@kernel.org, suzuki.poulose@arm.com, Andre.Przywara@arm.com, steven.price@arm.com, lorenzo.pieralisi@arm.com, sudeep.holla@arm.com Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Steve.Capper@arm.com, justin.he@arm.com, jianyong.wu@arm.com, kernel-team@android.com Subject: [PATCH v18 0/7] KVM: arm64: Add host/guest KVM-PTP support Date: Mon, 8 Feb 2021 13:40:22 +0000 Message-Id: <20210208134029.3269384-1-maz@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: netdev@vger.kernel.org, yangbo.lu@nxp.com, john.stultz@linaro.org, tglx@linutronix.de, pbonzini@redhat.com, seanjc@google.com, richardcochran@gmail.com, Mark.Rutland@arm.com, will@kernel.org, suzuki.poulose@arm.com, Andre.Przywara@arm.com, steven.price@arm.com, lorenzo.pieralisi@arm.com, sudeep.holla@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Steve.Capper@arm.com, justin.he@arm.com, jianyong.wu@arm.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Given that this series[0] has languished in my Inbox for the best of the past two years, and in an effort to eventually get it merged, I've taken the liberty to pick it up and do the changes I wanted to see instead of waiting to go through yet another round. All the patches have a link to their original counterpart (though I have squashed a couple of them where it made sense). Tested both 64 and 32bit guests for a good measure. Of course, I claim full responsibility for any bug introduced here. * From v17 [1]: - Fixed compilation issue on 32bit systems not selecting CONFIG_HAVE_ARM_SMCCC_DISCOVERY - Fixed KVM service discovery not properly parsing the reply from the hypervisor * From v16 [0]: - Moved the KVM service discovery to its own file, plugged it into PSCI instead of the arch code, dropped the inlining, made use of asm/hypervisor.h. - Tidied-up the namespacing - Cleanup the hypercall handler - De-duplicate the guest code - Tidied-up arm64-specific documentation - Dropped the generic PTP documentation as it needs a new location, and some cleanup - Squashed hypercall documentation and capability into the main KVM patch - Rebased on top of 5.11-rc4 [0] https://lore.kernel.org/r/20201209060932.212364-1-jianyong.wu@arm.com [1] https://lore.kernel.org/r/20210202141204.3134855-1-maz@kernel.org Jianyong Wu (4): ptp: Reorganize ptp_kvm.c to make it arch-independent clocksource: Add clocksource id for arm arch counter KVM: arm64: Add support for the KVM PTP service ptp: arm/arm64: Enable ptp_kvm for arm/arm64 Thomas Gleixner (1): time: Add mechanism to recognize clocksource in time_get_snapshot Will Deacon (2): arm/arm64: Probe for the presence of KVM hypervisor KVM: arm64: Advertise KVM UID to guests via SMCCC Documentation/virt/kvm/api.rst | 9 ++ Documentation/virt/kvm/arm/index.rst | 1 + Documentation/virt/kvm/arm/ptp_kvm.rst | 25 ++++++ arch/arm/include/asm/hypervisor.h | 3 + arch/arm64/include/asm/hypervisor.h | 3 + arch/arm64/kvm/arm.c | 1 + arch/arm64/kvm/hypercalls.c | 80 +++++++++++++++-- drivers/clocksource/arm_arch_timer.c | 36 ++++++++ drivers/firmware/psci/psci.c | 2 + drivers/firmware/smccc/Makefile | 2 +- drivers/firmware/smccc/kvm_guest.c | 50 +++++++++++ drivers/firmware/smccc/smccc.c | 1 + drivers/ptp/Kconfig | 2 +- drivers/ptp/Makefile | 2 + drivers/ptp/ptp_kvm_arm.c | 28 ++++++ drivers/ptp/{ptp_kvm.c => ptp_kvm_common.c} | 84 +++++------------- drivers/ptp/ptp_kvm_x86.c | 97 +++++++++++++++++++++ include/linux/arm-smccc.h | 41 +++++++++ include/linux/clocksource.h | 6 ++ include/linux/clocksource_ids.h | 12 +++ include/linux/ptp_kvm.h | 19 ++++ include/linux/timekeeping.h | 12 +-- include/uapi/linux/kvm.h | 1 + kernel/time/clocksource.c | 2 + kernel/time/timekeeping.c | 1 + 25 files changed, 442 insertions(+), 78 deletions(-) create mode 100644 Documentation/virt/kvm/arm/ptp_kvm.rst create mode 100644 drivers/firmware/smccc/kvm_guest.c create mode 100644 drivers/ptp/ptp_kvm_arm.c rename drivers/ptp/{ptp_kvm.c => ptp_kvm_common.c} (60%) create mode 100644 drivers/ptp/ptp_kvm_x86.c create mode 100644 include/linux/clocksource_ids.h create mode 100644 include/linux/ptp_kvm.h -- 2.29.2