mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Huang, Kai" <kai.huang@intel.com>
To: "kirill.shutemov@linux.intel.com" <kirill.shutemov@linux.intel.com>
Cc: "Hansen, Dave" <dave.hansen@intel.com>,
	"bp@alien8.de" <bp@alien8.de>, "x86@kernel.org" <x86@kernel.org>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"nik.borisov@suse.com" <nik.borisov@suse.com>
Subject: Re: [PATCH 1/2] x86/kexec: Fix a comment of swap_pages() assembly
Date: Tue, 20 Aug 2024 10:32:39 +0000	[thread overview]
Message-ID: <4c35dfdadff667ae5ea00dd6002b8cd73301dc22.camel@intel.com> (raw)
In-Reply-To: <q2y5vte3wwn5qde5p4nfmjfqtzxfen3nhjdyafc7nbirfidpvr@ro3djjz3pub4>

On Tue, 2024-08-20 at 11:40 +0300, Kirill A. Shutemov wrote:
> On Tue, Aug 20, 2024 at 12:21:11AM +1200, Kai Huang wrote:
> > When relocate_kernel() gets called, %rdi holds 'indirection_page' and
> > %rsi holds 'page_list'.  And %rdi always holds 'indirection_page' when
> > swap_pages() is called.
> > 
> > Therefore the comment of the first line code of swap_pages()
> > 
> > 	movq    %rdi, %rcx      /* Put the page_list in %rcx */
> > 
> > .. isn't correct because it actually moves the 'indirection_page' to
> > the %rcx.  Fix it.
> > 
> > Signed-off-by: Kai Huang <kai.huang@intel.com>
> 
> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> 
> Looks like it got broken by 4bfaaef01a1b ("[PATCH] Avoid overwriting the
> current pgd (V4, x86_64)")
> 

Thanks for finding this.  I spent some time yesterday trying to do so but it
wasn't obvious to me.  :-)

Yes that line was firstly introduced by commit 5234f5eb04abb ("[PATCH] kexec:
x86_64 kexec implementation") but by that time it was correct: %rdi indeed
holds 'page_list'.  The commit you mentioned above adds a new (first) argument
to relocate_kernel() and %rdi was changed to hold 'indirection_page', but the
comment was leftover.

But the two commits were introduced at 2004 and 2006, so I don't think it
worth any Fixes tag?

  reply	other threads:[~2024-08-20 10:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19 12:21 [PATCH 0/2] Misc comments fixup in relocate_kernel_64.S Kai Huang
2024-08-19 12:21 ` [PATCH 1/2] x86/kexec: Fix a comment of swap_pages() assembly Kai Huang
2024-08-20  8:40   ` Kirill A. Shutemov
2024-08-20 10:32     ` Huang, Kai [this message]
2024-08-20 11:15       ` kirill.shutemov
2024-08-19 12:21 ` [PATCH 2/2] x86/kexec: Add comments around swap_pages() assembly to improve readability Kai Huang
2024-08-20  9:25   ` Kirill A. Shutemov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4c35dfdadff667ae5ea00dd6002b8cd73301dc22.camel@intel.com \
    --to=kai.huang@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nik.borisov@suse.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®