Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp583052ybg; Tue, 28 Jul 2020 13:26:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBb3Xujo1KDs0GEmlwN9UhbiFYnmTqv45WmtnfATHa4W0WwJRnM4MHfPFLMm7uus0DylLo X-Received: by 2002:a17:906:698:: with SMTP id u24mr25003672ejb.57.1595967962209; Tue, 28 Jul 2020 13:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595967962; cv=none; d=google.com; s=arc-20160816; b=uPJ4X6pjyRzYFXcqwEp+EJ7UUjFg4HGAQu1pC/qUgfbrreXLDPKfKYCWHqbq1Pqavq FBOufIAQcQDJGi7arQJATIrmxqO/YVZgj0K8/POmvJCZwPHRaicWC79G78259HSY9Dw6 u00YWGmK322chbwGNMB/gcNMOtLuVCeFT5BZQX4BSZWBTV/3taFiWlDHDhQVhoropKNe hffOvh80Xci6LOhUYvBATuwWEU0EveyktODFSC1E4fhM0VH1gBUW1bsR0obIF2Qj8Tu7 L0gEB5uj3rdG+OGUEkxjwzLp7GTuLaB+WzMiESivkueJcGkBPh7TpXVNkmSYsPXpMzIm Ky2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=gpoBjeFgtx+juQcJ7mV8tX+ktwrhmPvOmQhMEFnTzZM=; b=QS88f7uy3Ngp7zXGnf+w6iPrel/2JISEWRBybrCNpo6PiRUg3T+o8gxbUeQGeVtYIP MznLml27+9UNmoPPTCvnhBojJpqdi7ogTRF/A3x35iEfutzyG3doksAglHNsBR68CN5V hKr1GUcgFEU0AYoYwfRBVivXWdHQsx4UK6/eNyDub7EXHiIQ3JxZs7cCbWSZfHEFW4/X MrpaAc+W2WYryPnWqKDEaAdvIe1OYbT4yEfWg1U44449TRBj5Diu7dNiCsLh12SwNF7b s/fQVbhht19ofphXTiXD8SEVyFCfGX1edWB1N0V6sSTyz5I6APise5APLBd3d/ewDOlJ dhzw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id si6si6026511ejb.331.2020.07.28.13.25.40; Tue, 28 Jul 2020 13:26:02 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728728AbgG1UW7 (ORCPT + 99 others); Tue, 28 Jul 2020 16:22:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728817AbgG1UW6 (ORCPT ); Tue, 28 Jul 2020 16:22:58 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58BFDC061794 for ; Tue, 28 Jul 2020 13:22:58 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 1759128EA02 From: Gabriel Krisman Bertazi To: luto@kernel.org, tglx@linutronix.de Cc: keescook@chromium.org, x86@kernel.org, linux-kernel@vger.kernel.org, Gabriel Krisman Bertazi , kernel@collabora.com Subject: [PATCH 4/6] arch: x86: Expose psABI on thread_info Date: Tue, 28 Jul 2020 16:22:27 -0400 Message-Id: <20200728202229.1195682-5-krisman@collabora.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200728202229.1195682-1-krisman@collabora.com> References: <20200728202229.1195682-1-krisman@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Expose psABI in thread_info, in preparation for the TIF_IA32 and TIF_X32 flags removal. Signed-off-by: Gabriel Krisman Bertazi --- arch/x86/include/asm/thread_info.h | 2 ++ arch/x86/kernel/process_64.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index 6d55a9c0dda2..698feefd5f5f 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -62,11 +62,13 @@ enum { struct thread_info { unsigned long flags; /* low level flags */ u32 status; /* thread synchronous flags */ + short int psabi; }; #define INIT_THREAD_INFO(tsk) \ { \ .flags = 0, \ + .psabi = 0, \ } #else /* !__ASSEMBLY__ */ diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index f20a365017b8..aea2c03e8a5d 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -532,6 +532,7 @@ void set_personality_64bit(void) /* inherit personality from parent */ /* Make sure to be in 64bit mode */ + current_thread_info()->psabi = PSABI_IA64; clear_thread_flag(TIF_IA32); clear_thread_flag(TIF_ADDR32); clear_thread_flag(TIF_X32); @@ -553,6 +554,7 @@ void set_personality_64bit(void) static void __set_personality_x32(void) { #ifdef CONFIG_X86_X32 + current_thread_info()->psabi = PSABI_X32; clear_thread_flag(TIF_IA32); set_thread_flag(TIF_X32); if (current->mm) @@ -574,6 +576,7 @@ static void __set_personality_x32(void) static void __set_personality_ia32(void) { #ifdef CONFIG_IA32_EMULATION + current_thread_info()->psabi = PSABI_IA32; set_thread_flag(TIF_IA32); clear_thread_flag(TIF_X32); if (current->mm) -- 2.27.0