Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp375282lqt; Thu, 6 Jun 2024 06:25:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX7WBpEx0YZigIh4AzDZb7+Gpu7lOutqdqnsW2cvjoWfUEfQLAGjfTgvOHOLUOvh7d5fpNm67H9CRJKujkQKgAl0kNPpDe8E+r/a/89kw== X-Google-Smtp-Source: AGHT+IGMTw3kjSLahwyUmQOD4UwHHD2jZe1TVRGqfeXB3mKHzgv/dZ5r/rjXtJ/rY1zAbCi1OX6e X-Received: by 2002:a17:907:760f:b0:a68:ae1b:dae7 with SMTP id a640c23a62f3a-a699f671cbamr400345166b.30.1717680300425; Thu, 06 Jun 2024 06:25:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717680300; cv=pass; d=google.com; s=arc-20160816; b=LIoIZNDhfGZLuhLJtVe6mhhTKqaWujfOGOeKZ5za69sjINIehERfcKuRJQFHJ420tu 6M3/ZkOIT+n6VgfgIVtn6zxt2SqFfat5eQ+5UmLhJy3rJhqa7UwkNcfVgLEta0amvDTo p9guaKMvBgvPW0pwJXkejeeIhAxLlAzgZzhdvlHqtPb5GuhQn06vpkBtxmvXirtHPzI0 3FYxATS5jMqAPepCzkidzrM3seKr8WpXxQRAk/ASYcAo7pQEXtVws41xKbP1derU7GWj CoyRe9pIN8T2HGjxpy4SkfAKqXPYGYcfztRCwZ4HzJFQH+SUxDAjFsGzp8X/9Vkx/6Jj EByQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=wG5iLmx8C9+BqjCdWkGamAX+VKrzLDENztJW/ZmXD5k=; fh=Ta6Z1f7+YYezs2ddI/yfG8Fk6+LR49oDM4qMnPfs3Us=; b=thcelWaCmOlW1z7Ve5Ge/7Oi6eKkE9fYTilOwazV9+OLRbLmJhd6mr/E3/03AqiaJD mrIINJhu0gf8SOoXunvOqpINNoJeYvkALpvsQPbRNIAXi4c0n2UscoWRgbuG3FERzSGF /tJba9huVZ6IQjFSBh62DC+DwF7EUt28JPG+Da0uXPm51vFrtVEns3ClHcemE7Cdl1cc jlwnjGkmfWTtIzEhsfyILS0Vq6uj4CwRw9Exd13et3hI+s4TZm6Kc4rrtFS8vqQzQrcT 5auxfv0RdCliTSm9h91xHdJKv2cQ/1vBKiihcKKnke8d/w+tNvoyctM61X+sOr47Gbn+ J6Wg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-204357-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204357-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c807494d6si67358166b.961.2024.06.06.06.25.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 06:25:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204357-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-204357-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204357-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 298AF1F23CBC for ; Thu, 6 Jun 2024 13:25:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 21228195FCB; Thu, 6 Jun 2024 13:24:53 +0000 (UTC) Received: from smtpbg154.qq.com (smtpbg154.qq.com [15.184.224.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89DFF195B0E for ; Thu, 6 Jun 2024 13:24:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=15.184.224.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717680292; cv=none; b=sq7AtY1MDaWKj9MUtNmuvbYB6LFZVXyvSOHFSlS2m9zSgQ+djxnuLA68RYaQC4T4V8+5SvBDkPiEybnu1V/ktd7hhVvG2Z9vJSyPATJ03qGxP7uE/XbLPKcXpQWqQxjoNd9iMBGOsHJR+HNKMzzO+yFv9U2/r9WQ06yWbBrEkPU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717680292; c=relaxed/simple; bh=rNBwdzFBhysEd9wzyQXAbWC3pB6V0UCYgvGyEBhdwgM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=SSO82QNa2pRmcklh1BdQMGjlpza+il+9xJHmHTLX5iPiZHzDlKQGA0mHrNLZWnrIi8pCoLbQXUY78B3DytTjODyrSOCk11+Sn82Q4kEH6khAMeppsM7LhexMMwNuXV6xy318tB3FSBHiqihK/Dct7+ldH9vA8EJke9s76wL+9QU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn; spf=pass smtp.mailfrom=shingroup.cn; arc=none smtp.client-ip=15.184.224.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shingroup.cn X-QQ-mid: bizesmtpsz1t1717680152t9w1o59 X-QQ-Originating-IP: AmpsQDgASEaAJP+E87sCAd76grdai6fjPk9qNQFKsTE= Received: from HX01040082.powercore.com.cn ( [14.19.67.247]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 06 Jun 2024 21:22:30 +0800 (CST) X-QQ-SSF: 01400000000000B0B000000A0000000 X-QQ-FEAT: ZbT1X8e7m5Fo8AN97Qo/SfGebcJKiGCLiCQTkAdeNHxeen7puOp3rgyNhjIt5 7ivIxPLQoqj+KveACDdj1lmBLe2B8/h/Vu0gnl0TIdLE8IDLugpGSGFcirwJP07QLzJL70D cgcDtrWYTwlJ9foJ0eDH0q5qY5aybrSj0hEeGnf9DDQB7Y7NJHxJ+1YAkXKnCuds3woC6tq 0GKmhV3D2upU42VhZB6cbfDqQuYa+lH4lTGgjJqB4gCsEQF8JaQo/9N4cI9EiKqyVtOSna/ 0dXm1bKxjcSRrgLGUJoblqa04ndCqf35Ce51QfzRd3kAjBx+G93Vv1lUCMa5nHc9yq59avq A5RJA9krwXJw+hZMRDcyO6SwkDveAgBf/RznDViJIF90orGxmoprHMOgw12ww== X-QQ-GoodBg: 2 X-BIZMAIL-ID: 20561316882800220 From: Jinglin Wen To: npiggin@gmail.com Cc: mpe@ellerman.id.au, christophe.leroy@csgroup.eu, naveen.n.rao@linux.ibm.com, jinglin.wen@shingroup.cn, masahiroy@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] powerpc: Fixed the bug of duplicate copying Date: Thu, 6 Jun 2024 21:21:32 +0800 Message-Id: <20240606132132.13785-1-jinglin.wen@shingroup.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpsz:shingroup.cn:qybglogicsvrgz:qybglogicsvrgz5a-2 Fixed the issue where the kernel, when booting from address 0, had code incorrectly duplicated to address 0. Signed-off-by: Jinglin Wen --- arch/powerpc/kernel/head_64.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 4690c219bfa4..6c73551bdc50 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S @@ -647,7 +647,9 @@ __after_prom_start: * Note: This process overwrites the OF exception vectors. */ LOAD_REG_IMMEDIATE(r3, PAGE_OFFSET) - mr. r4,r26 /* In some cases the loader may */ + tophys(r4,r26) + cmplwi cr0,r4,0 /* runtime base addr is zero */ + mr r4,r26 /* In some cases the loader may */ beq 9f /* have already put us at zero */ li r6,0x100 /* Start offset, the first 0x100 */ /* bytes were copied earlier. */ -- 2.25.1