From: Guenter Roeck <linux@roeck-us.net>
To: "David Laight" <David.Laight@ACULAB.COM>,
"'Armin Wolf'" <W_Armin@gmx.de>, "'Pali Rohár'" <pali@kernel.org>
Cc: "jdelvare@suse.com" <jdelvare@suse.com>,
"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
"linux-assembly@vger.kernel.org" <linux-assembly@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] hwmon: (dell-smm) Improve assembly code
Date: Wed, 23 Feb 2022 16:45:27 -0800 [thread overview]
Message-ID: <e0c0eac9-a66a-fc35-0864-2ca1ba7cb32f@roeck-us.net> (raw)
In-Reply-To: <63a04993864f4c08923ed753d83cdf37@AcuMS.aculab.com>
On 2/23/22 14:35, David Laight wrote:
> From: Armin Wolf
>> Sent: 23 February 2022 21:39
> ...
>>> As far as this patch goes I think I'd add a 'stc' (set carry)
>>> instruction before the first 'outb'.
>>> Then if the 'something magic happens here' doesn't happen (because
>>> you aren't on the right kind of motherboard) the action fails.
>>>
>>> David
>>
>> We already check for such scenarios by checking if eax changed.
>> I would not set the carry flag before doing a SMM call since im
>> not sure if the firmware code always clears the carry flag when
>> the call was successful.
>> If for example the firmware code only sets the carry flag on
>> error and otherwise ignores the carry flag, we might create some
>> false negatives when a successful SMM call leaves the carry flag set.
>
> If you are worried about that you should be clearing carry on entry.
>
I agree, but now we have an argument for clearing carry (because the
SMM code might not do it) and for setting carry (because the SMM code
might not execute). I don't know which way to go, if any, but that
would be a functional change and should be submitted as separate patch.
Guenter
next prev parent reply other threads:[~2022-02-24 0:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-20 19:08 [PATCH v4] hwmon: (dell-smm) Improve assembly code Armin Wolf
2022-02-22 16:54 ` Guenter Roeck
2022-02-22 17:51 ` Pali Rohár
2022-02-22 19:46 ` David Laight
2022-02-23 21:39 ` Armin Wolf
2022-02-23 22:35 ` David Laight
2022-02-24 0:45 ` Guenter Roeck [this message]
2022-03-02 18:07 ` Guenter Roeck
2022-06-20 15:21 ` Guenter Roeck
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=e0c0eac9-a66a-fc35-0864-2ca1ba7cb32f@roeck-us.net \
--to=linux@roeck-us.net \
--cc=David.Laight@ACULAB.COM \
--cc=W_Armin@gmx.de \
--cc=jdelvare@suse.com \
--cc=linux-assembly@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pali@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).