From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4864:20::441; helo=mail-wr1-x441.google.com; envelope-from=pete@akeo.ie; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) (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 C800321A07095 for ; Fri, 15 Feb 2019 06:57:10 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id x10so10628482wrs.8 for ; Fri, 15 Feb 2019 06:57:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=S6HfXu2oANc7AkuiItzTfMju2VRVUySDsRcL6/dUZrE=; b=KdYVoAWicMycTow1gAHJFDeYEw5//+trm/4OmRDeu6hAZStStX/c3hWBWIdSlPjkMG Ine68XYLoSMYHtoas7ly9pSdhTmdioefByVx5fieQqACM5OLe54B1yZwyubqVTgJVjPF kuRmNKlGhtWOqQ+XJZl3a3X4zWwGIeJtiiJ2/EZONaNpN2/QUNp0rxGQR6k8+sBxCE8N iazRkjCYQzUpG9hQgVw+wdnYYObGVh/+Xj1IWe0GBL/nxyMtR8lmpjwmP9NxnK0rr8TN FUkBGoa5wdaUblIe1cTirWc/FIiArQFYYGnf/yRXIQzVL0Rc4lshK7dF+Rd04KciJHpQ ZdNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=S6HfXu2oANc7AkuiItzTfMju2VRVUySDsRcL6/dUZrE=; b=qD/lU/1TPbEtc91aYOPQKMeRkvSR9q2/IxfKB+mYiXG9RKFxbnSKeWyY08N/Uja1/K TMP6uU8kXt8l/YUJtQharrmmZTIgaYYft2M/jV1y6PaIybFW/jEz0c5j9vK+eXRLfbVt iuuEr0N4m7uHTsoF+1LrSfOG/lZsUA5w/OEiNsz/zU6z6GR+fxxwPetWFrkbgmnnrPF9 d8eDhOZfAebbUx3SBBgLy9kZJy/yu2OnTCS+0c37sPSBbhloBcpLQ8qsvt5IqihuCx6J cOYPaFJGvqHnFkQSDRU8+k6sFIFlG+zjetCgvkDuQszrbHqMUxcx4fbdKTFMMRa36cQ7 xLfw== X-Gm-Message-State: AHQUAuZbqGjmnoJSkUDwcJuvQ47HvyP0ErJs+bBkD38xXOTW7lvt7vq0 OIO0YfKR/E80XHzlDLev6kEPP7rash0= X-Google-Smtp-Source: AHgI3IZSv2AMjfuZH4YEdhiei53d3syGEM33BIDj/X01rTJGPhAR0LuQWru8/B8ZmYq7TqYx09/wXg== X-Received: by 2002:adf:fdc3:: with SMTP id i3mr6754134wrs.252.1550242629054; Fri, 15 Feb 2019 06:57:09 -0800 (PST) Received: from [192.168.0.10] (gge44-1-78-198-200-53.fbx.proxad.net. [78.198.200.53]) by smtp.googlemail.com with ESMTPSA id 90sm11945456wrk.95.2019.02.15.06.57.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Feb 2019 06:57:08 -0800 (PST) To: Ard Biesheuvel , Leif Lindholm Cc: "edk2-devel@lists.01.org" References: <20190204124736.124-1-pete@akeo.ie> <20190204124736.124-2-pete@akeo.ie> <20190212181430.oji2fxzfpeq5lm4t@bivouac.eciton.net> From: Pete Batard Message-ID: <327e7ce8-b300-e239-0d47-13ee925711b0@akeo.ie> Date: Fri, 15 Feb 2019 15:57:07 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: Subject: Re: [PATCH 1/1] EmbeddedPkg/Library: Add VirtualRealTimeClockLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Feb 2019 14:57:11 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit On 2019-02-15 14:39, Ard Biesheuvel wrote: > On Fri, 15 Feb 2019 at 11:07, Ard Biesheuvel wrote: >> >> On Tue, 12 Feb 2019 at 19:14, Leif Lindholm wrote: >>> >>> On Mon, Feb 04, 2019 at 12:47:36PM +0000, Pete Batard wrote: >>>> This is designed to be used on platforms where a a real RTC is not >>>> available and relies on an RtcEpochSeconds variable having been set or, >>>> if that is not the case, falls back to using the epoch embedded at >>>> compilation time. >>>> >>>> Note that, in order to keep things simple for the setting of the >>>> compilation time variable, only GCC environments with UNIX-like shells >>>> and where a 'date' command is available are meant to be supported for >>>> now. >>>> >>>> Contributed-under: TianoCore Contribution Agreement 1.1 >>>> Signed-off-by: Pete Batard >>> >>> On the whole, this looks good to me. >>> One addition we'll need, so that we can build this library standalone >>> is an entry in EmbeddedPkg.dsc: >>> >>> diff --git a/EmbeddedPkg/EmbeddedPkg.dsc b/EmbeddedPkg/EmbeddedPkg.dsc >>> index 4d9e6399d5..dc5040e611 100644 >>> --- a/EmbeddedPkg/EmbeddedPkg.dsc >>> +++ b/EmbeddedPkg/EmbeddedPkg.dsc >>> @@ -218,6 +218,7 @@ [Components.common] >>> EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.inf >>> EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf >>> EmbeddedPkg/Library/DxeDtPlatformDtbLoaderLibDefault/DxeDtPlatformDtbLoaderLibDefault.inf >>> + EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf >>> EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf >>> EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf >>> >>> I don't have any strong opinions on either of Phil's suggestions, but >>> if you could give some feedback on those and fold the above in, this >>> could go in. >>> >> >> WIth this addition >> >> Reviewed-by: Ard Biesheuvel >> >> Pushed as 1b261a705f94..64a17fadcb79 > > OK, there is a problem with this code: > > +EFI_STATUS > +EFIAPI > +LibGetTime ( > + OUT EFI_TIME *Time, > + OUT EFI_TIME_CAPABILITIES *Capabilities > + ) > +{ > + EFI_STATUS Status; > + UINT32 EpochSeconds; > > EpochSeconds is declared here, and updated depending on time zone and > DST settings. However, the resulting value is never used anywhere. You're right. Looks like I forgot to merge all the use of EpochSeconds into ElapsedSeconds, from the code I copy/pasted. I'm very sorry about this, as it's something I should have picked up before sending this patch for review. > It is not clear to me what the correct fix is, so Pete, could you > please look into this? I'll send a fix for this as soon as I have a chance. Thanks for pointing the mistake. Regards, /Pete