[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b56bed44-6c53-4c5b-9fb7-724c53d41287@suse.com>
Date: Mon, 27 Nov 2023 16:06:13 +0100
From: Juergen Gross <jgross@...e.com>
To: Jan Beulich <jbeulich@...e.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>, x86@...nel.org
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>, xen-devel@...ts.xenproject.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/xen: fix percpu vcpu_info allocation
On 27.11.23 16:00, Jan Beulich wrote:
> On 27.11.2023 15:57, Boris Ostrovsky wrote:
>>
>>
>> On 11/24/23 2:48 AM, Juergen Gross wrote:
>>> Today the percpu struct vcpu_info is allocated via DEFINE_PER_CPU(),
>>> meaning that it could cross a page boundary. In this case registering
>>> it with the hypervisor will fail, resulting in a panic().
>>>
>>> This can easily be fixed by using DEFINE_PER_CPU_ALIGNED() instead,
>>> as struct vcpu_info is guaranteed to have a size of 64 bytes, matching
>>> the cache line size of x86 64-bit processors (Xen doesn't support
>>> 32-bit processors).
>>>
>>> Fixes: 5ead97c84fa7 ("xen: Core Xen implementation")
>>> Signed-off-by: Juergen Gross <jgross@...e.com>
>>
>> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@...cle.con>
>>
>> although I am not sure in usefulness of BUILD_BUG_ON --- 64 bytes is part of ABI and hypervisor already has its own BUILD_BUG_ON for this.
>
> I understood the check to guard against SMP_CACHE_BYTES < 64.
Yes, that was the idea. Better safe than sorry.
Juergen
Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3684 bytes)
Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (496 bytes)
Powered by blists - more mailing lists