Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1831680imw; Sat, 16 Jul 2022 16:19:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1soso/qSMS25Dibdpnx0GfujyMdinhof+FLB0yfKZKTsXmCak9RArIr+jqBzFEL80j9uihs X-Received: by 2002:a17:906:6a1c:b0:72f:2174:13db with SMTP id qw28-20020a1709066a1c00b0072f217413dbmr1490553ejc.687.1658013552226; Sat, 16 Jul 2022 16:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658013552; cv=none; d=google.com; s=arc-20160816; b=m9IzZ1ufC/h1zlUMrrqXJ8EVjrexBlzOHljopi1CEDHiR3rr1LaYbobeIXsrtZ3PFl OM827dOH8OmaQxYx8kXa7CNdXfNiYSXfZ9D9Oix/348tiuyWCsn5d17rXco8mPpsdLOy AWFobI0xKeYOthjOengzegvbQu+/7rBN+J8HeM3IjIpVQxjrejS4IWd8fQUUBlfc+rVD TVm/2a+wXh4yPPODGaGePDgnEQy8K0aUNhQrVADt4Y4QNru4a7gEm75fkfRbTR0+LeV2 cvw9tZpb31mOvuMm/L/mcM5lUiR+SmPRUT2b9w+v6bYPUqBTFL09UJFX9IWoxXQtWFEW 0NQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=tOd2h+5X6DIVgo8cTm+A/eBNlNlb0gNOIgz+JPAUdSc=; b=GWsTLgNJhDf7b/dQMQq5qrmFWqUWvInjLqW5vWZVSWUUm/npZPpdY0v3ZKd8H3bUPJ s4gSj0yGgw8zQh+l4XWCzBxGDPwCtulJTPIjFFMdqfnAmGyCgp2zFqa6LZ6NMdXpO+MT by9HmtO31O7n1Kqw1ZPy4LbkaI80UY0fy3uKt4rf5/H2q1UX/wZhTWwIPJUL7JedgCwu W92A0fGa3uJp3VjPgdIeZ2QfMyyAeB9B4Jm7HQCTiS9gfT8wgIpkpmOuLMJgbIEtkQIG 955voGYU7JrQOGoreHcEn3XXXhbhfEjsbjAedIxW4w+lVjxedVV3nYgFVuskWcUc7yII SbEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=oFTQVt3o; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a5-20020a509b45000000b0043ab664c9e7si10894194edj.282.2022.07.16.16.18.46; Sat, 16 Jul 2022 16:19:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=oFTQVt3o; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232491AbiGPXRP (ORCPT + 99 others); Sat, 16 Jul 2022 19:17:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229619AbiGPXRO (ORCPT ); Sat, 16 Jul 2022 19:17:14 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ADCB1AF22 for ; Sat, 16 Jul 2022 16:17:14 -0700 (PDT) Message-ID: <20220716230952.727288644@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1658013431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=tOd2h+5X6DIVgo8cTm+A/eBNlNlb0gNOIgz+JPAUdSc=; b=oFTQVt3owFOV+oSY8U3WQnmJAYOcGBGoUCum40vbucF0emAfCPRDk/WMPsBNw3Pbg0+9UA 3xzhsDToCRznVTj7pDE6Q7dkDR9R2lyA7PttQqNzgR5DT596wzcZQEBmiPcNcCWSg6iwdw v3qsaPiNkj51M9Sp/2TpxSBJECcOAlJy3SGTG3iGX8rjz0vDkeSBNCtvCYpa3zTzHYO9g0 /YbPa1zGqc1i+6y0fjUi6m4bh1Z8YfxyOo7jsLQQglU4N7dUhrx4lq92DE9/VhbKUu/Ynf ytI2Q4TeqJX6ktZBVp2qcme8qXtZhsHnKr0RS1UFgwInOBVvH50FB8ptZv/kyA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1658013431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=tOd2h+5X6DIVgo8cTm+A/eBNlNlb0gNOIgz+JPAUdSc=; b=WdxTxQ8jYG9/FPO6DHcYaOuRVxVDXZEdHmRUHwRBH8UoLxEWX1V7ki0XFm5lS5Op3j97tY ucBGzqzyO2tVyRAg== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Linus Torvalds , Tim Chen , Josh Poimboeuf , Andrew Cooper , Pawan Gupta , Johannes Wikner , Alyssa Milburn , Jann Horn , "H.J. Lu" , Joao Moreira , Joseph Nuzman , Steven Rostedt , Juergen Gross Subject: [patch 01/38] x86/paravirt: Ensure proper alignment References: <20220716230344.239749011@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Sun, 17 Jul 2022 01:17:11 +0200 (CEST) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The entries in the .parainstr sections are 8 byte aligned and the corresponding C struct makes the array offset 16 bytes. Though the pushed entries are only using 12 bytes. .parainstr_end is therefore 4 bytes short. That works by chance because it's only used in a loop: for (p = start; p < end; p++) But this falls flat when calculating the number of elements: n = end - start That's obviously off by one. Ensure that the gap is filled and the last entry is occupying 16 bytes. Signed-off-by: Thomas Gleixner Cc: Juergen Gross --- arch/x86/include/asm/paravirt.h | 1 + arch/x86/include/asm/paravirt_types.h | 1 + 2 files changed, 2 insertions(+) --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h @@ -743,6 +743,7 @@ extern void default_banner(void); word 771b; \ .byte ptype; \ .byte 772b-771b; \ + _ASM_ALIGN; \ .popsection --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h @@ -294,6 +294,7 @@ extern struct paravirt_patch_template pv " .byte " type "\n" \ " .byte 772b-771b\n" \ " .short " clobber "\n" \ + _ASM_ALIGN "\n" \ ".popsection\n" /* Generate patchable code, with the default asm parameters. */