From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 103C8C4363A for ; Thu, 8 Oct 2020 13:18:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4D832087D for ; Thu, 8 Oct 2020 13:18:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZAzy8O9t" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729756AbgJHNSR (ORCPT ); Thu, 8 Oct 2020 09:18:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbgJHNSR (ORCPT ); Thu, 8 Oct 2020 09:18:17 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F847C061755 for ; Thu, 8 Oct 2020 06:18:16 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id n14so3980009pff.6 for ; Thu, 08 Oct 2020 06:18:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:from:to:cc:subject:in-reply-to:references :user-agent:mime-version; bh=Y6/NSr1zLG3YbcTmQY3H9sPeZxK2xqopsbQmsWgxwcE=; b=ZAzy8O9tKzFhTJ4OBsjx185F9X+UQT7MhkS25qm+zXxGH+aRDABYoEL7I54v32S5C3 OTaW+4nmPPZX0Xgf8Gw8Ot9adm0N+/MahliHmzqd2KceKcQv2Ty0l25MR5OCQMUh8dQP y3OGksY/Eujyb39xxlScfYEv3WhUkOg9igV9mgef21tWYB3krosBp54QDNknn+HhSTYR ZrXlJOt3FHbsHoa31OwTkxewne8qR91VSmL6akzuciDp45r/9z0tw4wVNCZGRwzge0Ax xhjuieZIAtcDCVnnLspWXFqxBv+ZKTvmNiG5UjlXGRfhcYxItRDlW9p4e7a4i90wpX7M vnTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:from:to:cc:subject:in-reply-to :references:user-agent:mime-version; bh=Y6/NSr1zLG3YbcTmQY3H9sPeZxK2xqopsbQmsWgxwcE=; b=ho77gUMfQLUrBlg9n8vBHdxxQJqsq/TUq5tWatZR7qOEsoiT3hxKgFZhG+SnFLQLC7 WsTh2ZxFe4Iwv1ZZ2BzHl1D8irKI6DSMLgGqDxVQ15bxyMXvKbAcv/jnu1HbXJ5U1NGp 8orAKp28rauO6NNrVU8d7r7r07sCsCWe0/o5/SobIoUQa6DpPfiTukYvkSEH5mIQELa7 KsaZRA/3B7cvrfztbqF2+LDiJTmYFv7GpAO64g/hSc1k5aGCL9qyZbAM9t24OqnahCRr ZvTQecppliwq8KenjxYfktjuco4Tuzpd9xXU7fDWXcHzZRjTJWqn+ceYdzREWnaOVBie igmQ== X-Gm-Message-State: AOAM532MjNXxxU7dMPOVJg/i0e7S5gsN3SPIhprI8K14FRdvwe4VDSbe lLKBRbO7pnR688qLYEyxjYE= X-Google-Smtp-Source: ABdhPJzpE5qnubRD4rjuWocK944LVtnJh2IXK6nBvKDZl1XH5aM3PTKpT55idDtQbkpMmmsIHSdZHQ== X-Received: by 2002:a17:90a:46c2:: with SMTP id x2mr8266920pjg.60.1602163095840; Thu, 08 Oct 2020 06:18:15 -0700 (PDT) Received: from earth-mac.local.gmail.com (219x123x138x129.ap219.ftth.ucom.ne.jp. [219.123.138.129]) by smtp.gmail.com with ESMTPSA id n12sm7098919pgk.20.2020.10.08.06.18.12 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Oct 2020 06:18:14 -0700 (PDT) Date: Thu, 08 Oct 2020 22:18:10 +0900 Message-ID: From: Hajime Tazaki To: johannes@sipsolutions.net Cc: linux-um@lists.infradead.org, jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, tavi.purdila@gmail.com, linux-kernel-library@freelists.org, linux-arch@vger.kernel.org, tavi@cs.pub.ro, retrage01@gmail.com Subject: Re: [RFC v7 02/21] um: add os init and exit calls In-Reply-To: <0817bfdee3ee28ae8b94251ed559cf4e844a5ea4.camel@sipsolutions.net> References: <184f5b2c6a0c399edf519d27989519a35ab90700.1601960644.git.thehajime@gmail.com> <0817bfdee3ee28ae8b94251ed559cf4e844a5ea4.camel@sipsolutions.net> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/25.3 Mule/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Thu, 08 Oct 2020 00:13:02 +0900, Johannes Berg wrote: > > On Tue, 2020-10-06 at 18:44 +0900, Hajime Tazaki wrote: > > > > -#define __define_initcall(level,fn) \ > > - static initcall_t __initcall_##fn __used \ > > - __attribute__((__section__(".initcall" level ".init"))) = fn > > - > > -/* Userspace initcalls shouldn't depend on anything in the kernel, so we'll > > - * make them run first. > > - */ > > -#define __initcall(fn) __define_initcall("1", fn) > > +#undef __uml_exit_call > > +#define __uml_exit_call __used __section(os_exitcalls) > > Doesn't that break calling of sigio_cleanup and remove_umid_dir? Without the patch 04/21 um: host: implement os_initcalls and os_exitcalls, yes you're right. > After all, > > > +void __weak os_exitcalls(void) > > +{ > > +} > > This does nothing so far. > > Also, why the __weak? The intention is to define os_exitcalls() under tools/um so that the actual exitcalls is located in different ELF sections (we defined multiple __uml_exit_call for __UM_HOST__ and ! __UM_HOST__). Thus uml_cleanup() must see the symbol but give the place where actual function is defined at tools/um. Thus, this is __weak symbol-ed. -- Hajime