Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vendor-reset: init at unstable-2021-02-16 #103816

Merged
merged 1 commit into from
Apr 8, 2021

Conversation

wedens
Copy link

@wedens wedens commented Nov 14, 2020

Motivation for this change

The goal of this project is to provide a kernel module that is capable of resetting hardware devices into a state where they can be re-initialized or passed through into a virtual machine (VFIO). While it would be great to have these in the kernel as PCI quirks, some of the reset procedures are very complex and would never be accepted as a quirk (ie AMD Vega 10).

By providing this as an out of tree kernel module, vendors will be able to easily create pull requests to add functionality to this module, and users will be able to easily update this module without requiring a complete kernel rebuild.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 11-100 labels Nov 14, 2020
@wedens wedens changed the title vendor-reset: init at 2020-11-14 vendor-reset: init at 0.0.17 Nov 15, 2020
@RaghavSood
Copy link
Member

Result of nixpkgs-review pr 103816 1

2 packages marked as broken and skipped:
  • linuxPackages_hardkernel_4_14.vendor-reset
  • linuxPackages_hardkernel_latest.vendor-reset
12 packages failed to build:
  • linuxPackages_4_14.vendor-reset
  • linuxPackages_4_19.vendor-reset
  • linuxPackages_4_4.vendor-reset
  • linuxPackages_4_9.vendor-reset
  • linuxPackages_5_8.vendor-reset
  • linuxPackages_5_9.vendor-reset (linuxPackages_latest.vendor-reset)
  • linuxPackages_latest-libre.vendor-reset
  • linuxPackages_latest_hardened.vendor-reset
  • linuxPackages_latest_xen_dom0.vendor-reset
  • linuxPackages_latest_xen_dom0_hardened.vendor-reset
  • linuxPackages_testing_bcachefs.vendor-reset
  • linuxPackages_zen.vendor-reset
5 packages built:
  • linuxPackages-libre.vendor-reset
  • linuxPackages.vendor-reset (linuxPackages_5_4.vendor-reset)
  • linuxPackages_hardened.vendor-reset
  • linuxPackages_xen_dom0.vendor-reset
  • linuxPackages_xen_dom0_hardened.vendor-reset

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please restrict it to working kernels.

pkgs/os-specific/linux/vendor-reset/default.nix Outdated Show resolved Hide resolved
pkgs/os-specific/linux/vendor-reset/default.nix Outdated Show resolved Hide resolved
@wedens
Copy link
Author

wedens commented Jan 19, 2021

Please restrict it to working kernels.

It's not stated anywhere which kernel versions are supported. I think it should work on any reasonably modern kernel.

@SuperSandro2000
Copy link
Member

It's not stated anywhere which kernel versions are supported. I think it should work on any reasonably modern kernel.

Than restrict the version to exclude the build failures above.

@wedens wedens force-pushed the vendor-reset branch 2 times, most recently from 1e181a9 to c686907 Compare January 31, 2021 05:51
@wedens wedens changed the title vendor-reset: init at 0.0.17 vendor-reset: init at 0.1.0 Jan 31, 2021
@wedens
Copy link
Author

wedens commented Jan 31, 2021

Updated PR to vendor-reset version 0.1.0.

Than restrict the version to exclude the build failures above.

I don't think the failures are related to the vendor-reset itself, as it builds fine for some of the "failing" kernel versions locally, but in 19.09 channel.

Unfortunately, I can't do nixpkgs-review myself, as it pulls a lot of dependencies.

@RaghavSood
Copy link
Member

Result of nixpkgs-review pr 103816 run on x86_64-linux 1

2 packages marked as broken and skipped:
  • linuxPackages_hardkernel_4_14.vendor-reset
  • linuxPackages_hardkernel_latest.vendor-reset
4 packages failed to build:
  • linuxPackages-libre.vendor-reset
  • linuxPackages_4_14.vendor-reset
  • linuxPackages_4_4.vendor-reset
  • linuxPackages_4_9.vendor-reset
13 packages built:
  • linuxPackages.vendor-reset (linuxPackages_5_4.vendor-reset)
  • linuxPackages_4_19.vendor-reset
  • linuxPackages_5_10.vendor-reset (linuxPackages_latest.vendor-reset)
  • linuxPackages_hardened.vendor-reset
  • linuxPackages_latest-libre.vendor-reset
  • linuxPackages_latest_hardened.vendor-reset
  • linuxPackages_latest_xen_dom0.vendor-reset
  • linuxPackages_latest_xen_dom0_hardened.vendor-reset
  • linuxPackages_lqx.vendor-reset
  • linuxPackages_testing_bcachefs.vendor-reset
  • linuxPackages_xen_dom0.vendor-reset
  • linuxPackages_xen_dom0_hardened.vendor-reset
  • linuxPackages_zen.vendor-reset

@RaghavSood
Copy link
Member

builder for '/nix/store/8d22jdnmj2ljzplh867sg0l3zski4a7g-vendor-reset-0.1.0-4.14.217.drv' failed with exit code 2; last 10 log lines:
  /build/source/src/ftrace.c:55:8: error: implicit declaration of function 'within_module' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Werror=implicit-function-declaration8;;]
     55 |   if (!within_module(parent_ip, THIS_MODULE))
        |        ^~~~~~~~~~~~~
  cc1: some warnings being treated as errors
  make[4]: *** [/nix/store/594ghcknkl3m1lgr204zn9sk77rmq68p-linux-4.14.217-dev/lib/modules/4.14.217/source/scripts/Makefile.build:327: /build/source/src/ftrace.o] Error 1
  make[3]: *** [/nix/store/594ghcknkl3m1lgr204zn9sk77rmq68p-linux-4.14.217-dev/lib/modules/4.14.217/source/Makefile:1552: _module_/build/source] Error 2
  make[2]: *** [Makefile:146: sub-make] Error 2
  make[1]: *** [Makefile:24: __sub-make] Error 2
  make[1]: Leaving directory '/nix/store/594ghcknkl3m1lgr204zn9sk77rmq68p-linux-4.14.217-dev/lib/modules/4.14.217/build'
  make: *** [Makefile:8: build] Error 2
builder for '/nix/store/zd6d2q0yyxq8bv553jjm87hlww30w0ys-vendor-reset-0.1.0-4.4.253.drv' failed with exit code 2; last 10 log lines:
  /build/source/src/vendor-reset-dev.c:70:5: note: in expansion of macro 'vr_warn'
     70 |     vr_warn(&vdev, "failed to reset device\n");
        |     ^~~~~~~
  cc1: some warnings being treated as errors
  make[4]: *** [/nix/store/v1fy372b89y54qkn5a6vbdg7905sri41-linux-4.4.253-dev/lib/modules/4.4.253/source/scripts/Makefile.build:278: /build/source/src/vendor-reset-dev.o] Error 1
  make[3]: *** [/nix/store/v1fy372b89y54qkn5a6vbdg7905sri41-linux-4.4.253-dev/lib/modules/4.4.253/source/Makefile:1453: _module_/build/source] Error 2
  make[2]: *** [Makefile:152: sub-make] Error 2
  make[1]: *** [Makefile:24: __sub-make] Error 2
  make[1]: Leaving directory '/nix/store/v1fy372b89y54qkn5a6vbdg7905sri41-linux-4.4.253-dev/lib/modules/4.4.253/build'
  make: *** [Makefile:8: build] Error 2
builder for '/nix/store/np81jdffj8pbsybh3k7v02lqkvgakmwg-vendor-reset-0.1.0-4.9.253.drv' failed with exit code 2; last 10 log lines:
  /build/source/src/ftrace.c:55:8: error: implicit declaration of function 'within_module' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Werror=implicit-function-declaration8;;]
     55 |   if (!within_module(parent_ip, THIS_MODULE))
        |        ^~~~~~~~~~~~~
  cc1: some warnings being treated as errors
  make[4]: *** [/nix/store/xrvsyx3d4sfziy4j4232q5my2ihhq2yv-linux-4.9.253-dev/lib/modules/4.9.253/source/scripts/Makefile.build:305: /build/source/src/ftrace.o] Error 1
  make[3]: *** [/nix/store/xrvsyx3d4sfziy4j4232q5my2ihhq2yv-linux-4.9.253-dev/lib/modules/4.9.253/source/Makefile:1544: _module_/build/source] Error 2
  make[2]: *** [Makefile:152: sub-make] Error 2
  make[1]: *** [Makefile:24: __sub-make] Error 2
  make[1]: Leaving directory '/nix/store/xrvsyx3d4sfziy4j4232q5my2ihhq2yv-linux-4.9.253-dev/lib/modules/4.9.253/build'
  make: *** [Makefile:8: build] Error 2
builder for '/nix/store/ixx2c9xrak9f02i2nwfvzzq4d71p2n4a-linux-config-5.4.93.drv' failed with exit code 1; last 10 log lines:
  applying patch /nix/store/mnlqwys9dxznjcvq4w3s0435s9ql8qv8-bridge-stp-helper.patch
  patching file net/bridge/br_private.h
  Hunk #1 succeeded at 46 (offset 7 lines).
  applying patch /nix/store/mbz5gln1q4swlzmqs2399br98qjif9kn-request-key-helper.patch
  patching file security/keys/request_key.c
  applying patch /nix/store/2lr5rrl7ipi8yf0vw8bacqxv1xaw7gph-rtl8761b-support.patch
  patching file drivers/bluetooth/btrtl.c
  Hunk #1 FAILED at 130.
  Hunk #2 succeeded at 255 (offset 4 lines).
  1 out of 2 hunks FAILED -- saving rejects to file drivers/bluetooth/btrtl.c.rej
cannot build derivation '/nix/store/pfr36kx1ap09smy1d5qh289bcj5zh2ri-linux-5.4.93.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/2ma45i61qpilj72jc3n6css6r92yda22-vendor-reset-0.1.0-5.4.93.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/2s8dzk9bsw9sg8g0k8qz8qq42cbf06a7-env.drv': 4 dependencies couldn't be built
error: --- Error -------------------------------------------------------------------------------------------------- nix
build of '/nix/store/2s8dzk9bsw9sg8g0k8qz8qq42cbf06a7-env.drv' failed

@wedens
Copy link
Author

wedens commented Jan 31, 2021

Thanks! I've restricted it to kernels >= 4.19.

@wedens wedens force-pushed the vendor-reset branch 2 times, most recently from 84eefb8 to 2a62de8 Compare January 31, 2021 07:59
@RaghavSood
Copy link
Member

Result of nixpkgs-review pr 103816 run on x86_64-linux 1

1 package failed to build:
  • linuxPackages-libre.vendor-reset
13 packages built:
  • linuxPackages.vendor-reset (linuxPackages_5_4.vendor-reset)
  • linuxPackages_4_19.vendor-reset
  • linuxPackages_5_10.vendor-reset (linuxPackages_latest.vendor-reset)
  • linuxPackages_hardened.vendor-reset
  • linuxPackages_latest-libre.vendor-reset
  • linuxPackages_latest_hardened.vendor-reset
  • linuxPackages_latest_xen_dom0.vendor-reset
  • linuxPackages_latest_xen_dom0_hardened.vendor-reset
  • linuxPackages_lqx.vendor-reset
  • linuxPackages_testing_bcachefs.vendor-reset
  • linuxPackages_xen_dom0.vendor-reset
  • linuxPackages_xen_dom0_hardened.vendor-reset
  • linuxPackages_zen.vendor-reset

@wedens
Copy link
Author

wedens commented Mar 10, 2021

Rebased and updated to the latest version with a fix for linux 5.11

@wedens wedens changed the title vendor-reset: init at 0.1.0 vendor-reset: init at unstable-2021-02-16 Mar 10, 2021
@SuperSandro2000
Copy link
Member

ping @wedens

@wedens
Copy link
Author

wedens commented Apr 6, 2021

I've added the suggestions.

@elseym
Copy link
Member

elseym commented Apr 7, 2021

hey @wedens, thanks for packaging vendor-reset.

i just ran nixpkgs-review again:

Result of nixpkgs-review pr 103816 run on x86_64-linux 1

7 packages marked as broken and skipped:
  • linuxPackages-libre.vendor-reset
  • linuxPackages_4_14.vendor-reset
  • linuxPackages_4_4.vendor-reset
  • linuxPackages_4_9.vendor-reset
  • linuxPackages_hardkernel_4_14.vendor-reset
  • linuxPackages_hardkernel_latest.vendor-reset
  • linuxPackages_latest-libre.vendor-reset
13 packages built:
  • linuxPackages.vendor-reset (linuxPackages_5_10.vendor-reset)
  • linuxPackages_4_19.vendor-reset
  • linuxPackages_5_11.vendor-reset (linuxPackages_latest.vendor-reset)
  • linuxPackages_5_4.vendor-reset
  • linuxPackages_hardened.vendor-reset
  • linuxPackages_latest_hardened.vendor-reset
  • linuxPackages_latest_xen_dom0.vendor-reset
  • linuxPackages_latest_xen_dom0_hardened.vendor-reset
  • linuxPackages_lqx.vendor-reset
  • linuxPackages_testing_bcachefs.vendor-reset
  • linuxPackages_xen_dom0.vendor-reset
  • linuxPackages_xen_dom0_hardened.vendor-reset
  • linuxPackages_zen.vendor-reset

does this resolve the change-request, @SuperSandro2000?

@SuperSandro2000 SuperSandro2000 merged commit 61b8c50 into NixOS:master Apr 8, 2021
@wedens wedens deleted the vendor-reset branch April 17, 2021 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 11-100
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants