From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 107EDC4338F for ; Wed, 11 Aug 2021 09:01:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E89366101E for ; Wed, 11 Aug 2021 09:01:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236255AbhHKJCA (ORCPT ); Wed, 11 Aug 2021 05:02:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:58750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236270AbhHKJB7 (ORCPT ); Wed, 11 Aug 2021 05:01:59 -0400 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 9DE7060FE6; Wed, 11 Aug 2021 09:01:34 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mDk7A-004H2h-Iv; Wed, 11 Aug 2021 10:01:32 +0100 Date: Wed, 11 Aug 2021 10:01:32 +0100 Message-ID: <87wnos9wyb.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, Paolo Bonzini , Sean Christopherson , Peter Shier , Jim Mattson , David Matlack , Ricardo Koller , Jing Zhang , Raghavendra Rao Anata , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, Andrew Jones , Will Deacon , Catalin Marinas Subject: Re: [PATCH v6 17/21] KVM: arm64: Allow userspace to configure a guest's counter-timer offset In-Reply-To: References: <20210804085819.846610-1-oupton@google.com> <20210804085819.846610-18-oupton@google.com> <87a6lpbmbb.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: oupton@google.com, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, pbonzini@redhat.com, seanjc@google.com, pshier@google.com, jmattson@google.com, dmatlack@google.com, ricarkol@google.com, jingzhangos@google.com, rananta@google.com, james.morse@arm.com, Alexandru.Elisei@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, drjones@redhat.com, will@kernel.org, catalin.marinas@arm.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: kvm@vger.kernel.org On Tue, 10 Aug 2021 18:55:12 +0100, Oliver Upton wrote: > > On Tue, Aug 10, 2021 at 3:56 AM Marc Zyngier wrote: > > > > On Wed, 04 Aug 2021 09:58:15 +0100, > > Oliver Upton wrote: [...] > > > diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h > > > index 73c7139c866f..7252ffa3d675 100644 > > > --- a/include/clocksource/arm_arch_timer.h > > > +++ b/include/clocksource/arm_arch_timer.h > > > @@ -21,6 +21,7 @@ > > > #define CNTHCTL_EVNTEN (1 << 2) > > > #define CNTHCTL_EVNTDIR (1 << 3) > > > #define CNTHCTL_EVNTI (0xF << 4) > > > +#define CNTHCTL_ECV (1 << 12) > > > > > > enum arch_timer_reg { > > > ARCH_TIMER_REG_CTRL, > > > > You also want to document that SCR_EL3.ECVEn has to be set to 1 for > > this to work (see Documentation/arm64/booting.txt). And if it isn't, > > the firmware better handle the CNTPOFF_EL2 traps correctly... > > I'll grab the popcorn now ;-) Adding docs for this, good idea. > > > What firmware did you use for this? I think we need to update the boot > > wrapper, but that's something that can be done in parallel. > > I had actually just done a direct boot from ARM-TF -> Linux, nothing > else in between. Ah, right. I tend to use the boot-wrapper[1] to build a single binary that contains the 'boot loader', DT and kernel. Using ATF is probably more representative of the final thing, but the boot-wrapper is dead easy to hack on... Thanks, M. [1] git://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git -- Without deviation from the norm, progress is not possible. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66F4FC4338F for ; Wed, 11 Aug 2021 09:01:43 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id D608960FE6 for ; Wed, 11 Aug 2021 09:01:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D608960FE6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 5EB6E4080B; Wed, 11 Aug 2021 05:01:42 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L3Xgc-5JH5gn; Wed, 11 Aug 2021 05:01:37 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id A8E9E4086C; Wed, 11 Aug 2021 05:01:37 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B61DB40808 for ; Wed, 11 Aug 2021 05:01:36 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lhKR+qACiBRE for ; Wed, 11 Aug 2021 05:01:35 -0400 (EDT) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 9ED8E407F4 for ; Wed, 11 Aug 2021 05:01:35 -0400 (EDT) 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 9DE7060FE6; Wed, 11 Aug 2021 09:01:34 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mDk7A-004H2h-Iv; Wed, 11 Aug 2021 10:01:32 +0100 Date: Wed, 11 Aug 2021 10:01:32 +0100 Message-ID: <87wnos9wyb.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Subject: Re: [PATCH v6 17/21] KVM: arm64: Allow userspace to configure a guest's counter-timer offset In-Reply-To: References: <20210804085819.846610-1-oupton@google.com> <20210804085819.846610-18-oupton@google.com> <87a6lpbmbb.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: oupton@google.com, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, pbonzini@redhat.com, seanjc@google.com, pshier@google.com, jmattson@google.com, dmatlack@google.com, ricarkol@google.com, jingzhangos@google.com, rananta@google.com, james.morse@arm.com, Alexandru.Elisei@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, drjones@redhat.com, will@kernel.org, catalin.marinas@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: Catalin Marinas , kvm@vger.kernel.org, Will Deacon , Sean Christopherson , Peter Shier , Raghavendra Rao Anata , David Matlack , Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Jim Mattson X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Tue, 10 Aug 2021 18:55:12 +0100, Oliver Upton wrote: > > On Tue, Aug 10, 2021 at 3:56 AM Marc Zyngier wrote: > > > > On Wed, 04 Aug 2021 09:58:15 +0100, > > Oliver Upton wrote: [...] > > > diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h > > > index 73c7139c866f..7252ffa3d675 100644 > > > --- a/include/clocksource/arm_arch_timer.h > > > +++ b/include/clocksource/arm_arch_timer.h > > > @@ -21,6 +21,7 @@ > > > #define CNTHCTL_EVNTEN (1 << 2) > > > #define CNTHCTL_EVNTDIR (1 << 3) > > > #define CNTHCTL_EVNTI (0xF << 4) > > > +#define CNTHCTL_ECV (1 << 12) > > > > > > enum arch_timer_reg { > > > ARCH_TIMER_REG_CTRL, > > > > You also want to document that SCR_EL3.ECVEn has to be set to 1 for > > this to work (see Documentation/arm64/booting.txt). And if it isn't, > > the firmware better handle the CNTPOFF_EL2 traps correctly... > > I'll grab the popcorn now ;-) Adding docs for this, good idea. > > > What firmware did you use for this? I think we need to update the boot > > wrapper, but that's something that can be done in parallel. > > I had actually just done a direct boot from ARM-TF -> Linux, nothing > else in between. Ah, right. I tend to use the boot-wrapper[1] to build a single binary that contains the 'boot loader', DT and kernel. Using ATF is probably more representative of the final thing, but the boot-wrapper is dead easy to hack on... Thanks, M. [1] git://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git -- Without deviation from the norm, progress is not possible. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02471C4338F for ; Wed, 11 Aug 2021 09:32:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE5A260E97 for ; Wed, 11 Aug 2021 09:32:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BE5A260E97 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1qNzM42P1Her9yHf8I/VMSMxELqWc3MpzcZVmywU3EI=; b=RwBzLQeHGVpilb 4UJk4CZN67sueIwwfEYa4LUVacAeII0XkDNVEzaGMnRCgTbS9Q8/7udFVLmVhtv0+issO6gxUnlo3 wAgb8uXAij7WRl2cfDeKRbqdWWGLhhoyvp40D+jPt54qlR0TJY1MJQXqkZJb/FVloCPyc00z2YNpc HaqfM2hn8nfaKZqEcfgVd0eveiXw/zzYHnZRePwI5z9yhyVhOi+lVjLtBdB2mhxT+cwhGU/rXGKrT 8QlDjndd00NhKteuYXiD6a5cJ+KuFVbWqhTpUDuCGnMn6wZr/HNF03S87SdBzMuRH7O5yVd/OZpS1 zVVy7txHspTLWl3hTCRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDkYP-006Ix8-8Q; Wed, 11 Aug 2021 09:29:42 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDk7D-006Ah0-6q for linux-arm-kernel@lists.infradead.org; Wed, 11 Aug 2021 09:01:36 +0000 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 9DE7060FE6; Wed, 11 Aug 2021 09:01:34 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mDk7A-004H2h-Iv; Wed, 11 Aug 2021 10:01:32 +0100 Date: Wed, 11 Aug 2021 10:01:32 +0100 Message-ID: <87wnos9wyb.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, Paolo Bonzini , Sean Christopherson , Peter Shier , Jim Mattson , David Matlack , Ricardo Koller , Jing Zhang , Raghavendra Rao Anata , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, Andrew Jones , Will Deacon , Catalin Marinas Subject: Re: [PATCH v6 17/21] KVM: arm64: Allow userspace to configure a guest's counter-timer offset In-Reply-To: References: <20210804085819.846610-1-oupton@google.com> <20210804085819.846610-18-oupton@google.com> <87a6lpbmbb.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: oupton@google.com, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, pbonzini@redhat.com, seanjc@google.com, pshier@google.com, jmattson@google.com, dmatlack@google.com, ricarkol@google.com, jingzhangos@google.com, rananta@google.com, james.morse@arm.com, Alexandru.Elisei@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, drjones@redhat.com, will@kernel.org, catalin.marinas@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210811_020135_332268_27259E89 X-CRM114-Status: GOOD ( 25.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 10 Aug 2021 18:55:12 +0100, Oliver Upton wrote: > > On Tue, Aug 10, 2021 at 3:56 AM Marc Zyngier wrote: > > > > On Wed, 04 Aug 2021 09:58:15 +0100, > > Oliver Upton wrote: [...] > > > diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h > > > index 73c7139c866f..7252ffa3d675 100644 > > > --- a/include/clocksource/arm_arch_timer.h > > > +++ b/include/clocksource/arm_arch_timer.h > > > @@ -21,6 +21,7 @@ > > > #define CNTHCTL_EVNTEN (1 << 2) > > > #define CNTHCTL_EVNTDIR (1 << 3) > > > #define CNTHCTL_EVNTI (0xF << 4) > > > +#define CNTHCTL_ECV (1 << 12) > > > > > > enum arch_timer_reg { > > > ARCH_TIMER_REG_CTRL, > > > > You also want to document that SCR_EL3.ECVEn has to be set to 1 for > > this to work (see Documentation/arm64/booting.txt). And if it isn't, > > the firmware better handle the CNTPOFF_EL2 traps correctly... > > I'll grab the popcorn now ;-) Adding docs for this, good idea. > > > What firmware did you use for this? I think we need to update the boot > > wrapper, but that's something that can be done in parallel. > > I had actually just done a direct boot from ARM-TF -> Linux, nothing > else in between. Ah, right. I tend to use the boot-wrapper[1] to build a single binary that contains the 'boot loader', DT and kernel. Using ATF is probably more representative of the final thing, but the boot-wrapper is dead easy to hack on... Thanks, M. [1] git://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel