From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::242; helo=mail-it0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9CF32203B8FE8 for ; Thu, 26 Apr 2018 10:04:42 -0700 (PDT) Received: by mail-it0-x242.google.com with SMTP id 144-v6so10555304iti.5 for ; Thu, 26 Apr 2018 10:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uI7oKqAWZAE2oPLYrBsvwiBl6AbUm6GDOfEMz5qtgDQ=; b=TxvEIC7RteRWaIKgk+ml2qq0vk2gjvKFCfELP/G6jEoLTuA4XgMaTFBMMeL3PWxgCT XksNAtWIKyEvndmzLFz0quJ+o2XTPwQ3mjKH5Q/GWgKnh4HF4rUTpotas0tiUxasLbXX r1pf5bwy55Zi//m3MgF6vEp+GVdzPXlhne4vA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uI7oKqAWZAE2oPLYrBsvwiBl6AbUm6GDOfEMz5qtgDQ=; b=Z6AHMmM5ccwT4+tEu3BIZaaLqGCEngs0dsDQKpv6aH8XPCdilyT//tKGW+M9zwLmEF 57X2ItnszZKgYJaigkvZJH0pYlw6SwmhylHRBh8XN2aI5Y0nxKMHHawlbh7QS936yOKR zblU5+ZyuUP91UQJjlGUmK2w9GZ/zIpMJA0mDCbx9FQ3fStnXFm6qX2Ug1lJtyZnbWUl iR24UI9KIsalgv8qKxhMZ4E+JBmT8yKzjgh59IyIIUzMzJrPs5OfJtl1SqohK9vPA3y8 Xntov1RL5ZcNUAqRGr74gYvzwzC1//ziSosCRO+6DiL2mfIiFTY8kCjQw541HzK/a8r0 aLvQ== X-Gm-Message-State: ALQs6tA13XZNlRxviURt0s6mFl0tz3N6B8I2r8ISWGWsbdtC7NqqLTBW ZCs+pQ+++E9JBVXkXX7eSb4YVRZnVpi2XW6vXlg2RQ== X-Google-Smtp-Source: AB8JxZr87XGxOLYek8gB1mjmEmSdKefxrk95HVsyR45ZMEryR1FK0CL+6exf+B31zUIy12SiKhCdUbVxFQnDmeSwK4I= X-Received: by 2002:a24:e103:: with SMTP id n3-v6mr22405638ith.68.1524762281624; Thu, 26 Apr 2018 10:04:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.187.134 with HTTP; Thu, 26 Apr 2018 10:04:41 -0700 (PDT) In-Reply-To: <20180424141906.88016-1-sami.mujawar@arm.com> References: <20180424141906.88016-1-sami.mujawar@arm.com> From: Ard Biesheuvel Date: Thu, 26 Apr 2018 19:04:41 +0200 Message-ID: To: Sami Mujawar Cc: "edk2-devel@lists.01.org" , Arvind Chauhan , Daniil Egranov , Thomas Panakamattam Abraham , Leif Lindholm , Matteo Carlini , Stephanie Hughes-Fitt , Evan Lloyd , nd Subject: Re: [PATCH v1] Platform/ARM: Fix platform timer offset in GTDT X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 17:04:42 -0000 Content-Type: text/plain; charset="UTF-8" On 24 April 2018 at 16:19, Sami Mujawar wrote: > The FVP_PLATFORM_TIMER_COUNT is the sum of the memory > mapped platform timers and the watchdog timers. > > The watchdog timers can be disabled by setting the > FVP_WATCHDOG_COUNT (defined by PcdWatchdogCount) > to zero. > > On the VExpress platform, if the FVP_WATCHDOG_COUNT is > set to zero, the FVP_PLATFORM_TIMER_COUNT is 1 as > VExpress has one memory mapped timer. > > The code however incorrectly sets the platform timer > offset to zero in the GTDT. This causes the OS to read > the platform timer information from an invalid offset, > and may crash. > > Updated the GTDT table to set the platform timer offset > to zero only when the FVP_PLATFORM_TIMER_COUNT is zero. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Sami Mujawar > Reviewed-by: Evan Lloyd Reviewed-by: Ard Biesheuvel Pushed as ed9be80fa9521edc2ef959d493904d4800e64ca1 Thanks > --- > > Notes: > v1: > - Fix platform timer offset in GTDT for FVP [SAMI] > > Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc b/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc > index ae570574b298094ff468f30b78fbd8c98db506c5..1cb4b498300cf1a08514835677154eace1dd1803 100644 > --- a/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc > +++ b/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc > @@ -108,7 +108,7 @@ FVP_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt = { > FVP_GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL2TimerFlags > FVP_CNT_READ_BASE_ADDRESS, // UINT64 CntReadBasePhysicalAddress > FVP_PLATFORM_TIMER_COUNT, // UINT32 PlatformTimerCount > -#if (FVP_WATCHDOG_COUNT != 0) > +#if (FVP_PLATFORM_TIMER_COUNT != 0) > sizeof (EFI_ACPI_6_1_GENERIC_TIMER_DESCRIPTION_TABLE) // UINT32 PlatfromTimerOffset > #else > 0 > -- > 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' > >