This also seems to work on a Pentium J4205. Each device now has its own iommu group but I have not tested yet if everything works and is stable.
Since the instructions above were a little unclear to me, I had to jump through some hoops to get building the kernel to work. Here's how I did it:
I'm doing this on a fresh
Proxmox 7.3-1 install with the
5.15.74-1-pve kernel from the November 22, 2022 iso image.
Before starting, make sure you have at least
35gb free disk space.
Since I had no space left on any of my other drives, I had to increase the pve/root partition, which was automatically created during installation and had a size of ca. 30gb. I did it with
this guide, which deletes
local-lvm (dev/pve/data)
and extends
local (dev/pve/root)
. I wouldn't do this on an existing install, since it deletes your container/vm volumes.
I'm building the kernel based on the instruction of the
pve-common readme which the
developer wiki page links to.
(everything done as root)
Bash:
# prepare repositories
mv /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak
echo "deb http://download.proxmox.com/debian bullseye pvetest" > /etc/apt/sources.list.d/pve-development.list
apt-get update && apt-get upgrade
# install build packages
apt-get install build-essential git git-email debhelper pve-doc-generator devscripts
# download source
mkdir /root/proxmox && cd /root/proxmox
# for 6.x kernel
# git clone git://git.proxmox.com/git/pve-kernel.git
# for 5.15.x kernel
git clone --branch pve-kernel-5.15 git://git.proxmox.com/git/pve-kernel.git
# install dependencies
cd pve-kernel/ && mk-build-deps --install debian/control.in
Now edit
/root/proxmox/pve-kernel/patches/kernel/0003-pci-Enable-overrides-for-missing-ACS-capabilities-4..patch
like described above from:
Git:
...
+ /* Never override ACS for legacy devices or devices with ACS caps */
+ if (!pci_is_pcie(dev) ||
+ pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS))
+ return -ENOTTY;
+
+ for (i = 0; i < max_acs_id; i++)
...
to:
Git:
...
+ /* Never override ACS for legacy devices or devices with ACS caps */
+ if (!pci_is_pcie(dev)
+ )
+ return -ENOTTY;
+
+ for (i = 0; i < max_acs_id; i++)
...
Then just install one last dependency and start the build:
Note: I noticed some warnings during my build.
Code:
...
Makefile.config:595: No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev
Makefile.config:643: No libunwind found. Please install libunwind-dev[el] >=1.1 and/or set LIBUNWIND_DIR
Makefile.config:808: Missing perl devel files. Disabling perl scripring support, please install perl-ExtUtils-Embed/libperl-dev
Makefile.config:891: Old version of libbfd/binutils things like PE executable profiling will not be available
Makefile.config:955: No libzstd found, disables trace compression, please install libzstd-dev[el] and/or set LIBZSTD_DIR
Makefile.config:966: No libcap found, disables capability support, please install libcap-devel/libcap-dev
Makefile.config:1034: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
Makefile.config:1060: No alternatives command found, you need to set JDIR= to point to the root of your Java directory
...
You might want to install those, however it also finishes without them. This was my first time building a kernel. I don't know enough about that.
Edit: These seem to be regarding
perf
. To get rid of them, you need to install some additional packages, see below:
Bash:
# build will stop if this is not installed, it won't find python3-config
apt-get install python3-dev
# optional: install to get rid of Perf warnings
apt-get install systemtap-sdt-dev libunwind-dev libperl-dev libzstd-dev libcap-dev libbabeltrace-dev binutils-dev
# start the building
make
Depending on your system, this might take a few minutes to a few hours (on the J4205 it takes about 3-4 hours).
After that has finished, install the packages that you just built, enable the kernel for boot, edit grub and update grub.
Bash:
cd /root/proxmox/pve-kernel
dpkg -i *.deb
# edit to your built kernel version
update-initramfs -c -k 5.15.83-1-pve
Then, in
/etc/default/grub
edit the line
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
to
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on pcie_acs_override=downstream"
.
Lastly, do
update-grub
and
reboot now
.
To then check the iommu groups and which devices are in them, run
for d in /sys/kernel/iommu_groups/*/devices/*; do n=${d#*/iommu_groups/*}; n=${n%%/*}; printf 'IOMMU Group %s ' "$n"; lspci -nns "${d##*/}"; done
, which should output something like this:
Code:
IOMMU Group 0 00:00.0 Host bridge [0600]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Host Bridge [8086:5af0] (rev 0b)
IOMMU Group 1 00:02.0 VGA compatible controller [0300]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Graphics Controller [8086:5a84] (rev 0b)
IOMMU Group 2 00:0e.0 Audio device [0403]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster [8086:5a98] (rev 0b)
IOMMU Group 3 00:0f.0 Communication controller [0780]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Trusted Execution Engine [8086:5a9a] (rev 0b)
IOMMU Group 4 00:12.0 SATA controller [0106]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SATA AHCI Controller [8086:5ae3] (rev 0b)
IOMMU Group 5 00:13.0 PCI bridge [0604]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #1 [8086:5ad8] (rev fb)
IOMMU Group 6 00:13.3 PCI bridge [0604]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #4 [8086:5adb] (rev fb)
IOMMU Group 7 00:15.0 USB controller [0c03]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series USB xHCI [8086:5aa8] (rev 0b)
IOMMU Group 8 00:1f.0 ISA bridge [0601]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Low Pin Count Interface [8086:5ae8] (rev 0b)
IOMMU Group 8 00:1f.1 SMBus [0c05]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SMBus Controller [8086:5ad4] (rev 0b)
IOMMU Group 9 02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)
That's it.