Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp644520imb; Fri, 1 Mar 2019 10:03:31 -0800 (PST) X-Google-Smtp-Source: APXvYqwGRH5Gw7GqKpYVSnkVA4/NNbCIe7xqgjGnNH60v/LKkfaZM6XoBrQv4G7QBLz4YGMG0jnL X-Received: by 2002:a17:902:4a0c:: with SMTP id w12mr6566730pld.174.1551463411112; Fri, 01 Mar 2019 10:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551463411; cv=none; d=google.com; s=arc-20160816; b=DCCwoPxyU192zXrf4UWEtYfxFyJ6dNPC1h8BJauPewaUXVdPJYBdxO6leMQPRXFrM8 09llrxZfHG7sh7EXJEc1X4lYFg53NuhkITrRVbmZNNCPJR7IqQjbt4tvdXZB0/YVS+4M 4/Gfl0lvT5FXLzTN2Q/0kpUEPOX/w5VyA6CIF4L5ZnYJCR/HNHYlPLL+mAJcOKiz0jRA jiTZsfdq7dkyzAPlJS1ax+0D/0Ey0Rv2QAkeoCkI1gC800V6TArB1tKvjQ6Yd6ttK1CP XMoqAs9RKS1jAsyBoUcwEyIv0JqO5QG+aQdibi9bsMbrWE4kviNOuviG+8xV4qT+G9pb JbZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DHWPXUSg70P7oFntkIS7YhwNkOCIzd5Ta8zUZclrvFA=; b=FBk9mSttUr5k0nav9smDgzauf7qbBd1I08NMGrEMtBqlWmDBc8WcwFjzyf11LDVV0t +ICVN5AsknKzwoDFtRVkdaYPpOkkPIbaLjfz/gOhLJjdHMSYdYxbgNutiJqmCkEjobUr l6gw2PA10aUdVS/ybP3YWetqcwCkBMcsWnhZUSjJgYePy2ULJctMmh+64l05uDJWqq0V 9EYajUGI3sg5WoJngk1S6gB4MSLsmQ3izJqlr1TawrytSLy7mLd5Ra9ytjocNQEGjcH+ DOlepE80M7/A4VFHGGE5PomLmf75N9nBvAI0O21Z4EBU/hq5YwKH+7lRu8EXikSARvtj ESqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=a38jITjr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16si21246181pgi.148.2019.03.01.10.03.15; Fri, 01 Mar 2019 10:03:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=a38jITjr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389408AbfCART6 (ORCPT + 99 others); Fri, 1 Mar 2019 12:19:58 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:39409 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389288AbfCART5 (ORCPT ); Fri, 1 Mar 2019 12:19:57 -0500 Received: by mail-qt1-f193.google.com with SMTP id o6so28603660qtk.6 for ; Fri, 01 Mar 2019 09:19:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DHWPXUSg70P7oFntkIS7YhwNkOCIzd5Ta8zUZclrvFA=; b=a38jITjrVIFkNfD3sYQsTaS2Kaxy+KixXPvDeyZn5S8usJMZ/5lRTCMB2yAnydkY7r DsXdk145tMNPvCXHcjqRkVP15u/Qn1GLCwusg+6nVaUqWUu9jaB3auETlD7xRypZAqrg 2cJo1/T76aCKJ+peFfvoJwrKwJ2MTxaGfj3ew= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=DHWPXUSg70P7oFntkIS7YhwNkOCIzd5Ta8zUZclrvFA=; b=SJNubKz+bPt6lAwF8ls94JPIkEti9ch5w+XA4lhYHWzcaJJJiPdiHplUnpBQoT918U LuhQKWDlfj5ha3ojfRNlc4eAzGNHO5A/S2HFisf/grhNqQumofupYA6sDbacJ6+KmNh3 8m0WtJOIRAE4acXvBs3sGRfWybuoqjPTNx7SRizkKlwiw+GCrLJk6GBsj1XImjYFjESh ynBRo7tWSwK4hxGHGRk6sLumik0CLzAXVKvxiIdM2OwbBeU31V9M7zBV0FXXv2bjypC3 AsG8LIt56d84jiDQ+vZ0JCrrtl4YLtL8V094xa41hfpq3A/v6TVt9bCkKhO4IYmYMDAx fmSg== X-Gm-Message-State: APjAAAUQ6QB/Si0mUOFISXme4lQOBbfGk4IGE3D3JRWuNgOmbRo34gTQ hglxxkwhvCeXHaSG+CHJTc7W9w== X-Received: by 2002:ac8:1aa6:: with SMTP id x35mr4937634qtj.218.1551460796033; Fri, 01 Mar 2019 09:19:56 -0800 (PST) Received: from localhost ([2620:0:1004:1100:cca9:fccc:8667:9bdc]) by smtp.gmail.com with ESMTPSA id l24sm15097453qtf.27.2019.03.01.09.19.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2019 09:19:54 -0800 (PST) Date: Fri, 1 Mar 2019 12:19:54 -0500 From: Joel Fernandes To: Masahiro Yamada Cc: Linux Kernel Mailing List , Andrew Morton , Alexei Starovoitov , atish patra , Daniel Colascione , Dan Williams , Greg Kroah-Hartman , Guenter Roeck , Jonathan Corbet , Karim Yaghmour , Kees Cook , kernel-team@android.com, "open list:DOCUMENTATION" , "open list:KERNEL SELFTEST FRAMEWORK" , linux-trace-devel@vger.kernel.org, Manoj Rao , Masami Hiramatsu , Paul McKenney , "Peter Zijlstra (Intel)" , qais.yousef@arm.com, Randy Dunlap , Steven Rostedt , Shuah Khan , Thomas Gleixner , Yonghong Song Subject: Re: [PATCH v3 1/2] Provide in-kernel headers for making it easy to extend the kernel Message-ID: <20190301171954.GA217990@google.com> References: <20190227193748.132301-1-joel@joelfernandes.org> <20190228144306.GA138215@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 01, 2019 at 03:25:05PM +0900, Masahiro Yamada wrote: [...] > > > I am guessing the user will run these commands > > > on the target system. > > > In other words, external modules are native-compiled. > > > So, > > > > > > target-arch: arm64 > > > host-arch: arm64 > > > > > > > > > Is this correct? > > > > > > > > > If I understood the assumed use-case correctly, > > > kheaders.tar.xw will contain host-programs compiled for x86, > > > which will not work on the target system. > > > > > > > You are right, the above commands in the commit message work only if the > > host/target are same arch due to scripts. > > > > However we can build with arm64 device connected to a host, like this (which > > I tested): > > > > adb shell modprobe kheaders; adb pull /proc/kheaders.tar.xz > > rm -rf $HOME/headers; mkdir -p $HOME/headers > > tar -xvf /proc/kheaders.tar.xz -C $HOME/headers >/dev/null > > cd my-kernel-module > > make -C $HOME/headers M=$(pwd) ARCH=arm64 CROSS_COMPILE=aarch64- modules > > adb push test.ko /data/; adb shell rmmod kheaders > > > > The other way we can make this work is using x86 usermode emulation inside a > > chroot on the Android device which will make the earlier commands work. One > > thing to note is that Android also runs on x86 hardware so the commands in > > the commit message will work even for x86 Android targets already. > > > > Also note that this the "module building" part is really only one of the > > usecases. eBPF is another which needs the headers - and the headers are vast > > majority of the archive. Headers take 3.1MB out of 3.6MB of the archive on > > arm64 builds. > > > > How do you want to proceed here, should I mention these points in the commit > > message? > > > > I do not request a re-spin just for a matter of commit log, > but this version produces an empty tarball. > So, you will have a chance to update the patch anyway. > > In the next version, it would be nice to note that > "external modules must be built on the same host arch > as built vmlinux". Ok, I respun it with 1 more minor nit for arm64 building. Please take a look. > Let me ask one more question. > > I guess this patch is motivated by > how difficult to convey kernel headers > from vendors to users. > > In that situation, how will the user find > the right compiler to use for building external modules? > > > > > Greg KH said: > > We don't ever support the system of loading a module built with anything > other than the _exact_ same compiler than the kernel was. > > > For the full context, see this: > https://lore.kernel.org/patchwork/patch/836247/#1031547 IMO this issue is not related to this patch but is just an issue with building external modules in general. It is up to the user to use the right compiler, etc. I will let Greg comment more on that. thanks, - Joel