Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755131AbbB0UCg (ORCPT ); Fri, 27 Feb 2015 15:02:36 -0500 Received: from mail-la0-f51.google.com ([209.85.215.51]:33065 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752247AbbB0UCf (ORCPT ); Fri, 27 Feb 2015 15:02:35 -0500 MIME-Version: 1.0 In-Reply-To: <54F0A0EB.8060301@redhat.com> References: <54F0A0EB.8060301@redhat.com> From: Andy Lutomirski Date: Fri, 27 Feb 2015 12:02:13 -0800 Message-ID: Subject: Re: [RFC 2/3] x86: Switch all C consumers of kernel_stack to this_cpu_sp0 To: Denys Vlasenko Cc: X86 ML , "linux-kernel@vger.kernel.org" , Borislav Petkov , Oleg Nesterov , Konrad Rzeszutek Wilk , Boris Ostrovsky , Rusty Russell Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5786 Lines: 121 On Fri, Feb 27, 2015 at 8:52 AM, Denys Vlasenko wrote: > On 02/27/2015 01:07 AM, Andy Lutomirski wrote: >> This will make modifying the semantics of kernel_stack easier. >> >> Cc: Konrad Rzeszutek Wilk >> Cc: Boris Ostrovsky >> Cc: Rusty Russell >> Signed-off-by: Andy Lutomirski >> --- >> arch/x86/include/asm/thread_info.h | 3 +-- >> arch/x86/kernel/traps.c | 2 +- >> 2 files changed, 2 insertions(+), 3 deletions(-) >> >> diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h >> index e82e95abc92b..92549053d86d 100644 >> --- a/arch/x86/include/asm/thread_info.h >> +++ b/arch/x86/include/asm/thread_info.h >> @@ -163,8 +163,7 @@ DECLARE_PER_CPU(unsigned long, kernel_stack); >> static inline struct thread_info *current_thread_info(void) >> { >> struct thread_info *ti; >> - ti = (void *)(this_cpu_read_stable(kernel_stack) + >> - KERNEL_STACK_OFFSET - THREAD_SIZE); >> + ti = (void *)(this_cpu_sp0() - THREAD_SIZE); >> return ti; >> } > > This makes modpost unhappy, it says these modules need init_tss symbol > to be visible to them: > > Building modules, stage 2. > MODPOST 2556 modules > ERROR: "init_tss" [sound/usb/usx2y/snd-usb-usx2y.ko] undefined! > ERROR: "init_tss" [sound/pci/hda/snd-hda-codec.ko] undefined! > ERROR: "init_tss" [sound/pci/emu10k1/snd-emu10k1.ko] undefined! > ERROR: "init_tss" [sound/core/snd-pcm.ko] undefined! > ERROR: "init_tss" [sound/core/snd-hwdep.ko] undefined! > ERROR: "init_tss" [sound/core/seq/snd-seq.ko] undefined! > ERROR: "init_tss" [sound/core/oss/snd-pcm-oss.ko] undefined! > ERROR: "init_tss" [net/sunrpc/sunrpc.ko] undefined! > ERROR: "init_tss" [net/sctp/sctp.ko] undefined! > ERROR: "init_tss" [net/rds/rds_tcp.ko] undefined! > ERROR: "init_tss" [net/core/pktgen.ko] undefined! > ERROR: "init_tss" [net/batman-adv/batman-adv.ko] undefined! > ERROR: "init_tss" [net/9p/9pnet.ko] undefined! > ERROR: "init_tss" [fs/reiserfs/reiserfs.ko] undefined! > ERROR: "init_tss" [fs/ocfs2/dlmfs/ocfs2_dlmfs.ko] undefined! > ERROR: "init_tss" [fs/ocfs2/cluster/ocfs2_nodemanager.ko] undefined! > ERROR: "init_tss" [fs/nfsd/nfsd.ko] undefined! > ERROR: "init_tss" [fs/fscache/fscache.ko] undefined! > ERROR: "init_tss" [fs/fat/fat.ko] undefined! > ERROR: "init_tss" [fs/ecryptfs/ecryptfs.ko] undefined! > ERROR: "init_tss" [fs/cachefiles/cachefiles.ko] undefined! > ERROR: "init_tss" [fs/btrfs/btrfs.ko] undefined! > ERROR: "init_tss" [fs/9p/9p.ko] undefined! > ERROR: "init_tss" [drivers/xen/xen-privcmd.ko] undefined! > ERROR: "init_tss" [drivers/vhost/vhost.ko] undefined! > ERROR: "init_tss" [drivers/tty/n_hdlc.ko] undefined! > ERROR: "init_tss" [drivers/target/target_core_file.ko] undefined! > ERROR: "init_tss" [drivers/scsi/pmcraid.ko] undefined! > ERROR: "init_tss" [drivers/scsi/lpfc/lpfc.ko] undefined! > ERROR: "init_tss" [drivers/parport/parport.ko] undefined! > ERROR: "init_tss" [drivers/net/ethernet/broadcom/tg3.ko] undefined! > ERROR: "init_tss" [drivers/net/bonding/bonding.ko] undefined! > ERROR: "init_tss" [drivers/mtd/mtd.ko] undefined! > ERROR: "init_tss" [drivers/misc/vmw_vmci/vmw_vmci.ko] undefined! > ERROR: "init_tss" [drivers/media/v4l2-core/videodev.ko] undefined! > ERROR: "init_tss" [drivers/media/usb/uvc/uvcvideo.ko] undefined! > ERROR: "init_tss" [drivers/media/pci/saa7134/saa7134.ko] undefined! > ERROR: "init_tss" [drivers/media/pci/ivtv/ivtvfb.ko] undefined! > ERROR: "init_tss" [drivers/media/i2c/vpx3220.ko] undefined! > ERROR: "init_tss" [drivers/md/bcache/bcache.ko] undefined! > ERROR: "init_tss" [drivers/isdn/i4l/isdn.ko] undefined! > ERROR: "init_tss" [drivers/input/misc/uinput.ko] undefined! > ERROR: "init_tss" [drivers/infiniband/hw/qib/ib_qib.ko] undefined! > ERROR: "init_tss" [drivers/infiniband/hw/ipath/ib_ipath.ko] undefined! > ERROR: "init_tss" [drivers/infiniband/core/ib_uverbs.ko] undefined! > ERROR: "init_tss" [drivers/hid/uhid.ko] undefined! > ERROR: "init_tss" [drivers/gpu/drm/radeon/radeon.ko] undefined! > ERROR: "init_tss" [drivers/gpu/drm/qxl/qxl.ko] undefined! > ERROR: "init_tss" [drivers/gpu/drm/i915/i915.ko] undefined! > ERROR: "init_tss" [drivers/gpu/drm/drm.ko] undefined! > ERROR: "init_tss" [drivers/firewire/firewire-core.ko] undefined! > ERROR: "init_tss" [drivers/char/tpm/tpm_tis.ko] undefined! > ERROR: "init_tss" [drivers/char/tpm/tpm.ko] undefined! > ERROR: "init_tss" [drivers/char/pcmcia/cm4000_cs.ko] undefined! > ERROR: "init_tss" [drivers/char/lp.ko] undefined! > ERROR: "init_tss" [drivers/char/ipmi/ipmi_devintf.ko] undefined! > ERROR: "init_tss" [drivers/block/drbd/drbd.ko] undefined! > ERROR: "init_tss" [drivers/acpi/acpi_pad.ko] undefined! > ERROR: "init_tss" [arch/x86/oprofile/oprofile.ko] undefined! > ERROR: "init_tss" [arch/x86/kvm/kvm.ko] undefined! > ERROR: "init_tss" [arch/x86/kvm/kvm-intel.ko] undefined! > make[1]: *** [__modpost] Error 1 > make: *** [modules] Error 2 > > I took one and investigated how it references init_tss. > > drivers/hid/uhid.c: > > static int uhid_event_from_user(const char __user *buffer, size_t len, > struct uhid_event *event) > { > if (is_compat_task()) { <=========== HERE > u32 type; > > if (get_user(type, buffer)) > return -EFAULT; > > if (type == UHID_CREATE) { > > Whoops! I fixed it locally with an EXPORT_SYMBOL_GPL. --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/