From: kernel test robot <lkp@intel.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [ardb:x86-efistub-cleanup 10/12] drivers/firmware/efi/libstub/x86-stub.c:853: Error: incorrect register `%eax' used with `w' suffix
Date: Thu, 4 May 2023 06:40:20 +0800 [thread overview]
Message-ID: <202305040620.THfjNpr2-lkp@intel.com> (raw)
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
reply other threads:[~2023-05-03 22:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202305040620.THfjNpr2-lkp@intel.com \
--to=lkp@intel.com \
--cc=ardb@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/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 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.