Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2440459lqo; Mon, 20 May 2024 06:12:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbjdKaP7BiB6pZlOS38faYH7l3/5x+hhpDkE+ZxGgiv7DydXz1xhCY+oLU21MDtlVkZnulbgCea4d+HHJspj3beReSs9DEqy1tcb5vbQ== X-Google-Smtp-Source: AGHT+IEPoHSdjOrDPIWGM7XmhrNmGdG9hVlwJtmIPNTgMAkMijGMV1q58eD/T7sJAeWs9f3kspPM X-Received: by 2002:a17:902:728c:b0:1ec:31f5:16d5 with SMTP id d9443c01a7336-1ef43f2c758mr225071455ad.33.1716210722528; Mon, 20 May 2024 06:12:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716210722; cv=pass; d=google.com; s=arc-20160816; b=OntFUQ2EIwwwYsrC/KNbBDhThF137nUMS6JzB5fu8MUm+KJhYzTpQYWR4hB+5kYnRU QuEVsXhDLXLY7j4Pgn4MDQN7xhSTXyrBfBAWEL0Zucf0H1twFmxN2AG+CygOcEBvpBbc wZH0rQgjdw92mk7NFLvlUKxArxpbDNVbcqJFwFyfYXaDg1EPYzDxeE6UjvRxGZfUYqYJ HA13TPSr8EbfZ32joXSPnXk9V1PPBN6WP/GZoYYJSwQYYEuoPQ7XIUCjg1XGtBQS0t21 egatGkg6849yIlzueKQVJGz0QbaWT4cDxhIw7gHUH5EcJOX+f7UWyVKT8CFRqBk2Dh44 mPpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=L258sJ9R5dqKQVVkTh5ELV9Ui4gtSu88RZNbxA/WABg=; fh=zZNPig0CNujAA6XTmM97muAVnQ4boAO57gyJmNIgsug=; b=UrHa+GcWf3TCS2C7jMyyMI4dueuq3XtbbhwY5VZ81swZMaNGzaYj2XFMhNP8nz6nMi QWbghjq0hA13mCgEnKz019DkDusp7GNJjyLWytuKnuYC6A8jndy3Y6FYfqAdjRfRX9FA fO3l7VeT6EAzUOtRDxs2jlJSnGReA9puzk+XuZE41ZaQlkLuW2nKptQcPvp7xCIFxmyH CC8Fz3ztNKgBgZo364mx2Emu0hhsVU+w1HCHIWKa5MgpOvxfHesolgmJNCsdZGa4A/ik kvg3+Qa9fVu5REzXSf3fEVi2MChBwNmiw82rJ11/516an2emjQfVRbKlIjRwgBmzX1zb DkKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-183770-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183770-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-65dd7ba310dsi6804011a12.251.2024.05.20.06.12.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 06:12:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183770-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-183770-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183770-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 796D3B23CC0 for ; Mon, 20 May 2024 13:02:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CDC7135A63; Mon, 20 May 2024 13:02:07 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB7AC13440A for ; Mon, 20 May 2024 13:02:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716210126; cv=none; b=utORLYszwIYxdK78ZsIABC/huICm4ooxNoiaX+SbjO2mngEFEFEbdnEVa/w6bE9+oo6Z4EhHJEvQjFVEhntZdl6l1O6q7o9hR+B8MTyS17v8JFjHe58KoDps9+a6fduat12G9MAtVuPYIRK4kyoe1P3lg8o6XOB6XMI4Oo2cguY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716210126; c=relaxed/simple; bh=j3WyJaRMY8UAEuzhzoAYZCFcOGx2ubNCfBzbhVA+GDQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=neUjpXwTyQvbxR/bb0su5+5Lliaezyg3QHqdo5ABmLcybJDWHtjyo91F1vzZhEz/cVBsppOjzFPUbFlp3qpUQ3G/ZBizMuvY9iKqHeO7v77kKh5/bBOfGJjZRcuRN0tXSb+4CET8TqriwHpBBHxRErAkmmlAUglWjuPZrZeXpEw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 83505DA7; Mon, 20 May 2024 06:02:25 -0700 (PDT) Received: from J2N7QTR9R3.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8F67A3F641; Mon, 20 May 2024 06:01:59 -0700 (PDT) Date: Mon, 20 May 2024 14:01:50 +0100 From: Mark Rutland To: Li Zetao Cc: Jiangfeng Xiao , catalin.marinas@arm.com, will@kernel.org, Dave.Martin@arm.com, xieyuanbin1@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, nixiaoming@huawei.com, wangbing6@huawei.com, douzhaolei@huawei.com, liaohua4@huawei.com, lijiahuan5@huawei.com, wangfangpeng1@huawei.com, "zhangjianhua (E)" Subject: Re: [PATCH] arm64: asm-bug: Add .align 2 to the end of __BUG_ENTRY Message-ID: References: <1715955208-17109-1-git-send-email-xiaojiangfeng@huawei.com> <20d70835-9411-9a08-c567-56d7040e01dd@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20d70835-9411-9a08-c567-56d7040e01dd@huawei.com> On Mon, May 20, 2024 at 08:05:25PM +0800, Li Zetao wrote: > On 2024/5/20 18:33, Mark Rutland wrote: > > On Fri, May 17, 2024 at 10:13:28PM +0800, Jiangfeng Xiao wrote: > > > diff --git a/arch/arm64/include/asm/asm-bug.h b/arch/arm64/include/asm/asm-bug.h > > > index c762038..6e73809 100644 > > > --- a/arch/arm64/include/asm/asm-bug.h > > > +++ b/arch/arm64/include/asm/asm-bug.h > > > @@ -28,6 +28,7 @@ > > > 14470: .long 14471f - .; \ > > > _BUGVERBOSE_LOCATION(__FILE__, __LINE__) \ > > > .short flags; \ > > > + .align 2; \ > The use of .align 2 here is based on the assumption that struct bug_entry is > 4-byte aligned. Currently, there is no problem with this assumption, but for > compatibility reasons, refer to the riscv architecture and refactor the > implementation of __BUG_FLAGS: > > #define __BUG_FLAGS(flags) \ > do { \ > __asm__ __volatile__ ( \ > "1:\n\t" \ > "ebreak\n" \ > ".pushsection __bug_table,\"aw\"\n\t" \ > "2:\n\t" \ > __BUG_ENTRY "\n\t" \ > ".org 2b + %3\n\t" \ > ".popsection" \ > : \ > : "i" (__FILE__), "i" (__LINE__), \ > "i" (flags), \ > "i" (sizeof(struct bug_entry))); \ > } while (0) > > Align the real size of struct bug_entry through .org. What do you think? I can see why that appears nice, but we can't do that in asm-bug.h without something in asm-offets.h, and I suspect that's going to lead to pain with circular header dependencies. Regardless, if things change we'll need to make other changes here, so I don't think we gain much. I think it's preferable to have the explicit .align for now. Mark.