Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2351392pxb; Mon, 20 Sep 2021 19:47:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws6aAQE7Orh9QtPouGEh3Pe9H1578ngvVGGrEudW/4PklcfNsE4+QrkWX4F9sxD7RHUtJC X-Received: by 2002:a17:907:1b02:: with SMTP id mp2mr32682130ejc.196.1632192445205; Mon, 20 Sep 2021 19:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192445; cv=none; d=google.com; s=arc-20160816; b=0B7CWYHP+gVSBIak+/ybiwtJjkRMp4M32mjgEQ4xQCH0+O9dgz8blk1CN/y0tNttfC IDtj7bkpxdyJSjAaE1dcTyU0pwPKnBxIRP6E3SyNi08KdjMKVFOW9H2oZEqVicWPQ2LW fgZR7O+rZ+weorMx8ziCH96xqVLBcSHjMmZQmv8mI5FGzSO7Snlbswb8IizyIJsqfH3f 99RX8fY+Xj0pybhk68ImILzNhBL3dgqT+cVDDQ+uVhIEu9znY8Q2Z8de2CplgpijfYL9 /RzlTKKEPtZBuw5pfFVXuSKOX9o3l8uTv1wFuT8R43nROJXBcCPQrg+er1g88eYDwXrg FEfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KMLb+5eLj2dR2lEmM36BYQ16Ho/SfedE9ni9unJmAG0=; b=E0lLdbhD2Of0p7I65mjxgkUaKIFSMey5XmqFO94hklRW7t7gtrTsOZ//Hs0J8xSd3I 2jCTdQ5EoViWiqlCGwH87DnxXxIpDDmVz/i27LtUaQuD2EUU+/XSWUj/+U4Hr/Ebfb36 1xSDfwOyV3bIzsKyBtd1DK7+YVrt9H7W1F7NK85UMmnqfjXkU2VeR5+9nnR7+zjBmHVE TFC9ELn+S/hK+VG54rC4W+jMSx5OAeFfzvREKFh4vvrZIPLSeZKTgIS7GWggzF2I8Ail NoEZ9xVRYGDBwSigbfcdlawS0MHL98WWDJh7sFqhDJHzLmUnhAH370P4fgoJJ2gIpX14 D6kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HJUFu0lU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hg19si19009668ejc.506.2021.09.20.19.47.01; Mon, 20 Sep 2021 19:47:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HJUFu0lU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352534AbhITSZi (ORCPT + 99 others); Mon, 20 Sep 2021 14:25:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:40992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351317AbhITSS5 (ORCPT ); Mon, 20 Sep 2021 14:18:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4F7CB632A5; Mon, 20 Sep 2021 17:23:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158588; bh=Fg6iF0i5GmFWqlnF1RGJmWdpfCQ6uMgT4VsN2iWPVes=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HJUFu0lU/plXJ3boog2GL+yPR4Iof2hnpadU0ZFUePjmU7tTGYl7c/4vIbmfc+j2c Np6CQLE+vS1lkVO1tmdPePr14wv/3BVrnffm8I5gyNm9us7hsc5UGLyZeprbbM7SjV hjgzrLH3i5HANcmOOMI34zHjXqWzzNtoIvCUDCMo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Juergen Gross , Boris Ostrovsky Subject: [PATCH 5.4 193/260] xen: reset legacy rtc flag for PV domU Date: Mon, 20 Sep 2021 18:43:31 +0200 Message-Id: <20210920163937.672022402@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Juergen Gross commit f68aa100d815b5b4467fd1c3abbe3b99d65fd028 upstream. A Xen PV guest doesn't have a legacy RTC device, so reset the legacy RTC flag. Otherwise the following WARN splat will occur at boot: [ 1.333404] WARNING: CPU: 1 PID: 1 at /home/gross/linux/head/drivers/rtc/rtc-mc146818-lib.c:25 mc146818_get_time+0x1be/0x210 [ 1.333404] Modules linked in: [ 1.333404] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 5.14.0-rc7-default+ #282 [ 1.333404] RIP: e030:mc146818_get_time+0x1be/0x210 [ 1.333404] Code: c0 64 01 c5 83 fd 45 89 6b 14 7f 06 83 c5 64 89 6b 14 41 83 ec 01 b8 02 00 00 00 44 89 63 10 5b 5d 41 5c 41 5d 41 5e 41 5f c3 <0f> 0b 48 c7 c7 30 0e ef 82 4c 89 e6 e8 71 2a 24 00 48 c7 c0 ff ff [ 1.333404] RSP: e02b:ffffc90040093df8 EFLAGS: 00010002 [ 1.333404] RAX: 00000000000000ff RBX: ffffc90040093e34 RCX: 0000000000000000 [ 1.333404] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 000000000000000d [ 1.333404] RBP: ffffffff82ef0e30 R08: ffff888005013e60 R09: 0000000000000000 [ 1.333404] R10: ffffffff82373e9b R11: 0000000000033080 R12: 0000000000000200 [ 1.333404] R13: 0000000000000000 R14: 0000000000000002 R15: ffffffff82cdc6d4 [ 1.333404] FS: 0000000000000000(0000) GS:ffff88807d440000(0000) knlGS:0000000000000000 [ 1.333404] CS: 10000e030 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1.333404] CR2: 0000000000000000 CR3: 000000000260a000 CR4: 0000000000050660 [ 1.333404] Call Trace: [ 1.333404] ? wakeup_sources_sysfs_init+0x30/0x30 [ 1.333404] ? rdinit_setup+0x2b/0x2b [ 1.333404] early_resume_init+0x23/0xa4 [ 1.333404] ? cn_proc_init+0x36/0x36 [ 1.333404] do_one_initcall+0x3e/0x200 [ 1.333404] kernel_init_freeable+0x232/0x28e [ 1.333404] ? rest_init+0xd0/0xd0 [ 1.333404] kernel_init+0x16/0x120 [ 1.333404] ret_from_fork+0x1f/0x30 Cc: Fixes: 8d152e7a5c7537 ("x86/rtc: Replace paravirt rtc check with platform legacy quirk") Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20210903084937.19392-3-jgross@suse.com Signed-off-by: Juergen Gross Signed-off-by: Greg Kroah-Hartman --- arch/x86/xen/enlighten_pv.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -1183,6 +1183,11 @@ static void __init xen_dom0_set_legacy_f x86_platform.legacy.rtc = 1; } +static void __init xen_domu_set_legacy_features(void) +{ + x86_platform.legacy.rtc = 0; +} + /* First C function to be called on Xen boot */ asmlinkage __visible void __init xen_start_kernel(void) { @@ -1353,6 +1358,8 @@ asmlinkage __visible void __init xen_sta add_preferred_console("xenboot", 0, NULL); if (pci_xen) x86_init.pci.arch_init = pci_xen_init; + x86_platform.set_legacy_features = + xen_domu_set_legacy_features; } else { const struct dom0_vga_console_info *info = (void *)((char *)xen_start_info +