linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: David Laight <David.Laight@ACULAB.COM>,
	"pali@kernel.org" <pali@kernel.org>
Cc: "jdelvare@suse.com" <jdelvare@suse.com>,
	"linux@roeck-us.net" <linux@roeck-us.net>,
	"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 v2] hwmon: (dell-smm) Improve assembly code
Date: Sun, 20 Feb 2022 20:05:17 +0100	[thread overview]
Message-ID: <77eeca08-e970-84df-6490-36e330ce91ca@gmx.de> (raw)
In-Reply-To: <6f4c21b5e1cb4fa38a5e0c1716658329@AcuMS.aculab.com>

Am 20.02.22 um 19:48 schrieb David Laight:

> From: Armin Wolf
>> Sent: 19 February 2022 21:10
>>
>> The new assembly code works on both 32 bit and 64 bit
>> cpus and allows for more compiler optimisations by not
>> requiring smm_regs to be packed
> I'm intrigued about the __packed..
>
> Prior to 5.17-rc1 __packed was only applied to the fields after 'eax'.
> This actually has no effect (on any architecture) because there is
> no padding to remove - so all the later fields are still assumed to
> be 32bit aligned.
>
> 5.17-rc1 (565210c781201) moved the __packed to the end of the
> structure.
> AFAICT this structure is only ever used in one file and for on-stack
> items. It will always actually be aligned and is only read by the
> code in the file - so why was it ever marked __packed at all!
> On x86 it would make no difference anyway.
>
> I can only guess it was to ensure that the asm code didn't go
> 'wrong' because of the compiler adding 'random' padding.
> That isn't what __packed is for at all.
> The linux kernel requires that the compiler doesn't add 'random'
> padding - even if the C standard might allow it.
>
> 	David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>
Your right, after looking at the assembly output, i can confirm that
the removal of __packed changed nothing.
Maybe i should update this part of the commit message as well.

Armin Wolf


      reply	other threads:[~2022-02-20 19:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-19 21:10 [PATCH v2] hwmon: (dell-smm) Improve assembly code Armin Wolf
2022-02-20 12:20 ` David Laight
2022-02-20 15:30   ` Guenter Roeck
2022-02-20 18:03     ` David Laight
2022-02-20 18:48 ` David Laight
2022-02-20 19:05   ` Armin Wolf [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=77eeca08-e970-84df-6490-36e330ce91ca@gmx.de \
    --to=w_armin@gmx.de \
    --cc=David.Laight@ACULAB.COM \
    --cc=jdelvare@suse.com \
    --cc=linux-assembly@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --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).