Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp535459rwd; Thu, 8 Jun 2023 04:32:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7/Ct2FupKcxS3BBlq32LDmlfKBXDNXKro2dRAaU68LKB58TDwkAJUIt8SuhZP7W25FXa9v X-Received: by 2002:a17:902:db0f:b0:1af:981b:eeff with SMTP id m15-20020a170902db0f00b001af981beeffmr8175470plx.64.1686223976302; Thu, 08 Jun 2023 04:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686223976; cv=none; d=google.com; s=arc-20160816; b=v30hyFoFXrzHPT5G6ZvmdRJTcKDZVUZ62YraK9qkHV5bLJSSN5I+i8atBm6s0U5kMm dbyk6jijQ9khxP5o+Npl6PQYEqDTk7NscCb/O46Ao4W7pXgyEwzuYFFx3KupW/E33Aqt Dw2mARnugG0zFQKD6co0eJdbzxd45w+VaWWhI0jSL1lUyLU7/mru/4xI7aT8VyNLZvwz QE1iBu96eae7FhXrAWK2GvWsaVq9zyW3RXVHbH/ni+t/G3TrMDZHInG3E29H6h0SL8ZM +30Z2R5SN6PtVngL6SLzUFJ7mpnqI39juymuuBoxD8n9HzjVPGuJtn9NjVPcLnN5bmoj 8F1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+DTNJcw0s4eVhKHub4So5fKAYAU4MZDYsarpYMSkIEo=; b=J8ks3bu3Fv9eML7bwPi6AXBOvlzzypjFNfbtQ+D+ZRgqmYs36uFvJM96iq1LuABsbM n9U08hcu7FKCAredLromqJJPn9AxB14sUZ8sRmEBJY0iHrr6TLoyE8CS0HmVXNZyDCxi IAGNShKhHaDjd85XEbZKz2RtQNV4f2RF2d+G4cstgeXuNBU4pGiQRmG83kuorYA53GKv 53z2Pb7XCPIM5ip/lH/EsucK5wz9Aj33l7rVW9imuFRQ8iPA+ozqg6zmtAEFf5xYLnm+ UHlOolo35nXICP/aV1QNrYWFmK210RXpUXsY+clD9/+PWtX9ehDpvaJed/cZKdmidZnZ DC4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NpR4QF2+; 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 o3-20020a170902d4c300b001b248529a66si917379plg.624.2023.06.08.04.32.41; Thu, 08 Jun 2023 04:32:56 -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=NpR4QF2+; 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 S234424AbjFHLZy (ORCPT + 99 others); Thu, 8 Jun 2023 07:25:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231812AbjFHLZx (ORCPT ); Thu, 8 Jun 2023 07:25:53 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DE6E269F for ; Thu, 8 Jun 2023 04:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686223552; x=1717759552; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=wrjeCJhJ6fktJm5KxRZjxmwIgTcfO038Nx7zeCVzf1g=; b=NpR4QF2+oQ/e0m52Gndj1SNAE9ouU3ewyAhlyp4prPhV5j0InLIeFrXt orZZZqGcdiS1OLz5ODyyWKwgtbD7/YqmxkV9fkUvWB2zeCAiN5ttHlQ3W HUOFGnJyH0UpE5KHgFnKYhDTeiCTRuBCd/QB4qTqY0SBmLlPqPUoQ7I3m 1J3+T0tRD9bC6iJc+Z90BlI3V3UHepT8UgB7x7Yv2uLaPkKujOabT5ulZ e4xSW1wSXAp7Pj9JD5DnnttdkTMf+CUovP1xgHzLBPV2nt7GMd7VQCBhZ LDlixaJP4ePrDNdmX4+rsAKysh0hnS8n9Qv1GmguvLgHRK6qoDSP4EIJ/ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="337637360" X-IronPort-AV: E=Sophos;i="6.00,226,1681196400"; d="scan'208";a="337637360" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 04:25:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="709940339" X-IronPort-AV: E=Sophos;i="6.00,226,1681196400"; d="scan'208";a="709940339" Received: from fgorter-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.59.89]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 04:25:48 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id F33D010A676; Thu, 8 Jun 2023 14:25:46 +0300 (+03) Date: Thu, 8 Jun 2023 14:25:46 +0300 From: "kirill.shutemov@linux.intel.com" To: "Huang, Kai" Cc: "hpa@zytor.com" , "peterz@infradead.org" , "rostedt@goodmis.org" , "jpoimboe@kernel.org" , "linux-kernel@vger.kernel.org" , "dave.hansen@linux.intel.com" , "Wilk, Konrad" Subject: Re: [PATCH] x86/kexec: Add a comment to relocate_kernel() for better readability Message-ID: <20230608112546.y7djwgebpuv32tzt@box.shutemov.name> References: <20230607103910.407779-1-kai.huang@intel.com> <20230607111957.sppocwpkhfb2e2vf@box.shutemov.name> <538335b164bf8b84b8a55c5654ed15d849479388.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <538335b164bf8b84b8a55c5654ed15d849479388.camel@intel.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On Thu, Jun 08, 2023 at 04:41:37AM +0000, Huang, Kai wrote: > On Wed, 2023-06-07 at 14:19 +0300, kirill.shutemov@linux.intel.com wrote: > > On Wed, Jun 07, 2023 at 10:39:10PM +1200, Kai Huang wrote: > > > 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. > > > + */ > > > > Line split is not needed. It fits nicely under 80-characters. > > > > + /* Save the preserve_context to %r11 as swap_pages clobbers %rcx. */ > > > > Otherwise, LGTM. > > Sure. Will do. > > With above change, may I add your Acked-by ? :) Sure. -- Kiryl Shutsemau / Kirill A. Shutemov