Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4725351imw; Tue, 12 Jul 2022 13:05:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sy7FFu6bNEe9mLMofsZcIaYGcON0qOxjku6hq3vDyABJalnQCFtnNUsartepuJmPQG3UPe X-Received: by 2002:a17:907:7628:b0:72b:4d6f:ce8a with SMTP id jy8-20020a170907762800b0072b4d6fce8amr14568756ejc.59.1657656328025; Tue, 12 Jul 2022 13:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657656328; cv=none; d=google.com; s=arc-20160816; b=dmXb+Ea9QF09sDVCApHdh3Lw0FSdiqkw/5OXFMZRPXsqdzMjskIYgOy0aDpzQooiFR kKVdFvIQdaV+GPUyttghTVT9rJWDZ8bzgEqs+UZps6IbssgLnqBgpb8kydOgJ4GsDcWf PahrCYmrOdHET2nzhK02SJf2DmCb6hqsDUcJsygQfVSu+cEO+GUTCFAZoR88hKvi7HnO fA79y7Y63Ef/x9DJMx9OCpFFj4euOx1UKF5V7oCG3UnCT2cBtFMb2GEUqfXXU2W7GYD4 mUI/TI0krWW3CqOSU4xV5wNRFQ+RZRXoxnROPtK2WA/z0WVFYphw1KZCFYxiJTspRdPR VncA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Gguy5kWpeU2gcxFHYi/bwF9clXFPphIz+xOOOoHvkkA=; b=tZkge4bHnj5eruOX91Vec8MPawWQb1y7XqF4mlchqtjFJkGYMmnJWzG0TUmTihf5vr Gr7FASLaMWQG3ZW/E73sUpx76aaKd90lX//RPDjZCbp1QO+pkO1iLLP7XtL0BfkXGh1T H/rSedO+gPw2Mg+dFJ5fGj3HMSEny5l4mCF70sCeUqG/zXoQMXDkkrCXY3X8eejpxnj3 +pe4O2ownu9W/C/3WEHW2feIJQOTrvRAEN7rlfT+2CT3lRuRNDwvbKjpbVvrgkE1+8SL RuxKfMMKMGdbR6IK7VEzjiURsDkn3oCUFyJElZ0AF6n2ZCCbsStBbA9iFTGu6zIt+qMg B3Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lJg3Al14; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e19-20020a056402191300b0043ae0b9e568si2216264edz.436.2022.07.12.13.03.25; Tue, 12 Jul 2022 13:05:28 -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=@linuxfoundation.org header.s=korg header.b=lJg3Al14; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234268AbiGLSqE (ORCPT + 99 others); Tue, 12 Jul 2022 14:46:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234263AbiGLSpY (ORCPT ); Tue, 12 Jul 2022 14:45:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3ABBDB2E2; Tue, 12 Jul 2022 11:42:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 395EFB81BBB; Tue, 12 Jul 2022 18:42:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69C67C3411C; Tue, 12 Jul 2022 18:42:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657651352; bh=l0kO0QEUe8EFVtCdORKJzuiIYU1+sCDa53haTUQKWpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lJg3Al14bssennG7Fm5cCOMiBT4+hONK/mv+P7u94Xy/5XY67Tn6ouLwUX6woViaC ewD6x+PGzyBMs+k7bf9by3K2aDcVvRuuv2yT5kDlsD0XFwd+6tmi6QyVof6VmCZngI 134D4lZjPXolbwtpOnCwm3cFvvBxXxR9hWd8zZMQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Peter Zijlstra (Intel)" , Borislav Petkov , Josh Poimboeuf , Alexei Starovoitov , Thadeu Lima de Souza Cascardo , Ben Hutchings Subject: [PATCH 5.10 051/130] x86/asm: Fix register order Date: Tue, 12 Jul 2022 20:38:17 +0200 Message-Id: <20220712183248.791781759@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220712183246.394947160@linuxfoundation.org> References: <20220712183246.394947160@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Peter Zijlstra commit a92ede2d584a2e070def59c7e47e6b6f6341c55c upstream. Ensure the register order is correct; this allows for easy translation between register number and trampoline and vice-versa. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Borislav Petkov Acked-by: Josh Poimboeuf Tested-by: Alexei Starovoitov Link: https://lore.kernel.org/r/20211026120309.978573921@infradead.org Signed-off-by: Thadeu Lima de Souza Cascardo Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/GEN-for-each-reg.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) --- a/arch/x86/include/asm/GEN-for-each-reg.h +++ b/arch/x86/include/asm/GEN-for-each-reg.h @@ -1,11 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * These are in machine order; things rely on that. + */ #ifdef CONFIG_64BIT GEN(rax) -GEN(rbx) GEN(rcx) GEN(rdx) +GEN(rbx) +GEN(rsp) +GEN(rbp) GEN(rsi) GEN(rdi) -GEN(rbp) GEN(r8) GEN(r9) GEN(r10) @@ -16,10 +21,11 @@ GEN(r14) GEN(r15) #else GEN(eax) -GEN(ebx) GEN(ecx) GEN(edx) +GEN(ebx) +GEN(esp) +GEN(ebp) GEN(esi) GEN(edi) -GEN(ebp) #endif