* [ardb:x86-efistub-cleanup 10/12] drivers/firmware/efi/libstub/x86-stub.c:853: Error: incorrect register `%eax' used with `w' suffix
@ 2023-05-03 22:40 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-05-03 22:40 UTC (permalink / raw)
To: Ard Biesheuvel; +Cc: oe-kbuild-all
tree: git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git x86-efistub-cleanup
head: d19cef90fb0bff9916366748b6bd1ac55247a86b
commit: df8c0dbe82d9b25c99e9dff452f92ed90362f70f [10/12] x86: efistub: Perform 4/5 level paging switch from the stub
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20230504/202305040620.THfjNpr2-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?id=df8c0dbe82d9b25c99e9dff452f92ed90362f70f
git remote add ardb git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git
git fetch --no-tags ardb x86-efistub-cleanup
git checkout df8c0dbe82d9b25c99e9dff452f92ed90362f70f
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202305040620.THfjNpr2-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/firmware/efi/libstub/x86-stub.c: Assembler messages:
>> drivers/firmware/efi/libstub/x86-stub.c:853: Error: incorrect register `%eax' used with `w' suffix
drivers/firmware/efi/libstub/x86-stub.c:854: Error: incorrect register `%eax' used with `w' suffix
vim +853 drivers/firmware/efi/libstub/x86-stub.c
811
812 static void efi_5level_switch(void)
813 {
814 #ifdef CONFIG_X86_64
815 static const struct desc_struct gdt[] = {
816 [GDT_ENTRY_KERNEL32_CS] = GDT_ENTRY_INIT(0xc09b, 0, 0xfffff),
817 [GDT_ENTRY_KERNEL_CS] = GDT_ENTRY_INIT(0xa09b, 0, 0xfffff),
818 [GDT_ENTRY_KERNEL_DS] = GDT_ENTRY_INIT(0xc093, 0, 0xfffff),
819 };
820
821 bool want_la57 = IS_ENABLED(CONFIG_X86_5LEVEL) && !efi_no5lvl;
822 bool have_la57 = native_read_cr4() & X86_CR4_LA57;
823 bool need_toggle = want_la57 ^ have_la57;
824 u64 *pgt = (void *)la57_toggle + PAGE_SIZE;
825 u64 *cr3 = (u64 *)__native_read_cr3();
826 struct desc_ptr desc;
827 u64 *new_cr3;
828
829 if (!la57_toggle || !need_toggle)
830 return;
831
832 if (!have_la57) {
833 /*
834 * We are going to enable 5 level paging, so we need to
835 * allocate a root level page from the 32-bit addressable
836 * physical region, and plug the existing hierarchy into it.
837 */
838 new_cr3 = memset(pgt, 0, PAGE_SIZE);
839 new_cr3[0] = (u64)cr3 | _PAGE_TABLE_NOENC;
840 } else {
841 // take the new root table pointer from the current entry #0
842 new_cr3 = (u64 *)(cr3[0] & PAGE_MASK);
843
844 // copy the new root level table if it is not 32-bit addressable
845 if ((u64)new_cr3 > U32_MAX)
846 new_cr3 = memcpy(pgt, new_cr3, PAGE_SIZE);
847 }
848
849 desc.size = sizeof(gdt) - 1;
850 desc.address = (u64)gdt;
851
852 asm(" lgdt %[gdt] \n\t"
> 853 " movw %[ds], %%ds \n\t"
854 " movw %[ds], %%ss \n\t"
855 :
856 : [gdt] "m"(desc),
857 [ds] "r"(__KERNEL_DS));
858
859 la57_toggle(new_cr3, want_la57);
860 #endif
861 }
862
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-03 22:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-03 22:40 [ardb:x86-efistub-cleanup 10/12] drivers/firmware/efi/libstub/x86-stub.c:853: Error: incorrect register `%eax' used with `w' suffix kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.