From: "Jan Beulich" <JBeulich@novell.com>
To: "Rusty Russell" <rusty@rustcorp.com.au>, "Michal Marek" <mmarek@suse.cz>
Cc: "Ingo Molnar" <mingo@elte.hu>, <tony.luck@intel.com>,
"Jon Masters" <jonathan@jonmasters.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
<linux-arch@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-modules@vger.kernel.org>, <hpa@zytor.com>
Subject: Re: [PATCH] reduce export symbol CRC table size on 64-bit archs
Date: Fri, 10 Jul 2009 08:23:39 +0100 [thread overview]
Message-ID: <4A57089B0200007800009C0E@vpn.id2.novell.com> (raw)
In-Reply-To: <200907092044.22108.rusty@rustcorp.com.au>
>>> Rusty Russell <rusty@rustcorp.com.au> 09.07.09 13:14 >>>
>On Mon, 6 Jul 2009 05:12:51 pm Jan Beulich wrote:
>> >Jan Beulich napsal(a):
>> >> Since these CRCs are really only 32-bit quantities, there's no need to
>> >> store them in 64-bit slots. Since, however, gcc doesn't allow
>> >> respective initializations, asm() constructs get used to create the CRC
>> >> tables (and its for that reason that the patch only makes x86-64 and
>> >> ia64 utilize that functionality, as I can't verify this doesn't break
>> >> in some subtle way elsewhere).
>> >
>> >...
>> >
>> >> struct modversion_info
>> >> {
>> >> - unsigned long crc;
>> >> + ksym_crc_t crc;
>> >> char name[MODULE_NAME_LEN];
>> >> };
>> >
>> >This change breaks module-init-tools:
>> >Before:
>> >$ /sbin/modprobe --dump-modversions _build/drivers/usb/core/usbcore.ko
>> >
>> >| head
>> >
>> >0xb49b735a module_layout
>> >0xdb7e6a70 bus_register
>> >...
>> >After:
>> >$ /sbin/modprobe --dump-modversions
>> >_build-crc-int/drivers/usb/core/usbcore.ko | head
>> >0x75646f6d91ea7b5c le_layout
>> >0x5f7375623e215f43 register
>> >...
>> >It also breaks the newly added depmod -E option (check symbol versions),
>> >which also reads the struct modversion_info array (*). Is it possible
>> >name the section differently (__versions2?) on those architectures where
>> >the size changes, so that it is possible to fix m-i-t in a
>> >backwards-compatible manner?
>>
>> First of all I'd view it as a design bug if user mode code assumptions
>> prevent changes to the kernel.
>
>Yes, but unfortunately it happens. We do it much less than we used to, but
>there are limits.
>
>> But taking this as an uncorrectable fact, I'd think that renaming the
>> section would certainly be an option (though I'm unsure whether that would
>> have other consequences - Rusty?), however I could also imagine other means
>> to communicate to user land the width of a CRC value (e.g. adding an
>> absolute symbol during the .ko linking stage).
>
>No, just break it once. And I still like the idea that we should do something
>more radical if we're going to break this anyway, rather than these nasty asm
>hacks.
Actually I meanwhile think that module-init-tools can easily detect the changed
layout without any further kernel side adjustments: Since it is known that a
CRC always is a 32-bit value, simply checking whether the so-far-used 64-bit
value has more than 32 significant bits should suffice: If so, the new layout
is being used (with the symbol name starting at offset 4), else the old one is
in effect (name at offset 8). This ought to be a pretty trivial change to that
code.
Jan
next prev parent reply other threads:[~2009-07-10 7:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 11:51 Jan Beulich
2009-06-30 22:09 ` Ingo Molnar
2009-07-01 5:00 ` Rusty Russell
2009-07-01 7:00 ` Jan Beulich
2009-07-03 20:16 ` Michal Marek
2009-07-06 7:42 ` Jan Beulich
2009-07-09 11:14 ` Rusty Russell
2009-07-10 7:23 ` Jan Beulich [this message]
2009-07-10 14:36 ` H. Peter Anvin
2009-07-10 15:50 ` Jon Masters
2009-07-13 8:11 ` Michal Marek
2009-07-13 8:44 ` Jan Beulich
2009-07-14 10:29 ` Jon Masters
2009-07-14 10:44 ` Marco d'Itri
2009-07-14 16:43 ` H. Peter Anvin
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=4A57089B0200007800009C0E@vpn.id2.novell.com \
--to=jbeulich@novell.com \
--cc=hpa@zytor.com \
--cc=jonathan@jonmasters.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mmarek@suse.cz \
--cc=rusty@rustcorp.com.au \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
/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®