From patchwork Thu Aug 30 12:52:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 963859 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 421Mpw5HWSz9s3x; Thu, 30 Aug 2018 22:52:56 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fvMRM-0003uE-Bg; Thu, 30 Aug 2018 12:52:48 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fvMRI-0003sI-AM for kernel-team@lists.ubuntu.com; Thu, 30 Aug 2018 12:52:44 +0000 Received: from mail-ed1-f70.google.com ([209.85.208.70]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fvMRI-0000cE-3A for kernel-team@lists.ubuntu.com; Thu, 30 Aug 2018 12:52:44 +0000 Received: by mail-ed1-f70.google.com with SMTP id h4-v6so3640209ede.5 for ; Thu, 30 Aug 2018 05:52:44 -0700 (PDT) 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; bh=4VLceT/I30VOGT/+WZa1RofroRkaZVw5Itxsu8HrMSU=; b=K2kZCT9PYqbkCYyfBd2Xk0HESrU/ESHUO0dcfTFXZZBTv71iA6j6KuGNsCSVcCMn4Z T4IebXJ9WRyIrh7qCl1qUdF442pK9TBKfrLCqEJ95Vwl5GflTlkfiACLPxlnM92DpB4w 6ATGwHeEmWaMq0DY1zD9qP202p9Trc2bkQEXCHVawOqShse81xhDYeGf/fAHvMiEoUdy eDlTh3PBrEPDD9loh7Tz8GZBdC8j0V46zxxNFmetxCoLOdSbUWf5kTzKs0MlfFbBKrRC u+9HHCTEcgSVzvRbdlYwKeRJc0a1jHVyPSwGpBz7M4eV7XzPsSRKTa9xmk+RFmgb/GpJ ZYLA== X-Gm-Message-State: APzg51D0+FpuccOxaUIiwuC+fLBc71Ud4Aob/3vlOFTdqvr6pnydc8Ml CgLtAaVTkus7dBCnweCtS/CvqKMSixwEcod06y5XfnDrfX1i09iDh0mvXKn312rM/uYfWIaYzYV nqq6zI/T+vyo67qgXwBtPd9jrRpDXpLPi0Rw7YHfzeQ== X-Received: by 2002:a50:f69b:: with SMTP id d27-v6mr12911601edn.103.1535633563662; Thu, 30 Aug 2018 05:52:43 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb3pcferb0O59y3dlRhIAaK+VtfDwwS0Q/PrYClp5d3DBspwyifctxAUQ3777kx+vsfXtZ1Sw== X-Received: by 2002:a50:f69b:: with SMTP id d27-v6mr12911590edn.103.1535633563548; Thu, 30 Aug 2018 05:52:43 -0700 (PDT) Received: from localhost.localdomain ([81.221.205.149]) by smtp.gmail.com with ESMTPSA id y27-v6sm2953550edb.20.2018.08.30.05.52.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 05:52:42 -0700 (PDT) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [SRU][Trusty][PATCH v2 2/7] x86/asm: Move PUD_PAGE macros to page_types.h Date: Thu, 30 Aug 2018 14:52:34 +0200 Message-Id: <20180830125239.16775-3-juergh@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180830125239.16775-1-juergh@canonical.com> References: <20180822064021.17216-1-juergh@canonical.com> <20180830125239.16775-1-juergh@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: juergh@canonical.com MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Toshi Kani PUD_SHIFT is defined according to a given kernel configuration, which allows it be commonly used by any x86 kernels. However, PUD_PAGE_SIZE and PUD_PAGE_MASK, which are set from PUD_SHIFT, are defined in page_64_types.h, which can be used by 64-bit kernel only. Move PUD_PAGE_SIZE and PUD_PAGE_MASK to page_types.h so that they can be used by any x86 kernels as well. Signed-off-by: Toshi Kani Cc: Andrew Morton Cc: Juergen Gross Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Borislav Petkov Cc: Konrad Wilk Cc: Robert Elliot Cc: linux-mm@kvack.org Link: http://lkml.kernel.org/r/1442514264-12475-3-git-send-email-toshi.kani@hpe.com Signed-off-by: Thomas Gleixner CVE-2018-3620 CVE-2018-3646 (cherry picked from commit 832102671855f73962e7a04fdafd48b9385ea5c6) Signed-off-by: Juerg Haefliger --- arch/x86/include/asm/page_64_types.h | 3 --- arch/x86/include/asm/page_types.h | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h index d1d2972a54db..50ef295d430a 100644 --- a/arch/x86/include/asm/page_64_types.h +++ b/arch/x86/include/asm/page_64_types.h @@ -20,9 +20,6 @@ #define MCE_STACK 4 #define N_EXCEPTION_STACKS 4 /* hw limit: 7 */ -#define PUD_PAGE_SIZE (_AC(1, UL) << PUD_SHIFT) -#define PUD_PAGE_MASK (~(PUD_PAGE_SIZE-1)) - /* * Set __PAGE_OFFSET to the most negative possible address + * PGDIR_SIZE*16 (pgd slot 272). The gap is to allow a space for a diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h index 663ce4984f3f..80678a8775c2 100644 --- a/arch/x86/include/asm/page_types.h +++ b/arch/x86/include/asm/page_types.h @@ -25,6 +25,9 @@ #define PHYSICAL_PMD_PAGE_MASK (((signed long)PMD_PAGE_MASK) & __PHYSICAL_MASK) #define PHYSICAL_PUD_PAGE_MASK (((signed long)PUD_PAGE_MASK) & __PHYSICAL_MASK) +#define PUD_PAGE_SIZE (_AC(1, UL) << PUD_SHIFT) +#define PUD_PAGE_MASK (~(PUD_PAGE_SIZE-1)) + #define HPAGE_SHIFT PMD_SHIFT #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT) #define HPAGE_MASK (~(HPAGE_SIZE - 1))