From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD8FAC4167B for ; Tue, 28 Nov 2023 11:07:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344446AbjK1LGx (ORCPT ); Tue, 28 Nov 2023 06:06:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344527AbjK1LGj (ORCPT ); Tue, 28 Nov 2023 06:06:39 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 798DE1BC8 for ; Tue, 28 Nov 2023 03:06:44 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-332e7630a9dso3071668f8f.1 for ; Tue, 28 Nov 2023 03:06:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1701169603; x=1701774403; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=4544Fpr0xpXzSsGII81PnfJdRXQwcz4p3qozKAwiwGk=; b=Z8GtElyqE8HzK94hmR5+5Q4EFRC8gEw1XbvJf5a7qMNBjDtuO7jww67W8v0fn86PKn n1w9Kg4O/lHnap4tZSgWcd6nOzK7cGA1NLQe3xibBEYanXCorGxqq4T+Q2qyqwJefgQQ DmrFD1zRjB2q72JFNH/dA5RXXoj1xPbrjhB3E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701169603; x=1701774403; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4544Fpr0xpXzSsGII81PnfJdRXQwcz4p3qozKAwiwGk=; b=pvB67ciGGUUAVMWkygaPw3Saecf+Zp5D4mpXQ/0qDg8cv9vDWjrzprOQrOffwgzyh/ vN0cuAH3CJDj6bZxsJ47J1KqJIiDv1bxD6RofZf772t1ttaNlRiTiu0H9JAQkUjwdgus kvw7OAp5NSV/kQofsuQhyxzNPLX8xZmsMaRpJ+Qz8dcFjHSWn7c6Vqk41qaMgjT8r65l z9APR4KH/4AhB27KgLUaC6EHwS34V/za57TVWYWFzAnypS9PeVjSovcNalx+m4yC+oyD YargfiDLYnxG6qaMWIuiHKn8SqWh5NJpeiGRJeDdO3r4buQe/WZ1laOc2U6nYa1JT26t fw7w== X-Gm-Message-State: AOJu0YyT6/QwMOQ6MOI64fV4vVmfTs6WocypZEMlgp9OYWN1QNa/qL6w gOtd9hKw5sdwIMGt9PxQTuO/bw== X-Google-Smtp-Source: AGHT+IFtDYyljvWb3A7bJ1Us43VzQj6a6DufjzkHfU8NxQpzEuoUTLtz6a8kXHUUqQujHrcwJK3N7g== X-Received: by 2002:adf:eacd:0:b0:332:ced7:56e5 with SMTP id o13-20020adfeacd000000b00332ced756e5mr10461289wrn.13.1701169602916; Tue, 28 Nov 2023 03:06:42 -0800 (PST) Received: from localhost ([213.195.113.99]) by smtp.gmail.com with ESMTPSA id x17-20020adff651000000b003330ecc3907sm1324674wrp.44.2023.11.28.03.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 03:06:42 -0800 (PST) Date: Tue, 28 Nov 2023 12:06:41 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Juergen Gross Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Boris Ostrovsky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , xen-devel@lists.xenproject.org Subject: Re: [PATCH] x86/xen: fix percpu vcpu_info allocation Message-ID: References: <20231124074852.25161-1-jgross@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231124074852.25161-1-jgross@suse.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 24, 2023 at 08:48:52AM +0100, 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 FWIW, on FreeBSD we also switched to the same approach quite recently: https://cgit.freebsd.org/src/commit/sys/xen/xen_common.c?id=20fc5bf7df1db698f2651eaa04a3bc71290e1636 Should have checked the Linux side, sorry. Roger.