mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>
Cc: oe-kbuild-all@lists.linux.dev, x86@kernel.org,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	Sean Christopherson <seanjc@google.com>
Subject: Re: [PATCH] x86/trampoline: Bypass compat mode in trampoline_start64() if not needed
Date: Sun, 7 Jan 2024 06:17:16 +0800	[thread overview]
Message-ID: <202401070610.WkJiWgWO-lkp@intel.com> (raw)
In-Reply-To: <20240106010106.25772-1-kirill.shutemov@linux.intel.com>

Hi Kirill,

kernel test robot noticed the following build errors:

[auto build test ERROR on tip/master]
[also build test ERROR on tip/x86/core tip/auto-latest linus/master v6.7-rc8 next-20240105]
[cannot apply to bp/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Kirill-A-Shutemov/x86-trampoline-Bypass-compat-mode-in-trampoline_start64-if-not-needed/20240106-090311
base:   tip/master
patch link:    https://lore.kernel.org/r/20240106010106.25772-1-kirill.shutemov%40linux.intel.com
patch subject: [PATCH] x86/trampoline: Bypass compat mode in trampoline_start64() if not needed
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20240107/202401070610.WkJiWgWO-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240107/202401070610.WkJiWgWO-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401070610.WkJiWgWO-lkp@intel.com/

All errors (new ones prefixed by >>):

   as: arch/x86/realmode/rm/trampoline_64.o: unsupported relocation type: 0x185
   arch/x86/realmode/rm/trampoline_64.S: Assembler messages:
>> arch/x86/realmode/rm/trampoline_64.S:225: Error: cannot represent relocation type BFD_RELOC_X86_64_32S
   as: arch/x86/realmode/rm/trampoline_64.o: unsupported relocation type: 0x185
   arch/x86/realmode/rm/trampoline_64.S:231: Error: cannot represent relocation type BFD_RELOC_X86_64_32S


vim +225 arch/x86/realmode/rm/trampoline_64.S

   211	
   212	SYM_CODE_START(trampoline_start64)
   213		/*
   214		 * APs start here on a direct transfer from 64-bit BIOS with identity
   215		 * mapped page tables.  Load the kernel's GDT in order to gear down to
   216		 * 32-bit mode (to handle 4-level vs. 5-level paging), and to (re)load
   217		 * segment registers.  Load the zero IDT so any fault triggers a
   218		 * shutdown instead of jumping back into BIOS.
   219		 */
   220		lidt	tr_idt(%rip)
   221		lgdt	tr_gdt64(%rip)
   222	
   223		/* Check if paging mode has to be changed */
   224		movq	%cr4, %rax
 > 225		xorq	pa_tr_cr4, %rax
   226		andq	$X86_CR4_LA57, %rax
   227		jnz	.L_switch_paging
   228	
   229		/* Paging mode is correct proceed in 64-bit mode */
   230	
   231		LOCK_AND_LOAD_REALMODE_ESP lock_pa=1
   232	
   233		movw	$__KERNEL_DS, %dx
   234		movl	%edx, %ss
   235		addl	$pa_real_mode_base, %esp
   236		movl	%edx, %ds
   237		movl	%edx, %es
   238		movl	%edx, %fs
   239		movl	%edx, %gs
   240	
   241		movl	$pa_trampoline_pgd, %eax
   242		movq	%rax, %cr3
   243	
   244		jmpq	*tr_start(%rip)
   245	.L_switch_paging:
   246		/*
   247		 * To switch between 4- and 5-level paging modes, it is necessary
   248		 * to disable paging. This must be done in the compatibility mode.
   249		 */
   250		ljmpl	*tr_compat(%rip)
   251	SYM_CODE_END(trampoline_start64)
   252	
   253		.section ".rodata","a"
   254		# Duplicate the global descriptor table
   255		# so the kernel can live anywhere
   256		.balign	16
   257	SYM_DATA_START(tr_gdt)
   258		.short	tr_gdt_end - tr_gdt - 1	# gdt limit
   259		.long	pa_tr_gdt
   260		.short	0
   261		.quad	0x00cf9b000000ffff	# __KERNEL32_CS
   262		.quad	0x00af9b000000ffff	# __KERNEL_CS
   263		.quad	0x00cf93000000ffff	# __KERNEL_DS
   264	SYM_DATA_END_LABEL(tr_gdt, SYM_L_LOCAL, tr_gdt_end)
   265	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

      reply	other threads:[~2024-01-06 22:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-06  1:01 Kirill A. Shutemov
2024-01-06 22:17 ` kernel test robot [this message]

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=202401070610.WkJiWgWO-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=seanjc@google.com \
    --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®