Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1554454lql; Wed, 13 Mar 2024 00:59:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUZdZ+Y/0Fp7KSHBh1LenUa4vmdyDudxPzaRaBepRztDbdrFokS+CLNqWABNQYWuAVO3ma5aeR4es3qEMTf4MEAukeodex25XuUHhUh4A== X-Google-Smtp-Source: AGHT+IGGmuv5r+sUMAQ7LtIQgr6cbP23Cmw+tGA21meEDZ6yXxwpuvvl65EXXuKYH1jnB84RgrGo X-Received: by 2002:ac8:4e86:0:b0:42e:d98d:a217 with SMTP id 6-20020ac84e86000000b0042ed98da217mr5076298qtp.13.1710316778789; Wed, 13 Mar 2024 00:59:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710316778; cv=pass; d=google.com; s=arc-20160816; b=0Lf7vESyatzjxqx8IWjZGvYTeOtTyVUwCSmPtFmg8d793qyjwQMKBWAiPnuXHfXH6u 6cKkVL7J8qM8nioBNq84ZmPU8+aIgN7wfScdo/DW5IPf2+Yj3vme5mB1+armK22yVAvb 0Kzi0lu2js7+wnF61ibVowNfRpDEx7nuGgs47mP+m5C9/n2JjlPR7SPuUUCegL27BEU4 D4CEU3jL6S4S3iu73LE48jCNBGPdaqj+GS4D97pzlXuuj1duIrumUiKidPI3P646x/r1 owWIZiEzb5BtmKDbYdBabm/sBdOrV4UUbzMN6dKNRDvE6rdZWzbNfiP1MR52YIqSTfot erJw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=gvr0OywRqfXlY8J8P6TNVybbliGURKEupVKvqRMCnx0=; fh=HqLZRR79L3QrL2MLOmo50/S9i9MDOAYQLTuyzbec4pQ=; b=dknYT9dQTJlgozqmzUgRS8UkDTB09Olk8XwUGyx/fbRukhzrfwXAjJTHVqLSTDTYqR rpaQ/UWDppGhDUU6xpvJGjc7dHwu3gdD+e1j0X9+Zh85qgAO9nnmmk4x3FU2oqanRV2S b0+cD2aN2anTy52mV+75sg4XJM9dTTTO4LU23cxsj9GCH8otX/tkMeIVQGm06QdtHUTs /pq0xTiG/N8CVaIZHQvxNseCBEhsJpqrNeWmiCr0yiFFL9U8MlP6Vp4mlebZpvPgJaPH dyDcRgtwYqx8vB30iQL7xzuUjSIFfor3PprF8xK6Tyv3/U0Uma4oX6xSGBzW8s4Z3VJ2 oW6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=a8jSqfZa; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-101189-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101189-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n21-20020a05622a11d500b0042ef031146esi9378243qtk.67.2024.03.13.00.59.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 00:59:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101189-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=a8jSqfZa; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-101189-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101189-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 845DD1C20991 for ; Wed, 13 Mar 2024 07:59:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83FF01B95C; Wed, 13 Mar 2024 07:59:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a8jSqfZa" Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04AEF17589 for ; Wed, 13 Mar 2024 07:59:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710316755; cv=none; b=Er0dE7MnUCX43gGJPmxvHSkicMMmiR328tjfr4kxEFPOkn6WsiQ7tPleKPK0to8/4xsMhqMVFVnGNff40HtvTJTUgR4vRbi2dB1z7KV0DsSnsmc12p1uQjfl2bD/AUv4C1ZKIRO+kJog9QLea8UOyWToDnzV/Z9pGuCkeab275w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710316755; c=relaxed/simple; bh=5EKNsvHVcpLfe38673V9v/i6xog89qCKvXxKXsLsi1I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=JfzOqr5IMRxl6/WueEKK4OB/LdYFwC6UC9ENLLmA2P7sFlBRIiT2LK3mvHCoLSlw57lvc0lkc3fuSFL2UDWP7MvK/CNQOYoGmIzq6Tn6wUPFSnKOyDLiN9QoIqh6+Fhg1Vhrq8HqJr+GCZenWZ7SynEyFoxBWAhKzOVPia7nZMU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=a8jSqfZa; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5684ea117a3so5688955a12.0 for ; Wed, 13 Mar 2024 00:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710316752; x=1710921552; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=gvr0OywRqfXlY8J8P6TNVybbliGURKEupVKvqRMCnx0=; b=a8jSqfZaixpbH5KxI6Z4Jo2AHPdUeWB4Sgqm8gvEQhzDQgzlC5H/1M7RC62oEtQI4i VAsY45HKlp3qFEK7/x7IFOJ0Z4yu3WWyQuQfzsKlUbiGxv/LWZ68DxH9Op7urQdI7yfS mLS51mb8uYABgjjYhVpiF8seSXLMMuwZnsk29GVHOPMStNeqlFMeIZCuZvQ72lr0QCE6 d8/xsWE4oG3cHJjD/Xi+4BBaE+TBxfxEzM3pLT2esCvHyfH5uGnuL8OJV47IDCTay/hC auL2QCtd3xz7oHOfzjUeafXdE/LkhCeplaGnXxNNxz07P/DWykFvesGnu4soyDL8xWIJ XqFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710316752; x=1710921552; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gvr0OywRqfXlY8J8P6TNVybbliGURKEupVKvqRMCnx0=; b=P9AUoKe6is3XcDP8FsBBc5Xm+UPxYGbUbYvwPNz9j8d1k0elrjKcPlhOq+R8dOCgbo d9g8U5dSXnL1H1Qk91G3rmpvqlI4cO23bIDn0qKP5iEqyi/t3Rj/nXOfjSUrusD6LTtt YE5qfyVExzYEzbcM1qSXx9Jj3sYp/7AfY1c9ju+irH/SLwvQbwFBOWxqsLDbAaCUyOPo VFOthfXWVoXBNpVAGj4MXv4DCyAdjeh2RHtJyKQQ4Rc7EHR4jKqVCXkCDIklfArH9KN9 AaTkcP/H95vIecI+wJmhvSm/Z02HCnCQyEyvs728CiKhuQOcijSpP2EL3WmUvtRucmf7 MdpA== X-Forwarded-Encrypted: i=1; AJvYcCUrl1Mm6NoRIBwtsSLTO/+5JticlPAH6lLHOaiQwF7kw0+Nlib0sJaDkXKbebaZYlRiXCGmeQz9npb7t16do9SdG3avlhlNmCAE5WH8 X-Gm-Message-State: AOJu0Yyg7WbsbRl//QZHuqQEVNIcA/QlaskPYD68+5Van6ZxYJuQF+H9 uwZcgGfh5HhsgiuRbbTB1n8suPVY75fXWe6n0ZKlnAQJM+I/a8cQ X-Received: by 2002:a17:906:1150:b0:a46:4851:b8cb with SMTP id i16-20020a170906115000b00a464851b8cbmr1506147eja.15.1710316752093; Wed, 13 Mar 2024 00:59:12 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id la18-20020a170907781200b00a43e8e76825sm4677315ejc.149.2024.03.13.00.59.11 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Mar 2024 00:59:11 -0700 (PDT) From: Wei Yang To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH 2/4] x86/boot: replace __PHYSICAL_START with LOAD_PHYSICAL_ADDR Date: Wed, 13 Mar 2024 07:58:37 +0000 Message-Id: <20240313075839.8321-3-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20240313075839.8321-1-richard.weiyang@gmail.com> References: <20240313075839.8321-1-richard.weiyang@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Both __PHYSICAL_START and LOAD_PHYSICAL_ADDR are defined to get aligned CONFIG_PHYSICAL_START, so we can replace __PHYSICAL_START with LOAD_PHYSICAL_ADDR. And then remove the definition of __PHYSICAL_START, which is only used to define __START_KERNEL. Since includes , which includes , it is fine to move definition from to . Signed-off-by: Wei Yang --- arch/x86/include/asm/boot.h | 5 ----- arch/x86/include/asm/page_types.h | 8 +++++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h index a38cc0afc90a..12cbc57d0128 100644 --- a/arch/x86/include/asm/boot.h +++ b/arch/x86/include/asm/boot.h @@ -6,11 +6,6 @@ #include #include -/* Physical address where kernel should be loaded. */ -#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \ - + (CONFIG_PHYSICAL_ALIGN - 1)) \ - & ~(CONFIG_PHYSICAL_ALIGN - 1)) - /* Minimum kernel alignment, as a power of two */ #ifdef CONFIG_X86_64 # define MIN_KERNEL_ALIGN_LG2 PMD_SHIFT diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h index 86bd4311daf8..acc1620fd121 100644 --- a/arch/x86/include/asm/page_types.h +++ b/arch/x86/include/asm/page_types.h @@ -31,10 +31,12 @@ #define VM_DATA_DEFAULT_FLAGS VM_DATA_FLAGS_TSK_EXEC -#define __PHYSICAL_START ALIGN(CONFIG_PHYSICAL_START, \ - CONFIG_PHYSICAL_ALIGN) +/* Physical address where kernel should be loaded. */ +#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \ + + (CONFIG_PHYSICAL_ALIGN - 1)) \ + & ~(CONFIG_PHYSICAL_ALIGN - 1)) -#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START) +#define __START_KERNEL (__START_KERNEL_map + LOAD_PHYSICAL_ADDR) #ifdef CONFIG_X86_64 #include -- 2.34.1