Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18131423rwd; Tue, 27 Jun 2023 12:06:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vtEEDZwZri63rmesfLst6l/BHSxypy4iSsnbhAeg4kppExAZ1sdBXMHNcWhnOfb3fbqry X-Received: by 2002:a2e:2c0f:0:b0:2b4:765b:f6f0 with SMTP id s15-20020a2e2c0f000000b002b4765bf6f0mr18322234ljs.28.1687892798432; Tue, 27 Jun 2023 12:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687892798; cv=none; d=google.com; s=arc-20160816; b=eZS6pxzPVwwXmhiRI7dYKEo5qqYgE9pZ6HuILgUiW18EQr76VInSEnSaONmhdwipdp cuRGyT0KRVlJiQAlrKw62AHLiFAL0rA3reglBLEHuyWYY7muIG6y3bxNwgdpuxBASxhN r/a5fzetYZ2NA2IC86AJ8oOLXIPFOuEo9gLfF+U0TwyNttIDJ00cqrYfRegsJxEW8KKw qW5wJSK5ZLINkvS93sYkTK+E9LAnKrlY8HAjSdlC87BE9/8HM33FkjWTVy18+AxkMFmm aXPHCK8sff07wa5oMCH3TuzbvmMX/pPodK47NQdtE4WFT3CL/6k/61XiqmKyFlKWFREJ XTqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=ASAe2WysaQ8Ftovs67iBsRHjx+Enk5OsCUHl9msJeQE=; fh=RTfp0KBWkjrmq679b0MIGusAzer4Gb8oYJrzjKxloZc=; b=FV3oKkpUMmZLMh7aBkpg3UFP4Sk/fLxneDmZxDCA+5x29S/QcPqiB+LVAMZoCHcqW+ 8cHM6wOOkdlYRNVJ5wOfsOqqp4E189D1jl9x8DOvF+YQdjFKbAMFvQNRe6PHYbcZRl0C nnEFp1ZgZb1bT9jaXEp01f6IEUJ5Tmph0wLx4UmglXruHQ3ZoZ9Zn4ff77XUKtI59XPm SPeKZK7laueCElBpvUmCHwCvUVLD5QPb7ZshJQ/+sgQXz2unD5NnOUvc8Eujt3XzS6wz ys/yTNUuqFz6/L0aDh7OM8Yyk9n7BgqgXbqeF+dbJycxx1QE8t5bv9IYNxg/X0yucuSs bLnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=eCtQhi2s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r4-20020aa7cfc4000000b0051d9195b3e1si3636135edy.232.2023.06.27.12.06.12; Tue, 27 Jun 2023 12:06:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=eCtQhi2s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231520AbjF0TEJ (ORCPT + 99 others); Tue, 27 Jun 2023 15:04:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231396AbjF0TEF (ORCPT ); Tue, 27 Jun 2023 15:04:05 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C96D11BD5; Tue, 27 Jun 2023 12:04:02 -0700 (PDT) Received: from [192.168.10.54] (unknown [182.179.162.32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id D55856607155; Tue, 27 Jun 2023 20:03:59 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687892641; bh=2pkER0ZvYT5GddTzJ80ZqUr+7MVPSyIBtKVbKbTiFgw=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=eCtQhi2sazyGTHceRRSU9/qx1KZzby4PEdvhwrf/9NeSXVAVpLNJ+54zehqWX91M4 sgryi6syvyWZlpiV2zO10F66IJaXrTpBibAAp5WjN6suQI2oOrO8hZqscqbRaYDGoD EzfYtA8p/jEnZbi2ru7BoJfUzvoiQjXuHhk8IprwcfkfddzIAZD470zpSjfbyxeqWJ oVMjLz5RgfbnLtodD9s7IzMRfUNCcI2quiGyxqnqKf10qFpAKMYdRVUMhP0uNoltkZ J7pxhU2BMsjIwk8piEiQoS6AWGC2T47y798akn5+kTjRneNh+y4W6Ievg0SS235dzl RKR2TQPdn/Vzw== Message-ID: <5a5ccd98-7e4c-2108-aa4a-cd7c3ecd95dc@collabora.com> Date: Wed, 28 Jun 2023 00:03:56 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Cc: Muhammad Usama Anjum , shuah@kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v2] selftests: prctl: Add new prctl test for PR_SET_NAME Content-Language: en-US To: Osama Muhammad , Shuah Khan References: <20230607153600.15816-1-osmtendev@gmail.com> <3c03e28b-8006-a4ac-30bc-6aaf83ccb5d5@linuxfoundation.org> From: Muhammad Usama Anjum In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thank you for the patch. This patch cleanly applies on next-20230627. Unrelated to this patch: I'm not sure if this patch was written against linux next. Always try to send patches against latest next tag from following repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git On 6/26/23 11:36 PM, Osama Muhammad wrote: > Hi Shuah, > > Any feedback on this patch?. > > Thanks, > Osama > > > On Sat, 17 Jun 2023 at 18:01, Osama Muhammad wrote: >> >> Hi, >> >> Yes, I did install the latest kernel headers and TASK_COMM_LEN is not >> accessible in userspace. >> >> I looked into the test which uses TASK_COMM_LEN but the test defines >> it in its own header file. >> >> Example: https://elixir.bootlin.com/linux/latest/source/tools/testing/selftests/bpf/progs/pyperf.h#L13 >> >> TASK_COMM_LEN is defined in include/linux/sched.h, but this header >> file is not exposed to userspace. >> >> TASK_COMM_LEN is not defined in /include/uapi/linux/sched.h which is >> exposed to userspace kernel headers. >> Please find the link to the header file exposed to user space :- >> -https://elixir.bootlin.com/linux/v5.15.116/source/include/uapi/linux/sched.h >> >> As for arm64/abi/tpidr2.c It includes linux/sched.h which will be >> /include/uapi/linux/sched.h because the user space program is >> including it. >> So it also cannot use TASK_COMM_LEN directly. >> >> Regards, >> Osama >> >> On Tue, 13 Jun 2023 at 02:56, Shuah Khan wrote: >>> >>> On 6/10/23 07:01, Osama Muhammad wrote: >>>> Hi all, >>>> >>>> I looked into it and tried to use TASK_COMM_LEN in the test. Even >>>> though I included "linux/sched.h '', I was not able to compile the >>>> test because it couldn't find it in the header file. >>>> I dived deep into the issue and turns out header file mapped in >>>> /usr/include/linux/sched.h is actually mapped to >>>> /include/uapi/linux/sched.h[1] in linux source, >>>> where TASK_COMM_LEN is not even defined. Instead TASK_COMM_LEN is >>>> defined in /include/linux/sched.h which is not mapped to any header >>>> files in >>>> userspace(/(/usr/include/linux). >>>> I also tried to find the TASK_COM_LEN in /usr/include/linux/ but I >>>> couldn't find it. Following are the search results. >>>> grep -rnw '/usr/include/linux/' -e 'TASK_COMM_LEN" >>>> RESULTS OF COMMAND :- /usr/include/linux/taskstats.h:38:#define >>>> TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN >>>> Based on this information, I have two questions: >>>> 1. Would this require a fix to move 'TASK_COMM_LEN' macro from >>>> /include/linux/sched.h to UAPI headers /include/uapi/linux/sched.h. >>>> 2. Is there any other way to access TASK_COMM_LEN in the selftest that >>>> I'm not aware of? >>>> >>>> [1]:-https://elixir.bootlin.com/linux/v5.15.116/source/include/uapi/linux/sched.h >>>> >>> >>> The best source is Linux mainline. >>> >>> Take a look at test files that include linux/sched.h >>> >>> arm64/abi/tpidr2.c is one of them. >>> >>> Did you install headers before compiling the test? >>> make headers_install >>> >>> thanks, >>> -- Shuah >>> >>> -- BR, Muhammad Usama Anjum