From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org,
"Daniel P. Smith" <dpsmith@apertussolutions.com>,
Jan Beulich <jbeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v7 2/2] x86/time: prefer CMOS over EFI_GET_TIME
Date: Tue, 17 Sep 2024 13:00:55 +0200 [thread overview]
Message-ID: <ZulhZ60WRcFUfZcb@mail-itl> (raw)
In-Reply-To: <20240913075907.34460-3-roger.pau@citrix.com>
[-- Attachment #1: Type: text/plain, Size: 2766 bytes --]
On Fri, Sep 13, 2024 at 09:59:07AM +0200, Roger Pau Monne wrote:
> The EFI_GET_TIME implementation is well known to be broken for many firmware
> implementations, for Xen the result on such implementations are:
>
> ----[ Xen-4.19-unstable x86_64 debug=y Tainted: C ]----
> CPU: 0
> RIP: e008:[<0000000062ccfa70>] 0000000062ccfa70
> [...]
> Xen call trace:
> [<0000000062ccfa70>] R 0000000062ccfa70
> [<00000000732e9a3f>] S 00000000732e9a3f
> [<ffff82d04034f34f>] F arch/x86/time.c#get_cmos_time+0x1b3/0x26e
> [<ffff82d04045926f>] F init_xen_time+0x28/0xa4
> [<ffff82d040454bc4>] F __start_xen+0x1ee7/0x2578
> [<ffff82d040203334>] F __high_start+0x94/0xa0
>
> Pagetable walk from 0000000062ccfa70:
> L4[0x000] = 000000207ef1c063 ffffffffffffffff
> L3[0x001] = 000000005d6c0063 ffffffffffffffff
> L2[0x116] = 8000000062c001e3 ffffffffffffffff (PSE)
>
> ****************************************
> Panic on CPU 0:
> FATAL PAGE FAULT
> [error_code=0011]
> Faulting linear address: 0000000062ccfa70
> ****************************************
>
> Swap the preference to default to CMOS first, and EFI later, in an attempt to
> use EFI_GET_TIME as a last resort option only. Note that Linux for example
> doesn't allow calling the get_time method, and instead provides a dummy handler
> that unconditionally returns EFI_UNSUPPORTED on x86-64.
>
> Such change in the preferences requires some re-arranging of the function
> logic, so that panic messages with workaround suggestions are suitably printed.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Since this changes behavior for running on EFI,
Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> ---
> Changes since v2:
> - Updated to match previous changes.
> ---
> xen/arch/x86/time.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
> index e4751684951e..b86e4d58b40c 100644
> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -1592,14 +1592,14 @@ static void __init probe_wallclock(void)
> wallclock_source = WALLCLOCK_XEN;
> return;
> }
> - if ( efi_enabled(EFI_RS) && efi_get_time() )
> + if ( cmos_rtc_probe() )
> {
> - wallclock_source = WALLCLOCK_EFI;
> + wallclock_source = WALLCLOCK_CMOS;
> return;
> }
> - if ( cmos_rtc_probe() )
> + if ( efi_enabled(EFI_RS) && efi_get_time() )
> {
> - wallclock_source = WALLCLOCK_CMOS;
> + wallclock_source = WALLCLOCK_EFI;
> return;
> }
>
> --
> 2.46.0
>
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2024-09-17 11:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-13 7:59 [PATCH v7 0/2] x86/time: improvements to wallclock logic Roger Pau Monne
2024-09-13 7:59 ` [PATCH v7 1/2] x86/time: introduce command line option to select wallclock Roger Pau Monne
2024-09-13 12:38 ` Jan Beulich
2024-09-16 7:50 ` Roger Pau Monné
2024-09-16 7:53 ` Jan Beulich
2024-09-16 13:11 ` Andrew Cooper
2024-09-16 13:20 ` Marek Marczykowski-Górecki
2024-09-16 14:14 ` Roger Pau Monné
2025-01-13 16:07 ` Marek Marczykowski-Górecki
2025-01-13 17:52 ` Roger Pau Monné
2025-01-14 11:12 ` Oleksii Kurochko
2025-01-14 11:27 ` Roger Pau Monné
2025-01-14 11:40 ` Oleksii Kurochko
2025-01-14 11:44 ` Oleksii Kurochko
2025-01-14 12:13 ` Roger Pau Monné
2025-01-14 14:23 ` Oleksii Kurochko
2025-01-14 14:58 ` Roger Pau Monné
2025-01-14 15:38 ` Oleksii Kurochko
2024-09-13 7:59 ` [PATCH v7 2/2] x86/time: prefer CMOS over EFI_GET_TIME Roger Pau Monne
2024-09-16 13:14 ` Andrew Cooper
2024-09-17 11:00 ` Marek Marczykowski-Górecki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZulhZ60WRcFUfZcb@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=andrew.cooper3@citrix.com \
--cc=dpsmith@apertussolutions.com \
--cc=jbeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.