Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1625109pxy; Thu, 6 May 2021 11:44:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7AiWrWWfQaLhcSFWrmkEZ4uWMPRWBQYw5JtvoQQ03VljmAm+ggDvc8jZ8Nsi8VLYrr+jY X-Received: by 2002:a17:90b:1251:: with SMTP id gx17mr12741009pjb.175.1620326643750; Thu, 06 May 2021 11:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620326643; cv=none; d=google.com; s=arc-20160816; b=QEzcB0lcvwYQnw+cM0fB3a/HLYGOmx+oqOfJJqxWA1ctOBCfHkDccQ+DmTaHThZiFn jTZEM4LnVBaVyv/WS2vedyK+kulalHt7FVquWn9NoaXSVX/nt1ZtpOt7PgPt+ZdeibLV xEz1VSZKtrxFPXoMBPizzKkxAlZR7CHVuEPDaoZu7KdCmR1429q9ngWoKLd13P/doSdq zNnGTdep7Me+QuKqtyfcmp5XXtw6TaoTDQQMeJqPXOb8jS6cHpcHFcy74+4wdVZEl2zM dvVzmDY4wJlMq9hryYlfbkVvj02uuuIsqoz+aHwIRwgTBeObIz1F1JLhzE3ekxMiVBPh ulEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:message-id; bh=a7xRhmai2FJa9/loyN+9/WJCfaO/E+1T3AvAeGL60Ro=; b=f3IOic4jXWRSSpnDYlhU9FCHIMeZK//0M14gVL1FAqOW8GlKzY3bfd82nJUdP+uoHl gNG6FRhgZGo4WT5QHAM7XnVJjRRPXr6pPBXvCH292gNqFnyiWHfbHk57tX3sDGl0BehM JLXU7vE3SSdX0Ykz8Hk8QsMzg665ntis3QQaaHfVTkiVH8TFK6hf/UhqkZGKZN/KcA3x MUcbWF7xvXTWNwz0S3mQ93PFMg96BRg3tGyZABcNjje3OfJ/VCovBYNY3Om22OvSlX6t N56oFyaXA6ZnF5aXujaUPmNXzZM9YNNpO3/kNuVltaOHOwQwrlmzUpZduJl9czJECnzg SLIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z11si3912337pgk.162.2021.05.06.11.43.51; Thu, 06 May 2021 11:44:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233890AbhEFNby (ORCPT + 99 others); Thu, 6 May 2021 09:31:54 -0400 Received: from pegase2.c-s.fr ([93.17.235.10]:50859 "EHLO pegase2.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233461AbhEFNbv (ORCPT ); Thu, 6 May 2021 09:31:51 -0400 Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4FbZGM6mnrz9sVL; Thu, 6 May 2021 15:30:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h5Q48sXS11rc; Thu, 6 May 2021 15:30:51 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4FbZGM5vv8z9sV0; Thu, 6 May 2021 15:30:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8E8018B801; Thu, 6 May 2021 15:30:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id mlQERwmhUEX4; Thu, 6 May 2021 15:30:51 +0200 (CEST) Received: from po15610vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4D3068B800; Thu, 6 May 2021 15:30:51 +0200 (CEST) Received: by po15610vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 0AB966489F; Thu, 6 May 2021 13:30:51 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH] powerpc: Only pad struct pt_regs when needed To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 6 May 2021 13:30:51 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If neither KUAP nor PPC64 is selected, there is nothing in the second union of struct pt_regs, so the alignment padding is waste of memory. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ptrace.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h index 9c9ab2746168..4fd3a3bd5272 100644 --- a/arch/powerpc/include/asm/ptrace.h +++ b/arch/powerpc/include/asm/ptrace.h @@ -47,7 +47,7 @@ struct pt_regs unsigned long result; }; }; - +#if defined(CONFIG_PPC64) || defined(CONFIG_PPC_KUAP) union { struct { #ifdef CONFIG_PPC64 @@ -67,6 +67,7 @@ struct pt_regs }; unsigned long __pad[4]; /* Maintain 16 byte interrupt stack alignment */ }; +#endif }; #endif -- 2.25.0