All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	x86@kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/xen: fix percpu vcpu_info allocation
Date: Mon, 27 Nov 2023 16:06:13 +0100	[thread overview]
Message-ID: <b56bed44-6c53-4c5b-9fb7-724c53d41287@suse.com> (raw)
In-Reply-To: <1b2da249-254d-4879-aa16-9ea7f39d1259@suse.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1063 bytes --]

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@suse.com>
>>
>> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.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

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2023-11-27 15:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-24  7:48 [PATCH] x86/xen: fix percpu vcpu_info allocation Juergen Gross
2023-11-27 14:57 ` Boris Ostrovsky
2023-11-27 15:00   ` Jan Beulich
2023-11-27 15:06     ` Juergen Gross [this message]
2023-11-28 11:06 ` Roger Pau Monné

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=b56bed44-6c53-4c5b-9fb7-724c53d41287@suse.com \
    --to=jgross@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jbeulich@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --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.