[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/xen: call xen_set_upcall_vector() only after local apic setup


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 14 Nov 2022 10:32:48 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kd8rI4gWaybIXfyrl2buRn0IJO2ZUf0e+JRjkHL7QEw=; b=Zh7aEhxYmEhECungSXCgnQKT6i6zRIfy/Y6prvCLtAxB9m7NX72SlTWxaxG+0LSdyoim7M8KRR9njao1l7I6s7vqf4naS85ocLsDioVRvZnQvaFbaT4IST2gPxTpf3wLkHTxNW3JbwoZhAD9QjXD93+j7XPoXdQB66wt0kcqmXisorHciE5q2wuiFssOQYPjE64UpOsrmL8n6x2S6P1CsrF+soyGdKCUwkbDgRX0AP3c3/Scmakovi70bwLU+WZVbURCCQbBM4sYASbG+pYI5AbM9pjkrpLP/+tupTa7LneoId26g8GDKd8Sxj8aOjgPF9402mNDmJiNxCkoRIwOYA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OO+qjfbMaBiuBcjcz7F4Tr/siQZyOBc2BfuvUCk4FkpL9z7yGbiV7iy4T6iKIx/GFnZf7p95CsLPvXnQUMB3UaPD9LPuiKKukhknXqu2wJqxQvv7KZWgVjtDMw/SZrYwOIA1HxInJ18UE6hDCizBeFH8iVqMH6G1/WUpEYK0qn6D2qZudo8+O97fwUZhOXM+0lcgQwux9EBqLG7aKqL163x2PDRv/DRLLsvoFJKKopbrJHg06elg8y60bdeEwDX+4pPSTVum4IFsh+yNOkPqiLNPoAbNJM9i1dhyYXvoeVKcb5J0jgtlE1kYOstbvuhpMPlBIjO5IYIqIx+tnBpUPA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx
  • Delivery-date: Mon, 14 Nov 2022 09:33:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12.11.2022 14:23, Juergen Gross wrote:
> Calling xen_set_upcall_vector() before the local APIC has been
> initialized results in warnings when setting up the local APIC:
> 
> [    0.037322] APIC: Stale IRR: 00080000, ...
> 
> Avoid this problem by moving the call of xen_set_upcall_vector() for
> APs from xen_cpu_up_prepare_hvm() to a new hotplug callback called on
> the AP before interrupts are enabled and after the local APIC has been
> initialized. There is already a Xen specific hotplug state defined at
> a matching position, but right now it is specific to Arm. So rename
> the CPUHP_AP_ARM_XEN_STARTING to CPUHP_AP_XEN_STARTING and use it for
> x86, too.
> 
> On the boot processor use the x86_init.irqs.intr_mode_init hook to
> call xen_set_upcall_vector() only after the local APIC initialization.
> As interrupts are on already at the time when the hook is being used,
> modify xen_init_setup_upcall_vector() to disable interrupts. This is
> needed as the xen_percpu_upcall flag is set only after the callback
> has been registered, and the flag is needed for correctly acknowledging
> an interrupt.
> 
> Fixes: b1c3497e604d ("x86/xen: Add support for 
> HVMOP_set_evtchn_upcall_vector")
> Reported-by: Jan Beulich <jbeulich@xxxxxxxx>
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>

Just to mention it here - as per [1] the issue may instead result from
hypervisor misbehavior, so I guess we want to investigate that route
first.

Jan

[1] https://lists.xen.org/archives/html/xen-devel/2022-11/msg00783.html



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.