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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 B6F88C2D0DB for ; Mon, 20 Jan 2020 10:46:21 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 43FFB20674 for ; Mon, 20 Jan 2020 10:46:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43FFB20674 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 9197D4AEEC; Mon, 20 Jan 2020 05:46:20 -0500 (EST) 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 wAEo1UavcssE; Mon, 20 Jan 2020 05:46:16 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 644924AEEE; Mon, 20 Jan 2020 05:46:16 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B7FD74AEEB for ; Mon, 20 Jan 2020 05:46:12 -0500 (EST) 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 Y+ZdI2KgrNhW for ; Mon, 20 Jan 2020 05:46:07 -0500 (EST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 902A24AEDB for ; Mon, 20 Jan 2020 05:46:07 -0500 (EST) 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 0685330E; Mon, 20 Jan 2020 02:46:07 -0800 (PST) Received: from [10.2.69.39] (unknown [10.2.69.39]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 81BAA3F68E; Mon, 20 Jan 2020 02:46:06 -0800 (PST) Subject: Re: [PATCH] ARM: virt: Relax arch timer version check during early boot To: linux-arm-kernel@lists.infradead.org References: <1579097798-106243-1-git-send-email-vladimir.murzin@arm.com> From: Vladimir Murzin Message-ID: Date: Mon, 20 Jan 2020 10:46:05 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1579097798-106243-1-git-send-email-vladimir.murzin@arm.com> Content-Language: en-US Cc: maz@kernel.org, kvmarm@lists.cs.columbia.edu 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 + Marc + kvmarm@lists.cs.columbia.edu On 1/15/20 2:16 PM, Vladimir Murzin wrote: > Updates to the Generic Timer architecture allow ID_PFR1.GenTimer to > have values other than 0 or 1. At the moment, Linux is quite strict in > the way it handles this field at early boot and will not configure > arch timer if it doesn't find the value 1. > > Since here use ubfx for arch timer version extraction (hyb-stub build > with -march=armv7-a, so it is safe) > > To help backports (even though the code was correct at the time of writing) > Fixes: 8ec58be9f3ff ("ARM: virt: arch_timers: enable access to physical timers") > Signed-off-by: Vladimir Murzin > --- > arch/arm/kernel/hyp-stub.S | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S > index ae50203..6607fa8 100644 > --- a/arch/arm/kernel/hyp-stub.S > +++ b/arch/arm/kernel/hyp-stub.S > @@ -146,10 +146,9 @@ ARM_BE8(orr r7, r7, #(1 << 25)) @ HSCTLR.EE > #if !defined(ZIMAGE) && defined(CONFIG_ARM_ARCH_TIMER) > @ make CNTP_* and CNTPCT accessible from PL1 > mrc p15, 0, r7, c0, c1, 1 @ ID_PFR1 > - lsr r7, #16 > - and r7, #0xf > - cmp r7, #1 > - bne 1f > + ubfx r7, r7, #16, #4 > + teq r7, #0 > + beq 1f > mrc p15, 4, r7, c14, c1, 0 @ CNTHCTL > orr r7, r7, #3 @ PL1PCEN | PL1PCTEN > mcr p15, 4, r7, c14, c1, 0 @ CNTHCTL > _______________________________________________ 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=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 4273BC33CA1 for ; Mon, 20 Jan 2020 10:46:24 +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 116D920674 for ; Mon, 20 Jan 2020 10:46:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RV8vbENb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 116D920674 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NrITKnZPJcyJ+445wsDqI7orUE5dfvnGeopDsleAOSY=; b=RV8vbENb+t8e9H auxFAiDH/ictEwKmuFr+QF6RwrsmOUu4dpFjoymW+oMm3BQw4EdN3LgX5StJSFEkxqwq57E3m1n77 3VQ40EC0k7GAtAMTqas0brMxBk7Iy9Gxdvox/lW1xrtv8q+tOELmysM3QtEhH2jg4Jb68wcGuWQmS CHZbjaXlfr/WuEGDY+pePDu48JUAMqqjcBiB9AwyQubTbN3JSnUBsWJT791Q1mgJK/OPfzzfJVFfU 6ynbUY13jyrWkkJrfr77cnBXvOjB4YOxpUlpTCXpeJ/Q+/EmxE3S13dshdcRRfsq5Kd0Pz4U09cI5 pUQk5hli25zkEl/VYfUA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1itUZT-0003rI-Iw; Mon, 20 Jan 2020 10:46:15 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1itUZL-0003ql-VP for linux-arm-kernel@lists.infradead.org; Mon, 20 Jan 2020 10:46:14 +0000 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 0685330E; Mon, 20 Jan 2020 02:46:07 -0800 (PST) Received: from [10.2.69.39] (unknown [10.2.69.39]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 81BAA3F68E; Mon, 20 Jan 2020 02:46:06 -0800 (PST) Subject: Re: [PATCH] ARM: virt: Relax arch timer version check during early boot To: linux-arm-kernel@lists.infradead.org References: <1579097798-106243-1-git-send-email-vladimir.murzin@arm.com> From: Vladimir Murzin Message-ID: Date: Mon, 20 Jan 2020 10:46:05 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1579097798-106243-1-git-send-email-vladimir.murzin@arm.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200120_024608_054446_6D0C24B9 X-CRM114-Status: GOOD ( 17.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: maz@kernel.org, kvmarm@lists.cs.columbia.edu Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org + Marc + kvmarm@lists.cs.columbia.edu On 1/15/20 2:16 PM, Vladimir Murzin wrote: > Updates to the Generic Timer architecture allow ID_PFR1.GenTimer to > have values other than 0 or 1. At the moment, Linux is quite strict in > the way it handles this field at early boot and will not configure > arch timer if it doesn't find the value 1. > > Since here use ubfx for arch timer version extraction (hyb-stub build > with -march=armv7-a, so it is safe) > > To help backports (even though the code was correct at the time of writing) > Fixes: 8ec58be9f3ff ("ARM: virt: arch_timers: enable access to physical timers") > Signed-off-by: Vladimir Murzin > --- > arch/arm/kernel/hyp-stub.S | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S > index ae50203..6607fa8 100644 > --- a/arch/arm/kernel/hyp-stub.S > +++ b/arch/arm/kernel/hyp-stub.S > @@ -146,10 +146,9 @@ ARM_BE8(orr r7, r7, #(1 << 25)) @ HSCTLR.EE > #if !defined(ZIMAGE) && defined(CONFIG_ARM_ARCH_TIMER) > @ make CNTP_* and CNTPCT accessible from PL1 > mrc p15, 0, r7, c0, c1, 1 @ ID_PFR1 > - lsr r7, #16 > - and r7, #0xf > - cmp r7, #1 > - bne 1f > + ubfx r7, r7, #16, #4 > + teq r7, #0 > + beq 1f > mrc p15, 4, r7, c14, c1, 0 @ CNTHCTL > orr r7, r7, #3 @ PL1PCEN | PL1PCTEN > mcr p15, 4, r7, c14, c1, 0 @ CNTHCTL > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel