Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nHITm-0003Jq-QY for mharc-grub-devel@gnu.org; Mon, 07 Feb 2022 23:51:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHITk-0003JW-Qr for grub-devel@gnu.org; Mon, 07 Feb 2022 23:51:48 -0500 Received: from [2607:f8b0:4864:20::1030] (port=36533 helo=mail-pj1-x1030.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHITi-0005lu-P7 for grub-devel@gnu.org; Mon, 07 Feb 2022 23:51:48 -0500 Received: by mail-pj1-x1030.google.com with SMTP id h20-20020a17090adb9400b001b518bf99ffso1063710pjv.1 for ; Mon, 07 Feb 2022 20:51:45 -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=hIkGu9WAbO5blK8b48D2PEopDVFCbgxDis68iaXwm2o=; b=kb3iTnQ7Gjy0hkLm7Gxi9s6fp1jYNV+yJRDQJlP3GebRLVCqOa9WxbrKo1EfoAJBOv 7iaFD6vGtUPWQqJ09XcxtJGhg2V8xF6Q2OiTKc369UCNxY8oun4KkGkmSDHC3RSPSGEb DIybpSk2fqRXzJYsYzi+iah8mNCkrZ0ZwICr4= 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=hIkGu9WAbO5blK8b48D2PEopDVFCbgxDis68iaXwm2o=; b=U4wy7qjVILPrVGl1T3L5zo9W1FcY+qCwrC6XVyLjlMwjA7H3alcD0srnVGhEMRSZaj gAXd/bjOFJKtqwuxnFbCjz0jIn1EVaYAUG1oCms9IYfXtN8swufe9We42NQblm+iO1n6 6Zmf7CHMSiu1+KXuCWPQRfI78hi1ca8q0EPPnuhgrT9qquIUMQG4Wx8fbsAcTtGYR1hz h/OXEE48M1pSwN4sq2Ce56SPvySowanx8nROHGkYjqngtN8Z8Si7aCh2dadINlsSN0aT GXwx3tg9u//sebID1oHRu3YJ5s5DzGITSR2yrr6umdH2yeEauRRsnsZQiN+nwQh8xf3W +Eqg== X-Gm-Message-State: AOAM530Ma654rslZkL3d83JDnbhGLZFK16fecabCDOKX/gFFcc5frW8U QZmx1Iyt2Xeol3wyQqwG7paJBw== X-Google-Smtp-Source: ABdhPJzC1+FJWhg9rg6P+NpEWZYTh5QYa6z+bNlPZzfWvCQfq2AAcQMQAH+Iu0QLMtNAXtoc7FgirQ== X-Received: by 2002:a17:90b:38c7:: with SMTP id nn7mr2490499pjb.124.1644295904802; Mon, 07 Feb 2022 20:51:44 -0800 (PST) Received: from localhost ([2001:4479:e300:600:1fae:11f3:d027:4a9d]) by smtp.gmail.com with ESMTPSA id il18sm1001242pjb.27.2022.02.07.20.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 20:51:44 -0800 (PST) From: Daniel Axtens To: Glenn Washburn , Daniel Kiper , grub-devel@gnu.org, Vladimir 'phcoder' Serbinenko , John Paul Adrian Glaubitz Cc: Glenn Washburn Subject: Re: [PATCH] Revert "iee1275/datetime: Fix off-by-1 error." In-Reply-To: <20220125021051.721464-1-development@efficientek.com> References: <20220125021051.721464-1-development@efficientek.com> Date: Tue, 08 Feb 2022 15:51:41 +1100 Message-ID: <871r0e3qqq.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::1030 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=dja@axtens.net; helo=mail-pj1-x1030.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: Tue, 08 Feb 2022 04:51:49 -0000 Hi, I tested a pseries guest under: - qemu + KVM on a Power8 host with a fairly modern qemu - qemu + TCG Here the 'date' command simply reports "error: no cmos found", so this patch will have no impact on those platforms. 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. 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