From patchwork Sun Mar 17 19:06:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 10856525 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 DE37D13B5 for ; Sun, 17 Mar 2019 19:06:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2C4F2900C for ; Sun, 17 Mar 2019 19:06:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1A2B29010; Sun, 17 Mar 2019 19:06:27 +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 BE4C02900C for ; Sun, 17 Mar 2019 19:06:25 +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=jj0JBx3P6kzNuNZHlrw8DEIh9wxce/cbK5knHDkIxTQ=; b=KsP7QI+kbtE8TO 1+ArhefPV8/0gQVyHzCvajuhuKb5wuuuBxYSdNUPwwgujwo4df5YvPWoMnbnoQvz00f8uNtVBFVtG VYwlQka6T0uvmqVcgn/AW/Nwk1Q23hep4rH2k7u13MTear2OJSU/H/gJC+zbYJhFUd73yHAW+obcH h0Pb4Ij+PmU8OPCi5l3kAk3euSQsEDHp5fMCRSj7txikWntAaoDwSKuIOyiRuID0B+QkyCmEOUCIT cQgcXrKSRsioI8On3tmhitypf2JjHsq+JQbi9ULumflULsecmvyTOtEuREveUoSbtMC+nSX3atNNa TPnyVMNq2+MVh9wdxYnQ==; 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 1h5b6t-00020a-4S; Sun, 17 Mar 2019 19:06:15 +0000 Received: from mail-eopbgr760121.outbound.protection.outlook.com ([40.107.76.121] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5b6p-00020E-MU for linux-arm-kernel@lists.infradead.org; Sun, 17 Mar 2019 19:06:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zmvI/2Y1lH+OoJgMJZbaKbRlPwWuVvm2R+OLOwj15j0=; b=Z2DBA8up2Vmwvfqr6vfkHRhN5pTpAQ/mc3NabRUkodXkKw2mGbNizsKeJKQiFsRcQYPOKTIoY8RKEkOCtlBnSTYkV4tIR5kU1sLjAbzK6OXgcrQLmY98oOFt4bySO5uz+auoHKERYmf4Hxv1YjETRxde29kLBJr3gwUOKioDKjg= Received: from BN6PR21MB0466.namprd21.prod.outlook.com (10.172.111.144) by BN6PR21MB0788.namprd21.prod.outlook.com (10.175.132.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.0; Sun, 17 Mar 2019 19:06:03 +0000 Received: from BN6PR21MB0466.namprd21.prod.outlook.com ([fe80::f458:691d:54a:b05c]) by BN6PR21MB0466.namprd21.prod.outlook.com ([fe80::f458:691d:54a:b05c%13]) with mapi id 15.20.1730.008; Sun, 17 Mar 2019 19:06:02 +0000 From: Michael Kelley To: "will.deacon@arm.com" , "marc.zyngier@arm.com" , "linux-arm-kernel@lists.infradead.org" , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "olaf@aepfle.de" , "apw@canonical.com" , vkuznets , "jasowang@redhat.com" , "marcelo.cerri@canonical.com" , Sunil Muthuswamy , KY Srinivasan Subject: [PATCH v2 0/2] Drivers: hv: Move Hyper-V clock/timer code to separate clocksource driver Thread-Topic: [PATCH v2 0/2] Drivers: hv: Move Hyper-V clock/timer code to separate clocksource driver Thread-Index: AQHU3PR3nvkI5BPvckuJQbTeF03j1Q== Date: Sun, 17 Mar 2019 19:06:02 +0000 Message-ID: <1552849512-10063-1-git-send-email-mikelley@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: CO2PR18CA0050.namprd18.prod.outlook.com (2603:10b6:104:2::18) To BN6PR21MB0466.namprd21.prod.outlook.com (2603:10b6:404:b2::16) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 1.8.3.1 x-originating-ip: [167.220.2.136] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ecd03ed9-84dd-4456-730b-08d6ab0b9958 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:BN6PR21MB0788; x-ms-traffictypediagnostic: BN6PR21MB0788: x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2803; x-forefront-prvs: 09796A1B83 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(366004)(346002)(376002)(136003)(396003)(189003)(199004)(99286004)(486006)(8676002)(5660300002)(81166006)(81156014)(102836004)(26005)(52116002)(6506007)(8936002)(97736004)(386003)(6486002)(50226002)(6346003)(305945005)(86612001)(14454004)(7736002)(6636002)(7416002)(106356001)(186003)(36756003)(71190400001)(22452003)(10290500003)(54906003)(105586002)(6436002)(2906002)(478600001)(66066001)(71200400001)(110136005)(316002)(2501003)(4326008)(68736007)(6512007)(86362001)(1511001)(10090500001)(6116002)(2616005)(4720700003)(25786009)(256004)(476003)(53936002)(3846002)(2201001)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR21MB0788; H:BN6PR21MB0466.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=mikelley@microsoft.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 1y/T8vValLeECL+plUaMOaIn8fGtY89DMqSRFaRZZMbryzuOh6xwMLPl9JE4ooIdKqJTgFpb/ejMAsP6Kd0fKP7wnkJgP5Mr700zHebVtBdv4u3e5LdKSwi8BPtthp/BjfdW+gnMeCv8hkjF7TFMqzkFLZIE981Eop00aKllYYN5/Mv49hYNCCcp7q1kVnnsb21dS7WF0kc0S8n1LAM3+7EfK18YQ856JmdDDPKg2FWxBFV8KOy0BHjC1DlBvftayNhlYe7VjOCus4nI2yzpL9kbtkPQne4VOsweL3Sqpa7DyIqoHdQgWQ2FZzYVMfiS3jL3gm2zUSloup1f0Fq2mQTJ4erEp9INY2Azf3P3wyAVtKCzM6o7w6275p9k4jamDrNUcTQqkRVqLRsyBTevFs/ZZGRCf3/lMrN4fHrGimc= MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: ecd03ed9-84dd-4456-730b-08d6ab0b9958 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Mar 2019 19:06:02.8036 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR21MB0788 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190317_120611_829679_25394A17 X-CRM114-Status: GOOD ( 15.52 ) 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@arm.com" , "catalin.marinas@arm.com" , Michael Kelley 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 patch series moves Hyper-V clock/timer code to a separate Hyper-V clocksource driver. Previously, Hyper-V clock/timer code and data structures were mixed in with other Hyper-V code in the ISA independent drivers/hv code as well as in arch dependent code. The new Hyper-V clocksource driver is ISA independent, with a just few dependencies on arch specific functions. The patch series does not change any behavior or functionality -- it only reorganizes the existing code and fixes up the linkages. A few places outside of Hyper-V code are fixed up to use the new #include file structure. This restructuring is in response to Marc Zyngier's review comments on supporting Hyper-V running on ARM64, and is a good idea in general. It increases the amount of code shared between the x86 and ARM64 architectures, and reduces the size of the new code for supporting Hyper-V on ARM64. A new version of the Hyper-V on ARM64 patches will follow once this clocksource restructuring is accepted. The code is currently diff'ed against Linux 5.0. I'll rebase to linux-next once 5.1-rc1 is available. Changes in v2: * Revised commit short descriptions so the distinction between the two patches is clearer [GregKH] * Renamed new clocksource driver files and functions to use existing "timer" and "stimer" names instead of introducing "syntimer". [Vitaly Kuznetsov] * Introduced CONFIG_HYPER_TIMER to fix build problem when CONFIG_HYPERV=m [Vitaly Kuznetsov] * Added "Suggested-by: Marc Zyngier" Michael Kelley (2): Drivers: hv: Create Hyper-V clocksource driver from existing clockevents code Drivers: hv: Move Hyper-V clocksource code to new clocksource driver MAINTAINERS | 2 + arch/x86/entry/vdso/vclock_gettime.c | 1 + arch/x86/entry/vdso/vma.c | 2 +- arch/x86/hyperv/hv_init.c | 91 +--------- arch/x86/include/asm/hyperv-tlfs.h | 6 + arch/x86/include/asm/mshyperv.h | 80 ++------- arch/x86/kernel/cpu/mshyperv.c | 2 + arch/x86/kvm/x86.c | 1 + drivers/clocksource/Makefile | 1 + drivers/clocksource/hyperv_timer.c | 328 +++++++++++++++++++++++++++++++++++ drivers/hv/Kconfig | 3 + drivers/hv/hv.c | 154 ---------------- drivers/hv/hyperv_vmbus.h | 3 - drivers/hv/vmbus_drv.c | 39 +++-- include/clocksource/hyperv_timer.h | 104 +++++++++++ 15 files changed, 485 insertions(+), 332 deletions(-) create mode 100644 drivers/clocksource/hyperv_timer.c create mode 100644 include/clocksource/hyperv_timer.h Reviewed-by: Vitaly Kuznetsov