Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1212938pxb; Sun, 7 Mar 2021 10:05:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGUvlLXI8IBrb49HfGSA5TuYD8zwv3U9d0Z8qmbEJtmvk6OHM9i4LkzW0kUShrO1QzZFg+ X-Received: by 2002:a17:906:3883:: with SMTP id q3mr11478423ejd.160.1615140313448; Sun, 07 Mar 2021 10:05:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615140313; cv=none; d=google.com; s=arc-20160816; b=DGw4syGyazVnd7RvJefSrxjYWzEs8lB0mHUmRyKdwv02P95JfdQwbcWjLRO1v8LY7t FzDwlL4o75pvm+OQWODcUypaz8ZKFPLU5HFaMTaV26vKCWmE3I2FA+JNMxh+ypZJHRRF VWqd+pptidKG6uDVjSAFJPAZ9shGPgktf/uy7HYsCMGl77AsBdMQdaydEgrE5HSRFRwo F8uR+pmlhUcNljE6laUqD0LVxZoa/h/Bdh7GVp5+VQK5Axik8KHBPt7l6JKt44dlO9Ow ATvjTLysbMlzrHdark3pUv+JVduNe3AIyGnNRFrd1UELXQDBpT2bymwk2FgZquykjVqw mF6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=B2+RZVdJEIGjYvBplx65Ssevyg8xALCta0oPDumrCXQ=; b=pgEqIQE9R4NJxS/Dw5ftPYyFxfZz7hYEFmRjmz1hRlZX0dgn36VBAYJCSsHrJUuUgI G1zskKI5Z/qIUM8q6SU6SL1TvI55t89t+JiY80HtJ7bBYS9+uYpxWc1E+GKHIl5gTIEZ zrEFXSxntIfX35xeDZazon3c4BkBn/SaUYixb1D5V0Pl8die10Q6l9tkORaAuq2PvxgR 0N7mZcAdMo5rQ5jTjdyb/sXezu191yr8t8mZbGQP1MWT7AacCOe0jCkVQ8nTu/4CClPK C3920PQaqtNBwu7dPq+19UJoZGPpCY86cgHij/fEFOmPhyY9noh8YdSQxkysSZHUqCWH 9rwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Kxw27O2I; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s21si5439130ejj.271.2021.03.07.10.04.50; Sun, 07 Mar 2021 10:05:13 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Kxw27O2I; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbhCGOYs (ORCPT + 99 others); Sun, 7 Mar 2021 09:24:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbhCGOYY (ORCPT ); Sun, 7 Mar 2021 09:24:24 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48C9AC06174A; Sun, 7 Mar 2021 06:24:24 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id p5so3642967plo.4; Sun, 07 Mar 2021 06:24:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=B2+RZVdJEIGjYvBplx65Ssevyg8xALCta0oPDumrCXQ=; b=Kxw27O2Ia52HybpYuESfaEP6QG9+MlcxmOOkoEUhoLcvjjUOSPDD6kvb4jtd85zbr4 Eh2EI+0YUth5sLuA888oN4fbk+aFNVtdaKFZVeHpB4havhI9jxREYVqGYncmqUuRFED4 fJ2TkRjr5gh30b9/98UiCuc6zIbqLj6NR5nPx4vtFGdzTe3AsF/Dn+6SOS2TewWmHBUG AcG6v1RnObc9nzMGMauu2o8GQ7mMUZjJSMvQb5gPaNoB/qT5fLn7rLvhtCz2dxtNycHT Bpe5kRKVwKMNtHnrQ2DvYXK9OrCd67QKN5k8ad6NxxFl/rfMGpIZzYKSKZIUqhpmNQdy DtvQ== 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; bh=B2+RZVdJEIGjYvBplx65Ssevyg8xALCta0oPDumrCXQ=; b=dnUFOT9gFLYCzE0gw7hM2wvqAEpMr6b3lzB8aCY2fYaxxFyOCsXS3yCOtu2uBbq34U 6emm1AQw5qC6DCK98S3RraA6YA8GXY6T0xZdBGBiGU9I+TjtTVTyez6XnZG6PY7tvGfF i3f6sQ7pCM52/H1uGHsDH01XHd3/Of1V/WefIytqmBjfBtC1XDAG4jIZ4XWZX7t1No7Q 0tban53o4wfRer8Z54wkgyosvwEg/CNcYfH/JQJ04LagnmyU99uNwDOvHdCEu7R71cC1 rl5y538ZgunO0aWEO9srhpt67Vo+wB/q2jvveGxLjWZE7NYcR1CtRmV/Sw+Buc7BK4rl ENRA== X-Gm-Message-State: AOAM532oY0lP3jmOzhhx+QLzn6/OyAvt+GMasJykn/w5Wmc6oEtYzDoR OGAIfJIgasl3RfjLAsVRzUE= X-Received: by 2002:a17:90a:eac7:: with SMTP id ev7mr20559717pjb.158.1615127063574; Sun, 07 Mar 2021 06:24:23 -0800 (PST) Received: from AHUANG12-1LT7M0.lenovo.com (1-174-52-149.dynamic-ip.hinet.net. [1.174.52.149]) by smtp.gmail.com with ESMTPSA id t6sm2626600pjs.26.2021.03.07.06.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 06:24:23 -0800 (PST) From: Adrian Huang To: Thomas Gleixner , Ingo Molnar , Borislav Petkov Cc: x86@kernel.org, "H. Peter Anvin" , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Adrian Huang , Adrian Huang , Kees Cook Subject: [PATCH 1/1] Documentation/x86/boot: Correct algorithm for runtime start address Date: Sun, 7 Mar 2021 22:22:51 +0800 Message-Id: <20210307142251.797-1-adrianhuang0701@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adrian Huang Commit 8ab3820fd5b2 ("x86, kaslr: Return location from decompress_kernel") enforces CONFIG_PHYSICAL_START as the minimum relocation address when the kernel option CONFIG_RELOCATABLE is enabled. This change should be included accordingly. Signed-off-by: Adrian Huang Cc: Kees Cook --- Documentation/x86/boot.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Documentation/x86/boot.rst b/Documentation/x86/boot.rst index fc844913dece..808ea181ca40 100644 --- a/Documentation/x86/boot.rst +++ b/Documentation/x86/boot.rst @@ -894,10 +894,16 @@ Offset/size: 0x260/4 The kernel runtime start address is determined by the following algorithm:: - if (relocatable_kernel) - runtime_start = align_up(load_address, kernel_alignment) - else - runtime_start = pref_address + if (relocatable_kernel) { + runtime_start = align_up(load_address, kernel_alignment); + + /* pref_address is the minimum relocation address */ + if (runtime_start < pref_address) + runtime_start = pref_address; + } else { + /* Adhere to the statement describing in field 'pref_address' */ + runtime_start = pref_address; + } ============ =============== Field name: handover_offset -- 2.17.1