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::244; helo=mail-it0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (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 A8D8E2097DD29 for ; Fri, 1 Jun 2018 01:16:29 -0700 (PDT) Received: by mail-it0-x244.google.com with SMTP id v83-v6so858957itc.3 for ; Fri, 01 Jun 2018 01:16:29 -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=4EwaYUty3W33WRZkYkKvQiyGpya4RDzYSO0c36SFbzY=; b=i6CSkwKes6jDN7HGsFHzfCUhGhTgWu+qUvnKm96EZK/0lJhwvHHkUCZRas81pjSZKV 5EijvUThk7VlKbsi/oOl8zHPF+v2ewvcB7Fs8AThzlUsmU8RKXHSL86Fg27aN3WfDWdo I2v9YSrKnQve9fbXUhvKIFBBzJXCjCi+9b0yA= 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=4EwaYUty3W33WRZkYkKvQiyGpya4RDzYSO0c36SFbzY=; b=DePzPJmr44ePX3UJ4igkfX8WVMI3Hn4adO7RzaQfYSh3/EhrMZvJfKwFP6LMhDbf9r hbYpsi2k/m754L9DkSGqOUJ7++U2PZlyVfJ5DLkajL4s1FdbtgiC1HY19ZGUDeth/Db5 b8w1WF2x7d4S2L5pHhyqEGKS6B6W6MPfZBnI3TrzW35dDo5X5yUcex2GesILPJQyPfik ZYPmSC85bR5C6mBbTdz2jnxpdAL0cZjFyf2P6VqtNTjK91XeA47e1MGKVl9nmbLVNJHs PJaBpGCuko5f0F3tIepf4YushRv6OMiD0YKC2YrGM59SMOGGv6Ak+Kc2X7C6ty44JcMi bgRQ== X-Gm-Message-State: ALKqPwdcLIeqbkUFNAUaWLzF2qB2TmzI/GtoaKNt7HbiKMDm84s8mz0P eGK2ly0NQf44TINR6Z3WWeS9etELsoigXmZ43iQoOA== X-Google-Smtp-Source: ADUXVKJ6LfKKMzR/D9+ciYXV92I9Wb3lt02RsPcgBLtkvWIFJtv6emNcAgH/V1qlMvKBs4aFMl9pJJT0shQfgx/ZoO8= X-Received: by 2002:a24:e105:: with SMTP id n5-v6mr3335088ith.68.1527840988516; Fri, 01 Jun 2018 01:16:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:bb86:0:0:0:0:0 with HTTP; Fri, 1 Jun 2018 01:16:28 -0700 (PDT) In-Reply-To: <1527083494-26148-1-git-send-email-Alexei.Fedorov@arm.com> References: <1527083494-26148-1-git-send-email-Alexei.Fedorov@arm.com> From: Ard Biesheuvel Date: Fri, 1 Jun 2018 10:16:28 +0200 Message-ID: To: AlexeiFedorov Cc: "edk2-devel@lists.01.org" , Arvind Chauhan , Thomas Panakamattam Abraham , Leif Lindholm , Matteo Carlini , Stephanie Hughes-Fitt , nd , Evan Lloyd , Sami Mujawar Subject: Re: [PATCH edk2-platforms v1] Platform/ARM: Declare FVP Generic Timer Frame #1 as Non-secure 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: Fri, 01 Jun 2018 08:16:29 -0000 Content-Type: text/plain; charset="UTF-8" On 23 May 2018 at 15:51, AlexeiFedorov wrote: > From: Alexei Fedorov > > Programming Reference for Base FVPs describes 2 Generic Memory-mapped > Timer frames with Non-secure access permitted to frame #1. > However ACPI GTDT lists both timer frames #0 and #1 with > Secure Timer flag being set in GTx Common Flags field: > #define FVP_GTX_COMMON_FLAGS > (GTX_TIMER_SAVE_CONTEXT | GTX_TIMER_SECURE) > Declaring both timer frames as Secure prevents OS running > in Non-secure state from accessing Generic Timer frame #1. > > This patch fixes the above issue by removal of FVP_GTX_COMMON_FLAGS > and adding two FVP_GTX_COMMON_FLAGS_S and FVP_GTX_COMMON_FLAGS_NS > definitions used for Secure frame #0 and Non-secure frame #1 > accordingly. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Alexei Fedorov Reviewed-by: Ard Biesheuvel > --- > All the changes can be reviewed at: > https://github.com/AlexeiFedorov/edk2-platforms/tree/262_gtdt_timer_frame_ns_v1 > > Notes: > v1: > - remove FVP_GTX_COMMON_FLAGS [Alexei] > - define FVP_GTX_COMMON_FLAGS_S and FVP_GTX_COMMON_FLAGS_NS [Alexei] > - use FVP_GTX_COMMON_FLAGS_S for timer frame #0 and [Alexei] > FVP_GTX_COMMON_FLAGS_NS for frame #1 > > Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc b/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc > index 1cb4b498300cf1a08514835677154eace1dd1803..7a0b2b686ec849a8385ac5793e5d5855b9ba83ca 100644 > --- a/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc > +++ b/Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc > @@ -1,7 +1,7 @@ > /** @file > * Generic Timer Description Table (GTDT) > * > -* Copyright (c) 2012 - 2017, ARM Limited. All rights reserved. > +* Copyright (c) 2012 - 2018, ARM Limited. All rights reserved. > * Copyright (c) 2016, Linaro Ltd. All rights reserved > * > * This program and the accompanying materials > @@ -61,7 +61,8 @@ > #define GTX_TIMER_SAVE_CONTEXT EFI_ACPI_6_1_GTDT_GT_BLOCK_COMMON_FLAG_ALWAYS_ON_CAPABILITY > #define GTX_TIMER_LOSE_CONTEXT 0 > > -#define FVP_GTX_COMMON_FLAGS (GTX_TIMER_SAVE_CONTEXT | GTX_TIMER_SECURE) > +#define FVP_GTX_COMMON_FLAGS_S (GTX_TIMER_SAVE_CONTEXT | GTX_TIMER_SECURE) > +#define FVP_GTX_COMMON_FLAGS_NS (GTX_TIMER_SAVE_CONTEXT | GTX_TIMER_NON_SECURE) > > #define FVP_SBSA_WATCHDOG_REFRESH_BASE 0x000000002a450000 > #define FVP_SBSA_WATCHDOG_CONTROL_BASE 0x000000002a440000 > @@ -136,7 +137,7 @@ FVP_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt = { > FVP_GTX_TIMER_FLAGS, // UINT32 GTxPhysicalTimerFlags > 0, // UINT32 GTxVirtualTimerGSIV > 0, // UINT32 GTxVirtualTimerFlags > - FVP_GTX_COMMON_FLAGS // UINT32 GTxCommonFlags > + FVP_GTX_COMMON_FLAGS_S // UINT32 GTxCommonFlags > }, > { > 1, // UINT8 GTFrameNumber > @@ -149,7 +150,7 @@ FVP_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt = { > FVP_GTX_TIMER_FLAGS, // UINT32 GTxPhysicalTimerFlags > 0, // UINT32 GTxVirtualTimerGSIV > 0, // UINT32 GTxVirtualTimerFlags > - FVP_GTX_COMMON_FLAGS // UINT32 GTxCommonFlags > + FVP_GTX_COMMON_FLAGS_NS // UINT32 GTxCommonFlags > } > }, > #if (FVP_WATCHDOG_COUNT != 0) > -- > 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' > >