Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1617212lql; Wed, 13 Mar 2024 03:29:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMVuzZfoO343ETMqy8Y5VJzqhRcKbMijNoJuhKXRlEIv6EmkgV2rdpPC4jHsKcrn/dI/WBv/g3fon1Up9AqjSk3A4KVK/kNxrh94f25g== X-Google-Smtp-Source: AGHT+IFAK9YhcamFaUp2bfPjndvjb4RZ3g0Vl0R6Ka88TAQxAqSEbm1r2+4/nWQr97Y4jwJ/IVOH X-Received: by 2002:a05:6871:688:b0:221:3742:77ff with SMTP id l8-20020a056871068800b00221374277ffmr11068745oao.36.1710325799596; Wed, 13 Mar 2024 03:29:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710325799; cv=pass; d=google.com; s=arc-20160816; b=PBNWnhagRmHmN4Ir5mHsWcvodDraRjX+NkK5PQ334h+gsjvKfjdCEdBS7FeiS5Kzd4 r5sKafwnr95ecGnE9vJrIiJjzJJcN/uS5nx1vtW8aFR+HYIr50HQeLFEJj1ry/twtBCH 58hvOk4vwFQK6U3KXzJSgPIjQyQINRy2EFRx2QrcSz9v3u3tf7dbhLNsIwj9zByWUYFN vxomKh6MPAiP9UsU7aIHht71M3LliF2chGiphPWChn3wDDlTiSnl4UMIwAzhSggVT6S2 jXOAkbBHmdAmc8QEMeYJoQ/HahoiZMOzW0mcWADOIcRgCy8bE4H1wiEfvOyATOIeMjzX rxIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=h90PwmEKgkeo9xq9N4xH2gsdxhkIDdIMs34ij43dsWo=; fh=X3yFxWaGaoi0el54hD6ZfKFt0ege65O45bjQbvn7dgY=; b=qzB/JKdGNKRc/sdRIIL/sk8Xs5vkC2u+SC2yNmgC1LQGKzeZqTW3oMyYk481fJdmCt dxsIIMOSxRBj9+pa//HbYoG2X1e0VqvJ+UrL3qHNmnuQRIvvduMT4UdX++vqcD8EoOV3 g8v9XV7aD4bMlet6B/Ji4UjErnvHbyPTOM6eLc8l4mp/Ha9ddNxZoBzloQ6VYaXonkQq PXBrkHD6BRrWDoC89OUEGTrO+a6DVKyf+1XNZZYh4oL9xNpHd7LJBwtglbFreLtrTLT+ dqGZspJTzX3p7QQolg7+Z4NrWhWEFVQzAFmiCJfo+xSLU1UpX3FEWY6Y7jul2ny0Wfq/ rtCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=Ugu2wrmu; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-101354-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101354-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t24-20020a63dd18000000b005dc48e561adsi8853829pgg.20.2024.03.13.03.29.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 03:29:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101354-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=Ugu2wrmu; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-101354-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101354-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CD17B281BD7 for ; Wed, 13 Mar 2024 10:29:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62F433B795; Wed, 13 Mar 2024 10:29:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Ugu2wrmu" Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 1C48D3A1B4 for ; Wed, 13 Mar 2024 10:29:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710325783; cv=none; b=a6qEtiXJ7YKGik1IMLnIw3X3SsyHNNpBC1VxkkTtc8CM/Q9/uLm1P6wxDGCDX1b2KNJg4X3/jP+t6XN+wq/vVPCDV4vAvbLMHYzi2zgczIYX4phNuLnUkOld3ZhcITOkgjkl5kuak2ekSnrIKX33KLcm5BETKg15XoKUiy9OGPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710325783; c=relaxed/simple; bh=+BNsXKsv3Z99gUImvWqUbE2s/DQXyamyA3qt0L+MQz8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=u0aiLbjxN6qlIlDNskf9uiz4j6x2w4G3v7xDxU3y7W/0+UTpd5Ds2wAMPqXrN/RIy37/0vB51VYQkeMxlghhro3tpE3oHhksxFmksgZAYHbc6OqRVcG699nprCWbHliby8ExGSry3prEleEnkbRS/FMOBP27kD4O+o+BBUTopaE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Ugu2wrmu; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a465ddc2c09so43819566b.2 for ; Wed, 13 Mar 2024 03:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1710325779; x=1710930579; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=h90PwmEKgkeo9xq9N4xH2gsdxhkIDdIMs34ij43dsWo=; b=Ugu2wrmuyu6NFvXKbWdtg3weOKAgRlIEiHWP3VNbbZdlJiOdexwkh4dNOy7yaKs1RW uqZkPUDPodad8k0kNzZXegxLfajpSukpzS0Mrn9ZZqGyeUInLmOB9AX66O4BrhfrZyPZ M0HPgAneNOySnYSAQT+UZT8dS402/Cz/NSFlhHNfUZBe7jlvYXiRR6Dpv7fQ1w2YRGXJ x8y04YGYBi7505hZo8mQe4rl4ue7izrloCUPTD172X5yIdDffwvjItkknVKI2RidAWMk 7TPaXNxAcGDnzEO7c5HCGqwSr1BBMSqoLBGk8zetLWvZlf+weW6qmOprTqjhb+zijTHu DRHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710325779; x=1710930579; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=h90PwmEKgkeo9xq9N4xH2gsdxhkIDdIMs34ij43dsWo=; b=Jht/AiOzc+9nxiVNtu+9h9BK1pvsAAu99SwfG5QWnmMfK9X5Vk2EepQ5kt2S//MnKy OUNZOQpmZvU0T+aEkBNtWEEQykBqzkI4e71FSetS6MHMKDzfjb8/NdA1O4fmcaSUWyLR PXcK9RurN5LjRncYeWiwPkRGRKE/NoCdyJuTg5rlphBwY8B17N214H/xw7QzWRyVbEIh R2rndhXTZfjcvR8NTBu5YmimCFP/HuiqkX+/FdgPJS7RgRJ7vygMt2DHtXkISGQ2plVq UijjVg/TucJMjILxRMOeuqaLHo6QuBbcvlmeMmgt+u+cFWxGC3GQ4mtqNO28+7zauiG9 IUsg== X-Forwarded-Encrypted: i=1; AJvYcCWhaEYYrdPNpvWu3Qy/X8P7PRT4vtqGayfuqQtBwdyXkY1TaOeNEwm50QycxxXD8c68yc2fM3OG+aTrZSBIU7xQDmlMiM/rq7MfzElY X-Gm-Message-State: AOJu0Yw7xUqhDQKJpPSikU8DhVsf5018LYxUMfN9+6S0pHeGH8Gdzbug U6rYkgCjCyDzSCLF0BgrHhL7HcXtXbuwFxNHcSy1JML7WNQFr+Pf7ojsAXhR8bc= X-Received: by 2002:a17:906:5917:b0:a44:4c9e:85ef with SMTP id h23-20020a170906591700b00a444c9e85efmr6327478ejq.77.1710325779403; Wed, 13 Mar 2024 03:29:39 -0700 (PDT) Received: from ?IPV6:2a10:bac0:b000:73a8:7285:c2ff:fedd:7e3a? ([2a10:bac0:b000:73a8:7285:c2ff:fedd:7e3a]) by smtp.gmail.com with ESMTPSA id nb31-20020a1709071c9f00b00a46006bc7e9sm4594377ejc.159.2024.03.13.03.29.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Mar 2024 03:29:39 -0700 (PDT) Message-ID: Date: Wed, 13 Mar 2024 12:29:37 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/4] x86/boot: replace __PHYSICAL_START with LOAD_PHYSICAL_ADDR Content-Language: en-US To: Wei Yang , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com Cc: x86@kernel.org, linux-kernel@vger.kernel.org References: <20240313075839.8321-1-richard.weiyang@gmail.com> <20240313075839.8321-3-richard.weiyang@gmail.com> From: Nikolay Borisov In-Reply-To: <20240313075839.8321-3-richard.weiyang@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 13.03.24 г. 9:58 ч., Wei Yang wrote: > 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)) Why don't you simply define LOAD_PHYSICAL_ADDR via ALIGN(CONFIG_PHYSICAL_START, CONFIG_PHYSICAL_ALING) it's way more readable. > > -#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START) > +#define __START_KERNEL (__START_KERNEL_map + LOAD_PHYSICAL_ADDR) > > #ifdef CONFIG_X86_64 > #include