Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp57428lfe; Fri, 15 Apr 2022 19:20:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKntxFC55WX/Eerc1Yy3x8nZZwVeGTVZBu5q6R5sRn3no5RUwuHWf4Vq20CXRcEQU9LK1i X-Received: by 2002:a63:5b43:0:b0:39d:1a2b:5904 with SMTP id l3-20020a635b43000000b0039d1a2b5904mr1329321pgm.533.1650075629733; Fri, 15 Apr 2022 19:20:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650075629; cv=none; d=google.com; s=arc-20160816; b=UkxifCkvoVAAyOK9594oTkWz3EtrztW0wZltIN4JBGESZoLrv2wuWATdc0ettxJVfA JZrO87L7LMVYE2aNyJUF+4beGTCiHJmgLj3Oc/jlx35YQK1CDLhRdf4Bn9UEK4CI44Fd GcFH9ZDDZ0vmONqGvCOg9Jqm70Rmm5RUsb4kci34LIR79UR/OTF+/svqUb3hk1tjdxXi DolFnAvwR1qNBh2g+hZFhW2VH3m7CpYmfn1ecIb9rnrflBMyEvjArjz06zW6rTNzxWCX AQdXSP9bhFv4U3tuS1BfvdhHzXoDqY8x1m6FKE0HZVfUazEKzE0CIAX07yRkWSIcX+OH hCiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Q9+MlWfHo9/S6kJXuWo/hH/+hng49XBvdtfu0dGm548=; b=g120ursT42k88Oay5GtgieCrvHaMaIVr2N7AKDld9hkPstar55qZKFDXr9OJ+rr/Zu z6gokm99Vmac02bc/olGXBV69pTp9LTZS2+jN5DFsN+zlabfiaDeSmbBPqHs4TsJ7UhW fWPkmBYBt5sbRdcqXXC5FPpjHMKadtQbtEMEMlNueEMgwOQRkT8MMH+WGQ3Ud2OzKiqK bm07BANgaprUu4DJh/JNVGNbvKUpMO3FR6z+g4+B5r6fXq92ZxJGeFjz+tC0pxwmZ9PV lOYLQ6RfzvP6CWDU5Ngh3TiLTcPk4A6OFwZlX34p3pw3Yinw9+oeii0b3bRJ842425Hs R/Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iphcZZck; 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r14-20020a6560ce000000b0039924bbfdb7si2951825pgv.372.2022.04.15.19.20.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 19:20:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iphcZZck; 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A142E158551; Fri, 15 Apr 2022 18:34:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351852AbiDOJpF (ORCPT + 99 others); Fri, 15 Apr 2022 05:45:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351817AbiDOJow (ORCPT ); Fri, 15 Apr 2022 05:44:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D214AC046; Fri, 15 Apr 2022 02:42:24 -0700 (PDT) Date: Fri, 15 Apr 2022 09:42:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1650015743; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q9+MlWfHo9/S6kJXuWo/hH/+hng49XBvdtfu0dGm548=; b=iphcZZckLezsEvEUUDub36z0aAdZ/OO0SYHKMPMIrkGlabbXmPYmQiWkcAN0Q6/YETic77 nwHsAdaT9oyFPQhIcm+nyo4H/CEAHIcXj6gMkCfA5ow200DMFdTVrmzYa/V0y9Ovl0zA/M 5tBljdsO2rXMts3xpG0bty2K2tb8zKjWpBxtqEeGwSGSc5iBYxzefEFGeCDYvdP18SFqzp QLl3F0tifaAEB2L93o1wLj2HGfXz+cwzD+OTr3dPAuZMmLZhyeIJh/fl/LSfjbXZvBgku/ hM2/9uCP931bxx1HhCOiGM8LYyp3oGx0simpOX0KGQT2cZvlciO5Bk38DqkrTg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1650015743; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q9+MlWfHo9/S6kJXuWo/hH/+hng49XBvdtfu0dGm548=; b=mlTwPucv0yOMmeK33XfjAKyCS/l2nCJdaodErlgk5VtS25wHRxqwBGgbZBmxvwXUb4x+4o O0W6GG8i9sAWH4DQ== From: "tip-bot2 for Brian Gerst" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/core] x86/32: Simplify ELF_CORE_COPY_REGS Cc: Brian Gerst , Borislav Petkov , Thomas Gleixner , Andy Lutomirski , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220325153953.162643-2-brgerst@gmail.com> References: <20220325153953.162643-2-brgerst@gmail.com> MIME-Version: 1.0 Message-ID: <165001574217.4207.12557873929669073141.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 following commit has been merged into the x86/core branch of tip: Commit-ID: f5d9283ecb33329073033029fe427155aa0abfb1 Gitweb: https://git.kernel.org/tip/f5d9283ecb33329073033029fe427155aa0abfb1 Author: Brian Gerst AuthorDate: Fri, 25 Mar 2022 11:39:50 -04:00 Committer: Borislav Petkov CommitterDate: Tue, 12 Apr 2022 15:42:59 +02:00 x86/32: Simplify ELF_CORE_COPY_REGS GS is now always a user segment, so there is no difference between user and kernel registers. Signed-off-by: Brian Gerst Signed-off-by: Borislav Petkov Reviewed-by: Thomas Gleixner Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20220325153953.162643-2-brgerst@gmail.com --- arch/x86/include/asm/elf.h | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h index 29fea18..cb0ff10 100644 --- a/arch/x86/include/asm/elf.h +++ b/arch/x86/include/asm/elf.h @@ -116,7 +116,7 @@ extern unsigned int vdso32_enabled; * now struct_user_regs, they are different) */ -#define ELF_CORE_COPY_REGS_COMMON(pr_reg, regs) \ +#define ELF_CORE_COPY_REGS(pr_reg, regs) \ do { \ pr_reg[0] = regs->bx; \ pr_reg[1] = regs->cx; \ @@ -128,6 +128,7 @@ do { \ pr_reg[7] = regs->ds; \ pr_reg[8] = regs->es; \ pr_reg[9] = regs->fs; \ + savesegment(gs, pr_reg[10]); \ pr_reg[11] = regs->orig_ax; \ pr_reg[12] = regs->ip; \ pr_reg[13] = regs->cs; \ @@ -136,18 +137,6 @@ do { \ pr_reg[16] = regs->ss; \ } while (0); -#define ELF_CORE_COPY_REGS(pr_reg, regs) \ -do { \ - ELF_CORE_COPY_REGS_COMMON(pr_reg, regs);\ - pr_reg[10] = get_user_gs(regs); \ -} while (0); - -#define ELF_CORE_COPY_KERNEL_REGS(pr_reg, regs) \ -do { \ - ELF_CORE_COPY_REGS_COMMON(pr_reg, regs);\ - savesegment(gs, pr_reg[10]); \ -} while (0); - #define ELF_PLATFORM (utsname()->machine) #define set_personality_64bit() do { } while (0)