Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nIOdt-0007bT-6K for mharc-grub-devel@gnu.org; Fri, 11 Feb 2022 00:38:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIOdr-0007ak-CC for grub-devel@gnu.org; Fri, 11 Feb 2022 00:38:47 -0500 Received: from [2607:f8b0:4864:20::102c] (port=45996 helo=mail-pj1-x102c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIOdp-0001Wm-GR for grub-devel@gnu.org; Fri, 11 Feb 2022 00:38:46 -0500 Received: by mail-pj1-x102c.google.com with SMTP id q11-20020a17090a304b00b001b94d25eaecso3301890pjl.4 for ; Thu, 10 Feb 2022 21:38:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=KS8fEbmje4dr9/2JKCebMv4z5U0FBHFUTkOFvfXmh5g=; b=mPq0L+QoOhgEKukwZIYLOIg4NCuUoxMen971Ljesfh4uLUaakSEg3fYUwgm/hZPUro JrgWfSMHupcBqxf7ClJkcporJoWAmd6PASRQUlmjTY/c4KKR4jFmSWD/m/S1zbfbQdyz oMDHD+gr7KRiARu+Tc3GufnfYal0mdxHmXtZE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=KS8fEbmje4dr9/2JKCebMv4z5U0FBHFUTkOFvfXmh5g=; b=gweadGwDU5JrT1klNyFeyolmv80iKx40yuAXi+QClsnhRNfu81bLCW60JB8hJZo1sx +QBYxDT3SV4w0fmbKolDbfDw7DAlIBQvvJLZWxwRdPD4d8fgyqBRcJEjGdOsCr530+in M5fd6aFeVeLO+lhZSMyVgrLa6oJt1o9F0hlo3JD36K/1aHHj9NWpGJMHY9LnJkEjRV92 aWhIqDdGz0wbLuH8J18a+mFXOzdbHsod60rGsch/Wf7BDtGUFU9/uK5IXgPFZoSBZCcj 78//vGqe7xB5ZDOctr1IED2aNmz3rMrM8ytncpc5Z9T6Gx9U+CncC9wcGY8xGkxN5ynS +YXw== X-Gm-Message-State: AOAM532NGAn1uC0E/zH/9tDOFQdqSSh5z9ytKOAZvhLi/aPSVKJQvol/ DEZYN3GjUa3ocw4f2aT499aLCw== X-Google-Smtp-Source: ABdhPJw3qo4/3jdwn3bDNG8vPRa8w5GpI6S3kOXKC44FpL8Q+31YyH4gVn1eOSykg5gtU5C9vz/l2w== X-Received: by 2002:a17:902:b286:: with SMTP id u6mr40568plr.155.1644557923332; Thu, 10 Feb 2022 21:38:43 -0800 (PST) Received: from localhost ([2001:4479:e300:600:d3de:3045:38b4:5296]) by smtp.gmail.com with ESMTPSA id j8sm1969121pjc.11.2022.02.10.21.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 21:38:42 -0800 (PST) From: Daniel Axtens To: development@efficientek.com Cc: Daniel Kiper , grub-devel@gnu.org, Vladimir 'phcoder' Serbinenko , John Paul Adrian Glaubitz Subject: Re: [PATCH] Revert "iee1275/datetime: Fix off-by-1 error." In-Reply-To: <20220208153845.087216b0@crass-HP-ZBook-15-G2> References: <20220125021051.721464-1-development@efficientek.com> <871r0e3qqq.fsf@dja-thinkpad.axtens.net> <20220208153845.087216b0@crass-HP-ZBook-15-G2> Date: Fri, 11 Feb 2022 16:38:39 +1100 Message-ID: <87wni2q7xc.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102c (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=dja@axtens.net; helo=mail-pj1-x102c.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Feb 2022 05:38:47 -0000 > I suspect its the same on KVM and TCG because the machine definition is > the same and doesn't container either an RTC nor a CMOS. What confusing > to me is, don't these machines have clocks? They do have clocks! Sadly I know very little about the clocks. `date` works fine in Linux, so I suspect there's something where SLOF doesn't expose whatever it is that we need in the form we expect, or something like that. I guess someone should hunt it down but given that timeouts and such work (so I guess we have a working relative timer), I can't say it's likely to be a huge priority for anyone... Kind regards, Daniel > >> >> I also tested an LPAR on a Power8 PowerVM machine. In this case, before >> the patch, grub printed: >> >> grub> date >> 2022-02-09 04:31:10 Wednesday >> >> whereas on booting: >> >> [dja@sauce ~]$ date -u >> Tue Feb 8 04:46:40 UTC 2022 >> >> After applying the patch, grub printed: >> >> grub> date >> 2022-02-08 04:51:27 Tuesday >> >> It seems the patch makes things better. > > Great thanks Daniel for confirming this. > > Glenn > >> >> Tested-by: Daniel Axtens >> >> Kind regards, >> Daniel >> >> Glenn Washburn writes: >> >> > This is causing the test grub_cmd_date to fail because the returned date is >> > one day more than it should be. >> > >> > This reverts commit 607d66116a67e5a13eb0d46076f26dedc988e6a4. >> > >> > Signed-off-by: Glenn Washburn >> > --- >> > Hi all, >> > >> > Reverting this commit allows the grub_cmd_date test to pass. It appears that >> > this commit is (now) causing an off-by-1 error in QEMU and the latest OpenBIOS. >> > What I'm unsure of is if the original commit is actually correct on real >> > hardware and that potentially OpenBIOS has a bug. >> > >> > Adrian and Daniel A, could you test the reverting of this commit on real >> > hardware and see if date does in fact produce the expected date (and do current >> > builds show a date one day ahead of what it should be)? Can anyone point to >> > documentation saying that the original commit is in fact what should >> > be done? If the issue is in OpenBIOS I'd like to have some documentation >> > to back up a bug report. >> > >> > Vladimir, do you have any thoughts on this? >> > >> > Glenn >> > >> > --- >> > grub-core/lib/ieee1275/datetime.c | 4 ++-- >> > 1 file changed, 2 insertions(+), 2 deletions(-) >> > >> > diff --git a/grub-core/lib/ieee1275/datetime.c b/grub-core/lib/ieee1275/datetime.c >> > index b81fba2ed..74578f15a 100644 >> > --- a/grub-core/lib/ieee1275/datetime.c >> > +++ b/grub-core/lib/ieee1275/datetime.c >> > @@ -95,7 +95,7 @@ grub_get_datetime (struct grub_datetime *datetime) >> > >> > datetime->year = args.year; >> > datetime->month = args.month; >> > - datetime->day = args.day + 1; >> > + datetime->day = args.day; >> > datetime->hour = args.hour; >> > datetime->minute = args.minute; >> > datetime->second = args.second; >> > @@ -140,7 +140,7 @@ grub_set_datetime (struct grub_datetime *datetime) >> > >> > args.year = datetime->year; >> > args.month = datetime->month; >> > - args.day = datetime->day - 1; >> > + args.day = datetime->day; >> > args.hour = datetime->hour; >> > args.minute = datetime->minute; >> > args.second = datetime->second; >> > -- >> > 2.27.0