Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1217539ybn; Wed, 25 Sep 2019 14:24:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzpbcCuM4UkjPO8kOjBlxoDCIgHVc8i6+9kaQlYr29MuODejS7B0jjicVaubLU6Fca5svX X-Received: by 2002:a17:906:9498:: with SMTP id t24mr231370ejx.88.1569446686678; Wed, 25 Sep 2019 14:24:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569446686; cv=none; d=google.com; s=arc-20160816; b=jc3Z6FbNyN6gY/CfR+9St54A+PzM+dnRHdswxvb7I0Sn0LnHqPtK1z9WP/L4dvWrs/ YnVrY0J3iuQz5nrzRxyzXmEiTQvgiZOYxdQqzi8eia45qynOBt7kFnDXbWveKcNNb8Ve OThu31rVE6yuQyaDRhr5gN1HSzG2HzV4WQ8K1frMWrcvXrW2mrblG/gOraHqZRoMKzcc 3skZECdaV0aoFokn7O1fmqHpW4BRp9nHSrGOw59iG1oxz0l6nn9pR2QXjOodEFAyMPiH O1D8yZeKb21TaU8g/OWG3GeX4MCrsPpmDtSU/XTahrQqJu681563Hhmgoakc6cyJcFny UEeQ== 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=5k7wPBpYtJysqHkvruKeVC1RRtqTLm0gI87K8/OAzsM=; b=FkOtg5vljys2cqKfDr23o4m7UHJrDy4OV9uB9fiYg2KPjjQ5AyoGZ2hwB+490fYKdY TU/Qy/WDjFtc+CGzMd9f0CUDo3gN/m5hiBXYnGkhbrxud+DrKWd8kF9oVbhEZHgEZQjv qa6yGnxbmXnzUwoh5YmBR1SRkfZwVMNAtIKdS/Qn8Y+tbAkV2LNw/e9ZFlfRnSqomTpz 0kJRi+/HaF9GGPkck+yPu2zMOPua6Ho/qNuD/E/HQxN6I7JC9xQGyrfXauTWlZDSJDkp FIiFfr2myNcY1he2FouVFs3bF5IIYfRa8cDP5pQ+sof0f0dYEDdFBUifCsoM5oVokkB3 3E4Q== 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 d24si159466ede.119.2019.09.25.14.24.22; Wed, 25 Sep 2019 14:24:46 -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 S2440362AbfIWSPP (ORCPT + 99 others); Mon, 23 Sep 2019 14:15:15 -0400 Received: from mx0b-002e3701.pphosted.com ([148.163.143.35]:65320 "EHLO mx0b-002e3701.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394280AbfIWSPP (ORCPT ); Mon, 23 Sep 2019 14:15:15 -0400 Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8NI27Wk031655; Mon, 23 Sep 2019 18:14:41 GMT Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 2v6pd04jm5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Sep 2019 18:14:41 +0000 Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g4t3427.houston.hpe.com (Postfix) with ESMTP id 468B45C; Mon, 23 Sep 2019 18:14:40 +0000 (UTC) Received: from swahl-linux (swahl-linux.americas.hpqcorp.net [10.33.153.21]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id D3F0A5D; Mon, 23 Sep 2019 18:14:38 +0000 (UTC) Date: Mon, 23 Sep 2019 13:14:38 -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, Chao Fan , Zhenzhong Duan Cc: Baoquan He , russ.anderson@hpe.com, dimitri.sivanich@hpe.com, mike.travis@hpe.com Subject: [PATCH v2 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-23_05:2019-09-23,2019-09-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0 lowpriorityscore=0 mlxlogscore=999 priorityscore=1501 mlxscore=0 clxscore=1011 bulkscore=0 suspectscore=0 impostorscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1909230158 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. 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 | 18 ++++++++++++++++-- 2 files changed, 35 insertions(+), 8 deletions(-) -- 2.21.0 -- Steve Wahl, Hewlett Packard Enterprise