From: Sebastian Sumpf <Sebastian.Sumpf@genode-labs.com>
To: Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@intel.com>,
Richard Weinberger <richard@nod.at>
Cc: tglx@linutronix.de, mingo@redhat.com,
dave.hansen@linux.intel.com, x86@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [Bug report] __arch_hweight32/64 x86
Date: Tue, 27 Jun 2023 18:57:32 +0200 [thread overview]
Message-ID: <7738ff3a-3f5a-2583-93f7-458425fd84a5@genode-labs.com> (raw)
In-Reply-To: <20230627042538.GAZJpkwldpkqTKeeDL@fat_crate.local>
On 6/27/23 06:25, Borislav Petkov wrote:
> On Mon, Jun 26, 2023 at 03:41:27PM -0700, Dave Hansen wrote:
>> I'm not even sure that UML needs GENERIC_HWEIGHT. From a quick glance,
>> it looks like x86 used to use GENERIC_HWEIGHT, but got arch-specific
>> versions later. UML just never moved over to the arch-specific versions.
>
> Thanks - that could very well be the explanation.
>
> That bug report made me blink a couple of times since I did take extra
> precaution to not clobber regs in arch/x86/lib/hweight.S as this was
> part of the whole pain back then with calling a function from asm where
> gcc doesn't even know we're calling a function, see:
>
> f5967101e9de ("x86/hweight: Get rid of the special calling convention")
>
>> I _think_ the attached patch might just fix the problems with the C
>> version and bring the x86/UML implementation back in line with the rest
>> of x86.
>>
>> Thoughts?
>
>> diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
>> index 186f13268401..76d507860be4 100644
>> --- a/arch/x86/um/Kconfig
>> +++ b/arch/x86/um/Kconfig
>> @@ -44,6 +44,3 @@ config ARCH_HAS_SC_SIGNALS
>>
>> config ARCH_REUSE_HOST_VSYSCALL_AREA
>> def_bool !64BIT
>> -
>> -config GENERIC_HWEIGHT
>> - def_bool y
>
> Yeah, we should do it. UML should not do anything different wrt calling
> conventions so it should be able to handle the arch/x86/lib/hweight.S
> versions just fine.
Thank you for the quick resolution! It fixes the problem for me and sorry for
not explaining well enough.
> Richi?
>
--
Sebastian Sumpf
Genode Labs
http://www.genode-labs.com · http://genode.org
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
next prev parent reply other threads:[~2023-06-27 16:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 20:49 Sebastian Sumpf
2023-06-26 21:06 ` Borislav Petkov
2023-06-26 21:42 ` Sebastian Sumpf
2023-06-26 22:41 ` Dave Hansen
2023-06-27 4:25 ` Borislav Petkov
2023-06-27 16:57 ` Sebastian Sumpf [this message]
2023-06-29 9:10 ` David Laight
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=7738ff3a-3f5a-2583-93f7-458425fd84a5@genode-labs.com \
--to=sebastian.sumpf@genode-labs.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=richard@nod.at \
--cc=tglx@linutronix.de \
--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®