From nobody Tue Feb 10 09:58:28 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1576098845; cv=none; d=zohomail.com; s=zohoarc; b=NxzxPig5D/dsLmhcnZKyyL2x0hmNBPX4wCwGreCknSIY3YlW3v+JYeSA91lF5fRhCASWDOWsXNIMaMHEU2BS2V8T/sgieA5gDI+0KiANx6QhcD6N8aBFGlY9dYjdamKwoCn4Bp8weeii4zJ+betH5/Qh4RwvmXfHoOMYpdrzTZk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576098845; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cFlPRL+sLUTuijC5NQFp6tpso4qrKYb8CmKHyRnLwhE=; b=RdeQU/xMY4EUomIuTcDqb69aLVabmv9TZu+7V/ub8IP7IVCDABHWFgX4SVtaq8rjLmOdZOBV0KvvkW7MAejKLxuz8Kybs0s2OSZNVK1VAwBxhM0Oo1InK0yfk0iMfvtwRcBRE1f6MmDCOmrOTmtsl9iqFMMuzR/bQX4hAdokz6Y= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1576098845015541.213499364092; Wed, 11 Dec 2019 13:14:05 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1if9Ie-0007SM-HQ; Wed, 11 Dec 2019 21:13:36 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1if9Id-0007S8-1B for xen-devel@lists.xenproject.org; Wed, 11 Dec 2019 21:13:35 +0000 Received: from webmail.dornerworks.com (unknown [12.207.209.150]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id 133acc28-1c5b-11ea-b6f1-bc764e2007e4; Wed, 11 Dec 2019 21:13:28 +0000 (UTC) X-Inumbo-ID: 133acc28-1c5b-11ea-b6f1-bc764e2007e4 From: Jeff Kubascik To: Date: Wed, 11 Dec 2019 16:13:02 -0500 Message-ID: <20191211211302.117395-3-jeff.kubascik@dornerworks.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191211211302.117395-1-jeff.kubascik@dornerworks.com> References: <20191211211302.117395-1-jeff.kubascik@dornerworks.com> MIME-Version: 1.0 X-Originating-IP: [172.27.13.171] X-ClientProxiedBy: Mcbain.dw.local (172.27.1.45) To Mcbain.dw.local (172.27.1.45) X-spam-status: No, score=-2.9 required=3.5 tests=ALL_TRUSTED, BAYES_00, MAILSHELL_SCORE_0_4 X-Spam-Flag: NO Subject: [Xen-devel] [PATCH v3 2/2] xen/arm: sign extend writes to TimerValue X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stewart Hildebrand , Volodymyr Babchuk , Stefano Stabellini , Julien Grall Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Per the ARMv8 Reference Manual (ARM DDI 0487E.a), section D11.2.4 specifies that the values in the TimerValue view of the timers are signed in standard two's complement form. When writing to the TimerValue register, it should be signed extended as described by the equation CompareValue =3D (Counter[63:0] + SignExtend(TimerValue))[63:0] Signed-off-by: Jeff Kubascik --- xen/arch/arm/vtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c index 21b98ec20a..872181d9b6 100644 --- a/xen/arch/arm/vtimer.c +++ b/xen/arch/arm/vtimer.c @@ -211,7 +211,7 @@ static bool vtimer_cntp_tval(struct cpu_user_regs *regs= , uint32_t *r, } else { - v->arch.phys_timer.cval =3D cntpct + *r; + v->arch.phys_timer.cval =3D cntpct + (uint64_t)(int32_t)*r; if ( v->arch.phys_timer.ctl & CNTx_CTL_ENABLE ) { v->arch.phys_timer.ctl &=3D ~CNTx_CTL_PENDING; --=20 2.17.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel