From nobody Thu Nov 21 16:12:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1725011584; cv=none; d=zohomail.com; s=zohoarc; b=jBHOpWvSu1Fdi69DF50flll6TkklMdI/n5y5yfE52WQGLlsMCIq2hQf+vGYr+g24F2aUsa6aB+ugQASUwKYLP7quXDOFXKbgvVB/In069A2Y45n52LhwCQaXzVZj7UVqFpzoYCgGY+a67q9GXxW/BccXiylm45YNDL7tOQYnezg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725011584; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VUv2AnrjlmtsO6HtyrpSxryNAtOQVlYXS0leiTHoEDs=; b=bwzfcjmq4cqmOL0ecpbdHSuUic0qhmrr0zDCv8vzwg48qAgqkVXsY6gzKaQ6cD5j7G5HAeVCRa56zTi3xtd6SOeIg2F4aHJx+UEXv9wd9iSFCtEPEwr9E5Y2RlGm/nC2BGO07o+Y9AJn97bETNsCW5I7Sm/vGCnmWGPX9H1Al58= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725011584871225.06938274194965; Fri, 30 Aug 2024 02:53:04 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.786339.1195937 (Exim 4.92) (envelope-from ) id 1sjyJG-0001zg-PP; Fri, 30 Aug 2024 09:52:50 +0000 Received: by outflank-mailman (output) from mailman id 786339.1195937; Fri, 30 Aug 2024 09:52:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sjyJG-0001yd-Kr; Fri, 30 Aug 2024 09:52:50 +0000 Received: by outflank-mailman (input) for mailman id 786339; Fri, 30 Aug 2024 09:52:50 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sjyJF-0001wc-VH for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 09:52:49 +0000 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [2a00:1450:4864:20::52f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9d662550-66b5-11ef-a0b1-8be0dac302b0; Fri, 30 Aug 2024 11:52:48 +0200 (CEST) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5bec4e00978so1717653a12.0 for ; Fri, 30 Aug 2024 02:52:48 -0700 (PDT) Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c226c6a399sm1745361a12.8.2024.08.30.02.52.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 02:52:46 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9d662550-66b5-11ef-a0b1-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1725011567; x=1725616367; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VUv2AnrjlmtsO6HtyrpSxryNAtOQVlYXS0leiTHoEDs=; b=wPhHJXQpfZxysDs86M1sj3az1obft2YRwMvGmXEVWcLZJktbo1uFt0yjd9pmHhE8Ow bjXPCZhQCNJoz0qfYjhr2WwNmPaVTXYw7or8WtluHKcnHwUcjG5KbY+GK4H1eDNZ5oVh g0b5ww1/6hyiXugfFIbfIB2fV9XJdTHag7Y20= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725011567; x=1725616367; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VUv2AnrjlmtsO6HtyrpSxryNAtOQVlYXS0leiTHoEDs=; b=HV+S/E2Nz4Erk5v3Y34DP0PQAdPFPorq1o7DS4zBz07ZvVKxBZ2bVdbJ/68CZTpc+p ua7/pzqwKYqAnwRqt9iLT6HiF87fW2bi82ZjJZjpCai4D/qnbsZ1r9o2wSwOYTAVIebp 45NO3sJ7o4CirPYDRtnbSMhyyHrRjyQWTbrFqX+J+T+6gEczHVe8e3e51FQ+gbODcA8l ovZ5RiDIEimUAzR8N+VlFbek1qkdAu6ppn2SZR9wd8pydUlrKqn6tuZtxv8mukS0hDEe /RIUWeS9wRFZbeShC2EBsVDaJYuWS/4zdkSBpWYmUmlN5J2gBhN/+lhfUsqq8fIbz2G8 MIbA== X-Gm-Message-State: AOJu0Yygw5nAmUXhbiEcPe/bLmC3+tgYoZwlPALIJ4edzf2y8Zb5/yFX rZvdNg9gbcqfdbsYS8PnhVai1xhRTCiShNoBreh65+XUOP5gdCTv8DR04Satue5oQ7L+g891mzd l X-Google-Smtp-Source: AGHT+IG90mdLnqMxXpywPpfTEaRFhM+hkLnjtbl1iKjcoL7hGmRpCUtGYyjNmSkHeUjTNfxLqveMBA== X-Received: by 2002:a05:6402:2791:b0:5be:cfb1:ceb8 with SMTP id 4fb4d7f45d1cf-5c21ed3fd25mr4797240a12.13.1725011567001; Fri, 30 Aug 2024 02:52:47 -0700 (PDT) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: "Daniel P. Smith" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Roger Pau Monne , Jan Beulich , Andrew Cooper Subject: [PATCH v2 1/2] x86/time: split CMOS time fetching into wrapper Date: Fri, 30 Aug 2024 11:52:19 +0200 Message-ID: <20240830095220.49473-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240830095220.49473-1-roger.pau@citrix.com> References: <20240830095220.49473-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1725011585549116600 Split the logic that deals with probing and fetching the CMOS time into a separate helper. While moving the code also take the opportunity to reduce= the scope of some local variables. No functional change intended. Signed-off-by: Roger Pau Monn=C3=A9 Acked-by: Andrew Cooper , although... --- Changes since v1: - New in this version. --- xen/arch/x86/time.c | 72 +++++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index a97d78484105..272ca2468ea6 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -1245,29 +1245,14 @@ static void __get_cmos_time(struct rtc_time *rtc) rtc->year +=3D 100; } =20 -static unsigned long get_cmos_time(void) +/* Returns true when fetching time from CMOS is successful. */ +static bool read_cmos_time(struct rtc_time *rtc, bool cmos_rtc_probe) { - unsigned long res, flags; - struct rtc_time rtc; unsigned int seconds =3D 60; - static bool __read_mostly cmos_rtc_probe; - boolean_param("cmos-rtc-probe", cmos_rtc_probe); - - if ( efi_enabled(EFI_RS) ) - { - res =3D efi_get_time(); - if ( res ) - return res; - } - - if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) ) - cmos_rtc_probe =3D false; - else if ( system_state < SYS_STATE_smp_boot && !cmos_rtc_probe ) - panic("System with no CMOS RTC advertised must be booted from EFI" - " (or with command line option \"cmos-rtc-probe\")\n"); =20 for ( ; ; ) { + unsigned long flags; s_time_t start, t1, t2; =20 spin_lock_irqsave(&rtc_lock, flags); @@ -1285,33 +1270,56 @@ static unsigned long get_cmos_time(void) } while ( (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP) && t2 < MILLISECS(3) ); =20 - __get_cmos_time(&rtc); + __get_cmos_time(rtc); =20 spin_unlock_irqrestore(&rtc_lock, flags); =20 - if ( likely(!cmos_rtc_probe) || - t1 > SECONDS(1) || t2 >=3D MILLISECS(3) || - rtc.sec >=3D 60 || rtc.min >=3D 60 || rtc.hour >=3D 24 || - !rtc.day || rtc.day > 31 || - !rtc.mon || rtc.mon > 12 ) - break; + if ( likely(!cmos_rtc_probe) ) + return true; + + if ( t1 > SECONDS(1) || t2 >=3D MILLISECS(3) || + rtc->sec >=3D 60 || rtc->min >=3D 60 || rtc->hour >=3D 24 || + !rtc->day || rtc->day > 31 || + !rtc->mon || rtc->mon > 12 ) + return false; =20 if ( seconds < 60 ) { - if ( rtc.sec !=3D seconds ) - { - cmos_rtc_probe =3D false; + if ( rtc->sec !=3D seconds ) acpi_gbl_FADT.boot_flags &=3D ~ACPI_FADT_NO_CMOS_RTC; - } - break; + return true; } =20 process_pending_softirqs(); =20 - seconds =3D rtc.sec; + seconds =3D rtc->sec; } =20 - if ( unlikely(cmos_rtc_probe) ) + ASSERT_UNREACHABLE(); + return false; +} + +static unsigned long get_cmos_time(void) +{ + struct rtc_time rtc; + static bool __read_mostly cmos_rtc_probe; + boolean_param("cmos-rtc-probe", cmos_rtc_probe); + + if ( efi_enabled(EFI_RS) ) + { + unsigned long res =3D efi_get_time(); + + if ( res ) + return res; + } + + if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) ) + cmos_rtc_probe =3D false; + else if ( system_state < SYS_STATE_smp_boot && !cmos_rtc_probe ) + panic("System with no CMOS RTC advertised must be booted from EFI" + " (or with command line option \"cmos-rtc-probe\")\n"); + + if ( unlikely(!read_cmos_time(&rtc, cmos_rtc_probe)) ) panic("No CMOS RTC found - system must be booted from EFI\n"); =20 return mktime(rtc.year, rtc.mon, rtc.day, rtc.hour, rtc.min, rtc.sec); --=20 2.46.0 From nobody Thu Nov 21 16:12:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1725011586; cv=none; d=zohomail.com; s=zohoarc; b=GyRkdmGSnLHeq7MptGAM/qCyOA+0oVkiJl7jOdeLQovswW1Vnl3tNFPo6qFTwPsHrutQocDghBuCbsJFPukdEbnkhHb7D3XDIY3TOrDFDoDMzJZ6KdwxtHExDYOsAFuOQD/O/u71bzOR8L2RE4ITNygHXVgY7jnJ4RookNPA/5g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725011586; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Hgy6KsLd6IVjOwpOTywTcBhClUvG6CNwo7fjv2Ub9pE=; b=VOOKzCiLgbX81ztooL1/q3htNf2/dwya7I14V/84gXxvH8D9T6VbXj81+0f4UXPm26B+j9ZJqhF3LubHIdiiIoUaHsOs7k5LhDyveXAkNQre2xvdlh1Z90zB+i4rFngb7xiLDPKSGGJ7i4MjNLO9SXHOFjlouLtWRN3hXchobA8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725011586183730.5372555680754; Fri, 30 Aug 2024 02:53:06 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.786340.1195952 (Exim 4.92) (envelope-from ) id 1sjyJI-0002PS-39; Fri, 30 Aug 2024 09:52:52 +0000 Received: by outflank-mailman (output) from mailman id 786340.1195952; Fri, 30 Aug 2024 09:52:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sjyJH-0002PL-W4; Fri, 30 Aug 2024 09:52:51 +0000 Received: by outflank-mailman (input) for mailman id 786340; Fri, 30 Aug 2024 09:52:50 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sjyJG-0001wc-KF for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 09:52:50 +0000 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [2a00:1450:4864:20::630]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9e038f21-66b5-11ef-a0b1-8be0dac302b0; Fri, 30 Aug 2024 11:52:49 +0200 (CEST) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a86c476f679so197235666b.1 for ; Fri, 30 Aug 2024 02:52:50 -0700 (PDT) Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a89891db563sm194655566b.185.2024.08.30.02.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 02:52:47 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9e038f21-66b5-11ef-a0b1-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1725011569; x=1725616369; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Hgy6KsLd6IVjOwpOTywTcBhClUvG6CNwo7fjv2Ub9pE=; b=CISCvTTikoh72V5M1EcMolC5AWIP9DqPjY8cnPV/2gGIe7/bKXPEVTbyZBW90i8/m6 QYOkJ6YVvVPOAi5AaQ4oHN8P1pdk6uUarvnBVkq5a9gSa3fT65Ee/pSf13/KnxXERR/O 8Lrq20/E5CaCVJaFxOB2xJpHh/QWxky2UcqcU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725011569; x=1725616369; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hgy6KsLd6IVjOwpOTywTcBhClUvG6CNwo7fjv2Ub9pE=; b=eR3L7Di/v3wJA/CVrJFZf/IWkzordalNSbbUHaQWKxeVbSt+LddALuutT8TlxfqCIT 88Ap0SmitoYXc0ucjUyaer59PpdLb27OKJfxZzk/3+QUdx79nQ27E5GA7NKpiHQS0azu l9iUayvy9sKCgbrvT6INF3lUZcJQDiPcJmpfwfdeemAiWNcHa5YBL/d3T3x5WFRgZNI9 2xsev6Gv0W/scFyxnqHtlRqmOc74bLIKb6RV9lrv6gc7unqmlIahAkgJUZQmI+R1yrVs qN0A0EeQRKMRHWleEYdp5R+RkPwwJv33O2jOInPpcaTA9LRgXvC+e01avA86FQTyawzl x4Vg== X-Gm-Message-State: AOJu0YzXHE2MMV6Eei6U6NCpaCDVrJmu5NV9oakvPdvUNkjKot/eeQI5 A9oLJxPIkeDTrVARrWbIZG/eBKnduOQYCM8GRpwh/bbq0mlFSfmibjfJwgSAoJdwaTWeB7cklE7 r X-Google-Smtp-Source: AGHT+IFxGczVF6OVtd6iF412SmeyKSsOp7M6/YaF4GjHiZ2HTlFEHYZsy4UU3cUI+jq5qcQVC4tb1w== X-Received: by 2002:a17:907:94cb:b0:a86:8d83:542d with SMTP id a640c23a62f3a-a897fa751f3mr483777566b.45.1725011568064; Fri, 30 Aug 2024 02:52:48 -0700 (PDT) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: "Daniel P. Smith" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Roger Pau Monne , Jan Beulich , Andrew Cooper Subject: [PATCH v2 2/2] x86/time: prefer CMOS over EFI_GET_TIME Date: Fri, 30 Aug 2024 11:52:20 +0200 Message-ID: <20240830095220.49473-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240830095220.49473-1-roger.pau@citrix.com> References: <20240830095220.49473-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1725011587431116600 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=3Dy Tainted: C ]---- CPU: 0 RIP: e008:[<0000000062ccfa70>] 0000000062ccfa70 [...] Xen call trace: [<0000000062ccfa70>] R 0000000062ccfa70 [<00000000732e9a3f>] S 00000000732e9a3f [] F arch/x86/time.c#get_cmos_time+0x1b3/0x26e [] F init_xen_time+0x28/0xa4 [] F __start_xen+0x1ee7/0x2578 [] F __high_start+0x94/0xa0 Pagetable walk from 0000000062ccfa70: L4[0x000] =3D 000000207ef1c063 ffffffffffffffff L3[0x001] =3D 000000005d6c0063 ffffffffffffffff L2[0x116] =3D 8000000062c001e3 ffffffffffffffff (PSE) **************************************** Panic on CPU 0: FATAL PAGE FAULT [error_code=3D0011] 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 han= dler 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 prin= ted. Signed-off-by: Roger Pau Monn=C3=A9 --- xen/arch/x86/time.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 272ca2468ea6..0eee954809a9 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -1305,24 +1305,36 @@ static unsigned long get_cmos_time(void) static bool __read_mostly cmos_rtc_probe; boolean_param("cmos-rtc-probe", cmos_rtc_probe); =20 + if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) ) + cmos_rtc_probe =3D false; + + if ( (!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) || + cmos_rtc_probe) && read_cmos_time(&rtc, cmos_rtc_probe) ) + return mktime(rtc.year, rtc.mon, rtc.day, rtc.hour, rtc.min, rtc.s= ec); + if ( efi_enabled(EFI_RS) ) { unsigned long res =3D efi_get_time(); =20 if ( res ) return res; + + panic("Broken EFI_GET_TIME %s\n", + !cmos_rtc_probe ? "try booting with \"cmos-rtc-probe\" optio= n" + : "and no CMOS RTC found"); } =20 - if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) ) - cmos_rtc_probe =3D false; - else if ( system_state < SYS_STATE_smp_boot && !cmos_rtc_probe ) + /* + * No viable clock source found. Attempt to provide some guidance to = the + * user about possible workarounds to boot Xen on the system. + */ + ASSERT(system_state < SYS_STATE_smp_boot); + + if ( !cmos_rtc_probe ) panic("System with no CMOS RTC advertised must be booted from EFI" " (or with command line option \"cmos-rtc-probe\")\n"); =20 - if ( unlikely(!read_cmos_time(&rtc, cmos_rtc_probe)) ) - panic("No CMOS RTC found - system must be booted from EFI\n"); - - return mktime(rtc.year, rtc.mon, rtc.day, rtc.hour, rtc.min, rtc.sec); + panic("No CMOS RTC found - system must be booted from EFI\n"); } =20 static unsigned int __ro_after_init cmos_alias_mask; --=20 2.46.0