Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp551766rwd; Wed, 7 Jun 2023 03:57:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+bQnALpE+pGRuS5AcSMDdT9FCJ3VJ+I1gPi9Z/kSW+vWM19ZKFN51WGD+/p/QG2Pjisgz X-Received: by 2002:a05:6870:e8c4:b0:18e:2b7e:a846 with SMTP id r4-20020a056870e8c400b0018e2b7ea846mr7209359oan.50.1686135447808; Wed, 07 Jun 2023 03:57:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686135447; cv=none; d=google.com; s=arc-20160816; b=a/qoYlJ7YnBWGuSuZxphrsXsLbwpXe47J8fmHJ9dKkDBNhXDANpH1dF54HSoTz5cje PmD47JkeJlEGwcjv3lXSYHyW/UyXX05+2GNzleUpXBpT4An4nR5meQfJx/A246a3FUY+ xq6g5F22ZwU8qvjLinJ72cuqtjfU/loCF9fGPSG9YDVBrMrfeXxpDtAxgtQNMYRpNDoP KhTfOmJvPYzxxQhS/sHUevdrInLBUQFz4Th1ZTmHtE3mprw7ZJqZZ0/bxasGl9tVIy4E Z3e9i7uwiwMd8+7yAZpcP37dMWOQsfYl1CgpiZmTwpoFgZ9c4gALx1uhHpFLqH2vvuX3 sttw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2wanNwkiZvVfAAwW760ppHy3L9HfD913ZJBSRNz047A=; b=qUoT/NgZFk3hm1Etz0V1Tg9n/mcV9a0DAb5CglJ8peMUkn/2Paew3vc4x2uPWyxywG e5ayxcwrcZ+OJE1p1pwwEfAW1Bxyp/3xP9k28dP8a52is8YRsp2rBffsos4IyDG6gr7G mlujPr7DuKIVw0RtRKyqk3g1RSAy84XKbvFtrUDdUbUO5woDCAwOPOEdI4FIm+YuNB78 w7RV7qIBi2JzLdWMjW2uo0nLNb/mvErweBbN+tozLr9E2oytl9/+vFecHErxqwQb1huH F4MLWIsUS2BcerERVMvAsH7vt/EJrbgY+jg4NncJYpjSemY1OEOeAO2mSV8K+YGxjecZ UbRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=db+7+peq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 76-20020a63004f000000b0053ef51d3fa8si8616678pga.401.2023.06.07.03.57.15; Wed, 07 Jun 2023 03:57:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=db+7+peq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239458AbjFGKkK (ORCPT + 99 others); Wed, 7 Jun 2023 06:40:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234932AbjFGKkI (ORCPT ); Wed, 7 Jun 2023 06:40:08 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EFD7172E for ; Wed, 7 Jun 2023 03:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686134406; x=1717670406; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dXhQhpr65an843mzNgpNM3BfoFY8RKpdX33oWWzOawE=; b=db+7+peq40D+OYIa2jLF0KzNm69hpHCr+e68GD1h1h8t9AqOrU586YJR n9VPqX1sPNoeq0N7hB+2A23ZkfKKdAhAtteTZi6r5UmCcM98TOmyra5R6 yM8oqJI5TyYExOg3jeRKL1r14nvChk9Ac8suHa2XY5hEo4VjS359EbJWD XILkJGh0TI2XEmbgaXOHS2OH8HeDq0Ohzis7b4DoFzOiz8t/h/k83ycWy fH2lJcgk+r0E6Hn00jtu1Gu2iU63slyP7u6L8DmRMfTYCenN9Hqg4fMv8 1EAhu8AumEEgayQtfurQzOArr1q6Nu3INdsgCKkM2Z2n+UdEBolbOA1zY w==; X-IronPort-AV: E=McAfee;i="6600,9927,10733"; a="341602003" X-IronPort-AV: E=Sophos;i="6.00,223,1681196400"; d="scan'208";a="341602003" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 03:40:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10733"; a="1039561362" X-IronPort-AV: E=Sophos;i="6.00,223,1681196400"; d="scan'208";a="1039561362" Received: from byng-mobl.gar.corp.intel.com (HELO khuang2-desk.gar.corp.intel.com) ([10.209.159.27]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 03:40:03 -0700 From: Kai Huang To: linux-kernel@vger.kernel.org Cc: dave.hansen@linux.intel.com, kirill.shutemov@linux.intel.com, peterz@infradead.org, hpa@zytor.com, konrad.wilk@oracle.com, rostedt@goodmis.org, jpoimboe@kernel.org, Kai Huang Subject: [PATCH] x86/kexec: Add a comment to relocate_kernel() for better readability Date: Wed, 7 Jun 2023 22:39:10 +1200 Message-Id: <20230607103910.407779-1-kai.huang@intel.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The reason to save %rcx to %r11 before calling swap_pages isn't that obvious w/o looking into the swap_pages itself. Add a comment to improve the readability. Signed-off-by: Kai Huang --- arch/x86/kernel/relocate_kernel_64.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S index 56cab1bb25f5..97deae3c5e6c 100644 --- a/arch/x86/kernel/relocate_kernel_64.S +++ b/arch/x86/kernel/relocate_kernel_64.S @@ -169,6 +169,10 @@ SYM_CODE_START_LOCAL_NOALIGN(identity_mapped) wbinvd 1: + /* + * Save the preserve_context to %r11 as + * swap_pages clobbers %rcx. + */ movq %rcx, %r11 call swap_pages base-commit: 409bf2895d71bb68bc5b8589036e5ed1ca30bada -- 2.40.1