Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1770948ybn; Thu, 26 Sep 2019 01:52:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfmRIiDkLYgDaK6Ha3O5rMneYzwPf2hBidwT5lkjvQJ25KbEeS4UY4ZpPhaKQlZ8a9U3ok X-Received: by 2002:a50:b6c8:: with SMTP id f8mr2351441ede.33.1569487942268; Thu, 26 Sep 2019 01:52:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569487942; cv=none; d=google.com; s=arc-20160816; b=u8PWb1/wgCP/0EqAQdPojdTGVlIBqDxwt90rI0BEWBCh4621DkX3QXMZJC2AdojrLv L4ZyAe5YFWrGBih5xt6yJwZ/rFJlZMS2sT3z7KSt73Hs7L53XZh4ZRTwCQURWxXBm1y+ vi5ySUbKtDJ3BEUeX5QnAAznqe4GHfgHhUvgErDeo/Ubks+ytM8/FikDwgD/qRD3H0b8 LeaP6x6ATYj+LVTeuRi4YU0MORuzkE1rI0hn5YWSf82PUI7c/u/AB0136PZJSROq+pkz tD8KtcigCxF/7aBg1CAT2QqqxMzg6+D5PqGbF2Ahjcqm9Imf5XAtzuB3jbqR0VIe30W2 LkLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date; bh=YAiF5BlCb2IB5bjR36YOKaqDvS2QGjdRyBl5RSSVq18=; b=ct2KRBRan6iYfOZK2gIrqY/JDvx41mCOXGEXt4voovXOgyJDEr9D74TOWIQv6bx/vZ qIVBx8jQBe88hOxRlNvwRqNGxB+r88gS8zj2H9SwJAvzjteX0IkDBh7OJtZKiAVTx+lZ xu8afOTbys6vF8lWcrOspWdztwBI22MjQHdizGzM6YUHqZVzqej0R/CdqqAYf8f8whPY TeCW4M6yR0lpq1M7e9MHrGqjOLBZciEu9MDODeJ7fZ8LEK+CPaee3UqebdNQ5uH2FKkm D/7A42rMY8eZbU+KrxM61JU8iJk9EQelgws47jpzMgw0DIlvQaRTlHRvwe+zK4nOddyW xxfA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hpe.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10si631730ejx.96.2019.09.26.01.51.58; Thu, 26 Sep 2019 01:52:22 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633501AbfIXVDw (ORCPT + 99 others); Tue, 24 Sep 2019 17:03:52 -0400 Received: from mx0b-002e3701.pphosted.com ([148.163.143.35]:34670 "EHLO mx0b-002e3701.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2633481AbfIXVDv (ORCPT ); Tue, 24 Sep 2019 17:03:51 -0400 Received: from pps.filterd (m0150245.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8OKv7S3014201; Tue, 24 Sep 2019 21:03:24 GMT Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0b-002e3701.pphosted.com with ESMTP id 2v796w0xc4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Sep 2019 21:03:24 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id DA6986D; Tue, 24 Sep 2019 21:03:23 +0000 (UTC) Received: from swahl-linux (swahl-linux.americas.hpqcorp.net [10.33.153.21]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id DC6313B; Tue, 24 Sep 2019 21:03:22 +0000 (UTC) Date: Tue, 24 Sep 2019 16:03:22 -0500 From: Steve Wahl To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Juergen Gross , "Kirill A. Shutemov" , Brijesh Singh , Steve Wahl , Jordan Borgner , Feng Tang , linux-kernel@vger.kernel.org, Zhenzhong Duan , Dave Hansen Cc: Baoquan He , russ.anderson@hpe.com, dimitri.sivanich@hpe.com, mike.travis@hpe.com Subject: [PATCH v3 0/2] x86/boot/64: Avoid mapping reserved ranges in early page tables. Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.12.1 (2019-06-15) X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-09-24_10:2019-09-23,2019-09-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 mlxscore=0 spamscore=0 bulkscore=0 adultscore=0 mlxlogscore=999 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1909240169 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch set narrows the valid space addressed by the page table level2_kernel_pgt to only contain ranges checked against the "usable RAM" list provided by the BIOS. Prior to this, some larger than needed mappings were occasionally crossing over into spaces marked reserved, allowing the processor to access these reserved spaces, which were caught by the hardware and caused BIOS to halt on our platform (UV). Changes since v1: * Cover letter added because there's now two patches. * Patch 1: Added comment and re-worked changelog text. * Patch 2: New change requested by Dave Hansen to handle the case that the mapping of the last PMD page for the kernel image could cross a reserved region boundary. Changes since v2: * Patch 1: Added further inline comments. * Patch 2: None. Steve Wahl (2): x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area. x86/boot/64: round memory hole size up to next PMD page. arch/x86/boot/compressed/misc.c | 25 +++++++++++++++++++------ arch/x86/kernel/head64.c | 22 ++++++++++++++++++++-- 2 files changed, 39 insertions(+), 8 deletions(-) -- 2.21.0 -- Steve Wahl, Hewlett Packard Enterprise