From patchwork Wed Nov 28 14:45:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Price X-Patchwork-Id: 10702887 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0333215A8 for ; Wed, 28 Nov 2018 15:32:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6A6F2D7B3 for ; Wed, 28 Nov 2018 15:32:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA5BB2D918; Wed, 28 Nov 2018 15:32:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B3F972D8DB for ; Wed, 28 Nov 2018 15:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qTkK9jdJez9GB2bQjZ+mtIRssQjjwE+UiC6lRpBTMWg=; b=Ct9T43eO3hFzTo w34VnamJqIpMXUEfQ8b4gWCPEHtCvWgP+HFlNWh1c62Gx8OgMljDpwA9jmcLSi30ZdSEp4s07bjov rPXuBJwFUWt9bYbL68OEq9cP+hezSczR8V5bj8/rl9MpMTrzxDTCJpyKZTJ+y3PfuJg7tVdnciuz8 0k6DwrosqCxWThgW/Y3kPuSLj6pLihxpH0Ml3xBFxcbXqvZ9pcLPsC8Ujnbpjp26SJyIGuyZHU5Pz I4IgcRt/ODacdV7UL+ps6XT0D+tld2r4VTr+jy9wVBmK1nT1e6QdE8nO0GravFh4denZUBdQ8czDa +hdojQuMiMiube25kI+A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS1ol-0004wk-Ha; Wed, 28 Nov 2018 15:31:59 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS1oH-0004Rw-OR for linux-arm-kernel@bombadil.infradead.org; Wed, 28 Nov 2018 15:31:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CS1cqdpACoTniGfGZ8h7SpLHNVBpsoh3dIBTZxL/eWc=; b=vGCjqtaD8/wA9cxcGbKmdSrGky REXjr0xNq0XMjNivBGmPQCzxUPo942UnLrSumNE79p9VAX6HOF+xktU4L8yssI0txmyP2icaOuFGh 4vkCSuoZyCrjR/Uu0DtDv6ixSrFMqhMxo/EupXLMkd6FdYmpNJhEBK73Kdr/bFNHV2IpFnfPy4tgG VaEUWbiq1zYWtDVra2DL2J2y9lLC+jxLoVdFIB9Bj+K4eWf/RtEl1TXnEVOX5BH9nS2dM05zDlcAd HSsacY4yWQHmpW6JGGMf7LO2ueWBQ1E4NkzMpBstOuVtcBYrVEowCZHLg/e4HVfib7XnxOjOhIB11 UMVujwtg==; Received: from foss.arm.com ([217.140.101.70]) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS16v-0006Zj-00 for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 14:46:44 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 14C3919BF; Wed, 28 Nov 2018 06:46:28 -0800 (PST) Received: from e112269-lin.arm.com (e112269-lin.cambridge.arm.com [10.1.196.108]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8D4D83F5AF; Wed, 28 Nov 2018 06:46:26 -0800 (PST) From: Steven Price To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH 00/12] arm64: Paravirtualized time support Date: Wed, 28 Nov 2018 14:45:15 +0000 Message-Id: <20181128144527.44710-1-steven.price@arm.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_094641_237174_F0637B51 X-CRM114-Status: GOOD ( 13.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Marc Zyngier , Catalin Marinas , Will Deacon , Christoffer Dall , Steven Price Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This series add support for paravirtualized time for Arm64 guests and KVM hosts following the specification in Arm's document DEN 0057A: https://developer.arm.com/docs/den0057/a It implements support for Live Physical Time (LPT) which provides the guest with a method to derive a stable counter of time during which the guest is executing even when the guest is being migrated between hosts with different physical counter frequencies. It also implements support for stolen time, allowing the guest to identify time when it is forcibly not executing. Patch 1 provides some documentation Patches 2-4, 8 and 11 provide some refactoring of existing code Patch 5 implements the new PV_FEATURES discovery mechanism Patches 6-7 implement live physical time Patches 9-10 implement stolen time Patch 12 adds the 'PV_TIME' device for user space to enable the features Christoffer Dall (2): KVM: arm/arm64: Factor out hypercall handling from PSCI code KVM: Export mark_page_dirty_in_slot Steven Price (10): KVM: arm64: Document PV-time interface arm/arm64: Provide a wrapper for SMCCC 1.1 calls arm/arm64: Make use of the SMCCC 1.1 wrapper KVM: arm64: Implement PV_FEATURES call KVM: arm64: Support Live Physical Time reporting clocksource: arm_arch_timer: Use paravirtualized LPT KVM: arm64: Support stolen time reporting via shared page arm64: Retrieve stolen time as paravirtualized guest KVM: Allow kvm_device_ops to be const KVM: arm64: Provide a PV_TIME device to user space Documentation/virtual/kvm/arm/pvtime.txt | 169 ++++++++++++++ arch/arm/kvm/Makefile | 2 +- arch/arm/kvm/handle_exit.c | 2 +- arch/arm/mm/proc-v7-bugs.c | 46 ++-- arch/arm64/include/asm/arch_timer.h | 32 ++- arch/arm64/include/asm/kvm_host.h | 16 ++ arch/arm64/include/asm/kvm_mmu.h | 2 + arch/arm64/include/asm/pvclock-abi.h | 32 +++ arch/arm64/include/uapi/asm/kvm.h | 8 + arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/cpu_errata.c | 47 +--- arch/arm64/kernel/cpuinfo.c | 2 +- arch/arm64/kernel/kvm.c | 156 +++++++++++++ arch/arm64/kvm/Kconfig | 1 + arch/arm64/kvm/Makefile | 2 + arch/arm64/kvm/handle_exit.c | 4 +- drivers/clocksource/arm_arch_timer.c | 176 ++++++++++++++- include/kvm/arm_arch_timer.h | 2 + include/kvm/arm_hypercalls.h | 44 ++++ include/kvm/arm_psci.h | 2 +- include/kvm/arm_pv.h | 28 +++ include/linux/arm-smccc.h | 45 ++++ include/linux/cpuhotplug.h | 1 + include/linux/kvm_host.h | 5 +- include/linux/kvm_types.h | 2 + include/uapi/linux/kvm.h | 2 + virt/kvm/arm/arm.c | 25 +- virt/kvm/arm/hypercalls.c | 276 +++++++++++++++++++++++ virt/kvm/arm/mmu.c | 44 ++++ virt/kvm/arm/psci.c | 76 +------ virt/kvm/arm/pvtime.c | 243 ++++++++++++++++++++ virt/kvm/kvm_main.c | 12 +- 32 files changed, 1348 insertions(+), 157 deletions(-) create mode 100644 Documentation/virtual/kvm/arm/pvtime.txt create mode 100644 arch/arm64/include/asm/pvclock-abi.h create mode 100644 arch/arm64/kernel/kvm.c create mode 100644 include/kvm/arm_hypercalls.h create mode 100644 include/kvm/arm_pv.h create mode 100644 virt/kvm/arm/hypercalls.c create mode 100644 virt/kvm/arm/pvtime.c