Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3757059rdh; Tue, 28 Nov 2023 03:07:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKbaX4zUkkBa7jee6IjLWdXbVqtdpKSeEeWWU390YI/ZdRpUxFOSXVHVPwyqxJwMK91UeT X-Received: by 2002:a17:902:e750:b0:1cf:c02f:6cea with SMTP id p16-20020a170902e75000b001cfc02f6ceamr7419815plf.69.1701169632469; Tue, 28 Nov 2023 03:07:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701169632; cv=none; d=google.com; s=arc-20160816; b=rcq3U7qDlkngSIUw/CLuYUiddDOpQWCmXSL/6pxc5EwqQ0+McnONdGcOkN1DC5q2X5 Kva0qV/Z5T5RcHGi0fU01jicEEgFmS/FrsFAK9MqrKr0b2U0s5gjma7k50Vyw/iirOJY rU4J6DlmXKAkiZClufrVP5TzdNE+ief/CL/igWMxvzTi67ckYzc6IuQaWPg/B/MlSsQ2 3Xaq3PKIfgipw0I3vmdyt2l28nX6bQV5YyZYJPUQKQQvvmtLSRX8tFyIaFl6BFPvZJGA 8xonpbVieC6FFM/S3YBYn3lRmTWQcode0vqnWBXseJcZO+rw59b4zWgY62Drph7TokLQ BkcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4544Fpr0xpXzSsGII81PnfJdRXQwcz4p3qozKAwiwGk=; fh=KFg5IQ2GFNYGQNuiKRcVWnbWurnqgyvdgC3g1+PyrYY=; b=tghG0oi5+jzGBgfIywzdnijSSt5dGAq/5VDNRFUSdEsZZPXmYjJxA9aRtv9LvL9IzU 8iY0J0xtNrN/qRrOxxshK/W2BgSr1zxCUb+SOm0QVI8ah6+yqctOMTyoGhJq7RooqQbz 2tvfRzsuVapAM4E/bBoUh0z/Pbv8YTgt6ga8JQweBDCGiUIi3GBHhc1hC6KAi/EKTJef aAwUMn2N1VPI0kVMtLYhaO+cQscu+A12pPF0n3N2zmqxDgQTtOGUpRWabz16vOWAL80l swd+ziuF6Kh/5rJQ1gf+Gsw4M/G6CCtnS5FuIih6HuSwg7LJ56UXIhv29s2vJufX6UHI YeaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@citrix.com header.s=google header.b=Z8GtElyq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=citrix.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id y11-20020a17090322cb00b001d00553568bsi365364plg.373.2023.11.28.03.07.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 03:07:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@citrix.com header.s=google header.b=Z8GtElyq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=citrix.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B103D80A1399; Tue, 28 Nov 2023 03:07:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344359AbjK1LGx (ORCPT + 99 others); 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-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> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 28 Nov 2023 03:07:07 -0800 (PST) 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.