Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1309431ybl; Wed, 28 Aug 2019 12:41:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwT64+Yek4xvUTJRIyyrF9babUsdfIQQSYJJpzI48Dw2kzdubKaXYPu5LDgjyB2189JTO1+ X-Received: by 2002:a17:90a:ac11:: with SMTP id o17mr6033768pjq.104.1567021277032; Wed, 28 Aug 2019 12:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567021277; cv=none; d=google.com; s=arc-20160816; b=aQoAwam5e3P54ONmCoHHdOX4XDFrrZQcDm2A5Mif0rreChQMMtIs1N7MDp8aftVtYV 67g8vig7opoxIt8X7StLgcj73ikql6U6hFrDYFbDPSW8vEvjIDBJ3eovK9zq39yTLvzL AmWSfqHBHtembnWJhKX7v6JlN1vs8OYRrnyyjk7ysvBv1eErdnMDwDbEo9EXNU5/bv77 jzHehIDIKCmOvF5CoUP20yQD5OAc13CpIbx1vk1wLnF4WPR5dKpJL3wdtsKKOtzQsPFc RzqK/8cmOw8flg/FKFor3e96AhKHN98WiIRgmuyKQzJY6pMsHjpA4as6HXZuUtuL0LCF AhXA== 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 :dkim-signature; bh=mGPxPtRA1D+C9Lx3ecKYNHdNJ8rQlVmAMJe2O6XMN1o=; b=HRaM5wx8LWBIgr4EaQl991a7N/MmQmMlBKNB9C36B18zHoiAyJLn49gcMee4vVu9+/ S7DCcIaWpVPG2LdCEU5+gBPXd2vL8GNb42SX5xEn0g6OjyMBBuvhMXU7zsTLWMMnzbcR +6zEqL/xYdsIKWbENekWHxj+XxjUKjecwJrb4vDVzt/q6+oLgbSRuEs0jswg7foCXw9I qIJSCUCwYNRZxqbty6DBlGOqKB7frNO9JXzL+HgC/tNIFlUbShRQnGpa1r0NsY7UaAUz 8jfiLT545aJTRSRwkONyUgGW79FpGRW4pIruIPxnaT+gF2RCaAGIvQSk/Pg1jOow0VNZ M97g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=MgNQWIW5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 63si117213pfz.212.2019.08.28.12.40.37; Wed, 28 Aug 2019 12:41:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=MgNQWIW5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726983AbfH1Tis (ORCPT + 99 others); Wed, 28 Aug 2019 15:38:48 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:33838 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726947AbfH1Tiq (ORCPT ); Wed, 28 Aug 2019 15:38:46 -0400 Received: by mail-ed1-f65.google.com with SMTP id s49so1328721edb.1 for ; Wed, 28 Aug 2019 12:38:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mGPxPtRA1D+C9Lx3ecKYNHdNJ8rQlVmAMJe2O6XMN1o=; b=MgNQWIW5jaNIZ+v28n88Cf6T294svtLxJZdXwXVamUX/+sr9l91TkrXK+FgKlMwbry EPaEnzysbWIwA9j35sHyxxlGI2AlqJcLv0DksYPfmu7kxL5kj7JFqM770Ja98lKj9cBN KHajg8E52NCpTHC1oRWQ+WJyyNZAroXzHXP8M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mGPxPtRA1D+C9Lx3ecKYNHdNJ8rQlVmAMJe2O6XMN1o=; b=GMpmi9bnk9iRKeGlIMLSfYSBX3XEaYNo87AEhKsoz+ilozdGuUwA08towg798cYUPz jUrLKfiS3Xma8DczNlbhX4HuCBKDqoa9/WK/g4bkcaB8kdQGOetSPMEgGnoME7iw2DcS bmPthni35Iy/hDgvQG0lIEUznvvIlPOWtG+DZVZMbD/w5oVuMH8eVGlalZoCTmcTqGJJ 4jqZ8G5rafpEM1tF2AuVu+f3I2xpAglvr3dk9rXio6m7SM7s/FNzJbL/6tU3xV8V+Wv1 n/yc1v6Xlne9tH8cp3EfudOpcQIuflSoeVDi8RekgmdUK3O3FYU4+LVIPRRUBhea5AxM X8UA== X-Gm-Message-State: APjAAAXAfsvLULnSKG5xYDZY5Rek7oOFqkHxe993I1h7dJfDUVypttHz dAitxFasA+i8WetOvHsE0yktQgQRdOSi4lb8 X-Received: by 2002:a50:fc12:: with SMTP id i18mr6036132edr.23.1567021124863; Wed, 28 Aug 2019 12:38:44 -0700 (PDT) Received: from prevas-ravi.prevas.se (ip-5-186-115-35.cgn.fibianet.dk. [5.186.115.35]) by smtp.gmail.com with ESMTPSA id ni7sm38990ejb.57.2019.08.28.12.38.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2019 12:38:44 -0700 (PDT) From: Rasmus Villemoes To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org Cc: Rasmus Villemoes , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] x86: mmu.h: move mm_context_t::ia32_compat member a bit down Date: Wed, 28 Aug 2019 21:38:36 +0200 Message-Id: <20190828193836.16791-2-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190828193836.16791-1-linux@rasmusvillemoes.dk> References: <20190828193836.16791-1-linux@rasmusvillemoes.dk> 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 For CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=n, there's both a 6-byte hole after ia32_compat as well as a 4-byte hole after perf_rdpmc_allowed. So rearranging things a bit we cut 8 bytes of sizeof(struct mm_struct). For a CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y kernel, this patch just moves the 6-byte hole to another place in mm_context_t. Putting the ia32_compat member after the pkey members is deliberate to keep the latter two (when present) in the same 4-byte unit. Signed-off-by: Rasmus Villemoes --- arch/x86/include/asm/mmu.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/mmu.h b/arch/x86/include/asm/mmu.h index b1bb47a3577b..ba3d22fcd507 100644 --- a/arch/x86/include/asm/mmu.h +++ b/arch/x86/include/asm/mmu.h @@ -32,10 +32,6 @@ typedef struct { struct ldt_struct *ldt; struct mutex lock; #endif -#ifdef CONFIG_X86_64 - /* True if mm supports a task running in 32 bit compatibility mode. */ - unsigned short ia32_compat; -#endif void __user *vdso; /* vdso base address */ const struct vdso_image *vdso_image; /* vdso image in use */ @@ -49,6 +45,10 @@ typedef struct { u16 pkey_allocation_map; s16 execute_only_pkey; #endif +#ifdef CONFIG_X86_64 + /* True if mm supports a task running in 32 bit compatibility mode. */ + unsigned short ia32_compat; +#endif #ifdef CONFIG_X86_INTEL_MPX /* address of the bounds directory */ void __user *bd_addr; -- 2.20.1