From nobody Tue Jun 28 20:38:48 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B9AEA866E8E for ; Tue, 28 Jun 2022 20:39:00 +0000 (UTC) (envelope-from jake@technologyfriends.net) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LXbzS0n24z4QqW for ; Tue, 28 Jun 2022 20:39:00 +0000 (UTC) (envelope-from jake@technologyfriends.net) Received: by mail-qk1-x731.google.com with SMTP id k10so10578377qke.9 for ; Tue, 28 Jun 2022 13:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=technologyfriends.net; s=google; h=mime-version:from:date:message-id:subject:to; bh=klVD4EqcN8FepRfhguVcqevzBhDOwp8jaylgYhn9aGs=; b=IOctWk97t2qanUrF4wxVimdj9VfK/IOEgqCIAOgF9yCp1j9FkeUGO2TfBd9FyVIIrq EvUQbqjA1dx9CS+xeKnGrnnaQwIFo5pfGjNm3fEjV+YxaJWJxtuEbdP0wasV/cvIkv5d p/hMOTLMcalwFMOUhVjo/DGPB61FPnfV4WiSMlewN8AV/b8MtaSef1l3AK5P+r0f4zrX y3KOJ0W2doBR/qIJEODaOKshEcF1+g6P8rMh9sITPWb4v4RLFIcTMyoFGUbqlmO4mBnB yYUJJ9d3UZwKH68o21j0OdLQkjs3pOzLx3V3WS203SKTuVBOfaws+2a9cggQoOATyzMH HkXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=klVD4EqcN8FepRfhguVcqevzBhDOwp8jaylgYhn9aGs=; b=ASBxzaHi+6oIi3nQXJ5v4ZqYgxU96KSQMnJxXmX8/ymtQZCQ+rp/dJrcIxTBQNSVKl 3JySo9cA5wjvnghoB2/amxWsZGZN71IW6db9vVYF4q+7tmMJQpO2YF665Geice5+VgNR 7zaP3Zdg4ofPXYqTwhKX0E+vxkY1qSszrc4ILzeS5tf5b/hsfZ/FaxciOidR8ri+d9bu oor7z+GueNmtjZ5idt9+hTPwVBBskY6JQe85B7TF6bNogf8E1pQTH9fCwUrc8LbaxPGp FHjWOLxsMGbXiTmCzoL07IHNQTgRmE449G1MBOQV4JC2NGavbfLqLg30sR6qMNOBraF6 XT4Q== X-Gm-Message-State: AJIora/EhzqOUo/l/qHxFPIv8jWEvkszus2F6zpTBDETCJEiuZYw2XHt 86nbQN4tx0keKmVOuTLtQG+9DmBkKYrBOiA8ZPY8FB++66MkZjHh X-Google-Smtp-Source: AGRyM1ugG7NgsHZ31WdggmiuMobBJ9m2gZb9ppzZAhf4x6Fsz14FoQtSY+GWlU2RXXUHG5RNS1ADLx6YXKfkGUNXgdM= X-Received: by 2002:a05:620a:1a1a:b0:6af:351e:62de with SMTP id bk26-20020a05620a1a1a00b006af351e62demr6273490qkb.667.1656448739390; Tue, 28 Jun 2022 13:38:59 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 From: Jake Freeland Date: Tue, 28 Jun 2022 15:38:48 -0500 Message-ID: Subject: LinuxKPI debugfs Port To: freebsd-hackers@freebsd.org, Mark Johnston Content-Type: multipart/alternative; boundary="000000000000b34a5105e2880661" X-Rspamd-Queue-Id: 4LXbzS0n24z4QqW X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none ("invalid DKIM record") header.d=technologyfriends.net header.s=google header.b=IOctWk97; dmarc=none; spf=none (mx1.freebsd.org: domain of jake@technologyfriends.net has no SPF policy when checking 2607:f8b0:4864:20::731) smtp.mailfrom=jake@technologyfriends.net X-Spamd-Result: default: False [-3.10 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[jake]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[technologyfriends.net]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[technologyfriends.net:~]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::731:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_DKIM_PERMFAIL(0.00)[technologyfriends.net:s=google]; MLMMJ_DEST(0.00)[freebsd-hackers]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --000000000000b34a5105e2880661 Content-Type: text/plain; charset="UTF-8" Hi there, I am working on porting Intel's igt-gpu-tools drm graphics driver testing suite to FreeBSD and I ran into some issues regarding debugfs. I spoke to manu@ who told me that CONFIG_DEBUG_FS is required for the testing to work properly. I started working on a debugfs port and quickly got confused about what manu@ meant by implementing "CONFIG_DEBUG_FS". Some quick internet searching says that CONFIG_DEBUG_FS is a Linux kernel configuration flag. I am curious how I would go about implementing this into FreeBSD. I copied the Linux debugfs source code into a new repository and attempted to compile it on FreeBSD as a kernel module: https://github.com/jakesfreeland/debugfs-freebsd Of course I was met with many, many incompatibility errors. I proceeded to copy the required `sys/compat/linuxkpi/common/include/linux` headers into my repository and I was met with two options: 1. continue modifying the LinuxKPI headers and commit my modifications to src. 2. re-engineer the debugfs source code to comply with the preexisting LinuxKPI headers. Many problems come with both approaches. First, if I modify the LinuxKPI headers, I'd be "copying" over some code from Linux's GPLv2 headers. I do not know how much I can "copy" before legal issues arise. Second, if I re-engineer the debugfs source code, I am revolting against what LinuxKPI stands for: running Linux code with little-to-no modification. I don't know what the correct approach is here. I also discovered that lindebugfs, a curtailed version of Linux's debugfs, already exists in FreeBSD's src. I am led to believe that this is exclusively used under the Linuxulator so it wouldn't help me. Is this correct? Thank you so much, Jake Freeland --000000000000b34a5105e2880661 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi there,

I am working on porting I= ntel's igt-gpu-tools drm graphics driver testing
suite to Fre= eBSD and I ran into some issues regarding debugfs. I spoke
to man= u@ who told me that CONFIG_DEBUG_FS is required for the
testing t= o work properly. I started working on a debugfs port and quickly
= got confused about what manu@ meant by implementing=C2=A0"CONFIG_DEBUG= _FS".

Some quick internet searching says that= CONFIG_DEBUG_FS is a
Linux kernel configuration flag. I am curio= us how I would go about
implementing=C2=A0this into FreeBSD. I co= pied the Linux debugfs source
code into a new repository and atte= mpted to compile it on FreeBSD
as a kernel module:

=

<= div>Of course I was met with many, many incompatibility=C2=A0errors. I proc= eeded
to copy the required `sys/compat/linuxkpi/common/include/li= nux` headers
into my repository and I was met with two options:

1. continue modifying the LinuxKPI headers and comm= it my modifications
to src.

2. re-engine= er the debugfs source code to comply with the preexisting
LinuxKP= I headers.

Many problems come with both approaches= . First, if I modify the LinuxKPI
headers, I'd be "copyi= ng" over some code from Linux's GPLv2 headers.
I do not = know how much I can "copy" before legal issues arise. Second,
if I re-engineer the debugfs source code, I am revolting against wha= t LinuxKPI
stands for: running Linux code with little-to-no modif= ication. I don't know
what the correct approach is here.

I also discovered that lindebugfs, a curtailed version= of Linux's debugfs,
already exists in FreeBSD's src. I a= m led to believe=C2=A0that this is exclusively
used under the Lin= uxulator so it wouldn't help me. Is this correct?

<= div>Thank you so much,
Jake Freeland
--000000000000b34a5105e2880661--