From nobody Mon May 6 02:56:48 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.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 (zoho.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=1561052911; cv=none; d=zoho.com; s=zohoarc; b=OEiO+aca84TJ9g3l6xCwRiP7XJDVkfKo2YOrH9foZQ6YYN/PsRxjsp4uaYD52JVF5eRSMXlecWDRNXczqzn/MfErSqmPLtJLITFTe+BzfiH51DrXjKFP3gTDXX37uPGKhSPjWwkTdVBuLcJ/eL/dbSbh7VX+aoP81hnsVw8AX90= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561052911; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=xfTW/DDZL+qg5EXnFACIbtS4+IE5W0+QUin4o/5ywEY=; b=SbkF5/ij/GXiA6OcDg+oWMMNYTKWSCdcR7BfBysKB/gieDwnOxxaYJYv2a8fgAijxCTfocgyIHA/GUhcMUESu0UEVQd1LU289msTPIRgOkP4tzjChI2kHi5dEa5CB3vXf3yqNz4nWR3B5wDRue0TG3AtNzvU1nw4wZamSJ1wf/M= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.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 1561052911464742.9246068023775; Thu, 20 Jun 2019 10:48:31 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1he19Y-00015b-T0; Thu, 20 Jun 2019 17:47:16 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1he19X-00015S-Ma for xen-devel@lists.xenproject.org; Thu, 20 Jun 2019 17:47:15 +0000 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 6eafa8c8-9383-11e9-ba41-4327d1b8e17c; Thu, 20 Jun 2019 17:47:12 +0000 (UTC) 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 A0FFF360; Thu, 20 Jun 2019 10:47:11 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CFAE83F246; Thu, 20 Jun 2019 10:47:10 -0700 (PDT) X-Inumbo-ID: 6eafa8c8-9383-11e9-ba41-4327d1b8e17c From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 20 Jun 2019 18:47:06 +0100 Message-Id: <20190620174706.16657-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [PRE-4.12 PATCH] xen/arm: time: cycles_t should be an uint64_t and not unsigned long 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: Julien Grall , sstabellini@kernel.org, ian.jackson@eu.citrix.com, jbeulich@suse.com MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Since commit ca73ac8e7d "xen/arm: Add an isb() before reading CNTPCT_EL0 to prevent re-ordering", get_cycles() is now returning the number of cycles and used in more callers. While the counter registers is always 64-bit, get_cycles() will only reutrn a 32-bit on Arm32 and therefore truncate the value. This will result to weird behavior by both Xen and the Guest as the timer will not be setup correctly. This could be resolved by switch cycles_t from unsigned long to unsigned int. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- This is only targeting xen 4.11 and earlier. Xen 4.12 and later have a correct definition of cycles_t thanks to da3d55ae67 "console: avoid printing no or null time stamps". This will hopefully unblock osstest on staging-4.10 and staging-4.11. This patch should be backported up to Xen 4.8. --- xen/include/asm-arm/time.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/asm-arm/time.h b/xen/include/asm-arm/time.h index ca30406669..bd7dc86d78 100644 --- a/xen/include/asm-arm/time.h +++ b/xen/include/asm-arm/time.h @@ -7,7 +7,7 @@ DT_MATCH_COMPATIBLE("arm,armv7-timer"), \ DT_MATCH_COMPATIBLE("arm,armv8-timer") =20 -typedef unsigned long cycles_t; +typedef uint64_t cycles_t; =20 static inline cycles_t get_cycles (void) { --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel