lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231003.093338.913889246531201639.fujita.tomonori@gmail.com>
Date: Tue, 03 Oct 2023 09:33:38 +0900 (JST)
From: FUJITA Tomonori <fujita.tomonori@...il.com>
To: andrew@...n.ch, miguel.ojeda.sandonis@...il.com
Cc: fujita.tomonori@...il.com, netdev@...r.kernel.org,
 rust-for-linux@...r.kernel.org
Subject: Re: [PATCH v1 1/3] rust: core abstractions for network PHY drivers

On Mon, 2 Oct 2023 16:52:45 +0200
Andrew Lunn <andrew@...n.ch> wrote:

>> +//! Networking.
>> +
>> +#[cfg(CONFIG_PHYLIB)]
> 
> I brought this up on the rust for linux list, but did not get a answer
> which convinced me.

Sorry, I overlooked that discussion.


> Have you tried building this with PHYLIB as a kernel module? 

I've just tried and failed to build due to linker errors.


> My understanding is that at the moment, this binding code is always
> built in. So you somehow need to force phylib core to also be builtin.

Right. It means if you add Rust bindings for a subsystem, the
subsystem must be builtin, cannot be a module. I'm not sure if it's
acceptable.


> Or you don't build the binding, and also don't allow a module to use
> the binding.

I made PHY bindings available only if PHYLIB is builtin like the
following. However, we want modularity for Rust support, fully or
partially (e.g., per subsystem), I think.

Miguel, I suppose that you have worked on a new build system. It can
handle this problem?


diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index e4d941f0ebe4..a4776fdd9b6c 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -110,6 +110,7 @@ config AX88796B_PHY
 config AX88796B_RUST_PHY
 	bool "Rust reference driver"
 	depends on RUST && AX88796B_PHY
+	depends on PHYLIB=y
 	default n
 	help
 	  Uses the Rust version driver for Asix PHYs.
diff --git a/rust/kernel/net.rs b/rust/kernel/net.rs
index b49b052969e5..da988d59b69d 100644
--- a/rust/kernel/net.rs
+++ b/rust/kernel/net.rs
@@ -2,5 +2,5 @@
 
 //! Networking.
 
-#[cfg(CONFIG_PHYLIB)]
+#[cfg(CONFIG_PHYLIB = "y")]
 pub mod phy;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ