From: "H. Peter Anvin" <hpa@zytor.com>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>
Subject: Re: [PATCH] x86/boot: Do not test if AC and ID eflags are changeable on x86_64
Date: Fri, 07 Mar 2025 06:46:35 -0800 [thread overview]
Message-ID: <5147E060-2F35-4B55-ACAA-56D9DB0DD818@zytor.com> (raw)
In-Reply-To: <CAFULd4Z=ZU0z3g3yc6FTBkN38tsgF86ps2P7Dhc+bdF8A416Uw@mail.gmail.com>
On March 7, 2025 5:45:42 AM PST, Uros Bizjak <ubizjak@gmail.com> wrote:
>On Fri, Mar 7, 2025 at 2:13 PM H. Peter Anvin <hpa@zytor.com> wrote:
>
>> >> PUSF et al → pushf
>> >>
>> >> The -l and -q suffixes have been optional for a long time.
>> >
>> >No, not in this case. Please see the comment:
>> >
>> >/*
>> >* For building the 16-bit code we want to explicitly specify 32-bit
>> >* push/pop operations, rather than just saying 'pushf' or 'popf' and
>> >* letting the compiler choose.
>> >*/
>> >
>> >We are building 16-bit code here, and we want PUSHFL, the one with
>> >operand size prefix 0x66.
>> >
>> >Please consider the following code:
>> >
>> > .code16
>> > pushf
>> > pushfl
>> >
>> >as -o push.o push.s
>> >
>> >objdump -dr -Mdata16 push.o
>> >
>> >0000000000000000 <.text>:
>> > 0: 9c pushf
>> > 1: 66 9c pushfl
>> >
>> >Uros.
>> >
>>
>> *plonk* I should have remembered (.code16gcc is different then .code16 though.) I wrote the damned things after all...
>
>Please note that while "gcc -m16" emits .code16gcc, "clang -m16" emits
>.code16, so in the latter case we don't have ‘pushf’, and ‘popf’
>instructions default to 32-bit size. So, the only solution is to
>decorate pushfl with operand size prefix in this specific case.
>
>Uros.
>
Can you please beat up the clang people who do gratuitously incompatible things like this?
next prev parent reply other threads:[~2025-03-07 14:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-07 9:10 Uros Bizjak
2025-03-07 11:58 ` H. Peter Anvin
2025-03-07 12:15 ` Uros Bizjak
2025-03-07 13:13 ` H. Peter Anvin
2025-03-07 13:45 ` Uros Bizjak
2025-03-07 14:46 ` H. Peter Anvin [this message]
2025-03-08 10:12 ` Uros Bizjak
2025-03-08 19:34 ` Ingo Molnar
2025-03-09 0:33 ` H. Peter Anvin
2025-03-08 19:51 ` [tip: x86/boot] " tip-bot2 for Uros Bizjak
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=5147E060-2F35-4B55-ACAA-56D9DB0DD818@zytor.com \
--to=hpa@zytor.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=ubizjak@gmail.com \
--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®