Compare commits
119 Commits
master
...
pve-kernel
Author | SHA1 | Date | |
---|---|---|---|
|
3d4f3c6a24 | ||
|
1a0a722a6b | ||
|
fa0c83e432 | ||
|
4514dcd67d | ||
|
45b7fc9080 | ||
|
2c824a5e7e | ||
|
272659029d | ||
|
e2963e6cc7 | ||
|
1fd221805f | ||
|
c588c66897 | ||
|
dcb887c2c5 | ||
|
d7de6e6e73 | ||
|
a8bae8aa72 | ||
|
71041494f8 | ||
|
9f1d723ebd | ||
|
2052f312a5 | ||
|
1c369eca63 | ||
|
9efb073fd8 | ||
|
37677d8bb5 | ||
|
680c0ca559 | ||
|
a73877a5f9 | ||
|
5754e79c6c | ||
|
fb7fef1095 | ||
|
501d739518 | ||
|
5979e3a827 | ||
|
dcbc11ff68 | ||
|
a75b088f66 | ||
|
dec49aeaec | ||
|
9926a46d5e | ||
|
262409de1f | ||
|
de08dee85b | ||
|
68cfd2a11c | ||
|
689d5e3eb2 | ||
|
65409d8b4f | ||
|
e08cd8b881 | ||
|
7552e7acfe | ||
|
3bf225e636 | ||
|
8c992dd41c | ||
|
067446a439 | ||
|
c70fc5f9bb | ||
|
0c37b18017 | ||
|
06844ff615 | ||
|
0f9bca9cf7 | ||
|
90bee66e85 | ||
|
237da8e53e | ||
|
2914b5a244 | ||
|
873b9ad148 | ||
|
7af7a135d4 | ||
|
46f53dd76c | ||
|
6f85177a4f | ||
|
97585a6faf | ||
|
3ac9042330 | ||
|
8f874b75fb | ||
|
5134a37d2f | ||
|
601f4bbffd | ||
|
3a41693627 | ||
|
9f9078be64 | ||
|
22f515872d | ||
|
91ea919ee0 | ||
|
af277c0560 | ||
|
061182c7ed | ||
|
ae4a75cb51 | ||
|
a0620f611a | ||
|
3fd27e5117 | ||
|
19b148a675 | ||
|
4ffe95f116 | ||
|
6f9c016305 | ||
|
cac56ffc02 | ||
|
3d06789d88 | ||
|
8b70203497 | ||
|
0b45be4e3b | ||
|
ea78e7fd12 | ||
|
548f585b45 | ||
|
767a61c034 | ||
|
31b8a08725 | ||
|
58523253dd | ||
|
c1caadf9e8 | ||
|
9beed8f7a5 | ||
|
7330912018 | ||
|
d87c01a486 | ||
|
ed663201d5 | ||
|
f40c4306ce | ||
|
3917b25d81 | ||
|
4ca240afd7 | ||
|
b77e6230c9 | ||
|
f20a494e2f | ||
|
c7b4bf7ee3 | ||
|
870570ed57 | ||
|
b6923c3e69 | ||
|
2fdc4b1945 | ||
|
96806b77db | ||
|
b4d245a339 | ||
|
6ae4f00696 | ||
|
31a56fc647 | ||
|
84439439ae | ||
|
a1ea671261 | ||
|
d0141aeccb | ||
|
7a2d40e00e | ||
|
bc7e7ceec6 | ||
|
87dbf2e0af | ||
|
90d69926e3 | ||
|
e80508c506 | ||
|
3cf1727216 | ||
|
1de3bb1f40 | ||
|
81e07e4618 | ||
|
561d6d8499 | ||
|
671ee57b9d | ||
|
7d86cd88c7 | ||
|
3da8ec8523 | ||
|
95d22b9bec | ||
|
f324af0a73 | ||
|
d893aeed50 | ||
|
04ce24a7b8 | ||
|
58ca301430 | ||
|
9f481060ed | ||
|
baec1f8715 | ||
|
8c702bb389 | ||
|
92d3915d3b | ||
|
9b4c3df463 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,2 @@
|
||||
ubuntu-zesty
|
||||
*.prepared
|
||||
.*/
|
||||
|
8
.gitmodules
vendored
8
.gitmodules
vendored
@ -1,6 +1,6 @@
|
||||
[submodule "submodules/ubuntu-kernel"]
|
||||
path = submodules/ubuntu-kernel
|
||||
url = https://dev.lirent.ru/c/mirror_ubuntu-kernels.git
|
||||
[submodule "submodules/zfsonlinux"]
|
||||
path = submodules/zfsonlinux
|
||||
url = https://dev.lirent.ru/c/zfsonlinux.git
|
||||
url = ../zfsonlinux
|
||||
[submodule "submodules/ubuntu-kernel"]
|
||||
path = submodules/ubuntu-kernel
|
||||
url = ../mirror_ubuntu-kernels
|
||||
|
65
Makefile
65
Makefile
@ -1,20 +1,22 @@
|
||||
include /usr/share/dpkg/pkg-info.mk
|
||||
|
||||
# also bump proxmox-kernel-meta if the default MAJ.MIN version changes!
|
||||
KERNEL_MAJ=6
|
||||
KERNEL_MIN=8
|
||||
KERNEL_PATCHLEVEL=8
|
||||
# increment KREL for every published package release!
|
||||
# also bump pve-kernel-meta if either of MAJ.MIN, PATCHLEVEL or KREL change
|
||||
KERNEL_MAJ=5
|
||||
KERNEL_MIN=15
|
||||
KERNEL_PATCHLEVEL=158
|
||||
# increment KREL if the ABI changes (abicheck target in debian/rules)
|
||||
# rebuild packages with new KREL and run 'make abiupdate'
|
||||
KREL=2
|
||||
KREL=1
|
||||
|
||||
PKGREL=1
|
||||
|
||||
KERNEL_MAJMIN=$(KERNEL_MAJ).$(KERNEL_MIN)
|
||||
KERNEL_VER=$(KERNEL_MAJMIN).$(KERNEL_PATCHLEVEL)
|
||||
|
||||
EXTRAVERSION=-$(KREL)-pve
|
||||
KVNAME=$(KERNEL_VER)$(EXTRAVERSION)
|
||||
PACKAGE=proxmox-kernel-$(KVNAME)
|
||||
HDRPACKAGE=proxmox-headers-$(KVNAME)
|
||||
PACKAGE=pve-kernel-$(KVNAME)
|
||||
HDRPACKAGE=pve-headers-$(KVNAME)
|
||||
|
||||
ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
||||
|
||||
@ -25,9 +27,11 @@ ifneq ($(ARCH), amd64)
|
||||
KERNEL_ARCH=$(ARCH)
|
||||
endif
|
||||
|
||||
GITVERSION:=$(shell git rev-parse HEAD)
|
||||
|
||||
SKIPABI=0
|
||||
|
||||
BUILD_DIR=proxmox-kernel-$(KERNEL_VER)
|
||||
BUILD_DIR=pve-kernel-$(KERNEL_VER)
|
||||
|
||||
KERNEL_SRC=ubuntu-kernel
|
||||
KERNEL_SRC_SUBMODULE=submodules/$(KERNEL_SRC)
|
||||
@ -42,34 +46,30 @@ MODULE_DIRS=$(ZFSDIR)
|
||||
# exported to debian/rules via debian/rules.d/dirs.mk
|
||||
DIRS=KERNEL_SRC ZFSDIR MODULES
|
||||
|
||||
DSC=proxmox-kernel-$(KERNEL_MAJMIN)_$(KERNEL_VER)-$(KREL).dsc
|
||||
DST_DEB=$(PACKAGE)_$(KERNEL_VER)-$(KREL)_$(ARCH).deb
|
||||
SIGNED_TEMPLATE_DEB=$(PACKAGE)-signed-template_$(KERNEL_VER)-$(KREL)_$(ARCH).deb
|
||||
META_DEB=proxmox-kernel-$(KERNEL_MAJMIN)_$(KERNEL_VER)-$(KREL)_all.deb
|
||||
HDR_DEB=$(HDRPACKAGE)_$(KERNEL_VER)-$(KREL)_$(ARCH).deb
|
||||
META_HDR_DEB=proxmox-headers-$(KERNEL_MAJMIN)_$(KERNEL_VER)-$(KREL)_all.deb
|
||||
USR_HDR_DEB=proxmox-kernel-libc-dev_$(KERNEL_VER)-$(KREL)_$(ARCH).deb
|
||||
LINUX_TOOLS_DEB=linux-tools-$(KERNEL_MAJMIN)_$(KERNEL_VER)-$(KREL)_$(ARCH).deb
|
||||
LINUX_TOOLS_DBG_DEB=linux-tools-$(KERNEL_MAJMIN)-dbgsym_$(KERNEL_VER)-$(KREL)_$(ARCH).deb
|
||||
DSC=pve-kernel_$(KERNEL_VER)-$(PKGREL).dsc
|
||||
DST_DEB=$(PACKAGE)_$(KERNEL_VER)-$(PKGREL)_$(ARCH).deb
|
||||
HDR_DEB=$(HDRPACKAGE)_$(KERNEL_VER)-$(PKGREL)_$(ARCH).deb
|
||||
USR_HDR_DEB=pve-kernel-libc-dev_$(KERNEL_VER)-$(PKGREL)_$(ARCH).deb
|
||||
LINUX_TOOLS_DEB=linux-tools-$(KERNEL_MAJMIN)_$(KERNEL_VER)-$(PKGREL)_$(ARCH).deb
|
||||
LINUX_TOOLS_DBG_DEB=linux-tools-$(KERNEL_MAJMIN)-dbgsym_$(KERNEL_VER)-$(PKGREL)_$(ARCH).deb
|
||||
|
||||
DEBS=$(DST_DEB) $(META_DEB) $(HDR_DEB) $(META_HDR_DEB) $(LINUX_TOOLS_DEB) $(LINUX_TOOLS_DBG_DEB) $(SIGNED_TEMPLATE_DEB) # $(USR_HDR_DEB)
|
||||
DEBS=$(DST_DEB) $(HDR_DEB) $(USR_HDR_DEB) $(LINUX_TOOLS_DEB) $(LINUX_TOOLS_DBG_DEB)
|
||||
UPLOAD_DEBS=$(DST_DEB) $(HDR_DEB) $(LINUX_TOOLS_DEB) $(LINUX_TOOLS_DBG_DEB)
|
||||
|
||||
all: deb
|
||||
deb: $(DEBS)
|
||||
|
||||
$(META_DEB) $(META_HDR_DEB) $(LINUX_TOOLS_DEB) $(HDR_DEB): $(DST_DEB)
|
||||
$(LINUX_TOOLS_DEB) $(HDR_DEB) $(USR_HDR_DEB) $(LINUX_TOOLS_DBG_DEB): $(DST_DEB)
|
||||
$(DST_DEB): $(BUILD_DIR).prepared
|
||||
cd $(BUILD_DIR); dpkg-buildpackage --jobs=auto -b -uc -us
|
||||
lintian $(DST_DEB)
|
||||
#lintian $(HDR_DEB)
|
||||
lintian $(LINUX_TOOLS_DEB)
|
||||
|
||||
dsc:
|
||||
$(MAKE) $(DSC)
|
||||
lintian $(DSC)
|
||||
|
||||
dsc: $(DSC)
|
||||
$(DSC): $(BUILD_DIR).prepared
|
||||
cd $(BUILD_DIR); dpkg-buildpackage -S -uc -us -d
|
||||
lintian $(DSC)
|
||||
|
||||
sbuild: $(DSC)
|
||||
sbuild $(DSC)
|
||||
@ -80,18 +80,11 @@ $(BUILD_DIR).prepared: $(addsuffix .prepared,$(KERNEL_SRC) $(MODULES) debian)
|
||||
cp -a abi-blacklist $(BUILD_DIR)/
|
||||
touch $@
|
||||
|
||||
.PHONY: build-dir-fresh
|
||||
build-dir-fresh:
|
||||
$(MAKE) clean
|
||||
$(MAKE) $(BUILD_DIR).prepared
|
||||
echo "created build-directory: $(BUILD_DIR).prepared/"
|
||||
|
||||
debian.prepared: debian
|
||||
rm -rf $(BUILD_DIR)/debian
|
||||
mkdir -p $(BUILD_DIR)
|
||||
cp -a debian $(BUILD_DIR)/debian
|
||||
echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout $(shell git rev-parse HEAD)" \
|
||||
>$(BUILD_DIR)/debian/SOURCE
|
||||
echo "git clone git://git.proxmox.com/git/pve-kernel.git\\ngit checkout $(GITVERSION)" > $(BUILD_DIR)/debian/SOURCE
|
||||
@$(foreach dir, $(DIRS),echo "$(dir)=$($(dir))" >> $(BUILD_DIR)/debian/rules.d/env.mk;)
|
||||
echo "KVNAME=$(KVNAME)" >> $(BUILD_DIR)/debian/rules.d/env.mk
|
||||
echo "KERNEL_MAJMIN=$(KERNEL_MAJMIN)" >> $(BUILD_DIR)/debian/rules.d/env.mk
|
||||
@ -127,8 +120,8 @@ $(ZFSDIR).prepared: $(ZFSONLINUX_SUBMODULE)
|
||||
|
||||
.PHONY: upload
|
||||
upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
|
||||
upload: $(DEBS)
|
||||
tar cf - $(DEBS)|ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg,pbs --dist $(UPLOAD_DIST) --arch $(ARCH)
|
||||
upload: $(UPLOAD_DEBS)
|
||||
tar cf - $(UPLOAD_DEBS)|ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg,pbs --dist $(UPLOAD_DIST) --arch $(ARCH)
|
||||
|
||||
.PHONY: distclean
|
||||
distclean: clean
|
||||
@ -167,5 +160,5 @@ abi-tmp-$(KVNAME):
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf *~ proxmox-kernel-[0-9]*/ *.prepared $(KERNEL_CFG_ORG)
|
||||
rm -f *.deb *.dsc *.changes *.buildinfo *.build proxmox-kernel*.tar.*
|
||||
rm -rf *~ pve-kernel-[0-9]*/ *.prepared $(KERNEL_CFG_ORG)
|
||||
rm -f *.deb *.dsc *.changes *.buildinfo *.build pve-kernel*.tar.*
|
||||
|
97
README
97
README
@ -1,9 +1,9 @@
|
||||
KERNEL SOURCE:
|
||||
==============
|
||||
|
||||
We currently use the Ubuntu kernel sources, available from our mirror:
|
||||
We currently use the Ubuntu kernel sources, available from:
|
||||
|
||||
https://git.proxmox.com/?p=mirror_ubuntu-kernels.git;a=summary
|
||||
http://kernel.ubuntu.com/git/ubuntu/ubuntu-jammy.git/
|
||||
|
||||
Ubuntu will maintain those kernels till:
|
||||
|
||||
@ -24,67 +24,6 @@ Additional/Updated Modules:
|
||||
For licensing questions, see: http://open-zfs.org/wiki/Talk:FAQ
|
||||
|
||||
|
||||
BUILD
|
||||
=====
|
||||
|
||||
As this is packaging for the Linux kernel with some extra integrations, like
|
||||
ZFS, this repo cannot be handled like a plain Linux kernel git repository.
|
||||
|
||||
The actual Linux kernel source lives in a git submodule.
|
||||
|
||||
For a build you should init the submodules and then handle it like most our
|
||||
Debian packaging builds. If unsure you can follow this:
|
||||
|
||||
Installing Build-Dependencies
|
||||
-----------------------------
|
||||
|
||||
You can either just check the package metadata template `debian/control.in`
|
||||
and install the packages listed in the `Build-Depends` section manually
|
||||
(replace `debhelper-compat` with just `debhelper`) or use a more automated way
|
||||
described below:
|
||||
|
||||
# install base build-dependencies and helpers
|
||||
apt update
|
||||
apt install devscripts
|
||||
|
||||
# create build-directory so that we got final packaging control files from the
|
||||
# .in templates generated
|
||||
make build-dir-fresh
|
||||
|
||||
# install build-dependencies (replace BUILD-DIR with actual one)
|
||||
mk-build-deps -ir BUILD-DIR/debian/control
|
||||
|
||||
|
||||
Package Build
|
||||
-------------
|
||||
|
||||
# start the actual build
|
||||
make deb
|
||||
|
||||
For simple KConfig modifications you can adapt the list in `debian/rules` file.
|
||||
For quick code changes to the actual kernel code you can do them directly in
|
||||
the submodule/ubuntu-kernels directory, then re-create the build-directory, e.g.:
|
||||
|
||||
make clean
|
||||
# now build again, explicitly creating the build-dir isn't required anymore
|
||||
# after one has the build-dependencies already installed.
|
||||
make deb
|
||||
|
||||
|
||||
Modify-Build-Test Cycles
|
||||
------------------------
|
||||
|
||||
Ideally you avoid the need for doing a full package build and just directly
|
||||
build linux from the ubuntu-kernels or the mainline (stable) repo with copying
|
||||
over a build-config of a proxmox-kernel to that as .config and then using the
|
||||
`make olddefconfig` target.
|
||||
|
||||
If you need full package builds you can try to make changes inside the
|
||||
BUILD-DIR directly and then continue build from there, e.g., using
|
||||
`dpkg-buildpackage -b -uc -us --no-pre-clean`. Depending on what stage you want
|
||||
to continue build you might need to touch, or remove some *.prepared files.
|
||||
Just check `debian/rules` for how kernel build progress is tracked by make.
|
||||
|
||||
SUBMODULE
|
||||
=========
|
||||
|
||||
@ -96,7 +35,7 @@ get applied with the `patch` tool. From a git point-of-view, the copied
|
||||
directory remains clean even with extra patches applied since it does not
|
||||
contain a .git directory, but a reference to the (still pristine) submodule:
|
||||
|
||||
$ cat build/ubuntu-kernel/.git
|
||||
$ cat build/ubuntu-jammy/.git
|
||||
|
||||
If you mistakenly cloned the upstream repo as "normal" clone (not via the
|
||||
submodule mechanics) this means that you have a real .git directory with its
|
||||
@ -121,30 +60,18 @@ top level meta package, depends on current default kernel series meta package.
|
||||
|
||||
git clone git://git.proxmox.com/git/proxmox-ve.git
|
||||
|
||||
proxmox-default-kernel
|
||||
----------------------
|
||||
pve-kernel-meta
|
||||
---------------
|
||||
|
||||
Depends on default kernel and header meta package, e.g., proxmox-kernel-6.2 /
|
||||
proxmox-headers-6.2.
|
||||
depends on latest kernel and header package within a certain kernel series,
|
||||
e.g., pve-kernel-5.15 / pve-headers-5.15
|
||||
|
||||
git clone git://git.proxmox.com/git/pve-kernel-meta.git
|
||||
|
||||
proxmox-kernel-X.Y
|
||||
------------------
|
||||
|
||||
Depends on the latest kernel (or header, in case of proxmox-headers-X.Y)
|
||||
package within a certain series.
|
||||
|
||||
e.g., proxmox-kernel-6.2 depends on proxmox-kernel-6.2.16-6-pve
|
||||
|
||||
NOTE: Since Proxmox VE 8, based on Debian 12 Bookworm, the kernel ABI is bumped
|
||||
with every version bump due to module signing. Since then the meta package was
|
||||
pulled into the kernel repo, before that it lived in pve-kernel-meta.git.
|
||||
|
||||
pve-firmware
|
||||
------------
|
||||
|
||||
Contains the firmware for all released PVE kernels.
|
||||
contains the firmware for all released PVE kernels.
|
||||
|
||||
git clone git://git.proxmox.com/git/pve-firmware.git
|
||||
|
||||
@ -172,18 +99,18 @@ Watchdog blacklist
|
||||
|
||||
By default, all watchdog modules are black-listed because it is totally undefined
|
||||
which device is actually used for /dev/watchdog.
|
||||
We ship this list in /lib/modprobe.d/blacklist_proxmox-kernel-<VERSION>.conf
|
||||
We ship this list in /lib/modprobe.d/blacklist_pve-kernel-<VERSION>.conf
|
||||
The user typically edit /etc/modules to enable a specific watchdog device.
|
||||
|
||||
Debug kernel and modules
|
||||
------------------------
|
||||
|
||||
In order to build a -dbgsym package containing an unstripped copy of the kernel
|
||||
image and modules, enable the 'pkg.proxmox-kernel.debug' build profile (e.g. by
|
||||
exporting DEB_BUILD_PROFILES='pkg.proxmox-kernel.debug'). The resulting package can
|
||||
image and modules, enable the 'pkg.pve-kernel.debug' build profile (e.g. by
|
||||
exporting DEB_BUILD_PROFILES='pkg.pve-kernel.debug'). The resulting package can
|
||||
be used together with 'crash'/'kdump-tools' to debug kernel crashes.
|
||||
|
||||
Note: the -dbgsym package is only valid for the proxmox-kernel packages produced by
|
||||
Note: the -dbgsym package is only valid for the pve-kernel packages produced by
|
||||
the same build. A kernel/module from a different build will likely not match,
|
||||
even if both builds are of the same kernel and package version.
|
||||
|
||||
|
26350
abi-prev-5.15.158-1-pve
Normal file
26350
abi-prev-5.15.158-1-pve
Normal file
File diff suppressed because it is too large
Load Diff
28965
abi-prev-6.8.8-2-pve
28965
abi-prev-6.8.8-2-pve
File diff suppressed because it is too large
Load Diff
37
debian/certs/proxmox-uefi-ca.pem
vendored
37
debian/certs/proxmox-uefi-ca.pem
vendored
@ -1,37 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIGbjCCBFagAwIBAgIUTVo8veNlt0qzt14J+H2mhEB2SNUwDQYJKoZIhvcNAQEL
|
||||
BQAwgZMxCzAJBgNVBAYTAkFUMQ8wDQYDVQQIDAZWaWVubmExDzANBgNVBAcMBlZp
|
||||
ZW5uYTEmMCQGA1UECgwdUHJveG1veCBTZXJ2ZXIgU29sdXRpb25zIEdtYkgxFzAV
|
||||
BgNVBAMMDlNlY3VyZSBCb290IENBMSEwHwYJKoZIhvcNAQkBFhJvZmZpY2VAcHJv
|
||||
eG1veC5jb20wHhcNMjMwMzA2MTM1MTM0WhcNMzMwMzAzMTM1MTM0WjCBkzELMAkG
|
||||
A1UEBhMCQVQxDzANBgNVBAgMBlZpZW5uYTEPMA0GA1UEBwwGVmllbm5hMSYwJAYD
|
||||
VQQKDB1Qcm94bW94IFNlcnZlciBTb2x1dGlvbnMgR21iSDEXMBUGA1UEAwwOU2Vj
|
||||
dXJlIEJvb3QgQ0ExITAfBgkqhkiG9w0BCQEWEm9mZmljZUBwcm94bW94LmNvbTCC
|
||||
AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJ59mP8gRLqsA6P53ejy0wMk
|
||||
0qLlICtDkPXsJoi4QRHjlPErxXv5zsZ4WqSG2bQ8EW95FAf8EOF6ge+G17neYt1w
|
||||
DmlvHzLBfqTJj5EBRgVjdWOjX3AkS/elOyzHdq4rKOteUSpQlMP4ub2cAUdy/8rp
|
||||
ouTbduttNv8mymAO89/kbXCEmKFiRS+av+hykFFyXH/KTRa2QnvLVadMEkmtA+vm
|
||||
+yQhYWCTD8hdisa1o3dKM0Z2l8LyzfIOsVXcwHHB7AhtR4tbLR9Tz2p/m9Gz//vj
|
||||
82dBaChh6kxIMZ8kACP28dA561R2P6ZcjzLSJ0Tq5e4tiW9SNEzuTYKTRvFeQoQh
|
||||
4usDdSF3ifXDuimShpv8Yaf4fntyIaUfnm6H5tvNr9b9Rw6ZL200LV5VugQ1EpfE
|
||||
F0+c3LQfurwT7svISgXSY62Fe/TiHFANOVXM5j3/Dr2ktKyce7BUGN4ewpWPvP99
|
||||
io+rdd4bTReuDh8j0nhsSdYKfvuOmvQpgL8Smzno54/hdpuO6cv+slCr1ApDexl8
|
||||
gAPPwCZRsH7aPc92g+YPzDm3k77RqkCXPA19KKQLYKvL7a+H3rnqgO81CdGFPHOz
|
||||
I5UruKLLeDGAWR0bo0JqDMEL8/oPh9IvGo8lFcTros0NEof6A7p8SGmxM2NodTo9
|
||||
spDVs84xDPlp4yX4u8A9AgMBAAGjgbcwgbQwDwYDVR0TAQH/BAUwAwEB/zAOBgNV
|
||||
HQ8BAf8EBAMCAYYwEwYDVR0lBAwwCgYIKwYBBQUHAwMwHQYDVR0OBBYEFLXxsR5I
|
||||
LbWGkynLl1qjUgX4cs16MB8GA1UdIwQYMBaAFLXxsR5ILbWGkynLl1qjUgX4cs16
|
||||
MB0GA1UdEQQWMBSBEm9mZmljZUBwcm94bW94LmNvbTAdBgNVHRIEFjAUgRJvZmZp
|
||||
Y2VAcHJveG1veC5jb20wDQYJKoZIhvcNAQELBQADggIBAAUGWTt792ibVtE9yKgq
|
||||
9YtmybKGWjDHdMKl5AcnxLD60z7cEgcUBpEXaUbTzic5rz7fYhUM29LZkF8NIA2a
|
||||
rzrF0w+J1zZZKG2VvTWmdgynNNKQ/iTRbhgSZ94hEWOwumlEW4O6HwUN+VYFx8wf
|
||||
jvyWc1K6cdCc70IeC5POjYTlXKPoDq8ysPMLhxm7dsk7DDWcR0siMbYqGLLK5cJB
|
||||
lZE+9Q3Nj/q4m3odjK1ILrDGKqWWJgxopE21e903Ej+TNw+TduXygHqwVloEXUi4
|
||||
clmMMwCfhEBI9Vuy0+QSLxvrHKbwYpWd59RBQEsUubi8sT8Oh7njgmEd/Pf9uD7U
|
||||
1Rd9I+1MkNOZXyoyvaJQl9NZ9RpyG+ZbeQoFcL2CeCy0jJQQSilI5k4RtiDrGn6R
|
||||
GxlRL/FTvGWBkQGNwvoeFwD6i7zYainf1Z7f1Dh83MxKarxpAwX61K+rHpvAvjN/
|
||||
Hd4dslj5C+p188FnGaqiFlFAgVcF//F+yZFGYu1sTIQJ5f0C3LiFLeQYi3SPTf0L
|
||||
wk78eHgo6x1cIOM3/Ct4mflHBxnrfOJ9YdEAn2MklpDT5dif+9+zpN1myCQn4HoW
|
||||
OgoWIacSuvuFczHTQf2IX4ZEEE5SZwE31f7E0cqjgXmwbz1a81UMZHzvr71rDeWi
|
||||
oRgE3Pe1htzpOmw5Ygvjtn8k
|
||||
-----END CERTIFICATE-----
|
37
debian/certs/proxmox-uefi-signer-2023.pem
vendored
37
debian/certs/proxmox-uefi-signer-2023.pem
vendored
@ -1,37 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIGbzCCBFegAwIBAgIUakjebPHbd0vTEj9dEa3OF+gioGMwDQYJKoZIhvcNAQEL
|
||||
BQAwgZMxCzAJBgNVBAYTAkFUMQ8wDQYDVQQIDAZWaWVubmExDzANBgNVBAcMBlZp
|
||||
ZW5uYTEmMCQGA1UECgwdUHJveG1veCBTZXJ2ZXIgU29sdXRpb25zIEdtYkgxFzAV
|
||||
BgNVBAMMDlNlY3VyZSBCb290IENBMSEwHwYJKoZIhvcNAQkBFhJvZmZpY2VAcHJv
|
||||
eG1veC5jb20wHhcNMjMwMzA2MTQwNTI1WhcNMjcwNDE0MTQwNTI1WjCBmjELMAkG
|
||||
A1UEBhMCQVQxDzANBgNVBAgMBlZpZW5uYTEPMA0GA1UEBwwGVmllbm5hMSYwJAYD
|
||||
VQQKDB1Qcm94bW94IFNlcnZlciBTb2x1dGlvbnMgR21iSDEeMBwGA1UEAwwVU2Vj
|
||||
dXJlIEJvb3QgU2lnbiAyMDIzMSEwHwYJKoZIhvcNAQkBFhJvZmZpY2VAcHJveG1v
|
||||
eC5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJGReH5i3aihb/
|
||||
frdbzzNueHBt7DC9W2/GXYf0wfl8izCXz2SYM/UIZavbpzF2uhgxli3Dj4M0FyR2
|
||||
oTKRseWyy+YMiwuhQcqCw0KRS6uOUiGjOtPHsEqDFO6DP8d1gNjYkF0jzY/CNf0N
|
||||
5Sc+w8jknQJgZ9G1RGcC2ihZATx2pgG9nYA30Op8qHyhcF2KrUmh8wpXky21u0Ja
|
||||
0/whsNFNSfQrvosgUroxLd2TvBdcBJu3SXt0B15jfY4Qssjmwgfs/oU8YGaAYnIp
|
||||
PLJRqzho/kpDA3PH2lsgxv5BJHQgDuODLj3Q3dx09C71Qdb3FlQ6z9hIdFUoPrvC
|
||||
kUpZ5lEwGUyvFZtJJQvGm/1BpDj1G7P8lqODyfkJ4c77XoH7M9z945HmxrfAyjP7
|
||||
9Jk8NXA9bSy+ygPHPHlTLEc10HKvk/SRg/sGGUveTr9C6rObfP8EmvXogpS46xSn
|
||||
W9s2vFSVFyOBvLpdIhU91McBFinvQaqY0r2XTNrsU3Zp5YG3z6hh6BOLCpD/pixc
|
||||
BQyfT8wGeI59dobVSSrWqt+1vNxO02I5t7Mlam687Ix1e3C/nk7+i44WMcmB8n+x
|
||||
Dq/v/L+UJlQ75u2dsaAiYUrGcsHQWAZ34oIAfec9qCgG+OLTwobwXXiOlaWiO51n
|
||||
0xCQ4ePK+vZuDxRHaXL7hOxFCe3iKwIDAQABo4GxMIGuMB0GA1UdDgQWBBRr/2t+
|
||||
Hu0KTVTbNhd31p7aJH15IjAfBgNVHSMEGDAWgBS18bEeSC21hpMpy5dao1IF+HLN
|
||||
ejAdBgNVHREEFjAUgRJvZmZpY2VAcHJveG1veC5jb20wHQYDVR0SBBYwFIESb2Zm
|
||||
aWNlQHByb3htb3guY29tMAwGA1UdEwEB/wQCMAAwEwYDVR0lBAwwCgYIKwYBBQUH
|
||||
AwMwCwYDVR0PBAQDAgbAMA0GCSqGSIb3DQEBCwUAA4ICAQBYmLgWPJSK/pP/CkZE
|
||||
iYttW1Vd0Wm4DeZVSyUh2c9AI+A+IT5otEXjCflU8sYU4vm0eEtNwhmGdVf8oZe4
|
||||
tS/2eFawDAqEQ8xMsinbMJoqvcYx9uEZPiOOo3GS2YjfUy03Q3BAOV3rMFOjP4y+
|
||||
dfYF3IWnKQxvUV0wapRyDbT62plKt4UCtBagUPcm838YRD6ax+4yK/5sojMQM1IW
|
||||
2yGgEz8jeCyPI19Ots2RBZTJU2BZ1QqRPLybvLfsENtKgKqOE14BEp6WqtYBaj89
|
||||
QZD4tbP9Mqcmnj8AfG89pb1Fj6tq0MLZsboF6i0J7uuQ6CKkb5ksQhLODLMwAZi1
|
||||
1EAgWk5btwj6ZvoOHFOjAXGJ13tmUeYt/Zipyy/ie+5LSEdFevQ+zmZzsglfX3QK
|
||||
6skoBpHs3kLcuPsoe8uhCvn/b22lHkFdYYkIwIUQFPJgdvBzD8LYHnD8P60UdsQO
|
||||
vSSt9qzsq04DCEjwhmNJUeddL9ESGNL8vgpB9GvNjFEq6QMncELkdXDoAeqGFolE
|
||||
/dj+8sVq+34plRsvD1GDDx70UWk0ZtQlvhqDJ0kxeT+yYASrwLoujK44SLq8cMJr
|
||||
JYxDoxFOy5MSw+EzEXTP9LLkYNdPv/nzPbEz3lEctczyOgBWr22272Kdv3QCHBdP
|
||||
v4+vFbHnrXmu8cC9T45r2aX3rQ==
|
||||
-----END CERTIFICATE-----
|
469
debian/changelog
vendored
469
debian/changelog
vendored
@ -1,473 +1,170 @@
|
||||
proxmox-kernel-6.8 (6.8.8-2) bookworm; urgency=medium
|
||||
pve-kernel (5.15.158-1) bullseye; urgency=medium
|
||||
|
||||
* fix #5448: support SCSI controllers with bad VDP page length encoding again
|
||||
* update sources to Ubuntu-5.15.0-115.125, based on 5.15.158
|
||||
|
||||
* fix #5554: improve e1000e stability on cable reconnection
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 10 Jun 2024 16:56:16 +0200
|
||||
|
||||
* cherry-pick "virtio-pci: Check if is_avq is NULL"
|
||||
pve-kernel (5.15.152-1) bullseye; urgency=medium
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 24 Jun 2024 11:00:48 +0200
|
||||
* update to Ubuntu-5.15.0-111.121, based on 5.15.152
|
||||
|
||||
proxmox-kernel-6.8 (6.8.8-1) bookworm; urgency=medium
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 29 Apr 2024 09:31:55 +0200
|
||||
|
||||
* update fix for managing block flush queue list to avioid a regression with
|
||||
LVM
|
||||
pve-kernel (5.15.149-1) bullseye; urgency=medium
|
||||
|
||||
* update sources to Ubuntu-6.8.0-38.38 based on Linux 6.8.8
|
||||
* update to Ubuntu-5.15.0-104.114 basing of 5.15.149
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 10 Jun 2024 13:42:20 +0200
|
||||
* update ZFS to 2.1.15
|
||||
|
||||
proxmox-kernel-6.8 (6.8.4-4) bookworm; urgency=medium
|
||||
-- Proxmox Support Team <support@proxmox.com> Fri, 29 Mar 2024 15:24:01 +0100
|
||||
|
||||
* update ZFS to 2.2.4
|
||||
pve-kernel (5.15.143-1) bullseye; urgency=medium
|
||||
|
||||
* backport fix for NFS memory leak on mount that can add up if there are
|
||||
many mount operations
|
||||
* update to Ubuntu-5.15.0-100.110 basing of 5.15.143
|
||||
|
||||
* backport fix for managing block flush queue list, resolving a potential
|
||||
crash due to dereferebcing a NULL pointer with, e.g., the
|
||||
blk_flush_complete_seq function in the stack trace of the error.
|
||||
-- Proxmox Support Team <support@proxmox.com> Thu, 08 Feb 2024 19:12:26 +0100
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 04 Jun 2024 12:37:16 +0200
|
||||
pve-kernel (5.15.136-1) bullseye; urgency=medium
|
||||
|
||||
proxmox-kernel-6.8 (6.8.4-3) bookworm; urgency=medium
|
||||
* update to Ubuntu-5.15.0-94.104 basing of 5.15.136
|
||||
|
||||
* update sources and patches to Ubuntu-6.8.0-32.32
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 23 Jan 2024 12:10:07 +0100
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Thu, 02 May 2024 13:55:46 +0200
|
||||
pve-kernel (5.15.131-3) bullseye; urgency=medium
|
||||
|
||||
proxmox-kernel-6.8 (6.8.4-2) bookworm; urgency=medium
|
||||
* updates ZFS to 2.1.14
|
||||
|
||||
* patch apparmor to make it cope with recvmsg returning EINVAL
|
||||
* bump ABI to 5.15.131-2
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 10 Apr 2024 19:36:43 +0200
|
||||
-- Proxmox Support Team <support@proxmox.com> Fri, 01 Dec 2023 14:42:42 +0100
|
||||
|
||||
proxmox-kernel-6.8 (6.8.4-1) bookworm; urgency=medium
|
||||
pve-kernel (5.15.131-2) bullseye; urgency=medium
|
||||
|
||||
* update sources to Ubuntu-6.8.0-23.23 based on v6.8.4 upstream stable
|
||||
release
|
||||
* update to Ubuntu-5.15.0-91.101 fixing an issue with enumerating USB
|
||||
devices
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 08 Apr 2024 17:49:22 +0200
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 14 Nov 2023 12:32:55 +0100
|
||||
|
||||
proxmox-kernel-6.8 (6.8.1-1) bookworm; urgency=medium
|
||||
pve-kernel (5.15.131-1) bullseye; urgency=medium
|
||||
|
||||
* update submodule and patches for 24.04 Noble based kernel with tag
|
||||
Ubuntu-6.8.0-20.20
|
||||
* update to Ubuntu-5.15.0-90.100 basing of the 5.15.131 stable release
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 02 Apr 2024 18:19:23 +0200
|
||||
-- Proxmox Support Team <support@proxmox.com> Thu, 09 Nov 2023 10:29:57 +0100
|
||||
|
||||
proxmox-kernel-6.5 (6.5.13-4) bookworm; urgency=medium
|
||||
pve-kernel (5.15.126-1) bullseye; urgency=medium
|
||||
|
||||
* update sources to Ubuntu-6.5.0-32.32 based on stable-tree backports of up
|
||||
to v6.1.77, v6.6.16
|
||||
* update to Ubuntu-5.15.0-88.98 basing of 5.15.126
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Fri, 29 Mar 2024 15:28:57 +0100
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 03 Oct 2023 19:24:13 +0200
|
||||
|
||||
proxmox-kernel-6.5 (6.5.13-3) bookworm; urgency=medium
|
||||
pve-kernel (5.15.116-1) bullseye; urgency=medium
|
||||
|
||||
* updated sources to Ubuntu-6.5.0-27.28 to fix a regression in the tracing &
|
||||
debugging related eventfs, potentially breaking bpftrace.
|
||||
* disable CONFIG_GDS_FORCE_MITIGATION again to avoid software breakage with
|
||||
older intel-microcode versions
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 20 Mar 2024 11:45:08 +0100
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 29 Aug 2023 15:46:21 +0200
|
||||
|
||||
proxmox-kernel-6.5 (6.5.13-2) bookworm; urgency=medium
|
||||
pve-kernel (5.15.111-1) bullseye; urgency=medium
|
||||
|
||||
* update sources to Ubuntu-6.5.0-27.27 based on stable-tree backports of
|
||||
v6.1.74, v6.6.13
|
||||
* update to Ubuntu-5.15.0-82.91
|
||||
|
||||
* update ZFS to 2.2.3
|
||||
-- Proxmox Support Team <support@proxmox.com> Fri, 18 Aug 2023 10:57:15 +0200
|
||||
|
||||
* Revert "cherry-pick scheduler fix to avoid temporary VM freezes on NUMA
|
||||
hosts" as user feedback did not show real improvement.
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 11 Mar 2024 14:36:05 +0100
|
||||
|
||||
proxmox-kernel-6.5 (6.5.13-1) bookworm; urgency=medium
|
||||
|
||||
* update sources to Ubuntu-6.5.0-20.20 based on v6.5.13 and some newer
|
||||
stable-tree backports
|
||||
|
||||
* backport scheduler fix to avoid temporary VM freezes on NUMA hosts
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 05 Feb 2024 14:50:54 +0100
|
||||
|
||||
proxmox-kernel-6.5 (6.5.11-8) bookworm; urgency=medium
|
||||
|
||||
* fix #5077: cherry-pick revert for aacraid resets
|
||||
|
||||
* fix #5158: cherry-pick ext4 fix for high-CPU flush
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 30 Jan 2024 13:27:34 +0100
|
||||
|
||||
proxmox-kernel-6.5 (6.5.11-7) bookworm; urgency=medium
|
||||
|
||||
* update ZFS to 2.2.2 to make it easier for users to ensure we're not
|
||||
affected by any recently uncovered data integrity issues (which got
|
||||
already patched out earlier via backports).
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 05 Dec 2023 10:44:02 +0100
|
||||
|
||||
proxmox-kernel-6.5 (6.5.11-6) bookworm; urgency=medium
|
||||
|
||||
* cherry-pick ZFS fix for (rare) dirty dnode data corruption bug
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 29 Nov 2023 09:32:26 +0100
|
||||
|
||||
proxmox-kernel-6.5 (6.5.11-5) bookworm; urgency=medium
|
||||
|
||||
* properly set CONFIG_VFIO_VIRQFD as a boolean
|
||||
|
||||
* cherry-pick fix for RCU stall issue after VM live migration
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 27 Nov 2023 20:52:25 +0100
|
||||
|
||||
proxmox-kernel-6.5 (6.5.11-4) bookworm; urgency=medium
|
||||
|
||||
* add signed kernel variant for secure boot
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 20 Nov 2023 11:19:53 +0100
|
||||
|
||||
proxmox-kernel-6.5 (6.5.11-3) bookworm; urgency=medium
|
||||
|
||||
* ZFS: pick bug-fixes staged for 2.2.1:
|
||||
- add a tunable to disable BRT support and disable it by default
|
||||
- fix block cloning between unencrypted and encrypted datasets
|
||||
- disable block cloning by default
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Fri, 17 Nov 2023 17:34:32 +0100
|
||||
|
||||
proxmox-kernel-6.5 (6.5.11-2) bookworm; urgency=medium
|
||||
|
||||
* rebase on Ubuntu-6.5.0-14.14 to include a fix for viewing ast/bmc remote
|
||||
consoles
|
||||
|
||||
* backport flexible-array-member fixes for the amdgpu module to avoid UBSAN
|
||||
warnings.
|
||||
|
||||
* disable UBSAN bounds checking again completely, to many false-positives
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 14 Nov 2023 18:19:51 +0100
|
||||
|
||||
proxmox-kernel-6.5 (6.5.11-1) bookworm; urgency=medium
|
||||
|
||||
* update to v6.5.11 upstream stable release
|
||||
|
||||
* revert "memfd: improve userspace warnings for missing exec-related flags",
|
||||
producing to much log noise without any benefit
|
||||
|
||||
* Revert "UBUNTU: SAUCE: ceph: make sure all the files successfully put
|
||||
before unmounting"
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 08 Nov 2023 15:40:29 +0100
|
||||
|
||||
proxmox-kernel-6.5 (6.5.3-1) bookworm; urgency=medium
|
||||
|
||||
* disable UBSAN bounds checking to avoid false-positive oopses due to the
|
||||
ZFS module using an older style for declaring flexible array member.
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 23 Oct 2023 10:03:52 +0200
|
||||
|
||||
proxmox-kernel-6.5 (6.5.3-1~1) bookworm; urgency=medium
|
||||
|
||||
* update kernel to 6.5 based Ubuntu 23.10 Mantic release
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Fri, 13 Oct 2023 15:28:11 +0200
|
||||
|
||||
proxmox-kernel-6.2 (6.2.16-19) bookworm; urgency=medium
|
||||
|
||||
* backport exposing FLUSHBYASID when running nested VMs on AMD CPUs to fix
|
||||
nesting of some hyper-visors like VMware Workstation.
|
||||
|
||||
* backport constraining guest-supported xfeatures only at KVM_GET_XSAVE{2}
|
||||
to further improve compatibility for guests w.r.t. live-migration, or live
|
||||
snapshot rollback, to hosts with less (FPU) xfeatures supported.
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 24 Oct 2023 14:07:51 +0200
|
||||
|
||||
proxmox-kernel-6.2 (6.2.16-18) bookworm; urgency=medium
|
||||
|
||||
* backport fix for AMD erratum #1485 on Zen4-based CPUs to avoid triggering
|
||||
undefined instruction exceptions when disabling all, or certain security
|
||||
mitigations, like using the "mitigations=off" kernel command line
|
||||
parameter
|
||||
|
||||
* backport ZFS fix to avoid crashes and hangs if used on modern Intel HW
|
||||
like the Xeon Scalable 4th Gen "Sapphire Rapids" CPUs due to a HW bug as
|
||||
per Intel SPR erratum SPR4
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 11 Oct 2023 17:05:18 +0200
|
||||
|
||||
proxmox-kernel-6.2 (6.2.16-16) bookworm; urgency=medium
|
||||
|
||||
* update sources to Ubuntu-6.2.0-36.36
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 03 Oct 2023 07:42:21 +0200
|
||||
|
||||
proxmox-kernel-6.2 (6.2.16-15) bookworm; urgency=medium
|
||||
|
||||
* fix thunderbolt ring-interrupt not being masked on suspend
|
||||
|
||||
* cherry-pick fix to avoid potentially offlining one CPU thread on some EPYC
|
||||
CPUs with a new amd64-microcode package (still in unstable).
|
||||
|
||||
* update ZFS to 2.1.13
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Thu, 28 Sep 2023 15:53:58 +0200
|
||||
|
||||
proxmox-kernel-6.2 (6.2.16-14) bookworm; urgency=medium
|
||||
|
||||
* cherry-pick fix for setting X86_FEATURE_OSXSAVE feature improving
|
||||
performance of some code that tries to live-detect available CPU features,
|
||||
like, e.g., ZFS.
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 19 Sep 2023 10:17:16 +0200
|
||||
|
||||
proxmox-kernel-6.2 (6.2.16-13) bookworm; urgency=medium
|
||||
|
||||
* fix #4707: add override parameter for RMRR relaxation
|
||||
|
||||
* backport thunderbolt-net fixes for IPv6 and connection re-establishment
|
||||
after a node got rebooted
|
||||
|
||||
* update sources to Ubuntu-6.2.0-34.34
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 18 Sep 2023 15:31:57 +0200
|
||||
|
||||
proxmox-kernel-6.2 (6.2.16-12) bookworm; urgency=medium
|
||||
|
||||
* cherry-pick fix for KVM vCPU page-fault loop.
|
||||
Due to too small and signed type used for an memory related sequence
|
||||
counter there was a chance that for long-lived VMs KVM would effectively
|
||||
hang vCPUs due to always thinking page faults are stale, which results in
|
||||
KVM refusing to "fix" faults.
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 04 Sep 2023 15:21:22 +0200
|
||||
|
||||
proxmox-kernel-6.2 (6.2.16-11) bookworm; urgency=medium
|
||||
|
||||
* cherry-pick fix to surpress faulty segfault logging. While harmless, such
|
||||
logs can look scary and might let people follow them like a red herring.
|
||||
|
||||
* update sources to Ubuntu-6.2.0-32.32
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Thu, 31 Aug 2023 11:56:15 +0200
|
||||
|
||||
proxmox-kernel-6.2 (6.2.16-10) bookworm; urgency=medium
|
||||
|
||||
* disable CONFIG_GDS_FORCE_MITIGATION again
|
||||
when not having installed a new-enough intel-microcode, this disables AVX
|
||||
instructions which breaks a lot of software
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Fri, 18 Aug 2023 13:42:38 +0200
|
||||
|
||||
proxmox-kernel-6.2 (6.2.16-9) bookworm; urgency=medium
|
||||
|
||||
* add fixes for downfall
|
||||
|
||||
* enable mitigation config option CONFIG_GDS_FORCE_MITIGATION
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 16 Aug 2023 10:07:11 +0200
|
||||
|
||||
proxmox-kernel-6.2 (6.2.16-8) bookworm; urgency=medium
|
||||
|
||||
* sign modules and set trust anchor/lockdown to allow manual secure boot
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 02 Aug 2023 14:17:00 +0200
|
||||
|
||||
proxmox-kernel-6.2 (6.2.16-7) bookworm; urgency=medium
|
||||
|
||||
* change `pve-` prefix to `proxmox-`
|
||||
|
||||
* merge proxmox-kernel-meta packaging into main kernel repository
|
||||
|
||||
* bump ABI to 6.2.16-6
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 01 Aug 2023 13:23:46 +0200
|
||||
|
||||
pve-kernel (6.2.16-6) bookworm; urgency=medium
|
||||
|
||||
* fix #4833: backport fix for recovering potential NX huge pages
|
||||
|
||||
* fix #4770: backport "nvme: don't reject probe due to duplicate IDs"
|
||||
pve-kernel (5.15.108-2) bullseye; urgency=medium
|
||||
|
||||
* backport Zenbleed stop-gap workaround for CVE-2023-20593, the actual fix
|
||||
is the amd64-microcode update.
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 25 Jul 2023 17:33:45 +0200
|
||||
-- Proxmox Support Team <support@proxmox.com> Thu, 20 Jul 2023 12:06:18 +0200
|
||||
|
||||
pve-kernel (6.2.16-5) bookworm; urgency=medium
|
||||
pve-kernel (5.15.108-1) bullseye; urgency=medium
|
||||
|
||||
* kvm: xsave set: mask-out PKRU bit in xfeatures if vCPU has no support to
|
||||
improve live-migrations & snapshot-rollback of VMs running on modern Intel
|
||||
CPUs (Skylake-Server or Tiger Lake Desktop), if configured with a
|
||||
restricted vCPU type (e.g., qemu64) and if the migration source is from
|
||||
our 5.15 based kernel (default in Proxmox VE 7.4) to the 6.2 (and future
|
||||
newer) of Proxmox VE 8.0 as target.
|
||||
This copes with the fallout of a fix, that while itself improved migration
|
||||
compatibility for clusters with different host-CPU models, caused another
|
||||
issue on the transition between the older "broken" and newer "fixed"
|
||||
kernels for homogeneous clusters, i.e., those with the same PVE host-CPU
|
||||
model.
|
||||
* update to Ubuntu-5.15.0-77.84, based on 5.15.108
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Fri, 14 Jul 2023 19:53:39 +0200
|
||||
* bump ABI to 5.15.108-1
|
||||
|
||||
pve-kernel (6.2.16-4) bookworm; urgency=medium
|
||||
-- Proxmox Support Team <support@proxmox.com> Sat, 17 Jun 2023 11:41:53 +0200
|
||||
|
||||
* backport fixes for StackRot (CVE-2023-3269)
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Fri, 07 Jul 2023 06:22:28 +0200
|
||||
|
||||
pve-kernel (6.2.16-3) bookworm; urgency=medium
|
||||
|
||||
* update to Ubuntu-6.2.0-25.25
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Sat, 17 Jun 2023 07:58:57 +0200
|
||||
|
||||
pve-kernel (6.2.16-2) bookworm; urgency=medium
|
||||
|
||||
* update ZFS to 2.1.12
|
||||
|
||||
* bump ABI to 6.2.16-2
|
||||
|
||||
* backport "net/sched: flower: fix possible OOB write in fl_set_geneve_opt()"
|
||||
|
||||
* backport re-adding mdev_set_iommu_device() kABI for support of SRIOV based
|
||||
Nvidia vGPU
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 13 Jun 2023 15:30:53 +0200
|
||||
|
||||
pve-kernel (6.2.16-1) bookworm; urgency=medium
|
||||
|
||||
* update to Ubuntu-6.2.0-23.23 and pull in stable fixes up to v6.2.16
|
||||
|
||||
* build for Debian 12 Bookworm based releases
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Sat, 20 May 2023 19:23:34 +0200
|
||||
|
||||
pve-kernel (6.2.11-2) bullseye; urgency=medium
|
||||
pve-kernel (5.15.107-2) bullseye; urgency=medium
|
||||
|
||||
* backport "netfilter: nf_tables: deactivate anonymous set from preparation
|
||||
phase"
|
||||
|
||||
* bump ABI to 6.2.11-2
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 10 May 2023 11:10:23 +0200
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 10 May 2023 11:13:34 +0200
|
||||
pve-kernel (5.15.107-1) bullseye; urgency=medium
|
||||
|
||||
pve-kernel (6.2.11-1) bullseye; urgency=medium
|
||||
|
||||
* update kernel to Proxmox-6.2.11-1
|
||||
* update to Proxmox-5.15.107-1
|
||||
|
||||
* update ZFS to 2.1.11
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Thu, 20 Apr 2023 11:59:36 +0200
|
||||
-- Proxmox Support Team <support@proxmox.com> Thu, 20 Apr 2023 12:05:46 +0200
|
||||
|
||||
pve-kernel (6.2.9-1) bullseye; urgency=medium
|
||||
pve-kernel (5.15.104-2) bullseye; urgency=medium
|
||||
|
||||
* update to Ubuntu-6.2.0-19.19 and cherry-pick patches up to 6.2.9
|
||||
* backport "igb: revert rtnl_lock() that causes deadlock"
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Fri, 31 Mar 2023 12:48:33 +0200
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 12 Apr 2023 13:23:09 +0200
|
||||
|
||||
pve-kernel (6.2.6-1) bullseye; urgency=medium
|
||||
pve-kernel (5.15.104-1) bullseye; urgency=medium
|
||||
|
||||
* update to Ubuntu-6.2.0-17.17 based on 6.2.6
|
||||
* update to upstream ubuntu and stable tree's v5.15.104
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 14 Mar 2023 18:08:23 +0100
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 29 Mar 2023 17:51:33 +0200
|
||||
|
||||
pve-kernel (6.2.2-1) bullseye; urgency=medium
|
||||
pve-kernel (5.15.102-1) bullseye; urgency=medium
|
||||
|
||||
* update to Ubuntu-6.2.0-1.1
|
||||
* update to upstream ubuntu and stable tree's v5.15.102
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 13 Mar 2023 17:57:00 +0100
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 14 Mar 2023 14:48:39 +0100
|
||||
|
||||
pve-kernel (6.1.15-1) bullseye; urgency=medium
|
||||
pve-kernel (5.15.85-1) bullseye; urgency=medium
|
||||
|
||||
* update to Proxmox-6.1.15-1
|
||||
|
||||
* backport patch to fix issue with large IO requests
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 08 Mar 2023 09:53:18 +0100
|
||||
|
||||
pve-kernel (6.1.14-1) bullseye; urgency=medium
|
||||
|
||||
* update to Proxmox-6.1.14-1
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 27 Feb 2023 18:09:47 +0100
|
||||
|
||||
pve-kernel (6.1.10-1) bullseye; urgency=medium
|
||||
|
||||
* update to Proxmox-6.1.10-1
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 07 Feb 2023 14:10:10 +0100
|
||||
|
||||
pve-kernel (6.1.6-1) bullseye; urgency=medium
|
||||
* update to Ubuntu-5.15.0-65.72 based on v5.15.85
|
||||
|
||||
* update ZFS to 2.1.9
|
||||
|
||||
* update to Ubuntu-6.1.0-14.14 based on upstream 6.1.6
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 01 Feb 2023 16:07:18 +0100
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Sat, 28 Jan 2023 15:05:09 +0100
|
||||
|
||||
pve-kernel (6.1.2-1) bullseye; urgency=medium
|
||||
|
||||
* backport ZFS compat fixes for Linux 6.1 w.r.t. a OTMPFILE open syscall
|
||||
|
||||
* update to Ubuntu-6.1.0-12.12
|
||||
|
||||
* backport a few newer fixes-of-fixes from 6.1.4
|
||||
|
||||
* bump ABI to 6.1.2-1
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Sat, 07 Jan 2023 14:56:01 +0100
|
||||
|
||||
pve-kernel (6.1.0-1) bullseye; urgency=medium
|
||||
|
||||
* update to Ubuntu-6.1.0-1.1 based on upstram v6.1
|
||||
pve-kernel (5.15.83-1) bullseye; urgency=medium
|
||||
|
||||
* update ZFS to 2.1.7
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 13 Dec 2022 15:08:53 +0100
|
||||
* update to upstream stable v5.15.83
|
||||
|
||||
pve-kernel (5.19.17-1) bullseye; urgency=medium
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 14 Dec 2022 14:09:09 +0100
|
||||
|
||||
* update to Ubuntu-5.19.0-24.25
|
||||
pve-kernel (5.15.74-1) bullseye; urgency=medium
|
||||
|
||||
* bump ABI to 5.19.17-1
|
||||
* update to Ubuntu-5.15.0-54.60
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 14 Nov 2022 20:25:12 +0100
|
||||
* bump ABI to 5.15.74-1
|
||||
|
||||
pve-kernel (5.19.7-2) bullseye; urgency=medium
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 14 Nov 2022 20:17:15 +0100
|
||||
|
||||
pve-kernel (5.15.64-1) bullseye; urgency=medium
|
||||
|
||||
* update to Ubuntu-5.15.0-51.57
|
||||
|
||||
* bump ABI to 5.15.64-1
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Thu, 13 Oct 2022 10:30:34 +0200
|
||||
|
||||
pve-kernel (5.15.60-2) bullseye; urgency=medium
|
||||
|
||||
* update ZFS to 2.1.6
|
||||
|
||||
* update to Ubuntu-5.19.0-19.19
|
||||
* update to Ubuntu-5.15.0-50.56
|
||||
|
||||
* bump ABI to 5.19.7-2
|
||||
* bump ABI to 5.15.60-2
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 04 Oct 2022 17:18:40 +0200
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 04 Oct 2022 16:52:28 +0200
|
||||
|
||||
pve-kernel (5.19.7-1) bullseye; urgency=medium
|
||||
pve-kernel (5.15.60-1) bullseye; urgency=medium
|
||||
|
||||
* update to 5.19.7 based on Ubuntu-5.19.0-16.16
|
||||
* update to Ubuntu-5.15.0-49.55
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 06 Sep 2022 07:54:58 +0200
|
||||
|
||||
pve-kernel (5.19.0-1) bullseye; urgency=medium
|
||||
|
||||
* update to 5.19.0 based from Ubuntu-5.19.0-14.14
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 02 Aug 2022 09:18:39 +0200
|
||||
|
||||
pve-kernel (5.19.0-1~rc8+2) bullseye; urgency=medium
|
||||
|
||||
* backport smm fixes
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 27 Jul 2022 11:27:10 +0200
|
||||
|
||||
pve-kernel (5.19.0-1~rc8+1) bullseye; urgency=medium
|
||||
|
||||
* update to 5.19.0-rc8 based from Ubuntu-5.19.0-11.11
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Tue, 26 Jul 2022 11:47:30 +0200
|
||||
-- Proxmox Support Team <support@proxmox.com> Mon, 19 Sep 2022 17:53:17 +0200
|
||||
|
||||
pve-kernel (5.15.53-1) bullseye; urgency=medium
|
||||
|
||||
|
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
@ -0,0 +1 @@
|
||||
10
|
59
debian/control.in
vendored
59
debian/control.in
vendored
@ -1,4 +1,4 @@
|
||||
Source: proxmox-kernel-@KVMAJMIN@
|
||||
Source: pve-kernel
|
||||
Section: devel
|
||||
Priority: optional
|
||||
Maintainer: Proxmox Support Team <support@proxmox.com>
|
||||
@ -7,7 +7,7 @@ Build-Depends: asciidoc-base,
|
||||
bc,
|
||||
bison,
|
||||
cpio,
|
||||
debhelper-compat (= 13),
|
||||
debhelper (>= 10~),
|
||||
dh-python,
|
||||
dwarves,
|
||||
file,
|
||||
@ -32,7 +32,7 @@ Build-Depends: asciidoc-base,
|
||||
xmlto,
|
||||
zlib1g-dev,
|
||||
zstd,
|
||||
Build-Conflicts: proxmox-headers-@KVNAME@,
|
||||
Build-Conflicts: pve-headers-@KVNAME@,
|
||||
Standards-Version: 4.6.2
|
||||
Vcs-Git: git://git.proxmox.com/git/pve-kernel
|
||||
Vcs-Browser: https://git.proxmox.com/?p=pve-kernel.git
|
||||
@ -46,79 +46,48 @@ Description: Linux kernel version specific tools for version @KVMAJMIN@
|
||||
This package provides the architecture dependent parts for kernel
|
||||
version locked tools (such as perf and x86_energy_perf_policy)
|
||||
|
||||
Package: proxmox-headers-@KVNAME@
|
||||
Package: pve-headers-@KVNAME@
|
||||
Section: devel
|
||||
Priority: optional
|
||||
Architecture: any
|
||||
Provides: linux-headers-@KVNAME@-amd64, pve-headers-@KVNAME@
|
||||
Provides: linux-headers-@KVNAME@-amd64,
|
||||
Depends: ${misc:Depends},
|
||||
Description: Proxmox Kernel Headers
|
||||
This package contains the linux kernel headers
|
||||
|
||||
Package: proxmox-kernel-@KVNAME@
|
||||
Package: pve-kernel-@KVNAME@
|
||||
Section: admin
|
||||
Priority: optional
|
||||
Architecture: any
|
||||
Provides: linux-image-@KVNAME@-amd64, pve-kernel-@KVNAME@
|
||||
Provides: linux-image-@KVNAME@-amd64,
|
||||
Suggests: pve-firmware,
|
||||
Depends: busybox, initramfs-tools | linux-initramfs-tool, ${misc:Depends},
|
||||
Recommends: grub-pc | grub-efi-amd64 | grub-efi-ia32 | grub-efi-arm64,
|
||||
Description: Proxmox Kernel Image
|
||||
This package contains the linux kernel and initial ramdisk used for booting
|
||||
|
||||
Package: proxmox-kernel-@KVNAME@-dbgsym
|
||||
Package: pve-kernel-@KVNAME@-dbgsym
|
||||
Architecture: any
|
||||
Provides: linux-debug, pve-kernel-@KVNAME@-dbgsym
|
||||
Provides: linux-debug,
|
||||
Section: devel
|
||||
Priority: optional
|
||||
Build-Profiles: <pkg.proxmox-kernel.debug>
|
||||
Build-Profiles: <pkg.pve-kernel.debug>
|
||||
Depends: ${misc:Depends},
|
||||
Description: Proxmox Kernel debug image
|
||||
This package provides the kernel debug image for version @KVNAME@. The debug
|
||||
kernel image contained in this package is NOT meant to boot from - it is
|
||||
uncompressed, and unstripped, and suitable for use with crash/kdump-tools/..
|
||||
to analyze kernel crashes. This package also contains the proxmox-kernel modules
|
||||
to analyze kernel crashes. This package also contains the pve-kernel modules
|
||||
in their unstripped version.
|
||||
|
||||
Package: proxmox-kernel-@KVNAME@-signed-template
|
||||
Architecture: amd64
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, make | build-essential | dpkg-dev
|
||||
Description: Template for signed kernel package
|
||||
This package is used to control code signing by the Proxmox signing
|
||||
service.
|
||||
|
||||
Package: proxmox-kernel-libc-dev
|
||||
Package: pve-kernel-libc-dev
|
||||
Section: devel
|
||||
Priority: optional
|
||||
Architecture: any
|
||||
Provides: linux-libc-dev (=${binary:Version}), pve-kernel-libc-dev
|
||||
Provides: linux-libc-dev (=${binary:Version}),
|
||||
Conflicts: linux-libc-dev,
|
||||
Replaces: linux-libc-dev, pve-kernel-libc-dev
|
||||
Breaks: pve-kernel-libc-dev
|
||||
Replaces: linux-libc-dev,
|
||||
Depends: ${misc:Depends},
|
||||
Description: Linux support headers for userspace development
|
||||
This package provides userspaces headers from the Linux kernel. These headers
|
||||
are used by the installed headers for GNU libc and other system libraries.
|
||||
|
||||
Package: proxmox-headers-@KVMAJMIN@
|
||||
Architecture: all
|
||||
Section: admin
|
||||
Provides: linux-headers-amd64, linux-headers-generic, pve-headers-@KVMAJMIN@
|
||||
Replaces: pve-headers-@KVMAJMIN@
|
||||
Priority: optional
|
||||
Depends: proxmox-headers-@KVNAME@, ${misc:Depends},
|
||||
Description: Latest Proxmox Kernel Headers
|
||||
This is a metapackage which will install the kernel headers
|
||||
for the latest available proxmox kernel from the @KVMAJMIN@
|
||||
series.
|
||||
|
||||
Package: proxmox-kernel-@KVMAJMIN@
|
||||
Architecture: all
|
||||
Section: admin
|
||||
Provides: linux-image-amd64, linux-image-generic, wireguard-modules (=1.0.0), pve-kernel-@KVMAJMIN@
|
||||
Replaces: pve-kernel-@KVMAJMIN@
|
||||
Priority: optional
|
||||
Depends: pve-firmware, proxmox-kernel-@KVNAME@-signed | proxmox-kernel-@KVNAME@, ${misc:Depends},
|
||||
Description: Latest Proxmox Kernel Image
|
||||
This is a metapackage which will install the latest available
|
||||
proxmox kernel from the @KVMAJMIN@ series.
|
||||
|
17
debian/proxmox-kernel-meta.postinst.in
vendored
17
debian/proxmox-kernel-meta.postinst.in
vendored
@ -1,17 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Abort if any command returns an error value
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
# setup kernel links for installation CD (rescue boot)
|
||||
mkdir -p /boot/pve
|
||||
ln -sf /boot/vmlinuz-@@KVNAME@@ /boot/pve/vmlinuz-@@KVMAJMIN@@
|
||||
ln -sf /boot/initrd.img-@@KVNAME@@ /boot/pve/initrd.img-@@KVMAJMIN@@
|
||||
;;
|
||||
esac
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
19
debian/proxmox-kernel-meta.postrm.in
vendored
19
debian/proxmox-kernel-meta.postrm.in
vendored
@ -1,19 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Abort if any command returns an error value
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||
# remove kernel symlinks
|
||||
rm -f /boot/pve/vmlinuz-@@KVNAME@@
|
||||
rm -f /boot/pve/initrd.img-@@KVNAME@@
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postrm called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
#DEBHELPER#
|
46
debian/proxmox-kernel.postrm.in
vendored
46
debian/proxmox-kernel.postrm.in
vendored
@ -1,46 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
# Ignore all 'upgrade' invocations .
|
||||
exit 0 if $ARGV[0] =~ /upgrade/;
|
||||
|
||||
my $imagedir = "/boot";
|
||||
|
||||
my $version = "@@KVNAME@@";
|
||||
|
||||
if (-d "/etc/kernel/postrm.d") {
|
||||
print STDERR "Examining /etc/kernel/postrm.d.\n";
|
||||
system (
|
||||
"run-parts --verbose --exit-on-error --arg=$version --arg=$imagedir/vmlinuz-$version /etc/kernel/postrm.d"
|
||||
) && die "Failed to process /etc/kernel/postrm.d";
|
||||
}
|
||||
|
||||
unlink "$imagedir/initrd.img-$version";
|
||||
unlink "$imagedir/initrd.img-$version.bak";
|
||||
unlink "/var/lib/initramfs-tools/$version";
|
||||
|
||||
# Ignore all invocations except when called on to purge.
|
||||
exit 0 unless $ARGV[0] =~ /purge/;
|
||||
|
||||
my @files_to_remove = qw{
|
||||
modules.dep modules.isapnpmap modules.pcimap
|
||||
modules.usbmap modules.parportmap
|
||||
modules.generic_string modules.ieee1394map
|
||||
modules.ieee1394map modules.pnpbiosmap
|
||||
modules.alias modules.ccwmap modules.inputmap
|
||||
modules.symbols modules.ofmap
|
||||
modules.seriomap modules.*.bin
|
||||
modules.softdep modules.devname
|
||||
};
|
||||
|
||||
foreach my $extra_file (@files_to_remove) {
|
||||
for (glob("/lib/modules/$version/$extra_file")) {
|
||||
unlink;
|
||||
}
|
||||
}
|
||||
|
||||
system ("rmdir", "/lib/modules/$version") if -d "/lib/modules/$version";
|
||||
|
||||
exit 0
|
@ -1,7 +1,6 @@
|
||||
#!/usr/bin/perl
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
# Ignore all invocations except when called on to configure.
|
||||
exit 0 unless $ARGV[0] =~ /configure/;
|
||||
@ -17,9 +16,10 @@ system("depmod $version");
|
||||
|
||||
if (-d "/etc/kernel/postinst.d") {
|
||||
print STDERR "Examining /etc/kernel/postinst.d.\n";
|
||||
system(
|
||||
"run-parts --verbose --exit-on-error --arg=$version --arg=$imagedir/vmlinuz-$version /etc/kernel/postinst.d"
|
||||
) && die "Failed to process /etc/kernel/postinst.d";
|
||||
system ("run-parts --verbose --exit-on-error --arg=$version " .
|
||||
"--arg=$imagedir/vmlinuz-$version " .
|
||||
"/etc/kernel/postinst.d") &&
|
||||
die "Failed to process /etc/kernel/postinst.d";
|
||||
}
|
||||
|
||||
exit 0
|
46
debian/pve-kernel.postrm.in
vendored
Normal file
46
debian/pve-kernel.postrm.in
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
# Ignore all 'upgrade' invocations .
|
||||
exit 0 if $ARGV[0] =~ /upgrade/;
|
||||
|
||||
my $imagedir = "/boot";
|
||||
|
||||
my $version = "@@KVNAME@@";
|
||||
|
||||
if (-d "/etc/kernel/postrm.d") {
|
||||
print STDERR "Examining /etc/kernel/postrm.d.\n";
|
||||
system ("run-parts --verbose --exit-on-error --arg=$version " .
|
||||
"--arg=$imagedir/vmlinuz-$version " .
|
||||
"/etc/kernel/postrm.d") &&
|
||||
die "Failed to process /etc/kernel/postrm.d";
|
||||
}
|
||||
|
||||
unlink "$imagedir/initrd.img-$version";
|
||||
unlink "$imagedir/initrd.img-$version.bak";
|
||||
unlink "/var/lib/initramfs-tools/$version";
|
||||
|
||||
# Ignore all invocations except when called on to purge.
|
||||
exit 0 unless $ARGV[0] =~ /purge/;
|
||||
|
||||
my @files_to_remove = qw{
|
||||
modules.dep modules.isapnpmap modules.pcimap
|
||||
modules.usbmap modules.parportmap
|
||||
modules.generic_string modules.ieee1394map
|
||||
modules.ieee1394map modules.pnpbiosmap
|
||||
modules.alias modules.ccwmap modules.inputmap
|
||||
modules.symbols modules.ofmap
|
||||
modules.seriomap modules.*.bin
|
||||
modules.softdep modules.devname
|
||||
};
|
||||
|
||||
foreach my $extra_file (@files_to_remove) {
|
||||
for (glob("/lib/modules/$version/$extra_file")) {
|
||||
unlink;
|
||||
}
|
||||
}
|
||||
|
||||
system ("rmdir", "/lib/modules/$version") if -d "/lib/modules/$version";
|
||||
|
||||
exit 0
|
@ -1,7 +1,6 @@
|
||||
#!/usr/bin/perl
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
# Ignore all invocations uxcept when called on to remove
|
||||
exit 0 unless ($ARGV[0] && $ARGV[0] =~ /remove/) ;
|
||||
@ -15,9 +14,10 @@ my $version = "@@KVNAME@@";
|
||||
|
||||
if (-d "/etc/kernel/prerm.d") {
|
||||
print STDERR "Examining /etc/kernel/prerm.d.\n";
|
||||
system(
|
||||
"run-parts --verbose --exit-on-error --arg=$version --arg=$imagedir/vmlinuz-$version /etc/kernel/prerm.d"
|
||||
) && die "Failed to process /etc/kernel/prerm.d";
|
||||
system ("run-parts --verbose --exit-on-error --arg=$version " .
|
||||
"--arg=$imagedir/vmlinuz-$version " .
|
||||
"/etc/kernel/prerm.d") &&
|
||||
die "Failed to process /etc/kernel/prerm.d";
|
||||
}
|
||||
|
||||
exit 0
|
211
debian/rules
vendored
211
debian/rules
vendored
@ -16,18 +16,16 @@ MAKEFLAGS += $(subst parallel=,-j,$(filter parallel=%,${DEB_BUILD_OPTIONS}))
|
||||
CHANGELOG_DATE:=$(shell dpkg-parsechangelog -SDate)
|
||||
CHANGELOG_DATE_UTC_ISO := $(shell date -u -d '$(CHANGELOG_DATE)' +%Y-%m-%dT%H:%MZ)
|
||||
|
||||
PMX_KERNEL_PKG=proxmox-kernel-$(KVNAME)
|
||||
PMX_KERNEL_SERIES_PKG=proxmox-kernel-$(KERNEL_MAJMIN)
|
||||
PMX_DEBUG_KERNEL_PKG=proxmox-kernel-$(KVNAME)-dbgsym
|
||||
PMX_HEADER_PKG=proxmox-headers-$(KVNAME)
|
||||
PMX_USR_HEADER_PKG=proxmox-kernel-libc-dev
|
||||
PMX_KERNEL_SIGNING_TEMPLATE_PKG=proxmox-kernel-${KVNAME}-signed-template
|
||||
PMX_KERNEL_SIGNED_VERSION := $(shell echo ${DEB_VERSION} | sed -e 's/-/+/')
|
||||
PVE_KERNEL_PKG=pve-kernel-$(KVNAME)
|
||||
PVE_DEBUG_KERNEL_PKG=pve-kernel-$(KVNAME)-dbgsym
|
||||
PVE_HEADER_PKG=pve-headers-$(KVNAME)
|
||||
PVE_USR_HEADER_PKG=pve-kernel-libc-dev
|
||||
LINUX_TOOLS_PKG=linux-tools-$(KERNEL_MAJMIN)
|
||||
KERNEL_SRC_COPY=$(KERNEL_SRC)_tmp
|
||||
|
||||
# TODO: split for archs, move to files?
|
||||
PMX_CONFIG_OPTS= \
|
||||
PVE_CONFIG_OPTS= \
|
||||
--set-val INET_TABLE_PERTURB_ORDER 16 \
|
||||
-m INTEL_MEI_WDT \
|
||||
-d CONFIG_SND_PCM_OSS \
|
||||
-e CONFIG_TRANSPARENT_HUGEPAGE_MADVISE \
|
||||
@ -35,7 +33,6 @@ PMX_CONFIG_OPTS= \
|
||||
-m CONFIG_CEPH_FS \
|
||||
-m CONFIG_BLK_DEV_NBD \
|
||||
-m CONFIG_BLK_DEV_RBD \
|
||||
-m CONFIG_BLK_DEV_UBLK \
|
||||
-d CONFIG_SND_PCSP \
|
||||
-m CONFIG_BCACHE \
|
||||
-m CONFIG_JFS_FS \
|
||||
@ -56,18 +53,12 @@ PMX_CONFIG_OPTS= \
|
||||
-e CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE \
|
||||
-e CONFIG_SYSFB_SIMPLEFB \
|
||||
-e CONFIG_DRM_SIMPLEDRM \
|
||||
-e CONFIG_MODULE_SIG \
|
||||
-e CONFIG_MODULE_SIG_ALL \
|
||||
-e CONFIG_MODULE_SIG_FORMAT \
|
||||
--set-str CONFIG_MODULE_SIG_HASH sha512 \
|
||||
--set-str CONFIG_MODULE_SIG_KEY certs/signing_key.pem \
|
||||
-e CONFIG_MODULE_SIG_KEY_TYPE_RSA \
|
||||
-e CONFIG_MODULE_SIG_SHA512 \
|
||||
-d CONFIG_MODULE_SIG \
|
||||
-d CONFIG_MEMCG_DISABLED \
|
||||
-e CONFIG_MEMCG_SWAP_ENABLED \
|
||||
-e CONFIG_HYPERV \
|
||||
-m CONFIG_VFIO_IOMMU_TYPE1 \
|
||||
-e CONFIG_VFIO_VIRQFD \
|
||||
-m CONFIG_VFIO_VIRQFD \
|
||||
-m CONFIG_VFIO \
|
||||
-m CONFIG_VFIO_PCI \
|
||||
-m CONFIG_USB_XHCI_HCD \
|
||||
@ -85,52 +76,31 @@ PMX_CONFIG_OPTS= \
|
||||
-d CONFIG_DEFAULT_CFQ \
|
||||
-e CONFIG_DEFAULT_DEADLINE \
|
||||
-e CONFIG_MODVERSIONS \
|
||||
-e CONFIG_ZSTD_COMPRESS \
|
||||
-d CONFIG_DEFAULT_SECURITY_DAC \
|
||||
-e CONFIG_DEFAULT_SECURITY_APPARMOR \
|
||||
--set-str CONFIG_DEFAULT_SECURITY apparmor \
|
||||
-e CONFIG_MODULE_ALLOW_BTF_MISMATCH \
|
||||
-d CONFIG_UNWINDER_ORC \
|
||||
-d CONFIG_UNWINDER_GUESS \
|
||||
-e CONFIG_UNWINDER_FRAME_POINTER \
|
||||
--set-str CONFIG_SYSTEM_TRUSTED_KEYS ""\
|
||||
--set-str CONFIG_SYSTEM_REVOCATION_KEYS ""\
|
||||
-e CONFIG_SECURITY_LOCKDOWN_LSM \
|
||||
-e CONFIG_SECURITY_LOCKDOWN_LSM_EARLY \
|
||||
--set-str CONFIG_LSM lockdown,yama,integrity,apparmor \
|
||||
-e CONFIG_PAGE_TABLE_ISOLATION \
|
||||
-e CONFIG_ARCH_HAS_CPU_FINALIZE_INIT \
|
||||
-d CONFIG_GDS_FORCE_MITIGATION \
|
||||
-d CONFIG_WQ_CPU_INTENSIVE_REPORT \
|
||||
-d CONFIG_N_GSM \
|
||||
-d UBSAN_BOUNDS \
|
||||
-d CONFIG_SECURITY_LOCKDOWN_LSM \
|
||||
-d CONFIG_SECURITY_LOCKDOWN_LSM_EARLY \
|
||||
--set-str CONFIG_LSM yama,integrity,apparmor \
|
||||
-d MICROCODE_LATE_LOADING \
|
||||
-e CONFIG_PAGE_TABLE_ISOLATION
|
||||
|
||||
debian/control: $(wildcard debian/*.in)
|
||||
sed -e 's/@@KVNAME@@/$(KVNAME)/g' < debian/proxmox-kernel.prerm.in > debian/$(PMX_KERNEL_PKG).prerm
|
||||
sed -e 's/@@KVNAME@@/$(KVNAME)/g' < debian/proxmox-kernel.postrm.in > debian/$(PMX_KERNEL_PKG).postrm
|
||||
sed -e 's/@@KVNAME@@/$(KVNAME)/g' < debian/proxmox-kernel.postinst.in > debian/$(PMX_KERNEL_PKG).postinst
|
||||
sed -e 's/@@KVNAME@@/$(KVNAME)/g' < debian/proxmox-headers.postinst.in > debian/$(PMX_HEADER_PKG).postinst
|
||||
sed -e 's/@@KVMAJMIN@@/$(KERNEL_MAJMIN)/g' -e 's/@@KVNAME@@/$(KVNAME)/g' < debian/proxmox-kernel-meta.postrm.in > debian/$(PMX_KERNEL_SERIES_PKG).postrm
|
||||
sed -e 's/@@KVMAJMIN@@/$(KERNEL_MAJMIN)/g' -e 's/@@KVNAME@@/$(KVNAME)/g' < debian/proxmox-kernel-meta.postinst.in > debian/$(PMX_KERNEL_SERIES_PKG).postinst
|
||||
chmod +x debian/$(PMX_KERNEL_PKG).prerm
|
||||
chmod +x debian/$(PMX_KERNEL_PKG).postrm
|
||||
chmod +x debian/$(PMX_KERNEL_PKG).postinst
|
||||
chmod +x debian/$(PMX_KERNEL_SERIES_PKG).postrm
|
||||
chmod +x debian/$(PMX_KERNEL_SERIES_PKG).postinst
|
||||
chmod +x debian/$(PMX_HEADER_PKG).postinst
|
||||
sed -e 's/@@KVNAME@@/$(KVNAME)/g' < debian/pve-kernel.prerm.in > debian/$(PVE_KERNEL_PKG).prerm
|
||||
sed -e 's/@@KVNAME@@/$(KVNAME)/g' < debian/pve-kernel.postrm.in > debian/$(PVE_KERNEL_PKG).postrm
|
||||
sed -e 's/@@KVNAME@@/$(KVNAME)/g' < debian/pve-kernel.postinst.in > debian/$(PVE_KERNEL_PKG).postinst
|
||||
sed -e 's/@@KVNAME@@/$(KVNAME)/g' < debian/pve-headers.postinst.in > debian/$(PVE_HEADER_PKG).postinst
|
||||
chmod +x debian/$(PVE_KERNEL_PKG).prerm
|
||||
chmod +x debian/$(PVE_KERNEL_PKG).postrm
|
||||
chmod +x debian/$(PVE_KERNEL_PKG).postinst
|
||||
chmod +x debian/$(PVE_HEADER_PKG).postinst
|
||||
sed -e 's/@KVNAME@/$(KVNAME)/g' -e 's/@KVMAJMIN@/$(KERNEL_MAJMIN)/g' < debian/control.in > debian/control
|
||||
|
||||
# signing-template
|
||||
sed -e '1 s/proxmox-kernel/proxmox-kernel-signed/' -e '1 s/${DEB_VERSION}/${PMX_KERNEL_SIGNED_VERSION}/' < debian/changelog > debian/signing-template/changelog
|
||||
sed -e 's/@KVNAME@/${KVNAME}/g' -e 's/@KVMAJMIN@/$(KERNEL_MAJMIN)/g' -e 's/@UNSIGNED_VERSION@/${DEB_VERSION}/g' < debian/signing-template/control.in > debian/signing-template/control
|
||||
sed -e 's/@KVNAME@/${KVNAME}/g' < debian/signing-template/files.json.in > debian/signing-template/files.json
|
||||
sed -e 's/@KVNAME@/${KVNAME}/g' -e 's/@PKG_VERSION@/${DEB_VERSION}/' < debian/signing-template/rules.in > debian/signing-template/rules
|
||||
sed -e 's/@@KVNAME@@/${KVNAME}/g' < debian/proxmox-kernel.prerm.in > debian/signing-template/prerm
|
||||
sed -e 's/@@KVNAME@@/${KVNAME}/g' < debian/proxmox-kernel.postrm.in > debian/signing-template/postrm
|
||||
sed -e 's/@@KVNAME@@/${KVNAME}/g' < debian/proxmox-kernel.postinst.in > debian/signing-template/postinst
|
||||
rm debian/signing-template/*.in
|
||||
cp debian/SOURCE debian/signing-template/
|
||||
|
||||
build: .compile_mark .tools_compile_mark .modules_compile_mark
|
||||
|
||||
install: .install_mark .tools_install_mark .headers_install_mark .usr_headers_install_mark
|
||||
@ -143,7 +113,7 @@ install: .install_mark .tools_install_mark .headers_install_mark .usr_headers_in
|
||||
|
||||
binary: install
|
||||
debian/rules fwcheck abicheck
|
||||
dh_strip -N$(PMX_HEADER_PKG) -N$(PMX_USR_HEADER_PKG)
|
||||
dh_strip -N$(PVE_HEADER_PKG) -N$(PVE_USR_HEADER_PKG)
|
||||
dh_makeshlibs
|
||||
dh_shlibdeps
|
||||
dh_installdeb
|
||||
@ -152,87 +122,63 @@ binary: install
|
||||
dh_builddeb
|
||||
|
||||
.config_mark:
|
||||
cd $(KERNEL_SRC); scripts/config $(PMX_CONFIG_OPTS)
|
||||
$(MAKE) -C $(KERNEL_SRC) olddefconfig
|
||||
cd $(KERNEL_SRC); scripts/config $(PVE_CONFIG_OPTS)
|
||||
$(MAKE) -C $(KERNEL_SRC) oldconfig
|
||||
# copy to allow building in parallel to kernel/module compilation without interference
|
||||
rm -rf $(KERNEL_SRC_COPY)
|
||||
cp -ar $(KERNEL_SRC) $(KERNEL_SRC_COPY)
|
||||
touch $@
|
||||
|
||||
.compile_mark: .config_mark
|
||||
$(MAKE) -C $(KERNEL_SRC) KBUILD_BUILD_VERSION_TIMESTAMP="PMX $(DEB_VERSION) ($(CHANGELOG_DATE_UTC_ISO))"
|
||||
$(MAKE) -C $(KERNEL_SRC) KBUILD_BUILD_VERSION_TIMESTAMP="PVE $(DEB_VERSION) ($(CHANGELOG_DATE_UTC_ISO))"
|
||||
touch $@
|
||||
|
||||
.install_mark: .compile_mark .modules_compile_mark
|
||||
rm -rf debian/$(PMX_KERNEL_PKG)
|
||||
mkdir -p debian/$(PMX_KERNEL_PKG)/lib/modules/$(KVNAME)
|
||||
mkdir debian/$(PMX_KERNEL_PKG)/boot
|
||||
install -m 644 $(KERNEL_SRC)/.config debian/$(PMX_KERNEL_PKG)/boot/config-$(KVNAME)
|
||||
install -m 644 $(KERNEL_SRC)/System.map debian/$(PMX_KERNEL_PKG)/boot/System.map-$(KVNAME)
|
||||
install -m 644 $(KERNEL_SRC)/$(KERNEL_IMAGE_PATH) debian/$(PMX_KERNEL_PKG)/boot/$(KERNEL_INSTALL_FILE)-$(KVNAME)
|
||||
$(MAKE) -C $(KERNEL_SRC) INSTALL_MOD_PATH=$(BUILD_DIR)/debian/$(PMX_KERNEL_PKG)/ modules_install
|
||||
rm -rf debian/$(PVE_KERNEL_PKG)
|
||||
mkdir -p debian/$(PVE_KERNEL_PKG)/lib/modules/$(KVNAME)
|
||||
mkdir debian/$(PVE_KERNEL_PKG)/boot
|
||||
install -m 644 $(KERNEL_SRC)/.config debian/$(PVE_KERNEL_PKG)/boot/config-$(KVNAME)
|
||||
install -m 644 $(KERNEL_SRC)/System.map debian/$(PVE_KERNEL_PKG)/boot/System.map-$(KVNAME)
|
||||
install -m 644 $(KERNEL_SRC)/$(KERNEL_IMAGE_PATH) debian/$(PVE_KERNEL_PKG)/boot/$(KERNEL_INSTALL_FILE)-$(KVNAME)
|
||||
$(MAKE) -C $(KERNEL_SRC) INSTALL_MOD_PATH=$(BUILD_DIR)/debian/$(PVE_KERNEL_PKG)/ modules_install
|
||||
# install zfs drivers
|
||||
install -d -m 0755 debian/$(PMX_KERNEL_PKG)/lib/modules/$(KVNAME)/zfs
|
||||
install -m 644 $(MODULES)/zfs.ko $(MODULES)/spl.ko debian/$(PMX_KERNEL_PKG)/lib/modules/$(KVNAME)/zfs
|
||||
install -d -m 0755 debian/$(PVE_KERNEL_PKG)/lib/modules/$(KVNAME)/zfs
|
||||
install -m 644 $(addprefix $(MODULES)/,zfs.ko zavl.ko znvpair.ko zunicode.ko zcommon.ko icp.ko zlua.ko spl.ko zzstd.ko) debian/$(PVE_KERNEL_PKG)/lib/modules/$(KVNAME)/zfs
|
||||
# remove firmware
|
||||
rm -rf debian/$(PMX_KERNEL_PKG)/lib/firmware
|
||||
rm -rf debian/$(PVE_KERNEL_PKG)/lib/firmware
|
||||
|
||||
ifeq ($(filter pkg.proxmox-kernel.debug,$(DEB_BUILD_PROFILES)),)
|
||||
echo "'pkg.proxmox-kernel.debug' build profile disabled, skipping -dbgsym creation"
|
||||
ifeq ($(filter pkg.pve-kernel.debug,$(DEB_BUILD_PROFILES)),)
|
||||
echo "'pkg.pve-kernel.debug' build profile disabled, skipping -dbgsym creation"
|
||||
else
|
||||
echo "'pkg.proxmox-kernel.debug' build profile enabled, creating -dbgsym contents"
|
||||
mkdir -p debian/$(PMX_DEBUG_KERNEL_PKG)/usr/lib/debug/lib/modules/$(KVNAME)
|
||||
mkdir debian/$(PMX_DEBUG_KERNEL_PKG)/usr/lib/debug/boot
|
||||
install -m 644 $(KERNEL_SRC)/vmlinux debian/$(PMX_DEBUG_KERNEL_PKG)/usr/lib/debug/boot/vmlinux-$(KVNAME)
|
||||
cp -r debian/$(PMX_KERNEL_PKG)/lib/modules/$(KVNAME) debian/$(PMX_DEBUG_KERNEL_PKG)/usr/lib/debug/lib/modules/
|
||||
rm -f debian/$(PMX_DEBUG_KERNEL_PKG)/usr/lib/debug/lib/modules/$(KVNAME)/source
|
||||
rm -f debian/$(PMX_DEBUG_KERNEL_PKG)/usr/lib/debug/lib/modules/$(KVNAME)/build
|
||||
rm -f debian/$(PMX_DEBUG_KERNEL_PKG)/usr/lib/debug/lib/modules/$(KVNAME)/modules.*
|
||||
echo "'pkg.pve-kernel.debug' build profile enabled, creating -dbgsym contents"
|
||||
mkdir -p debian/$(PVE_DEBUG_KERNEL_PKG)/usr/lib/debug/lib/modules/$(KVNAME)
|
||||
mkdir debian/$(PVE_DEBUG_KERNEL_PKG)/usr/lib/debug/boot
|
||||
install -m 644 $(KERNEL_SRC)/vmlinux debian/$(PVE_DEBUG_KERNEL_PKG)/usr/lib/debug/boot/vmlinux-$(KVNAME)
|
||||
cp -r debian/$(PVE_KERNEL_PKG)/lib/modules/$(KVNAME) debian/$(PVE_DEBUG_KERNEL_PKG)/usr/lib/debug/lib/modules/
|
||||
rm -f debian/$(PVE_DEBUG_KERNEL_PKG)/usr/lib/debug/lib/modules/$(KVNAME)/source
|
||||
rm -f debian/$(PVE_DEBUG_KERNEL_PKG)/usr/lib/debug/lib/modules/$(KVNAME)/build
|
||||
rm -f debian/$(PVE_DEBUG_KERNEL_PKG)/usr/lib/debug/lib/modules/$(KVNAME)/modules.*
|
||||
endif
|
||||
|
||||
# strip debug info
|
||||
find debian/$(PMX_KERNEL_PKG)/lib/modules -name \*.ko -print | while read f ; do strip --strip-debug "$$f"; done
|
||||
|
||||
# sign modules using ephemeral, embedded key
|
||||
if grep -q CONFIG_MODULE_SIG=y ubuntu-kernel/.config ; then \
|
||||
find debian/$(PMX_KERNEL_PKG)/lib/modules -name \*.ko -print | while read f ; do \
|
||||
./ubuntu-kernel/scripts/sign-file sha512 ./ubuntu-kernel/certs/signing_key.pem ubuntu-kernel/certs/signing_key.x509 "$$f" ; \
|
||||
done; \
|
||||
rm ./ubuntu-kernel/certs/signing_key.pem ; \
|
||||
fi
|
||||
find debian/$(PVE_KERNEL_PKG)/lib/modules -name \*.ko -print | while read f ; do strip --strip-debug "$$f"; done
|
||||
# finalize
|
||||
/sbin/depmod -b debian/$(PMX_KERNEL_PKG)/ $(KVNAME)
|
||||
/sbin/depmod -b debian/$(PVE_KERNEL_PKG)/ $(KVNAME)
|
||||
# Autogenerate blacklist for watchdog devices (see README)
|
||||
install -m 0755 -d debian/$(PMX_KERNEL_PKG)/lib/modprobe.d
|
||||
ls debian/$(PMX_KERNEL_PKG)/lib/modules/$(KVNAME)/kernel/drivers/watchdog/ > watchdog-blacklist.tmp
|
||||
install -m 0755 -d debian/$(PVE_KERNEL_PKG)/lib/modprobe.d
|
||||
ls debian/$(PVE_KERNEL_PKG)/lib/modules/$(KVNAME)/kernel/drivers/watchdog/ > watchdog-blacklist.tmp
|
||||
echo ipmi_watchdog.ko >> watchdog-blacklist.tmp
|
||||
cat watchdog-blacklist.tmp|sed -e 's/^/blacklist /' -e 's/.ko$$//'|sort -u > debian/$(PMX_KERNEL_PKG)/lib/modprobe.d/blacklist_$(PMX_KERNEL_PKG).conf
|
||||
rm -f debian/$(PMX_KERNEL_PKG)/lib/modules/$(KVNAME)/source
|
||||
rm -f debian/$(PMX_KERNEL_PKG)/lib/modules/$(KVNAME)/build
|
||||
|
||||
# copy signing template contents
|
||||
rm -rf debian/${PMX_KERNEL_SIGNING_TEMPLATE_PKG}
|
||||
mkdir -p debian/${PMX_KERNEL_SIGNING_TEMPLATE_PKG}/usr/share/code-signing/${PMX_KERNEL_SIGNING_TEMPLATE_PKG}/source-template/debian
|
||||
cp -R debian/copyright \
|
||||
debian/signing-template/rules \
|
||||
debian/signing-template/control \
|
||||
debian/signing-template/source \
|
||||
debian/signing-template/changelog \
|
||||
debian/signing-template/prerm \
|
||||
debian/signing-template/postrm \
|
||||
debian/signing-template/postinst \
|
||||
debian/signing-template/SOURCE \
|
||||
debian/${PMX_KERNEL_SIGNING_TEMPLATE_PKG}/usr/share/code-signing/${PMX_KERNEL_SIGNING_TEMPLATE_PKG}/source-template/debian
|
||||
cp debian/signing-template/files.json debian/${PMX_KERNEL_SIGNING_TEMPLATE_PKG}/usr/share/code-signing/${PMX_KERNEL_SIGNING_TEMPLATE_PKG}/
|
||||
|
||||
cat watchdog-blacklist.tmp|sed -e 's/^/blacklist /' -e 's/.ko$$//'|sort -u > debian/$(PVE_KERNEL_PKG)/lib/modprobe.d/blacklist_$(PVE_KERNEL_PKG).conf
|
||||
rm -f debian/$(PVE_KERNEL_PKG)/lib/modules/$(KVNAME)/source
|
||||
rm -f debian/$(PVE_KERNEL_PKG)/lib/modules/$(KVNAME)/build
|
||||
touch $@
|
||||
|
||||
.tools_compile_mark: .compile_mark
|
||||
$(MAKE) -C $(KERNEL_SRC)/tools/perf prefix=/usr NO_LIBTRACEEVENT=1 HAVE_NO_LIBBFD=1 HAVE_CPLUS_DEMANGLE_SUPPORT=1 NO_LIBPYTHON=1 NO_LIBPERL=1 NO_LIBCRYPTO=1 PYTHON=python3
|
||||
$(MAKE) -C $(KERNEL_SRC)/tools/perf prefix=/usr HAVE_NO_LIBBFD=1 HAVE_CPLUS_DEMANGLE_SUPPORT=1 NO_LIBPYTHON=1 NO_LIBPERL=1 NO_LIBCRYPTO=1 PYTHON=python3
|
||||
echo "checking GPL-2 only perf binary for library linkage with incompatible licenses.."
|
||||
! ldd $(KERNEL_SRC)/tools/perf/perf | grep -q -E '\blibbfd'
|
||||
! ldd $(KERNEL_SRC)/tools/perf/perf | grep -q -E '\blibcrypto'
|
||||
$(MAKE) -C $(KERNEL_SRC)/tools/perf NO_LIBTRACEEVENT=1 man
|
||||
$(MAKE) -C $(KERNEL_SRC)/tools/perf man
|
||||
touch $@
|
||||
|
||||
.tools_install_mark: .tools_compile_mark
|
||||
@ -247,9 +193,9 @@ endif
|
||||
touch $@
|
||||
|
||||
.headers_prepare_mark: .config_mark
|
||||
rm -rf debian/$(PMX_HEADER_PKG)
|
||||
mkdir -p debian/$(PMX_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)
|
||||
install -m 0644 $(KERNEL_SRC)/.config debian/$(PMX_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)
|
||||
rm -rf debian/$(PVE_HEADER_PKG)
|
||||
mkdir -p debian/$(PVE_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)
|
||||
install -m 0644 $(KERNEL_SRC)/.config debian/$(PVE_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)
|
||||
make -C $(KERNEL_SRC_COPY) mrproper
|
||||
cd $(KERNEL_SRC_COPY); find . -path './debian/*' -prune \
|
||||
-o -path './include/*' -prune \
|
||||
@ -263,35 +209,35 @@ endif
|
||||
-o -name '*.sh' \
|
||||
-o -name '*.pl' \
|
||||
\) \
|
||||
-print | cpio -pd --preserve-modification-time $(BUILD_DIR)/debian/$(PMX_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)
|
||||
-print | cpio -pd --preserve-modification-time $(BUILD_DIR)/debian/$(PVE_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)
|
||||
cd $(KERNEL_SRC_COPY); \
|
||||
( \
|
||||
find arch/$(KERNEL_HEADER_ARCH) -name include -type d -print | \
|
||||
xargs -n1 -i: find : -type f \
|
||||
) | \
|
||||
cpio -pd --preserve-modification-time $(BUILD_DIR)/debian/$(PMX_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)
|
||||
cpio -pd --preserve-modification-time $(BUILD_DIR)/debian/$(PVE_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)
|
||||
touch $@
|
||||
|
||||
.headers_compile_mark: .headers_prepare_mark
|
||||
# set output to subdir of source to reduce number of hardcoded paths in output files
|
||||
rm -rf $(BUILD_DIR)/$(KERNEL_SRC_COPY)/$(PMX_HEADER_PKG)
|
||||
mkdir -p $(BUILD_DIR)/$(KERNEL_SRC_COPY)/$(PMX_HEADER_PKG)
|
||||
cp $(KERNEL_SRC)/.config $(BUILD_DIR)/$(KERNEL_SRC_COPY)/$(PMX_HEADER_PKG)/.config
|
||||
$(MAKE) -C $(KERNEL_SRC_COPY) O=$(BUILD_DIR)/$(KERNEL_SRC_COPY)/$(PMX_HEADER_PKG) -j1 syncconfig modules_prepare prepare scripts
|
||||
cd $(KERNEL_SRC_COPY); cp -a include scripts $(BUILD_DIR)/debian/$(PMX_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)
|
||||
find $(BUILD_DIR)/$(KERNEL_SRC_COPY)/$(PMX_HEADER_PKG) -name \*.o.ur-\* -o -name '*.cmd' | xargs rm -f
|
||||
rsync --ignore-existing -r -v -a $(addprefix $(BUILD_DIR)/$(KERNEL_SRC_COPY)/$(PMX_HEADER_PKG)/,arch include kernel scripts tools) $(BUILD_DIR)/debian/$(PMX_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)/
|
||||
rm -rf $(BUILD_DIR)/$(KERNEL_SRC_COPY)/$(PVE_HEADER_PKG)
|
||||
mkdir -p $(BUILD_DIR)/$(KERNEL_SRC_COPY)/$(PVE_HEADER_PKG)
|
||||
cp $(KERNEL_SRC)/.config $(BUILD_DIR)/$(KERNEL_SRC_COPY)/$(PVE_HEADER_PKG)/.config
|
||||
$(MAKE) -C $(KERNEL_SRC_COPY) O=$(BUILD_DIR)/$(KERNEL_SRC_COPY)/$(PVE_HEADER_PKG) -j1 syncconfig modules_prepare prepare scripts
|
||||
cd $(KERNEL_SRC_COPY); cp -a include scripts $(BUILD_DIR)/debian/$(PVE_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)
|
||||
find $(BUILD_DIR)/$(KERNEL_SRC_COPY)/$(PVE_HEADER_PKG) -name \*.o.ur-\* -o -name '*.cmd' | xargs rm -f
|
||||
rsync --ignore-existing -r -v -a $(addprefix $(BUILD_DIR)/$(KERNEL_SRC_COPY)/$(PVE_HEADER_PKG)/,arch include kernel scripts tools) $(BUILD_DIR)/debian/$(PVE_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)/
|
||||
rm -rf $(BUILD_DIR)/$(KERNEL_SRC_COPY)
|
||||
touch $@
|
||||
|
||||
.headers_install_mark: .compile_mark .modules_compile_mark .headers_compile_mark
|
||||
cp $(KERNEL_SRC)/include/generated/compile.h debian/$(PMX_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)/include/generated/compile.h
|
||||
install -m 0644 $(KERNEL_SRC)/Module.symvers debian/$(PMX_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)
|
||||
mkdir -p debian/$(PMX_HEADER_PKG)/lib/modules/$(KVNAME)
|
||||
ln -sf /usr/src/linux-headers-$(KVNAME) debian/$(PMX_HEADER_PKG)/lib/modules/$(KVNAME)/build
|
||||
cp $(KERNEL_SRC)/include/generated/compile.h debian/$(PVE_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)/include/generated/compile.h
|
||||
install -m 0644 $(KERNEL_SRC)/Module.symvers debian/$(PVE_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)
|
||||
mkdir -p debian/$(PVE_HEADER_PKG)/lib/modules/$(KVNAME)
|
||||
ln -sf /usr/src/linux-headers-$(KVNAME) debian/$(PVE_HEADER_PKG)/lib/modules/$(KVNAME)/build
|
||||
touch $@
|
||||
|
||||
.usr_headers_install_mark: PKG_DIR = debian/$(PMX_USR_HEADER_PKG)
|
||||
.usr_headers_install_mark: PKG_DIR = debian/$(PVE_USR_HEADER_PKG)
|
||||
.usr_headers_install_mark: OUT_DIR = $(PKG_DIR)/usr
|
||||
.usr_headers_install_mark: .config_mark
|
||||
rm -rf '$(PKG_DIR)'
|
||||
@ -314,11 +260,18 @@ $(MODULES)/zfs.ko: .compile_mark
|
||||
cd $(MODULES)/$(ZFSDIR); ./autogen.sh
|
||||
cd $(MODULES)/$(ZFSDIR); ./configure --with-config=kernel --with-linux=$(BUILD_DIR)/$(KERNEL_SRC) --with-linux-obj=$(BUILD_DIR)/$(KERNEL_SRC)
|
||||
$(MAKE) -C $(MODULES)/$(ZFSDIR)
|
||||
cp $(MODULES)/$(ZFSDIR)/module/zfs.ko $(MODULES)/
|
||||
cp $(MODULES)/$(ZFSDIR)/module/spl.ko $(MODULES)/
|
||||
cp $(MODULES)/$(ZFSDIR)/module/avl/zavl.ko $(MODULES)/
|
||||
cp $(MODULES)/$(ZFSDIR)/module/nvpair/znvpair.ko $(MODULES)/
|
||||
cp $(MODULES)/$(ZFSDIR)/module/unicode/zunicode.ko $(MODULES)/
|
||||
cp $(MODULES)/$(ZFSDIR)/module/zcommon/zcommon.ko $(MODULES)/
|
||||
cp $(MODULES)/$(ZFSDIR)/module/icp/icp.ko $(MODULES)/
|
||||
cp $(MODULES)/$(ZFSDIR)/module/zfs/zfs.ko $(MODULES)/
|
||||
cp $(MODULES)/$(ZFSDIR)/module/lua/zlua.ko $(MODULES)/
|
||||
cp $(MODULES)/$(ZFSDIR)/module/spl/spl.ko $(MODULES)/
|
||||
cp $(MODULES)/$(ZFSDIR)/module/zstd/zzstd.ko $(MODULES)/
|
||||
|
||||
fwlist-$(KVNAME): .compile_mark .modules_compile_mark
|
||||
debian/scripts/find-firmware.pl debian/$(PMX_KERNEL_PKG)/lib/modules/$(KVNAME) >fwlist.tmp
|
||||
debian/scripts/find-firmware.pl debian/$(PVE_KERNEL_PKG)/lib/modules/$(KVNAME) >fwlist.tmp
|
||||
mv fwlist.tmp $@
|
||||
|
||||
.PHONY: fwcheck
|
||||
@ -333,7 +286,7 @@ fwcheck: fwlist-$(KVNAME) fwlist-previous
|
||||
|
||||
|
||||
abi-$(KVNAME): .compile_mark
|
||||
debian/scripts/abi-generate debian/$(PMX_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)/Module.symvers abi-$(KVNAME) $(KVNAME)
|
||||
debian/scripts/abi-generate debian/$(PVE_HEADER_PKG)/usr/src/linux-headers-$(KVNAME)/Module.symvers abi-$(KVNAME) $(KVNAME)
|
||||
|
||||
.PHONY: abicheck
|
||||
abicheck: debian/scripts/abi-check abi-$(KVNAME) abi-prev-* abi-blacklist
|
||||
|
218
debian/scripts/abi-check
vendored
218
debian/scripts/abi-check
vendored
@ -1,7 +1,4 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
my $abinew = shift;
|
||||
my $abiold = shift;
|
||||
@ -25,30 +22,30 @@ my $count;
|
||||
print "II: Checking ABI...\n";
|
||||
|
||||
if ($skipabi) {
|
||||
print "WW: Explicitly asked to ignore ABI, running in no-fail mode\n";
|
||||
$fail_exit = 0;
|
||||
$abiskip = 1;
|
||||
$EE = "WW:";
|
||||
print "WW: Explicitly asked to ignore ABI, running in no-fail mode\n";
|
||||
$fail_exit = 0;
|
||||
$abiskip = 1;
|
||||
$EE = "WW:";
|
||||
}
|
||||
|
||||
if ($prev_abistr ne $abistr) {
|
||||
print "II: Different ABI's, running in no-fail mode\n";
|
||||
$fail_exit = 0;
|
||||
$EE = "WW:";
|
||||
print "II: Different ABI's, running in no-fail mode\n";
|
||||
$fail_exit = 0;
|
||||
$EE = "WW:";
|
||||
}
|
||||
|
||||
if (not -f "$abinew" or not -f "$abiold") {
|
||||
print "EE: Previous or current ABI file missing!\n";
|
||||
print " $abinew\n" if not -f "$abinew";
|
||||
print " $abiold\n" if not -f "$abiold";
|
||||
print "EE: Previous or current ABI file missing!\n";
|
||||
print " $abinew\n" if not -f "$abinew";
|
||||
print " $abiold\n" if not -f "$abiold";
|
||||
|
||||
# Exit if the ABI files are missing, but return status based on whether
|
||||
# skip ABI was indicated.
|
||||
if ("$abiskip" eq "1") {
|
||||
exit(0);
|
||||
} else {
|
||||
exit(1);
|
||||
}
|
||||
# Exit if the ABI files are missing, but return status based on whether
|
||||
# skip ABI was indicated.
|
||||
if ("$abiskip" eq "1") {
|
||||
exit(0);
|
||||
} else {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
my %symbols;
|
||||
@ -60,97 +57,101 @@ my %module_syms;
|
||||
my $ignore = 0;
|
||||
print " Reading symbols/modules to ignore...";
|
||||
|
||||
for my $file ("abi-blacklist") {
|
||||
next if !-f $file;
|
||||
open(my $IGNORE_FH, '<', $file) or die "Could not open $file - $!";
|
||||
|
||||
while (<$IGNORE_FH>) {
|
||||
chomp;
|
||||
if ($_ =~ m/M: (.*)/) {
|
||||
$modules_ignore{$1} = 1;
|
||||
} else {
|
||||
$symbols_ignore{$_} = 1;
|
||||
for $file ("abi-blacklist") {
|
||||
if (-f $file) {
|
||||
open(IGNORE, "< $file") or
|
||||
die "Could not open $file";
|
||||
while (<IGNORE>) {
|
||||
chomp;
|
||||
if ($_ =~ m/M: (.*)/) {
|
||||
$modules_ignore{$1} = 1;
|
||||
} else {
|
||||
$symbols_ignore{$_} = 1;
|
||||
}
|
||||
$ignore++;
|
||||
}
|
||||
close(IGNORE);
|
||||
}
|
||||
$ignore++;
|
||||
}
|
||||
close($IGNORE_FH);
|
||||
}
|
||||
print "read $ignore symbols/modules.\n";
|
||||
|
||||
sub is_ignored($$) {
|
||||
my ($mod, $sym) = @_;
|
||||
my ($mod, $sym) = @_;
|
||||
|
||||
die "Missing module name in is_ignored()" if not defined($mod);
|
||||
die "Missing symbol name in is_ignored()" if not defined($sym);
|
||||
die "Missing module name in is_ignored()" if not defined($mod);
|
||||
die "Missing symbol name in is_ignored()" if not defined($sym);
|
||||
|
||||
if (defined($symbols_ignore{$sym}) or defined($modules_ignore{$mod})) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
if (defined($symbols_ignore{$sym}) or defined($modules_ignore{$mod})) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
# Read new syms first
|
||||
print " Reading new symbols ($abistr)...";
|
||||
$count = 0;
|
||||
open(my $NEW_FH, '<', $abinew) or die "Could not open $abinew - $!";
|
||||
while (<$NEW_FH>) {
|
||||
chomp;
|
||||
m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/;
|
||||
$symbols{$4}{'type'} = $1;
|
||||
$symbols{$4}{'loc'} = $2;
|
||||
$symbols{$4}{'hash'} = $3;
|
||||
$module_syms{$2} = 0;
|
||||
$count++;
|
||||
open(NEW, "< $abinew") or
|
||||
die "Could not open $abinew";
|
||||
while (<NEW>) {
|
||||
chomp;
|
||||
m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/;
|
||||
$symbols{$4}{'type'} = $1;
|
||||
$symbols{$4}{'loc'} = $2;
|
||||
$symbols{$4}{'hash'} = $3;
|
||||
$module_syms{$2} = 0;
|
||||
$count++;
|
||||
}
|
||||
close($NEW_FH);
|
||||
close(NEW);
|
||||
print "read $count symbols.\n";
|
||||
|
||||
# Now the old symbols, checking for missing ones
|
||||
print " Reading old symbols...";
|
||||
$count = 0;
|
||||
open(my $OLD_FH, '<', $abiold) or die "Could not open $abiold - $!";
|
||||
while (<$OLD_FH>) {
|
||||
chomp;
|
||||
m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/;
|
||||
$symbols{$4}{'old_type'} = $1;
|
||||
$symbols{$4}{'old_loc'} = $2;
|
||||
$symbols{$4}{'old_hash'} = $3;
|
||||
$count++;
|
||||
open(OLD, "< $abiold") or
|
||||
die "Could not open $abiold";
|
||||
while (<OLD>) {
|
||||
chomp;
|
||||
m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/;
|
||||
$symbols{$4}{'old_type'} = $1;
|
||||
$symbols{$4}{'old_loc'} = $2;
|
||||
$symbols{$4}{'old_hash'} = $3;
|
||||
$count++;
|
||||
}
|
||||
close($OLD_FH);
|
||||
close(OLD);
|
||||
|
||||
print "read $count symbols.\n";
|
||||
|
||||
print "II: Checking for missing symbols in new ABI...";
|
||||
$count = 0;
|
||||
for my $sym (keys(%symbols)) {
|
||||
if (!defined($symbols{$sym}{'type'})) {
|
||||
print "\n" if not $count;
|
||||
printf(" MISS : %s%s\n", $sym, is_ignored($symbols{$sym}{'old_loc'}, $sym) ? " (ignored)" : "");
|
||||
$count++ if !is_ignored($symbols{$sym}{'old_loc'}, $sym);
|
||||
}
|
||||
foreach $sym (keys(%symbols)) {
|
||||
if (!defined($symbols{$sym}{'type'})) {
|
||||
print "\n" if not $count;
|
||||
printf(" MISS : %s%s\n", $sym,
|
||||
is_ignored($symbols{$sym}{'old_loc'}, $sym) ? " (ignored)" : "");
|
||||
$count++ if !is_ignored($symbols{$sym}{'old_loc'}, $sym);
|
||||
}
|
||||
}
|
||||
print " " if $count;
|
||||
print "found $count missing symbols\n";
|
||||
if ($count) {
|
||||
print "$EE Symbols gone missing (what did you do!?!)\n";
|
||||
$errors++;
|
||||
print "$EE Symbols gone missing (what did you do!?!)\n";
|
||||
$errors++;
|
||||
}
|
||||
|
||||
|
||||
print "II: Checking for new symbols in new ABI...";
|
||||
$count = 0;
|
||||
for my $sym (keys(%symbols)) {
|
||||
if (!defined($symbols{$sym}{'old_type'})) {
|
||||
print "\n" if not $count;
|
||||
print " NEW : $sym\n";
|
||||
$count++;
|
||||
}
|
||||
foreach $sym (keys(%symbols)) {
|
||||
if (!defined($symbols{$sym}{'old_type'})) {
|
||||
print "\n" if not $count;
|
||||
print " NEW : $sym\n";
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
print " " if $count;
|
||||
print "found $count new symbols\n";
|
||||
if ($count) {
|
||||
print "WW: Found new symbols. Not recommended unless ABI was bumped\n";
|
||||
print "WW: Found new symbols. Not recommended unless ABI was bumped\n";
|
||||
}
|
||||
|
||||
print "II: Checking for changes to ABI...\n";
|
||||
@ -158,34 +159,37 @@ $count = 0;
|
||||
my $moved = 0;
|
||||
my $changed_type = 0;
|
||||
my $changed_hash = 0;
|
||||
for my $sym (keys(%symbols)) {
|
||||
if (!defined($symbols{$sym}{'old_type'}) or !defined($symbols{$sym}{'type'})) {
|
||||
next;
|
||||
}
|
||||
foreach $sym (keys(%symbols)) {
|
||||
if (!defined($symbols{$sym}{'old_type'}) or
|
||||
!defined($symbols{$sym}{'type'})) {
|
||||
next;
|
||||
}
|
||||
|
||||
# Changes in location don't hurt us, but log it anyway
|
||||
if ($symbols{$sym}{'loc'} ne $symbols{$sym}{'old_loc'}) {
|
||||
printf(" MOVE : %-40s : %s => %s\n", $sym, $symbols{$sym}{'old_loc'}, $symbols{$sym}{'loc'});
|
||||
$moved++;
|
||||
}
|
||||
# Changes in location don't hurt us, but log it anyway
|
||||
if ($symbols{$sym}{'loc'} ne $symbols{$sym}{'old_loc'}) {
|
||||
printf(" MOVE : %-40s : %s => %s\n", $sym, $symbols{$sym}{'old_loc'},
|
||||
$symbols{$sym}{'loc'});
|
||||
$moved++;
|
||||
}
|
||||
|
||||
# Changes to export type are only bad if new type isn't
|
||||
# EXPORT_SYMBOL. Changing things to GPL are bad.
|
||||
if ($symbols{$sym}{'type'} ne $symbols{$sym}{'old_type'}) {
|
||||
printf(" TYPE : %-40s : %s => %s%s\n", $sym, $symbols{$sym}{'old_type'}.
|
||||
$symbols{$sym}{'type'}, is_ignored($symbols{$sym}{'loc'}, $sym)
|
||||
? " (ignored)" : "");
|
||||
$changed_type++ if $symbols{$sym}{'type'} ne "EXPORT_SYMBOL" and !is_ignored($symbols{$sym}{'loc'}, $sym);
|
||||
}
|
||||
# Changes to export type are only bad if new type isn't
|
||||
# EXPORT_SYMBOL. Changing things to GPL are bad.
|
||||
if ($symbols{$sym}{'type'} ne $symbols{$sym}{'old_type'}) {
|
||||
printf(" TYPE : %-40s : %s => %s%s\n", $sym, $symbols{$sym}{'old_type'}.
|
||||
$symbols{$sym}{'type'}, is_ignored($symbols{$sym}{'loc'}, $sym)
|
||||
? " (ignored)" : "");
|
||||
$changed_type++ if $symbols{$sym}{'type'} ne "EXPORT_SYMBOL"
|
||||
and !is_ignored($symbols{$sym}{'loc'}, $sym);
|
||||
}
|
||||
|
||||
# Changes to the hash are always bad
|
||||
if ($symbols{$sym}{'hash'} ne $symbols{$sym}{'old_hash'}) {
|
||||
printf(" HASH : %-40s : %s => %s%s\n", $sym, $symbols{$sym}{'old_hash'},
|
||||
$symbols{$sym}{'hash'}, is_ignored($symbols{$sym}{'loc'}, $sym)
|
||||
? " (ignored)" : "");
|
||||
$changed_hash++ if !is_ignored($symbols{$sym}{'loc'}, $sym);
|
||||
$module_syms{$symbols{$sym}{'loc'}}++;
|
||||
}
|
||||
# Changes to the hash are always bad
|
||||
if ($symbols{$sym}{'hash'} ne $symbols{$sym}{'old_hash'}) {
|
||||
printf(" HASH : %-40s : %s => %s%s\n", $sym, $symbols{$sym}{'old_hash'},
|
||||
$symbols{$sym}{'hash'}, is_ignored($symbols{$sym}{'loc'}, $sym)
|
||||
? " (ignored)" : "");
|
||||
$changed_hash++ if !is_ignored($symbols{$sym}{'loc'}, $sym);
|
||||
$module_syms{$symbols{$sym}{'loc'}}++;
|
||||
}
|
||||
}
|
||||
|
||||
print "WW: $moved symbols changed location\n" if $moved;
|
||||
@ -194,17 +198,17 @@ print "$EE $changed_hash symbols changed hash and weren't ignored\n" if $changed
|
||||
|
||||
$errors++ if $changed_hash or $changed_type;
|
||||
if ($changed_hash) {
|
||||
print "II: Module hash change summary...\n";
|
||||
for my $mod (sort { $module_syms{$b} <=> $module_syms{$a} } keys %module_syms) {
|
||||
next if ! $module_syms{$mod};
|
||||
printf(" %-40s: %d\n", $mod, $module_syms{$mod});
|
||||
}
|
||||
print "II: Module hash change summary...\n";
|
||||
foreach $mod (sort { $module_syms{$b} <=> $module_syms{$a} } keys %module_syms) {
|
||||
next if ! $module_syms{$mod};
|
||||
printf(" %-40s: %d\n", $mod, $module_syms{$mod});
|
||||
}
|
||||
}
|
||||
|
||||
print "II: Done\n";
|
||||
|
||||
if ($errors) {
|
||||
exit($fail_exit);
|
||||
exit($fail_exit);
|
||||
} else {
|
||||
exit(0);
|
||||
exit(0);
|
||||
}
|
||||
|
9
debian/scripts/abi-generate
vendored
9
debian/scripts/abi-generate
vendored
@ -1,11 +1,8 @@
|
||||
#!/usr/bin/perl
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use PVE::Tools;
|
||||
|
||||
use PVE::Tools ();
|
||||
|
||||
use IO::File ();
|
||||
use IO::File;
|
||||
|
||||
sub usage {
|
||||
die "USAGE: $0 INFILE OUTFILE [ABI INFILE-IS-DEB]\n";
|
||||
|
15
debian/scripts/find-firmware.pl
vendored
15
debian/scripts/find-firmware.pl
vendored
@ -1,7 +1,6 @@
|
||||
#!/usr/bin/perl
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $dir = shift;
|
||||
|
||||
@ -13,21 +12,21 @@ warn "\n\nNOTE: strange directory name: $dir\n\n" if $dir !~ m|^(.*/)?(\d+.\d+.\
|
||||
|
||||
my $apiver = $2;
|
||||
|
||||
open(my $FIND_KO_FH, "find '$dir' -name '*.ko'|");
|
||||
while (defined(my $fn = <$FIND_KO_FH>)) {
|
||||
open(TMP, "find '$dir' -name '*.ko'|");
|
||||
while (defined(my $fn = <TMP>)) {
|
||||
chomp $fn;
|
||||
my $relfn = $fn;
|
||||
$relfn =~ s|^$dir/*||;
|
||||
|
||||
my $cmd = "/sbin/modinfo -F firmware '$fn'";
|
||||
open(my $MOD_FH, "$cmd|");
|
||||
while (defined(my $fw = <$MOD_FH>)) {
|
||||
open(MOD, "$cmd|");
|
||||
while (defined(my $fw = <MOD>)) {
|
||||
chomp $fw;
|
||||
print "$fw $relfn\n";
|
||||
}
|
||||
close($MOD_FH);
|
||||
close(MOD);
|
||||
|
||||
}
|
||||
close($FIND_KO_FH);
|
||||
close TMP;
|
||||
|
||||
exit 0;
|
||||
|
25
debian/signing-template/control.in
vendored
25
debian/signing-template/control.in
vendored
@ -1,25 +0,0 @@
|
||||
Source: proxmox-kernel-signed-@KVMAJMIN@
|
||||
Section: kernel
|
||||
Priority: optional
|
||||
Maintainer: Proxmox Support Team <support@proxmox.com>
|
||||
Standards-Version: 4.2.0
|
||||
Build-Depends: debhelper-compat (= 12), dh-exec, python3:any, rsync, sbsigntool, proxmox-kernel-@KVNAME@ (= @UNSIGNED_VERSION@)
|
||||
Rules-Requires-Root: no
|
||||
Vcs-Git: git://git.proxmox.com/git/pve-kernel
|
||||
Vcs-Browser: https://git.proxmox.com/?p=pve-kernel.git
|
||||
|
||||
Package: proxmox-kernel-@KVNAME@-signed
|
||||
Section: admin
|
||||
Priority: optional
|
||||
Architecture: any
|
||||
Provides: linux-image-@KVNAME@-amd64, proxmox-kernel-@KVNAME@
|
||||
Depends: ${unsigned:Depends}, ${misc:Depends}
|
||||
Recommends: ${unsigned:Recommends}
|
||||
Suggests: ${unsigned:Suggests}
|
||||
Breaks: ${unsigned:Breaks}
|
||||
Conflicts: proxmox-kernel-@KVNAME@
|
||||
Replaces: proxmox-kernel-@KVNAME@
|
||||
Description: ${unsigned:DescriptionShort} (signed)
|
||||
${unsigned:DescriptionLong}
|
||||
.
|
||||
This package contains the kernel image signed by the Proxmox Secure Boot CA.
|
13
debian/signing-template/files.json.in
vendored
13
debian/signing-template/files.json.in
vendored
@ -1,13 +0,0 @@
|
||||
{
|
||||
"packages": {
|
||||
"proxmox-kernel-@KVNAME@": {
|
||||
"trusted_certs": [],
|
||||
"files": [
|
||||
{
|
||||
"sig_type": "efi",
|
||||
"file": "boot/vmlinuz-@KVNAME@"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
58
debian/signing-template/rules.in
vendored
58
debian/signing-template/rules.in
vendored
@ -1,58 +0,0 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
SHELL := bash -e
|
||||
|
||||
export DH_OPTIONS
|
||||
|
||||
include /usr/share/dpkg/architecture.mk
|
||||
|
||||
KERNEL_VERSION=@KVNAME@
|
||||
IMAGE_PACKAGE_NAME=proxmox-kernel-$(KERNEL_VERSION)
|
||||
PACKAGE_NAME=$(IMAGE_PACKAGE_NAME)-signed
|
||||
PACKAGE_VERSION=@PKG_VERSION@
|
||||
PACKAGE_DIR=debian/$(PACKAGE_NAME)
|
||||
SIGNATURE_DIR=debian/signatures/${IMAGE_PACKAGE_NAME}
|
||||
|
||||
build: build-arch build-indep
|
||||
build-arch:
|
||||
build-indep:
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_clean
|
||||
|
||||
binary: binary-arch binary-indep
|
||||
binary-arch:
|
||||
dh_testdir
|
||||
mkdir -p $(PACKAGE_DIR)/boot
|
||||
rsync -a $(patsubst %,/boot/%-$(KERNEL_VERSION),config System.map vmlinuz) $(PACKAGE_DIR)/boot/
|
||||
if [ -f $(SIGNATURE_DIR)/boot/vmlinuz-$(KERNEL_VERSION).sig ]; then \
|
||||
sbattach --attach $(SIGNATURE_DIR)/boot/vmlinuz-$(KERNEL_VERSION).sig \
|
||||
$(PACKAGE_DIR)/boot/vmlinuz-$(KERNEL_VERSION); \
|
||||
else \
|
||||
echo "No signature for image 'vmlinuz-$(KERNEL_VERSION)' found in '$(SIGNATURE_DIR)'"; \
|
||||
false; \
|
||||
fi
|
||||
mkdir -p $(PACKAGE_DIR)/lib/modules/$(KERNEL_VERSION)
|
||||
rsync -ar /lib/modules/$(KERNEL_VERSION)/ $(PACKAGE_DIR)/lib/modules/$(KERNEL_VERSION)/
|
||||
mkdir -p $(PACKAGE_DIR)/lib/modprobe.d/
|
||||
cp /lib/modprobe.d/blacklist_$(IMAGE_PACKAGE_NAME).conf $(PACKAGE_DIR)/lib/modprobe.d/
|
||||
dh_install
|
||||
dh_installchangelogs
|
||||
dh_installdocs -A debian/copyright debian/SOURCE
|
||||
dh_lintian
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
dh_installdeb
|
||||
# Copy most package relations and description from unsigned package
|
||||
for field in Depends Suggests Recommends Breaks; do \
|
||||
echo >> debian/$(PACKAGE_NAME).substvars "unsigned:$$field=$$(dpkg-query -f '$${'$$field'}' -W $(IMAGE_PACKAGE_NAME))"; \
|
||||
done
|
||||
echo >> debian/$(PACKAGE_NAME).substvars "unsigned:DescriptionShort=$$(dpkg-query -f '$${Description}' -W $(IMAGE_PACKAGE_NAME) | head -n 1)"
|
||||
echo >> debian/$(PACKAGE_NAME).substvars "unsigned:DescriptionLong=$$(dpkg-query -f '$${Description}' -W $(IMAGE_PACKAGE_NAME) | tail -n +2 | sed -rz 's/\$$/$${}/g; s/^ //; s/\n \.?/$${Newline}/g')"
|
||||
dh_gencontrol -- -v$(PACKAGE_VERSION)
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
binary-indep:
|
||||
|
||||
.PHONY: build build-arch build-indep clean binary binary-arch binary-indep
|
1
debian/signing-template/source/format
vendored
1
debian/signing-template/source/format
vendored
@ -1 +0,0 @@
|
||||
3.0 (native)
|
4
debian/source/lintian-overrides
vendored
4
debian/source/lintian-overrides
vendored
@ -1,2 +1,2 @@
|
||||
debian-control-has-dbgsym-package (in section for proxmox-kernel-*-pve-dbgsym) Package [debian/control:*]
|
||||
license-problem-gfdl-invariants invariant part is: with the :ref:`invariant sections <fdl-invariant>` being list their titles, with the :ref:`front-cover texts <fdl-cover-texts>` being list, and with the :ref:`back-cover texts <fdl-cover-texts>` being list [ubuntu-kernel/Documentation/userspace-api/media/fdl-appendix.rst]
|
||||
pve-kernel source: debian-control-has-dbgsym-package (in section for pve-kernel-*-pve-dbgsym) Package [debian/control:*]
|
||||
pve-kernel source: license-problem-gfdl-invariants invariant part is: with the :ref:`invariant sections <fdl-invariant>` being list their titles, with the :ref:`front-cover texts <fdl-cover-texts>` being list, and with the :ref:`back-cover texts <fdl-cover-texts>` being list [ubuntu-kernel/Documentation/userspace-api/media/fdl-appendix.rst]
|
||||
|
1036
fwlist-previous
1036
fwlist-previous
File diff suppressed because it is too large
Load Diff
@ -17,19 +17,28 @@ $KBUILD_BUILD_TIMESTAMP.
|
||||
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
init/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
scripts/mkcompile_h | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/init/Makefile b/init/Makefile
|
||||
index cbac576c57d6..479b1253fcbe 100644
|
||||
--- a/init/Makefile
|
||||
+++ b/init/Makefile
|
||||
@@ -29,7 +29,7 @@ preempt-flag-$(CONFIG_PREEMPT_DYNAMIC) := PREEMPT_DYNAMIC
|
||||
preempt-flag-$(CONFIG_PREEMPT_RT) := PREEMPT_RT
|
||||
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
|
||||
index 6a2a04d92f42..6c9430ee1a09 100755
|
||||
--- a/scripts/mkcompile_h
|
||||
+++ b/scripts/mkcompile_h
|
||||
@@ -22,10 +22,14 @@ else
|
||||
VERSION=$KBUILD_BUILD_VERSION
|
||||
fi
|
||||
|
||||
build-version = $(or $(KBUILD_BUILD_VERSION), $(build-version-auto))
|
||||
-build-timestamp = $(or $(KBUILD_BUILD_TIMESTAMP), $(build-timestamp-auto))
|
||||
+build-timestamp = $(or $(KBUILD_BUILD_VERSION_TIMESTAMP), $(KBUILD_BUILD_TIMESTAMP), $(build-timestamp-auto))
|
||||
|
||||
# Maximum length of UTS_VERSION is 64 chars
|
||||
filechk_uts_version = \
|
||||
-if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then
|
||||
- TIMESTAMP=`date`
|
||||
+if [ -z "$KBUILD_BUILD_VERSION_TIMESTAMP" ]; then
|
||||
+ if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then
|
||||
+ TIMESTAMP=`date`
|
||||
+ else
|
||||
+ TIMESTAMP=$KBUILD_BUILD_TIMESTAMP
|
||||
+ fi
|
||||
else
|
||||
- TIMESTAMP=$KBUILD_BUILD_TIMESTAMP
|
||||
+ TIMESTAMP=$KBUILD_BUILD_VERSION_TIMESTAMP
|
||||
fi
|
||||
if test -z "$KBUILD_BUILD_USER"; then
|
||||
LINUX_COMPILE_BY=$(whoami | sed 's/\\/\\\\/')
|
||||
|
@ -19,10 +19,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||
|
||||
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
|
||||
index 75204d36d7f9..1fb5ff73ec1e 100644
|
||||
index 3326dfced68a..3f1604948ace 100644
|
||||
--- a/net/bridge/br_stp_if.c
|
||||
+++ b/net/bridge/br_stp_if.c
|
||||
@@ -265,10 +265,7 @@ bool br_stp_recalculate_bridge_id(struct net_bridge *br)
|
||||
@@ -268,10 +268,7 @@ bool br_stp_recalculate_bridge_id(struct net_bridge *br)
|
||||
return false;
|
||||
|
||||
list_for_each_entry(p, &br->port_list, list) {
|
||||
|
@ -55,10 +55,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
2 files changed, 111 insertions(+)
|
||||
|
||||
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
|
||||
index 4272acb3d047..d18cc2c1f9c3 100644
|
||||
index 6c1254a22225..91c091c0f2c9 100644
|
||||
--- a/Documentation/admin-guide/kernel-parameters.txt
|
||||
+++ b/Documentation/admin-guide/kernel-parameters.txt
|
||||
@@ -4400,6 +4400,15 @@
|
||||
@@ -4035,6 +4035,15 @@
|
||||
Also, it enforces the PCI Local Bus spec
|
||||
rule that those bits should be 0 in system reset
|
||||
events (useful for kexec/kdump cases).
|
||||
@ -75,10 +75,10 @@ index 4272acb3d047..d18cc2c1f9c3 100644
|
||||
Safety option to keep boot IRQs enabled. This
|
||||
should never be necessary.
|
||||
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
|
||||
index ce469d84ebae..4f163ef55e7b 100644
|
||||
index bc680bdcbbed..faa53ccc9b69 100644
|
||||
--- a/drivers/pci/quirks.c
|
||||
+++ b/drivers/pci/quirks.c
|
||||
@@ -287,6 +287,106 @@ static int __init pci_apply_final_quirks(void)
|
||||
@@ -194,6 +194,106 @@ static int __init pci_apply_final_quirks(void)
|
||||
}
|
||||
fs_initcall_sync(pci_apply_final_quirks);
|
||||
|
||||
@ -185,7 +185,7 @@ index ce469d84ebae..4f163ef55e7b 100644
|
||||
/*
|
||||
* Decoding should be disabled for a PCI device during BAR sizing to avoid
|
||||
* conflict. But doing so may cause problems on host bridge and perhaps other
|
||||
@@ -5100,6 +5200,8 @@ static const struct pci_dev_acs_enabled {
|
||||
@@ -4972,6 +5072,8 @@ static const struct pci_dev_acs_enabled {
|
||||
{ PCI_VENDOR_ID_CAVIUM, 0xA060, pci_quirk_mf_endpoint_acs },
|
||||
/* APM X-Gene */
|
||||
{ PCI_VENDOR_ID_AMCC, 0xE004, pci_quirk_xgene_acs },
|
||||
|
@ -13,10 +13,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
|
||||
index 0f50960b0e3a..37f840f57f32 100644
|
||||
index d11c581ce9b9..0b0ce6979370 100644
|
||||
--- a/virt/kvm/kvm_main.c
|
||||
+++ b/virt/kvm/kvm_main.c
|
||||
@@ -82,7 +82,7 @@ module_param(halt_poll_ns, uint, 0644);
|
||||
@@ -79,7 +79,7 @@ module_param(halt_poll_ns, uint, 0644);
|
||||
EXPORT_SYMBOL_GPL(halt_poll_ns);
|
||||
|
||||
/* Default doubles per-vcpu halt_poll_ns. */
|
||||
|
@ -3,26 +3,22 @@ From: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
Date: Wed, 7 Oct 2020 17:18:28 +0200
|
||||
Subject: [PATCH] net: core: downgrade unregister_netdevice refcount leak from
|
||||
emergency to error
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
|
||||
---
|
||||
net/core/dev.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/net/core/dev.c b/net/core/dev.c
|
||||
index c365aa06f886..c9066a7aa4c5 100644
|
||||
index f80bc2ca888a..6ca7a4b8a8f4 100644
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -10470,7 +10470,7 @@ static struct net_device *netdev_wait_allrefs_any(struct list_head *list)
|
||||
if (time_after(jiffies, warning_time +
|
||||
READ_ONCE(netdev_unregister_timeout_secs) * HZ)) {
|
||||
list_for_each_entry(dev, list, todo_list) {
|
||||
- pr_emerg("unregister_netdevice: waiting for %s to become free. Usage count = %d\n",
|
||||
+ pr_err("unregister_netdevice: waiting for %s to become free. Usage count = %d\n",
|
||||
dev->name, netdev_refcnt_read(dev));
|
||||
ref_tracker_dir_print(&dev->refcnt_tracker, 10);
|
||||
}
|
||||
@@ -10562,7 +10562,7 @@ static void netdev_wait_allrefs(struct net_device *dev)
|
||||
if (refcnt != 1 &&
|
||||
time_after(jiffies, warning_time +
|
||||
netdev_unregister_timeout_secs * HZ)) {
|
||||
- pr_emerg("unregister_netdevice: waiting for %s to become free. Usage count = %d\n",
|
||||
+ pr_err("unregister_netdevice: waiting for %s to become free. Usage count = %d\n",
|
||||
dev->name, refcnt);
|
||||
warning_time = jiffies;
|
||||
}
|
||||
|
@ -0,0 +1,104 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
Date: Mon, 27 Sep 2021 11:28:39 +0200
|
||||
Subject: [PATCH] Revert "PCI: Coalesce host bridge contiguous apertures"
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This reverts commit ab20e43b20b60f5cc8e2ea3763ffa388158469ac.
|
||||
|
||||
was reverted upstream because of reports similar to
|
||||
|
||||
Link: https://bugzilla.proxmox.com/show_bug.cgi?id=3552
|
||||
Link: https://lore.kernel.org/r/20210709231529.GA3270116@roeck-us.net
|
||||
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
drivers/pci/probe.c | 50 ++++-----------------------------------------
|
||||
1 file changed, 4 insertions(+), 46 deletions(-)
|
||||
|
||||
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
|
||||
index 103ee42f6717..6b73e9179111 100644
|
||||
--- a/drivers/pci/probe.c
|
||||
+++ b/drivers/pci/probe.c
|
||||
@@ -20,7 +20,6 @@
|
||||
#include <linux/irqdomain.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/bitfield.h>
|
||||
-#include <linux/list_sort.h>
|
||||
#include "pci.h"
|
||||
|
||||
#define CARDBUS_LATENCY_TIMER 176 /* secondary latency timer */
|
||||
@@ -881,31 +880,14 @@ static void pci_set_bus_msi_domain(struct pci_bus *bus)
|
||||
dev_set_msi_domain(&bus->dev, d);
|
||||
}
|
||||
|
||||
-static int res_cmp(void *priv, const struct list_head *a,
|
||||
- const struct list_head *b)
|
||||
-{
|
||||
- struct resource_entry *entry1, *entry2;
|
||||
-
|
||||
- entry1 = container_of(a, struct resource_entry, node);
|
||||
- entry2 = container_of(b, struct resource_entry, node);
|
||||
-
|
||||
- if (entry1->res->flags != entry2->res->flags)
|
||||
- return entry1->res->flags > entry2->res->flags;
|
||||
-
|
||||
- if (entry1->offset != entry2->offset)
|
||||
- return entry1->offset > entry2->offset;
|
||||
-
|
||||
- return entry1->res->start > entry2->res->start;
|
||||
-}
|
||||
-
|
||||
static int pci_register_host_bridge(struct pci_host_bridge *bridge)
|
||||
{
|
||||
struct device *parent = bridge->dev.parent;
|
||||
- struct resource_entry *window, *next, *n;
|
||||
+ struct resource_entry *window, *n;
|
||||
struct pci_bus *bus, *b;
|
||||
- resource_size_t offset, next_offset;
|
||||
+ resource_size_t offset;
|
||||
LIST_HEAD(resources);
|
||||
- struct resource *res, *next_res;
|
||||
+ struct resource *res;
|
||||
char addr[64], *fmt;
|
||||
const char *name;
|
||||
int err;
|
||||
@@ -988,35 +970,11 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)
|
||||
if (nr_node_ids > 1 && pcibus_to_node(bus) == NUMA_NO_NODE)
|
||||
dev_warn(&bus->dev, "Unknown NUMA node; performance will be reduced\n");
|
||||
|
||||
- /* Sort and coalesce contiguous windows */
|
||||
- list_sort(NULL, &resources, res_cmp);
|
||||
- resource_list_for_each_entry_safe(window, n, &resources) {
|
||||
- if (list_is_last(&window->node, &resources))
|
||||
- break;
|
||||
-
|
||||
- next = list_next_entry(window, node);
|
||||
- offset = window->offset;
|
||||
- res = window->res;
|
||||
- next_offset = next->offset;
|
||||
- next_res = next->res;
|
||||
-
|
||||
- if (res->flags != next_res->flags || offset != next_offset)
|
||||
- continue;
|
||||
-
|
||||
- if (res->end + 1 == next_res->start) {
|
||||
- next_res->start = res->start;
|
||||
- res->flags = res->start = res->end = 0;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
/* Add initial resources to the bus */
|
||||
resource_list_for_each_entry_safe(window, n, &resources) {
|
||||
+ list_move_tail(&window->node, &bridge->windows);
|
||||
offset = window->offset;
|
||||
res = window->res;
|
||||
- if (!res->end)
|
||||
- continue;
|
||||
-
|
||||
- list_move_tail(&window->node, &bridge->windows);
|
||||
|
||||
if (res->flags & IORESOURCE_BUS)
|
||||
pci_bus_insert_busn_res(bus, bus->number, res->end);
|
@ -1,30 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
Date: Tue, 10 Jan 2023 08:52:40 +0100
|
||||
Subject: [PATCH] Revert "fortify: Do not cast to "unsigned char""
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This reverts commit 106b7a61c488d2022f44e3531ce33461c7c0685f.
|
||||
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
include/linux/fortify-string.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/linux/fortify-string.h b/include/linux/fortify-string.h
|
||||
index 89a6888f2f9e..66e0b60dcabb 100644
|
||||
--- a/include/linux/fortify-string.h
|
||||
+++ b/include/linux/fortify-string.h
|
||||
@@ -18,7 +18,7 @@ void __write_overflow_field(size_t avail, size_t wanted) __compiletime_warning("
|
||||
|
||||
#define __compiletime_strlen(p) \
|
||||
({ \
|
||||
- char *__p = (char *)(p); \
|
||||
+ unsigned char *__p = (unsigned char *)(p); \
|
||||
size_t __ret = SIZE_MAX; \
|
||||
const size_t __p_size = __member_size(p); \
|
||||
if (__p_size != SIZE_MAX && \
|
@ -0,0 +1,112 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
|
||||
Date: Tue, 13 Jul 2021 20:50:07 +0800
|
||||
Subject: [PATCH] PCI: Reinstate "PCI: Coalesce host bridge contiguous
|
||||
apertures"
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Built-in graphics on HP EliteDesk 805 G6 doesn't work because graphics
|
||||
can't get the BAR it needs:
|
||||
pci_bus 0000:00: root bus resource [mem 0x10020200000-0x100303fffff window]
|
||||
pci_bus 0000:00: root bus resource [mem 0x10030400000-0x100401fffff window]
|
||||
|
||||
pci 0000:00:08.1: bridge window [mem 0xd2000000-0xd23fffff]
|
||||
pci 0000:00:08.1: bridge window [mem 0x10030000000-0x100401fffff 64bit pref]
|
||||
pci 0000:00:08.1: can't claim BAR 15 [mem 0x10030000000-0x100401fffff 64bit pref]: no compatible bridge window
|
||||
pci 0000:00:08.1: [mem 0x10030000000-0x100401fffff 64bit pref] clipped to [mem 0x10030000000-0x100303fffff 64bit pref]
|
||||
pci 0000:00:08.1: bridge window [mem 0x10030000000-0x100303fffff 64bit pref]
|
||||
pci 0000:07:00.0: can't claim BAR 0 [mem 0x10030000000-0x1003fffffff 64bit pref]: no compatible bridge window
|
||||
pci 0000:07:00.0: can't claim BAR 2 [mem 0x10040000000-0x100401fffff 64bit pref]: no compatible bridge window
|
||||
|
||||
However, the root bus has two contiguous apertures that can contain the
|
||||
child resource requested.
|
||||
|
||||
Coalesce contiguous apertures so we can allocate from the entire contiguous
|
||||
region.
|
||||
|
||||
This is the second take of commit 65db04053efe ("PCI: Coalesce host
|
||||
bridge contiguous apertures"). The original approach sorts the apertures
|
||||
by address, but that makes NVMe stop working on QEMU ppc:sam460ex:
|
||||
PCI host bridge to bus 0002:00
|
||||
pci_bus 0002:00: root bus resource [io 0x0000-0xffff]
|
||||
pci_bus 0002:00: root bus resource [mem 0xd80000000-0xdffffffff] (bus address [0x80000000-0xffffffff])
|
||||
pci_bus 0002:00: root bus resource [mem 0xc0ee00000-0xc0eefffff] (bus address [0x00000000-0x000fffff])
|
||||
|
||||
After the offending commit:
|
||||
PCI host bridge to bus 0002:00
|
||||
pci_bus 0002:00: root bus resource [io 0x0000-0xffff]
|
||||
pci_bus 0002:00: root bus resource [mem 0xc0ee00000-0xc0eefffff] (bus address [0x00000000-0x000fffff])
|
||||
pci_bus 0002:00: root bus resource [mem 0xd80000000-0xdffffffff] (bus address [0x80000000-0xffffffff])
|
||||
|
||||
Since the apertures on HP EliteDesk 805 G6 are already in ascending
|
||||
order, doing a precautious sorting is not necessary.
|
||||
|
||||
Remove the sorting part to avoid the regression on ppc:sam460ex.
|
||||
|
||||
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=212013
|
||||
Cc: Guenter Roeck <linux@roeck-us.net>
|
||||
Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
|
||||
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
drivers/pci/probe.c | 31 +++++++++++++++++++++++++++----
|
||||
1 file changed, 27 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
|
||||
index 6b73e9179111..50eef5b211f4 100644
|
||||
--- a/drivers/pci/probe.c
|
||||
+++ b/drivers/pci/probe.c
|
||||
@@ -883,11 +883,11 @@ static void pci_set_bus_msi_domain(struct pci_bus *bus)
|
||||
static int pci_register_host_bridge(struct pci_host_bridge *bridge)
|
||||
{
|
||||
struct device *parent = bridge->dev.parent;
|
||||
- struct resource_entry *window, *n;
|
||||
+ struct resource_entry *window, *next, *n;
|
||||
struct pci_bus *bus, *b;
|
||||
- resource_size_t offset;
|
||||
+ resource_size_t offset, next_offset;
|
||||
LIST_HEAD(resources);
|
||||
- struct resource *res;
|
||||
+ struct resource *res, *next_res;
|
||||
char addr[64], *fmt;
|
||||
const char *name;
|
||||
int err;
|
||||
@@ -970,11 +970,34 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)
|
||||
if (nr_node_ids > 1 && pcibus_to_node(bus) == NUMA_NO_NODE)
|
||||
dev_warn(&bus->dev, "Unknown NUMA node; performance will be reduced\n");
|
||||
|
||||
+ /* Coalesce contiguous windows */
|
||||
+ resource_list_for_each_entry_safe(window, n, &resources) {
|
||||
+ if (list_is_last(&window->node, &resources))
|
||||
+ break;
|
||||
+
|
||||
+ next = list_next_entry(window, node);
|
||||
+ offset = window->offset;
|
||||
+ res = window->res;
|
||||
+ next_offset = next->offset;
|
||||
+ next_res = next->res;
|
||||
+
|
||||
+ if (res->flags != next_res->flags || offset != next_offset)
|
||||
+ continue;
|
||||
+
|
||||
+ if (res->end + 1 == next_res->start) {
|
||||
+ next_res->start = res->start;
|
||||
+ res->flags = res->start = res->end = 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* Add initial resources to the bus */
|
||||
resource_list_for_each_entry_safe(window, n, &resources) {
|
||||
- list_move_tail(&window->node, &bridge->windows);
|
||||
offset = window->offset;
|
||||
res = window->res;
|
||||
+ if (!res->end)
|
||||
+ continue;
|
||||
+
|
||||
+ list_move_tail(&window->node, &bridge->windows);
|
||||
|
||||
if (res->flags & IORESOURCE_BUS)
|
||||
pci_bus_insert_busn_res(bus, bus->number, res->end);
|
@ -1,133 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
Date: Fri, 14 Jul 2023 18:10:32 +0200
|
||||
Subject: [PATCH] kvm: xsave set: mask-out PKRU bit in xfeatures if vCPU has no
|
||||
support
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Fixes live-migrations & snapshot-rollback of VMs with a restricted
|
||||
CPU type (e.g., qemu64) from our 5.15 based kernel (default Proxmox
|
||||
VE 7.4) to the 6.2 (and future newer) of Proxmox VE 8.0.
|
||||
|
||||
Previous to ad856280ddea ("x86/kvm/fpu: Limit guest user_xfeatures to
|
||||
supported bits of XCR0") the PKRU bit of the host could leak into the
|
||||
state from the guest, which caused trouble when migrating between
|
||||
hosts with different CPUs, i.e., where the source supported it but
|
||||
the target did not, causing a general protection fault when the guest
|
||||
tried to use a pkru related instruction after the migration.
|
||||
|
||||
But the fix, while welcome, caused a temporary out-of-sync state when
|
||||
migrating such a VM from a kernel without the fix to a kernel with
|
||||
the fix, as it threw of KVM when the CPUID of the guest and most of
|
||||
the state doesn't report XSAVE and thus any xfeatures, but PKRU and
|
||||
the related state is set as enabled, causing the vCPU to spin at 100%
|
||||
without any progress forever.
|
||||
|
||||
The fix could be at two sites, either in QEMU or in the kernel, I
|
||||
choose the kernel as we have all the info there for a targeted
|
||||
heuristic so that we don't have to adapt QEMU and qemu-server, the
|
||||
latter even on both sides.
|
||||
|
||||
Still, a short summary of the possible fixes and short drawbacks:
|
||||
* on QEMU-side either
|
||||
- clear the PKRU state in the migration saved state would be rather
|
||||
complicated to implement as the vCPU is initialised way before we
|
||||
have the saved xfeature state available to check what we'd need
|
||||
to do, plus the user-space only gets a memory blob from ioctl
|
||||
KVM_GET_XSAVE2 that it passes to KVM_SET_XSAVE ioctl, there are
|
||||
no ABI guarantees, and while the struct seem stable for 5.15 to
|
||||
6.5-rc1, that doesn't has to be for future kernels, so off the
|
||||
table.
|
||||
- enforce that the CPUID reports PKU support even if it normally
|
||||
wouldn't. While this works (tested by hard-coding it as POC) it
|
||||
is a) not really nice and b) needs some interaction from
|
||||
qemu-server to enable this flag as otherwise we have no good info
|
||||
to decide when it's OK to do this, which means we need to adapt
|
||||
both PVE 7 and 8's qemu-server and also pve-qemu, workable but
|
||||
not optimal
|
||||
|
||||
* on Kernel/KVM-side we can hook into the set XSAVE ioctl specific to
|
||||
the KVM subsystem, which already reduces chance of regression for
|
||||
all other places. There we have access to the union/struct
|
||||
definitions of the saved state and thus can savely cast to that.
|
||||
We also got access to the vCPU's CPUID capabilities, meaning we can
|
||||
check if the XCR0 (first XSAVE Control Register) reports
|
||||
that it support the PKRU feature, and if it does *NOT* but the
|
||||
saved xfeatures register from XSAVE *DOES* report it, we can safely
|
||||
assume that this combination is due to an migration from an older,
|
||||
leaky kernel – and clear the bit in the xfeature register before
|
||||
restoring it to the guest vCPU KVM state, avoiding the confusing
|
||||
situation that made the vCPU spin at 100%.
|
||||
This should be safe to do, as the guest vCPU CPUID never reported
|
||||
support for the PKRU feature, and it's also a relatively niche and
|
||||
newish feature.
|
||||
|
||||
If it gains us something we can drop this patch a bit in the future
|
||||
Proxmox VE 9 major release, but we should ensure that VMs that where
|
||||
started before PVE 8 cannot be directly live-migrated to the release
|
||||
that includes that change; so we should rather only drop it if the
|
||||
maintenance burden is high.
|
||||
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
arch/x86/kvm/cpuid.c | 6 ++++++
|
||||
arch/x86/kvm/cpuid.h | 2 ++
|
||||
arch/x86/kvm/x86.c | 13 +++++++++++++
|
||||
3 files changed, 21 insertions(+)
|
||||
|
||||
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
|
||||
index 3a02276899db..e07a6089ba4b 100644
|
||||
--- a/arch/x86/kvm/cpuid.c
|
||||
+++ b/arch/x86/kvm/cpuid.c
|
||||
@@ -262,6 +262,12 @@ static u64 cpuid_get_supported_xcr0(struct kvm_cpuid_entry2 *entries, int nent)
|
||||
return (best->eax | ((u64)best->edx << 32)) & kvm_caps.supported_xcr0;
|
||||
}
|
||||
|
||||
+bool vcpu_supports_xsave_pkru(struct kvm_vcpu *vcpu) {
|
||||
+ u64 guest_supported_xcr0 = cpuid_get_supported_xcr0(
|
||||
+ vcpu->arch.cpuid_entries, vcpu->arch.cpuid_nent);
|
||||
+ return (guest_supported_xcr0 & XFEATURE_MASK_PKRU) != 0;
|
||||
+}
|
||||
+
|
||||
static void __kvm_update_cpuid_runtime(struct kvm_vcpu *vcpu, struct kvm_cpuid_entry2 *entries,
|
||||
int nent)
|
||||
{
|
||||
diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h
|
||||
index 23dbb9eb277c..07da153802e4 100644
|
||||
--- a/arch/x86/kvm/cpuid.h
|
||||
+++ b/arch/x86/kvm/cpuid.h
|
||||
@@ -32,6 +32,8 @@ int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
|
||||
bool kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx,
|
||||
u32 *ecx, u32 *edx, bool exact_only);
|
||||
|
||||
+bool vcpu_supports_xsave_pkru(struct kvm_vcpu *vcpu);
|
||||
+
|
||||
u32 xstate_required_size(u64 xstate_bv, bool compacted);
|
||||
|
||||
int cpuid_query_maxphyaddr(struct kvm_vcpu *vcpu);
|
||||
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
|
||||
index c84927216fad..880e2b87777e 100644
|
||||
--- a/arch/x86/kvm/x86.c
|
||||
+++ b/arch/x86/kvm/x86.c
|
||||
@@ -5580,6 +5580,19 @@ static int kvm_vcpu_ioctl_x86_set_xsave(struct kvm_vcpu *vcpu,
|
||||
if (fpstate_is_confidential(&vcpu->arch.guest_fpu))
|
||||
return 0;
|
||||
|
||||
+ if (!vcpu_supports_xsave_pkru(vcpu)) {
|
||||
+ void *buf = guest_xsave->region;
|
||||
+ union fpregs_state *ustate = buf;
|
||||
+ if (ustate->xsave.header.xfeatures & XFEATURE_MASK_PKRU) {
|
||||
+ printk(
|
||||
+ KERN_NOTICE "clearing PKRU xfeature bit as vCPU from PID %d"
|
||||
+ " reports no PKRU support - migration from fpu-leaky kernel?",
|
||||
+ current->pid
|
||||
+ );
|
||||
+ ustate->xsave.header.xfeatures &= ~XFEATURE_MASK_PKRU;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return fpu_copy_uabi_to_guest_fpstate(&vcpu->arch.guest_fpu,
|
||||
guest_xsave->region,
|
||||
kvm_caps.supported_xcr0,
|
@ -1,43 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: kiler129 <grzegorz@noflash.pl>
|
||||
Date: Mon, 18 Sep 2023 15:19:26 +0200
|
||||
Subject: [PATCH] allow opt-in to allow pass-through on broken hardware..
|
||||
|
||||
adapted from https://github.com/kiler129/relax-intel-rmrr , licensed under MIT or GPL 2.0+
|
||||
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
drivers/iommu/intel/iommu.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
|
||||
index c4c6240d14f9..5e037a9ea6a6 100644
|
||||
--- a/drivers/iommu/intel/iommu.c
|
||||
+++ b/drivers/iommu/intel/iommu.c
|
||||
@@ -234,6 +234,7 @@ static int dmar_map_gfx = 1;
|
||||
static int dmar_map_ipu = 1;
|
||||
static int intel_iommu_superpage = 1;
|
||||
static int iommu_identity_mapping;
|
||||
+static int intel_relaxable_rmrr = 0;
|
||||
static int iommu_skip_te_disable;
|
||||
|
||||
#define IDENTMAP_GFX 2
|
||||
@@ -296,6 +297,9 @@ static int __init intel_iommu_setup(char *str)
|
||||
} else if (!strncmp(str, "tboot_noforce", 13)) {
|
||||
pr_info("Intel-IOMMU: not forcing on after tboot. This could expose security risk for tboot\n");
|
||||
intel_iommu_tboot_noforce = 1;
|
||||
+ } else if (!strncmp(str, "relax_rmrr", 10)) {
|
||||
+ pr_info("Intel-IOMMU: assuming all RMRRs are relaxable. This can lead to instability or data loss\n");
|
||||
+ intel_relaxable_rmrr = 1;
|
||||
} else {
|
||||
pr_notice("Unknown option - '%s'\n", str);
|
||||
}
|
||||
@@ -2470,7 +2474,7 @@ static bool device_rmrr_is_relaxable(struct device *dev)
|
||||
return false;
|
||||
|
||||
pdev = to_pci_dev(dev);
|
||||
- if (IS_USB_DEVICE(pdev) || IS_GFX_DEVICE(pdev))
|
||||
+ if (intel_relaxable_rmrr || IS_USB_DEVICE(pdev) || IS_GFX_DEVICE(pdev))
|
||||
return true;
|
||||
else
|
||||
return false;
|
@ -0,0 +1,28 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= <f.gruenbichler@proxmox.com>
|
||||
Date: Thu, 14 Sep 2017 11:09:58 +0200
|
||||
Subject: [PATCH] do not generate split BTF type info per default
|
||||
|
||||
This reverts commit a8ed1a0607cfa5478ff6009539f44790c4d0956d.
|
||||
|
||||
It breaks ZFS sometimes:
|
||||
https://github.com/openzfs/zfs/issues/12301#issuecomment-873303739
|
||||
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
lib/Kconfig.debug | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
|
||||
index 28faea9b5da6..9cfb8a026adb 100644
|
||||
--- a/lib/Kconfig.debug
|
||||
+++ b/lib/Kconfig.debug
|
||||
@@ -331,7 +331,7 @@ config PAHOLE_HAS_SPLIT_BTF
|
||||
def_bool PAHOLE_VERSION >= 119
|
||||
|
||||
config DEBUG_INFO_BTF_MODULES
|
||||
- def_bool y
|
||||
+ def_bool n
|
||||
depends on DEBUG_INFO_BTF && MODULES && PAHOLE_HAS_SPLIT_BTF
|
||||
help
|
||||
Generate compact split BTF type information for kernel modules.
|
@ -1,37 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Sean Christopherson <seanjc@google.com>
|
||||
Date: Wed, 18 Oct 2023 12:41:04 -0700
|
||||
Subject: [PATCH] KVM: nSVM: Advertise support for flush-by-ASID
|
||||
|
||||
Advertise support for FLUSHBYASID when nested SVM is enabled, as KVM can
|
||||
always emulate flushing TLB entries for a vmcb12 ASID, e.g. by running L2
|
||||
with a new, fresh ASID in vmcb02. Some modern hypervisors, e.g. VMWare
|
||||
Workstation 17, require FLUSHBYASID support and will refuse to run if it's
|
||||
not present.
|
||||
|
||||
Punt on proper support, as "Honor L1's request to flush an ASID on nested
|
||||
VMRUN" is one of the TODO items in the (incomplete) list of issues that
|
||||
need to be addressed in order for KVM to NOT do a full TLB flush on every
|
||||
nested SVM transition (see nested_svm_transition_tlb_flush()).
|
||||
|
||||
Reported-by: Stefan Sterz <s.sterz@proxmox.com>
|
||||
Closes: https://lkml.kernel.org/r/b9915c9c-4cf6-051a-2d91-44cc6380f455%40proxmox.com
|
||||
Signed-off-by: Sean Christopherson <seanjc@google.com>
|
||||
Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
arch/x86/kvm/svm/svm.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
|
||||
index e90b429c84f1..5c7faf7c447f 100644
|
||||
--- a/arch/x86/kvm/svm/svm.c
|
||||
+++ b/arch/x86/kvm/svm/svm.c
|
||||
@@ -5085,6 +5085,7 @@ static __init void svm_set_cpu_caps(void)
|
||||
if (nested) {
|
||||
kvm_cpu_cap_set(X86_FEATURE_SVM);
|
||||
kvm_cpu_cap_set(X86_FEATURE_VMCBCLEAN);
|
||||
+ kvm_cpu_cap_set(X86_FEATURE_FLUSHBYASID);
|
||||
|
||||
/*
|
||||
* KVM currently flushes TLBs on *every* nested SVM transition,
|
@ -0,0 +1,147 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
|
||||
Date: Tue, 11 Jan 2022 09:31:59 +0100
|
||||
Subject: [PATCH] blk-cgroup: always terminate io.stat lines
|
||||
|
||||
With the removal of seq_get_buf in blkcg_print_one_stat, we
|
||||
cannot make adding the newline conditional on there being
|
||||
relevant stats because the name was already written out
|
||||
unconditionally.
|
||||
Otherwise we may end up with multiple device names in one
|
||||
line which is confusing and doesn't follow the nested-keyed
|
||||
file format.
|
||||
|
||||
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
|
||||
Fixes: 252c651a4c85 ("blk-cgroup: stop using seq_get_buf")
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
block/blk-cgroup.c | 9 ++-------
|
||||
block/blk-iocost.c | 5 ++---
|
||||
block/blk-iolatency.c | 8 +++-----
|
||||
include/linux/blk-cgroup.h | 2 +-
|
||||
4 files changed, 8 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
|
||||
index fd81a7370864..4677829e4ae3 100644
|
||||
--- a/block/blk-cgroup.c
|
||||
+++ b/block/blk-cgroup.c
|
||||
@@ -900,7 +900,6 @@ static void blkcg_print_one_stat(struct blkcg_gq *blkg, struct seq_file *s)
|
||||
{
|
||||
struct blkg_iostat_set *bis = &blkg->iostat;
|
||||
u64 rbytes, wbytes, rios, wios, dbytes, dios;
|
||||
- bool has_stats = false;
|
||||
const char *dname;
|
||||
unsigned seq;
|
||||
int i;
|
||||
@@ -926,14 +925,12 @@ static void blkcg_print_one_stat(struct blkcg_gq *blkg, struct seq_file *s)
|
||||
} while (u64_stats_fetch_retry(&bis->sync, seq));
|
||||
|
||||
if (rbytes || wbytes || rios || wios) {
|
||||
- has_stats = true;
|
||||
seq_printf(s, "rbytes=%llu wbytes=%llu rios=%llu wios=%llu dbytes=%llu dios=%llu",
|
||||
rbytes, wbytes, rios, wios,
|
||||
dbytes, dios);
|
||||
}
|
||||
|
||||
if (blkcg_debug_stats && atomic_read(&blkg->use_delay)) {
|
||||
- has_stats = true;
|
||||
seq_printf(s, " use_delay=%d delay_nsec=%llu",
|
||||
atomic_read(&blkg->use_delay),
|
||||
atomic64_read(&blkg->delay_nsec));
|
||||
@@ -945,12 +942,10 @@ static void blkcg_print_one_stat(struct blkcg_gq *blkg, struct seq_file *s)
|
||||
if (!blkg->pd[i] || !pol->pd_stat_fn)
|
||||
continue;
|
||||
|
||||
- if (pol->pd_stat_fn(blkg->pd[i], s))
|
||||
- has_stats = true;
|
||||
+ pol->pd_stat_fn(blkg->pd[i], s);
|
||||
}
|
||||
|
||||
- if (has_stats)
|
||||
- seq_printf(s, "\n");
|
||||
+ seq_puts(s, "\n");
|
||||
}
|
||||
|
||||
static int blkcg_print_stat(struct seq_file *sf, void *v)
|
||||
diff --git a/block/blk-iocost.c b/block/blk-iocost.c
|
||||
index 645a589edda8..b0846da38eda 100644
|
||||
--- a/block/blk-iocost.c
|
||||
+++ b/block/blk-iocost.c
|
||||
@@ -3028,13 +3028,13 @@ static void ioc_pd_free(struct blkg_policy_data *pd)
|
||||
kfree(iocg);
|
||||
}
|
||||
|
||||
-static bool ioc_pd_stat(struct blkg_policy_data *pd, struct seq_file *s)
|
||||
+static void ioc_pd_stat(struct blkg_policy_data *pd, struct seq_file *s)
|
||||
{
|
||||
struct ioc_gq *iocg = pd_to_iocg(pd);
|
||||
struct ioc *ioc = iocg->ioc;
|
||||
|
||||
if (!ioc->enabled)
|
||||
- return false;
|
||||
+ return;
|
||||
|
||||
if (iocg->level == 0) {
|
||||
unsigned vp10k = DIV64_U64_ROUND_CLOSEST(
|
||||
@@ -3050,7 +3050,6 @@ static bool ioc_pd_stat(struct blkg_policy_data *pd, struct seq_file *s)
|
||||
iocg->last_stat.wait_us,
|
||||
iocg->last_stat.indebt_us,
|
||||
iocg->last_stat.indelay_us);
|
||||
- return true;
|
||||
}
|
||||
|
||||
static u64 ioc_weight_prfill(struct seq_file *sf, struct blkg_policy_data *pd,
|
||||
diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c
|
||||
index bdef8395af6e..a5f13743a280 100644
|
||||
--- a/block/blk-iolatency.c
|
||||
+++ b/block/blk-iolatency.c
|
||||
@@ -906,7 +906,7 @@ static int iolatency_print_limit(struct seq_file *sf, void *v)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static bool iolatency_ssd_stat(struct iolatency_grp *iolat, struct seq_file *s)
|
||||
+static void iolatency_ssd_stat(struct iolatency_grp *iolat, struct seq_file *s)
|
||||
{
|
||||
struct latency_stat stat;
|
||||
int cpu;
|
||||
@@ -929,17 +929,16 @@ static bool iolatency_ssd_stat(struct iolatency_grp *iolat, struct seq_file *s)
|
||||
(unsigned long long)stat.ps.missed,
|
||||
(unsigned long long)stat.ps.total,
|
||||
iolat->rq_depth.max_depth);
|
||||
- return true;
|
||||
}
|
||||
|
||||
-static bool iolatency_pd_stat(struct blkg_policy_data *pd, struct seq_file *s)
|
||||
+static void iolatency_pd_stat(struct blkg_policy_data *pd, struct seq_file *s)
|
||||
{
|
||||
struct iolatency_grp *iolat = pd_to_lat(pd);
|
||||
unsigned long long avg_lat;
|
||||
unsigned long long cur_win;
|
||||
|
||||
if (!blkcg_debug_stats)
|
||||
- return false;
|
||||
+ return;
|
||||
|
||||
if (iolat->ssd)
|
||||
return iolatency_ssd_stat(iolat, s);
|
||||
@@ -952,7 +951,6 @@ static bool iolatency_pd_stat(struct blkg_policy_data *pd, struct seq_file *s)
|
||||
else
|
||||
seq_printf(s, " depth=%u avg_lat=%llu win=%llu",
|
||||
iolat->rq_depth.max_depth, avg_lat, cur_win);
|
||||
- return true;
|
||||
}
|
||||
|
||||
static struct blkg_policy_data *iolatency_pd_alloc(gfp_t gfp,
|
||||
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
|
||||
index bc5c04d711bb..618359e3beca 100644
|
||||
--- a/include/linux/blk-cgroup.h
|
||||
+++ b/include/linux/blk-cgroup.h
|
||||
@@ -153,7 +153,7 @@ typedef void (blkcg_pol_online_pd_fn)(struct blkg_policy_data *pd);
|
||||
typedef void (blkcg_pol_offline_pd_fn)(struct blkg_policy_data *pd);
|
||||
typedef void (blkcg_pol_free_pd_fn)(struct blkg_policy_data *pd);
|
||||
typedef void (blkcg_pol_reset_pd_stats_fn)(struct blkg_policy_data *pd);
|
||||
-typedef bool (blkcg_pol_stat_pd_fn)(struct blkg_policy_data *pd,
|
||||
+typedef void (blkcg_pol_stat_pd_fn)(struct blkg_policy_data *pd,
|
||||
struct seq_file *s);
|
||||
|
||||
struct blkcg_policy {
|
@ -0,0 +1,34 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Javier Martinez Canillas <javierm@redhat.com>
|
||||
Date: Tue, 25 Jan 2022 10:12:19 +0100
|
||||
Subject: [PATCH] drivers/firmware: Don't mark as busy the simple-framebuffer
|
||||
IO resource
|
||||
|
||||
The sysfb_create_simplefb() function requests a IO memory resource for the
|
||||
simple-framebuffer platform device, but it also marks it as busy which can
|
||||
lead to drivers requesting the same memory resource to fail.
|
||||
|
||||
Let's drop the IORESOURCE_BUSY flag and let drivers to request it as busy
|
||||
instead.
|
||||
|
||||
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
|
||||
Reviewed-by: Zack Rusin <zackr@vmware.com>
|
||||
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
drivers/firmware/sysfb_simplefb.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/firmware/sysfb_simplefb.c b/drivers/firmware/sysfb_simplefb.c
|
||||
index fd4fa923088a..ca907f7e76c6 100644
|
||||
--- a/drivers/firmware/sysfb_simplefb.c
|
||||
+++ b/drivers/firmware/sysfb_simplefb.c
|
||||
@@ -99,7 +99,7 @@ __init struct platform_device *sysfb_create_simplefb(const struct screen_info *s
|
||||
|
||||
/* setup IORESOURCE_MEM as framebuffer memory */
|
||||
memset(&res, 0, sizeof(res));
|
||||
- res.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
|
||||
+ res.flags = IORESOURCE_MEM;
|
||||
res.name = simplefb_resname;
|
||||
res.start = base;
|
||||
res.end = res.start + length - 1;
|
@ -1,44 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
Date: Mon, 6 Nov 2023 10:17:02 +0100
|
||||
Subject: [PATCH] revert "memfd: improve userspace warnings for missing
|
||||
exec-related flags".
|
||||
|
||||
This warning is telling userspace developers to pass MFD_EXEC and
|
||||
MFD_NOEXEC_SEAL to memfd_create(). Commit 434ed3350f57 ("memfd: improve
|
||||
userspace warnings for missing exec-related flags") made the warning more
|
||||
frequent and visible in the hope that this would accelerate the fixing of
|
||||
errant userspace.
|
||||
|
||||
But the overall effect is to generate far too much dmesg noise.
|
||||
|
||||
Fixes: 434ed3350f57 ("memfd: improve userspace warnings for missing exec-related flags")
|
||||
Reported-by: Damian Tometzki <dtometzki@fedoraproject.org>
|
||||
Closes: https://lkml.kernel.org/r/ZPFzCSIgZ4QuHsSC@fedora.fritz.box
|
||||
Cc: Aleksa Sarai <cyphar@cyphar.com>
|
||||
Cc: Christian Brauner <brauner@kernel.org>
|
||||
Cc: Daniel Verkamp <dverkamp@chromium.org>
|
||||
Cc: Jeff Xu <jeffxu@google.com>
|
||||
Cc: Kees Cook <keescook@chromium.org>
|
||||
Cc: Shuah Khan <shuah@kernel.org>
|
||||
Cc: <stable@vger.kernel.org>
|
||||
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
||||
(cherry picked from commit 2562d67b1bdf91c7395b0225d60fdeb26b4bc5a0)
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
mm/memfd.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/mm/memfd.c b/mm/memfd.c
|
||||
index d3a1ba4208c9..6a9de5d9105e 100644
|
||||
--- a/mm/memfd.c
|
||||
+++ b/mm/memfd.c
|
||||
@@ -282,7 +282,7 @@ static int check_sysctl_memfd_noexec(unsigned int *flags)
|
||||
}
|
||||
|
||||
if (!(*flags & MFD_NOEXEC_SEAL) && sysctl >= MEMFD_NOEXEC_SCOPE_NOEXEC_ENFORCED) {
|
||||
- pr_err_ratelimited(
|
||||
+ pr_warn_once(
|
||||
"%s[%d]: memfd_create() requires MFD_NOEXEC_SEAL with vm.memfd_noexec=%d\n",
|
||||
current->comm, task_pid_nr(current), sysctl);
|
||||
return -EACCES;
|
@ -1,31 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
|
||||
Date: Wed, 10 Apr 2024 13:21:59 +0200
|
||||
Subject: [PATCH] apparmor: expect msg_namelen=0 for recvmsg calls
|
||||
|
||||
When coming from sys_recvmsg, msg->msg_namelen is explicitly set to
|
||||
zero early on. (see ____sys_recvmsg in net/socket.c)
|
||||
We still end up in 'map_addr' where the assumption is that addr !=
|
||||
NULL means addrlen has a valid size.
|
||||
|
||||
This is likely not a final fix, it was suggested by jjohansen on irc
|
||||
to get things going until this is resolved properly.
|
||||
|
||||
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
|
||||
---
|
||||
security/apparmor/af_inet.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/security/apparmor/af_inet.c b/security/apparmor/af_inet.c
|
||||
index 57b710054a76..35f905d9b960 100644
|
||||
--- a/security/apparmor/af_inet.c
|
||||
+++ b/security/apparmor/af_inet.c
|
||||
@@ -766,7 +766,7 @@ int aa_inet_msg_perm(const char *op, u32 request, struct socket *sock,
|
||||
/* do we need early bailout for !family ... */
|
||||
return sk_has_perm2(sock->sk, op, request, profile, ad,
|
||||
map_sock_addr(sock, ADDR_LOCAL, &laddr, &ad),
|
||||
- map_addr(msg->msg_name, msg->msg_namelen, 0,
|
||||
+ map_addr(msg->msg_namelen == 0 ? NULL : msg->msg_name, msg->msg_namelen, 0,
|
||||
ADDR_REMOTE, &raddr, &ad),
|
||||
profile_remote_perm(profile, sock->sk, request,
|
||||
&raddr, &laddr.maddr, &ad));
|
@ -0,0 +1,63 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Zimmermann <tzimmermann@suse.de>
|
||||
Date: Tue, 25 Jan 2022 10:12:20 +0100
|
||||
Subject: [PATCH] drm/simpledrm: Request memory region in driver
|
||||
|
||||
Requesting the framebuffer memory in simpledrm marks the memory
|
||||
range as busy. This used to be done by the firmware sysfb code,
|
||||
but the driver is the correct place.
|
||||
|
||||
v2:
|
||||
* use I/O memory if request_mem_region() fails (Jocelyn)
|
||||
|
||||
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
|
||||
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
|
||||
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
drivers/gpu/drm/tiny/simpledrm.c | 22 +++++++++++++++++-----
|
||||
1 file changed, 17 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c
|
||||
index f3c2c173ca4b..da58c0d0f44d 100644
|
||||
--- a/drivers/gpu/drm/tiny/simpledrm.c
|
||||
+++ b/drivers/gpu/drm/tiny/simpledrm.c
|
||||
@@ -525,21 +525,33 @@ static int simpledrm_device_init_mm(struct simpledrm_device *sdev)
|
||||
{
|
||||
struct drm_device *dev = &sdev->dev;
|
||||
struct platform_device *pdev = sdev->pdev;
|
||||
- struct resource *mem;
|
||||
+ struct resource *res, *mem;
|
||||
void __iomem *screen_base;
|
||||
int ret;
|
||||
|
||||
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
- if (!mem)
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
+ if (!res)
|
||||
return -EINVAL;
|
||||
|
||||
- ret = devm_aperture_acquire_from_firmware(dev, mem->start, resource_size(mem));
|
||||
+ ret = devm_aperture_acquire_from_firmware(dev, res->start, resource_size(res));
|
||||
if (ret) {
|
||||
drm_err(dev, "could not acquire memory range %pr: error %d\n",
|
||||
- mem, ret);
|
||||
+ res, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ mem = devm_request_mem_region(&pdev->dev, res->start, resource_size(res),
|
||||
+ sdev->dev.driver->name);
|
||||
+ if (!mem) {
|
||||
+ /*
|
||||
+ * We cannot make this fatal. Sometimes this comes from magic
|
||||
+ * spaces our resource handlers simply don't know about. Use
|
||||
+ * the I/O-memory resource as-is and try to map that instead.
|
||||
+ */
|
||||
+ drm_warn(dev, "could not acquire memory region %pr\n", res);
|
||||
+ mem = res;
|
||||
+ }
|
||||
+
|
||||
screen_base = devm_ioremap_wc(&pdev->dev, mem->start,
|
||||
resource_size(mem));
|
||||
if (!screen_base)
|
@ -0,0 +1,148 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Zimmermann <tzimmermann@suse.de>
|
||||
Date: Tue, 25 Jan 2022 10:12:21 +0100
|
||||
Subject: [PATCH] fbdev/simplefb: Request memory region in driver
|
||||
|
||||
Requesting the framebuffer memory in simpledrm marks the memory
|
||||
range as busy. This used to be done by the firmware sysfb code,
|
||||
but the driver is the correct place.
|
||||
|
||||
v2:
|
||||
* store memory region in struct for later cleanup (Javier)
|
||||
|
||||
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
|
||||
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
drivers/video/fbdev/simplefb.c | 65 +++++++++++++++++++++++-----------
|
||||
1 file changed, 45 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
|
||||
index a2e3a4690025..8acfb12abfee 100644
|
||||
--- a/drivers/video/fbdev/simplefb.c
|
||||
+++ b/drivers/video/fbdev/simplefb.c
|
||||
@@ -66,7 +66,21 @@ static int simplefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-struct simplefb_par;
|
||||
+struct simplefb_par {
|
||||
+ u32 palette[PSEUDO_PALETTE_SIZE];
|
||||
+ struct resource *mem;
|
||||
+#if defined CONFIG_OF && defined CONFIG_COMMON_CLK
|
||||
+ bool clks_enabled;
|
||||
+ unsigned int clk_count;
|
||||
+ struct clk **clks;
|
||||
+#endif
|
||||
+#if defined CONFIG_OF && defined CONFIG_REGULATOR
|
||||
+ bool regulators_enabled;
|
||||
+ u32 regulator_count;
|
||||
+ struct regulator **regulators;
|
||||
+#endif
|
||||
+};
|
||||
+
|
||||
static void simplefb_clocks_destroy(struct simplefb_par *par);
|
||||
static void simplefb_regulators_destroy(struct simplefb_par *par);
|
||||
|
||||
@@ -76,12 +90,18 @@ static void simplefb_regulators_destroy(struct simplefb_par *par);
|
||||
*/
|
||||
static void simplefb_destroy(struct fb_info *info)
|
||||
{
|
||||
+ struct simplefb_par *par = info->par;
|
||||
+ struct resource *mem = par->mem;
|
||||
+
|
||||
simplefb_regulators_destroy(info->par);
|
||||
simplefb_clocks_destroy(info->par);
|
||||
if (info->screen_base)
|
||||
iounmap(info->screen_base);
|
||||
|
||||
framebuffer_release(info);
|
||||
+
|
||||
+ if (mem)
|
||||
+ release_mem_region(mem->start, resource_size(mem));
|
||||
}
|
||||
|
||||
static const struct fb_ops simplefb_ops = {
|
||||
@@ -175,20 +195,6 @@ static int simplefb_parse_pd(struct platform_device *pdev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-struct simplefb_par {
|
||||
- u32 palette[PSEUDO_PALETTE_SIZE];
|
||||
-#if defined CONFIG_OF && defined CONFIG_COMMON_CLK
|
||||
- bool clks_enabled;
|
||||
- unsigned int clk_count;
|
||||
- struct clk **clks;
|
||||
-#endif
|
||||
-#if defined CONFIG_OF && defined CONFIG_REGULATOR
|
||||
- bool regulators_enabled;
|
||||
- u32 regulator_count;
|
||||
- struct regulator **regulators;
|
||||
-#endif
|
||||
-};
|
||||
-
|
||||
#if defined CONFIG_OF && defined CONFIG_COMMON_CLK
|
||||
/*
|
||||
* Clock handling code.
|
||||
@@ -411,7 +417,7 @@ static int simplefb_probe(struct platform_device *pdev)
|
||||
struct simplefb_params params;
|
||||
struct fb_info *info;
|
||||
struct simplefb_par *par;
|
||||
- struct resource *mem;
|
||||
+ struct resource *res, *mem;
|
||||
|
||||
/*
|
||||
* Generic drivers must not be registered if a framebuffer exists.
|
||||
@@ -436,15 +442,28 @@ static int simplefb_probe(struct platform_device *pdev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
- if (!mem) {
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
+ if (!res) {
|
||||
dev_err(&pdev->dev, "No memory resource\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
+ mem = request_mem_region(res->start, resource_size(res), "simplefb");
|
||||
+ if (!mem) {
|
||||
+ /*
|
||||
+ * We cannot make this fatal. Sometimes this comes from magic
|
||||
+ * spaces our resource handlers simply don't know about. Use
|
||||
+ * the I/O-memory resource as-is and try to map that instead.
|
||||
+ */
|
||||
+ dev_warn(&pdev->dev, "simplefb: cannot reserve video memory at %pR\n", res);
|
||||
+ mem = res;
|
||||
+ }
|
||||
+
|
||||
info = framebuffer_alloc(sizeof(struct simplefb_par), &pdev->dev);
|
||||
- if (!info)
|
||||
- return -ENOMEM;
|
||||
+ if (!info) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto error_release_mem_region;
|
||||
+ }
|
||||
platform_set_drvdata(pdev, info);
|
||||
|
||||
par = info->par;
|
||||
@@ -501,6 +520,9 @@ static int simplefb_probe(struct platform_device *pdev)
|
||||
info->var.xres, info->var.yres,
|
||||
info->var.bits_per_pixel, info->fix.line_length);
|
||||
|
||||
+ if (mem != res)
|
||||
+ par->mem = mem; /* release in clean-up handler */
|
||||
+
|
||||
ret = register_framebuffer(info);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret);
|
||||
@@ -519,6 +541,9 @@ static int simplefb_probe(struct platform_device *pdev)
|
||||
iounmap(info->screen_base);
|
||||
error_fb_release:
|
||||
framebuffer_release(info);
|
||||
+error_release_mem_region:
|
||||
+ if (mem != res)
|
||||
+ release_mem_region(mem->start, resource_size(mem));
|
||||
return ret;
|
||||
}
|
||||
|
@ -1,79 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: "Borislav Petkov (AMD)" <bp@alien8.de>
|
||||
Date: Sun, 24 Mar 2024 20:51:35 +0100
|
||||
Subject: [PATCH] x86/CPU/AMD: Improve the erratum 1386 workaround
|
||||
|
||||
Disable XSAVES only on machines which haven't loaded the microcode
|
||||
revision containing the erratum fix.
|
||||
|
||||
This will come in handy when running archaic OSes as guests. OSes whose
|
||||
brilliant programmers thought that CPUID is overrated and one should not
|
||||
query it but use features directly, ala shoot first, ask questions
|
||||
later... but only if you're alive after the shooting.
|
||||
|
||||
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
|
||||
Tested-by: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
|
||||
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
|
||||
Link: https://lore.kernel.org/r/20240324200525.GBZgCHhYFsBj12PrKv@fat_crate.local
|
||||
---
|
||||
arch/x86/include/asm/cpu_device_id.h | 8 ++++++++
|
||||
arch/x86/kernel/cpu/amd.c | 12 ++++++++++++
|
||||
2 files changed, 20 insertions(+)
|
||||
|
||||
diff --git a/arch/x86/include/asm/cpu_device_id.h b/arch/x86/include/asm/cpu_device_id.h
|
||||
index eb8fcede9e3b..bf4e065cf1e2 100644
|
||||
--- a/arch/x86/include/asm/cpu_device_id.h
|
||||
+++ b/arch/x86/include/asm/cpu_device_id.h
|
||||
@@ -190,6 +190,14 @@ struct x86_cpu_desc {
|
||||
.x86_microcode_rev = (revision), \
|
||||
}
|
||||
|
||||
+#define AMD_CPU_DESC(fam, model, stepping, revision) { \
|
||||
+ .x86_family = (fam), \
|
||||
+ .x86_vendor = X86_VENDOR_AMD, \
|
||||
+ .x86_model = (model), \
|
||||
+ .x86_stepping = (stepping), \
|
||||
+ .x86_microcode_rev = (revision), \
|
||||
+}
|
||||
+
|
||||
extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match);
|
||||
extern bool x86_cpu_has_min_microcode_rev(const struct x86_cpu_desc *table);
|
||||
|
||||
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
|
||||
index dfa8d0cf5e18..22a263b1a884 100644
|
||||
--- a/arch/x86/kernel/cpu/amd.c
|
||||
+++ b/arch/x86/kernel/cpu/amd.c
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <asm/apic.h>
|
||||
#include <asm/cacheinfo.h>
|
||||
#include <asm/cpu.h>
|
||||
+#include <asm/cpu_device_id.h>
|
||||
#include <asm/spec-ctrl.h>
|
||||
#include <asm/smp.h>
|
||||
#include <asm/numa.h>
|
||||
@@ -926,6 +927,11 @@ static void init_amd_bd(struct cpuinfo_x86 *c)
|
||||
clear_rdrand_cpuid_bit(c);
|
||||
}
|
||||
|
||||
+static const struct x86_cpu_desc erratum_1386_microcode[] = {
|
||||
+ AMD_CPU_DESC(0x17, 0x1, 0x2, 0x0800126e),
|
||||
+ AMD_CPU_DESC(0x17, 0x31, 0x0, 0x08301052),
|
||||
+};
|
||||
+
|
||||
static void fix_erratum_1386(struct cpuinfo_x86 *c)
|
||||
{
|
||||
/*
|
||||
@@ -935,7 +941,13 @@ static void fix_erratum_1386(struct cpuinfo_x86 *c)
|
||||
*
|
||||
* Affected parts all have no supervisor XSAVE states, meaning that
|
||||
* the XSAVEC instruction (which works fine) is equivalent.
|
||||
+ *
|
||||
+ * Clear the feature flag only on microcode revisions which
|
||||
+ * don't have the fix.
|
||||
*/
|
||||
+ if (x86_cpu_has_min_microcode_rev(erratum_1386_microcode))
|
||||
+ return;
|
||||
+
|
||||
clear_cpu_cap(c, X86_FEATURE_XSAVES);
|
||||
}
|
||||
|
@ -0,0 +1,81 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Olga Kornievskaia <kolga@netapp.com>
|
||||
Date: Wed, 16 Mar 2022 18:24:26 -0400
|
||||
Subject: [PATCH] NFSv4.1 provide mount option to toggle trunking discovery
|
||||
|
||||
Introduce a new mount option -- trunkdiscovery,notrunkdiscovery -- to
|
||||
toggle whether or not the client will engage in actively discovery
|
||||
of trunking locations.
|
||||
|
||||
v2 make notrunkdiscovery default
|
||||
|
||||
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
|
||||
Fixes: 1976b2b31462 ("NFSv4.1 query for fs_location attr on a new file system")
|
||||
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
||||
(cherry picked from commit a43bf604446414103b7535f38e739b65601c4fb2)
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
fs/nfs/client.c | 3 ++-
|
||||
fs/nfs/fs_context.c | 8 ++++++++
|
||||
include/linux/nfs_fs_sb.h | 1 +
|
||||
3 files changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
|
||||
index 090b16890e3d..f303e96ce165 100644
|
||||
--- a/fs/nfs/client.c
|
||||
+++ b/fs/nfs/client.c
|
||||
@@ -861,7 +861,8 @@ int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, struct nfs
|
||||
}
|
||||
|
||||
if (clp->rpc_ops->discover_trunking != NULL &&
|
||||
- (server->caps & NFS_CAP_FS_LOCATIONS)) {
|
||||
+ (server->caps & NFS_CAP_FS_LOCATIONS &&
|
||||
+ (server->flags & NFS_MOUNT_TRUNK_DISCOVERY))) {
|
||||
error = clp->rpc_ops->discover_trunking(server, mntfh);
|
||||
if (error < 0)
|
||||
return error;
|
||||
diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c
|
||||
index fb3cad38b149..0166370f088e 100644
|
||||
--- a/fs/nfs/fs_context.c
|
||||
+++ b/fs/nfs/fs_context.c
|
||||
@@ -79,6 +79,7 @@ enum nfs_param {
|
||||
Opt_source,
|
||||
Opt_tcp,
|
||||
Opt_timeo,
|
||||
+ Opt_trunkdiscovery,
|
||||
Opt_udp,
|
||||
Opt_v,
|
||||
Opt_vers,
|
||||
@@ -179,6 +180,7 @@ static const struct fs_parameter_spec nfs_fs_parameters[] = {
|
||||
fsparam_string("source", Opt_source),
|
||||
fsparam_flag ("tcp", Opt_tcp),
|
||||
fsparam_u32 ("timeo", Opt_timeo),
|
||||
+ fsparam_flag_no("trunkdiscovery", Opt_trunkdiscovery),
|
||||
fsparam_flag ("udp", Opt_udp),
|
||||
fsparam_flag ("v2", Opt_v),
|
||||
fsparam_flag ("v3", Opt_v),
|
||||
@@ -528,6 +530,12 @@ static int nfs_fs_context_parse_param(struct fs_context *fc,
|
||||
else
|
||||
ctx->flags &= ~NFS_MOUNT_NOCTO;
|
||||
break;
|
||||
+ case Opt_trunkdiscovery:
|
||||
+ if (result.negated)
|
||||
+ ctx->flags &= ~NFS_MOUNT_TRUNK_DISCOVERY;
|
||||
+ else
|
||||
+ ctx->flags |= NFS_MOUNT_TRUNK_DISCOVERY;
|
||||
+ break;
|
||||
case Opt_ac:
|
||||
if (result.negated)
|
||||
ctx->flags |= NFS_MOUNT_NOAC;
|
||||
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
|
||||
index 5e065f16d061..324bdd653ad4 100644
|
||||
--- a/include/linux/nfs_fs_sb.h
|
||||
+++ b/include/linux/nfs_fs_sb.h
|
||||
@@ -157,6 +157,7 @@ struct nfs_server {
|
||||
#define NFS_MOUNT_SOFTREVAL 0x800000
|
||||
#define NFS_MOUNT_WRITE_EAGER 0x01000000
|
||||
#define NFS_MOUNT_WRITE_WAIT 0x02000000
|
||||
+#define NFS_MOUNT_TRUNK_DISCOVERY 0x04000000
|
||||
|
||||
unsigned int fattr_valid; /* Valid attributes */
|
||||
unsigned int caps; /* server capabilities */
|
@ -1,64 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Chengming Zhou <chengming.zhou@linux.dev>
|
||||
Date: Sat, 8 Jun 2024 22:31:15 +0800
|
||||
Subject: [PATCH] block: fix request.queuelist usage in flush
|
||||
|
||||
Friedrich Weber reported a kernel crash problem and bisected to commit
|
||||
81ada09cc25e ("blk-flush: reuse rq queuelist in flush state machine").
|
||||
|
||||
The root cause is that we use "list_move_tail(&rq->queuelist, pending)"
|
||||
in the PREFLUSH/POSTFLUSH sequences. But rq->queuelist.next == xxx since
|
||||
it's popped out from plug->cached_rq in __blk_mq_alloc_requests_batch().
|
||||
We don't initialize its queuelist just for this first request, although
|
||||
the queuelist of all later popped requests will be initialized.
|
||||
|
||||
Fix it by changing to use "list_add_tail(&rq->queuelist, pending)" so
|
||||
rq->queuelist doesn't need to be initialized. It should be ok since rq
|
||||
can't be on any list when PREFLUSH or POSTFLUSH, has no move actually.
|
||||
|
||||
Please note the commit 81ada09cc25e ("blk-flush: reuse rq queuelist in
|
||||
flush state machine") also has another requirement that no drivers would
|
||||
touch rq->queuelist after blk_mq_end_request() since we will reuse it to
|
||||
add rq to the post-flush pending list in POSTFLUSH. If this is not true,
|
||||
we will have to revert that commit IMHO.
|
||||
|
||||
This updated version adds "list_del_init(&rq->queuelist)" in flush rq
|
||||
callback since the dm layer may submit request of a weird invalid format
|
||||
(REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH), which causes double list_add
|
||||
if without this "list_del_init(&rq->queuelist)". The weird invalid format
|
||||
problem should be fixed in dm layer.
|
||||
|
||||
Reported-by: Friedrich Weber <f.weber@proxmox.com>
|
||||
Closes: https://lore.kernel.org/lkml/14b89dfb-505c-49f7-aebb-01c54451db40@proxmox.com/
|
||||
Closes: https://lore.kernel.org/lkml/c9d03ff7-27c5-4ebd-b3f6-5a90d96f35ba@proxmox.com/
|
||||
Fixes: 81ada09cc25e ("blk-flush: reuse rq queuelist in flush state machine")
|
||||
Cc: Christoph Hellwig <hch@lst.de>
|
||||
Cc: ming.lei@redhat.com
|
||||
Cc: bvanassche@acm.org
|
||||
Tested-by: Friedrich Weber <f.weber@proxmox.com>
|
||||
Signed-off-by: Chengming Zhou <chengming.zhou@linux.dev>
|
||||
---
|
||||
block/blk-flush.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/block/blk-flush.c b/block/blk-flush.c
|
||||
index 3f4d41952ef2..d72b57898b23 100644
|
||||
--- a/block/blk-flush.c
|
||||
+++ b/block/blk-flush.c
|
||||
@@ -183,7 +183,7 @@ static void blk_flush_complete_seq(struct request *rq,
|
||||
/* queue for flush */
|
||||
if (list_empty(pending))
|
||||
fq->flush_pending_since = jiffies;
|
||||
- list_move_tail(&rq->queuelist, pending);
|
||||
+ list_add_tail(&rq->queuelist, pending);
|
||||
break;
|
||||
|
||||
case REQ_FSEQ_DATA:
|
||||
@@ -261,6 +261,7 @@ static enum rq_end_io_ret flush_end_io(struct request *flush_rq,
|
||||
unsigned int seq = blk_flush_cur_seq(rq);
|
||||
|
||||
BUG_ON(seq != REQ_FSEQ_PREFLUSH && seq != REQ_FSEQ_POSTFLUSH);
|
||||
+ list_del_init(&rq->queuelist);
|
||||
blk_flush_complete_seq(rq, fq, seq, error);
|
||||
}
|
||||
|
@ -0,0 +1,69 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Marc Bevand <m@zorinaq.com>
|
||||
Date: Tue, 21 Dec 2021 15:31:12 -0800
|
||||
Subject: [PATCH] EDAC/amd64: Add PCI device IDs for family 19h model 50h
|
||||
|
||||
Add the new family 19h model 50h PCI IDs (device 18h functions 0 and 6)
|
||||
to support Ryzen 5000 APUs ("Cezanne").
|
||||
|
||||
Signed-off-by: Marc Bevand <m@zorinaq.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
drivers/edac/amd64_edac.c | 15 +++++++++++++++
|
||||
drivers/edac/amd64_edac.h | 3 +++
|
||||
2 files changed, 18 insertions(+)
|
||||
|
||||
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
|
||||
index c6c58f01067f..f8ef2edf8abf 100644
|
||||
--- a/drivers/edac/amd64_edac.c
|
||||
+++ b/drivers/edac/amd64_edac.c
|
||||
@@ -2660,6 +2660,16 @@ static struct amd64_family_type family_types[] = {
|
||||
.dbam_to_cs = f17_addr_mask_to_cs_size,
|
||||
}
|
||||
},
|
||||
+ [F19_M50H_CPUS] = {
|
||||
+ .ctl_name = "F19h_M50h",
|
||||
+ .f0_id = PCI_DEVICE_ID_AMD_19H_M50H_DF_F0,
|
||||
+ .f6_id = PCI_DEVICE_ID_AMD_19H_M50H_DF_F6,
|
||||
+ .max_mcs = 2,
|
||||
+ .ops = {
|
||||
+ .early_channel_count = f17_early_channel_count,
|
||||
+ .dbam_to_cs = f17_addr_mask_to_cs_size,
|
||||
+ }
|
||||
+ },
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -3706,6 +3716,11 @@ static struct amd64_family_type *per_family_init(struct amd64_pvt *pvt)
|
||||
pvt->ops = &family_types[F17_M70H_CPUS].ops;
|
||||
fam_type->ctl_name = "F19h_M20h";
|
||||
break;
|
||||
+ } else if (pvt->model >= 0x50 && pvt->model <= 0x5f) {
|
||||
+ fam_type = &family_types[F19_M50H_CPUS];
|
||||
+ pvt->ops = &family_types[F19_M50H_CPUS].ops;
|
||||
+ fam_type->ctl_name = "F19h_M50h";
|
||||
+ break;
|
||||
} else if (pvt->model >= 0xa0 && pvt->model <= 0xaf) {
|
||||
fam_type = &family_types[F19_M10H_CPUS];
|
||||
pvt->ops = &family_types[F19_M10H_CPUS].ops;
|
||||
diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h
|
||||
index 650cab401e21..352bda9803f6 100644
|
||||
--- a/drivers/edac/amd64_edac.h
|
||||
+++ b/drivers/edac/amd64_edac.h
|
||||
@@ -128,6 +128,8 @@
|
||||
#define PCI_DEVICE_ID_AMD_19H_DF_F6 0x1656
|
||||
#define PCI_DEVICE_ID_AMD_19H_M10H_DF_F0 0x14ad
|
||||
#define PCI_DEVICE_ID_AMD_19H_M10H_DF_F6 0x14b3
|
||||
+#define PCI_DEVICE_ID_AMD_19H_M50H_DF_F0 0x166a
|
||||
+#define PCI_DEVICE_ID_AMD_19H_M50H_DF_F6 0x1670
|
||||
|
||||
/*
|
||||
* Function 1 - Address Map
|
||||
@@ -301,6 +303,7 @@ enum amd_families {
|
||||
F17_M70H_CPUS,
|
||||
F19_CPUS,
|
||||
F19_M10H_CPUS,
|
||||
+ F19_M50H_CPUS,
|
||||
NUM_FAMILIES,
|
||||
};
|
||||
|
@ -1,49 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: "Martin K. Petersen" <martin.petersen@oracle.com>
|
||||
Date: Mon, 20 May 2024 22:30:40 -0400
|
||||
Subject: [PATCH] scsi: core: Handle devices which return an unusually large
|
||||
VPD page count
|
||||
|
||||
Peter Schneider reported that a system would no longer boot after
|
||||
updating to 6.8.4. Peter bisected the issue and identified commit
|
||||
b5fc07a5fb56 ("scsi: core: Consult supported VPD page list prior to
|
||||
fetching page") as being the culprit.
|
||||
|
||||
Turns out the enclosure device in Peter's system reports a byteswapped
|
||||
page length for VPD page 0. It reports "02 00" as page length instead
|
||||
of "00 02". This causes us to attempt to access 516 bytes (page length
|
||||
+ header) of information despite only 2 pages being present.
|
||||
|
||||
Limit the page search scope to the size of our VPD buffer to guard
|
||||
against devices returning a larger page count than requested.
|
||||
|
||||
Link: https://lore.kernel.org/r/20240521023040.2703884-1-martin.petersen@oracle.com
|
||||
Fixes: b5fc07a5fb56 ("scsi: core: Consult supported VPD page list prior to fetching page")
|
||||
Cc: stable@vger.kernel.org
|
||||
Reported-by: Peter Schneider <pschneider1968@googlemail.com>
|
||||
Closes: https://lore.kernel.org/all/eec6ebbf-061b-4a7b-96dc-ea748aa4d035@googlemail.com/
|
||||
Tested-by: Peter Schneider <pschneider1968@googlemail.com>
|
||||
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
|
||||
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
|
||||
---
|
||||
drivers/scsi/scsi.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
|
||||
index 8cad9792a562..b3ff3a633a1e 100644
|
||||
--- a/drivers/scsi/scsi.c
|
||||
+++ b/drivers/scsi/scsi.c
|
||||
@@ -350,6 +350,13 @@ static int scsi_get_vpd_size(struct scsi_device *sdev, u8 page)
|
||||
if (result < SCSI_VPD_HEADER_SIZE)
|
||||
return 0;
|
||||
|
||||
+ if (result > sizeof(vpd)) {
|
||||
+ dev_warn_once(&sdev->sdev_gendev,
|
||||
+ "%s: long VPD page 0 length: %d bytes\n",
|
||||
+ __func__, result);
|
||||
+ result = sizeof(vpd);
|
||||
+ }
|
||||
+
|
||||
result -= SCSI_VPD_HEADER_SIZE;
|
||||
if (!memchr(&vpd[SCSI_VPD_HEADER_SIZE], page, result))
|
||||
return 0;
|
53
patches/kernel/0016-bug-introduce-ASSERT_STRUCT_OFFSET.patch
Normal file
53
patches/kernel/0016-bug-introduce-ASSERT_STRUCT_OFFSET.patch
Normal file
@ -0,0 +1,53 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Date: Wed, 3 Aug 2022 18:49:59 +0300
|
||||
Subject: [PATCH] bug: introduce ASSERT_STRUCT_OFFSET
|
||||
|
||||
ASSERT_STRUCT_OFFSET allows to assert during the build of
|
||||
the kernel that a field in a struct have an expected offset.
|
||||
|
||||
KVM used to have such macro, but there is almost nothing KVM specific
|
||||
in it so move it to build_bug.h, so that it can be used in other
|
||||
places in KVM.
|
||||
|
||||
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
arch/x86/kvm/vmx/vmcs12.h | 5 ++---
|
||||
include/linux/build_bug.h | 9 +++++++++
|
||||
2 files changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/kvm/vmx/vmcs12.h b/arch/x86/kvm/vmx/vmcs12.h
|
||||
index 2a45f026ee11..ba8617964982 100644
|
||||
--- a/arch/x86/kvm/vmx/vmcs12.h
|
||||
+++ b/arch/x86/kvm/vmx/vmcs12.h
|
||||
@@ -208,9 +208,8 @@ struct __packed vmcs12 {
|
||||
/*
|
||||
* For save/restore compatibility, the vmcs12 field offsets must not change.
|
||||
*/
|
||||
-#define CHECK_OFFSET(field, loc) \
|
||||
- BUILD_BUG_ON_MSG(offsetof(struct vmcs12, field) != (loc), \
|
||||
- "Offset of " #field " in struct vmcs12 has changed.")
|
||||
+#define CHECK_OFFSET(field, loc) \
|
||||
+ ASSERT_STRUCT_OFFSET(struct vmcs12, field, loc)
|
||||
|
||||
static inline void vmx_check_vmcs12_offsets(void)
|
||||
{
|
||||
diff --git a/include/linux/build_bug.h b/include/linux/build_bug.h
|
||||
index e3a0be2c90ad..3aa3640f8c18 100644
|
||||
--- a/include/linux/build_bug.h
|
||||
+++ b/include/linux/build_bug.h
|
||||
@@ -77,4 +77,13 @@
|
||||
#define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
|
||||
#define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
|
||||
|
||||
+
|
||||
+/*
|
||||
+ * Compile time check that field has an expected offset
|
||||
+ */
|
||||
+#define ASSERT_STRUCT_OFFSET(type, field, expected_offset) \
|
||||
+ BUILD_BUG_ON_MSG(offsetof(type, field) != (expected_offset), \
|
||||
+ "Offset of " #field " in " #type " has changed.")
|
||||
+
|
||||
+
|
||||
#endif /* _LINUX_BUILD_BUG_H */
|
@ -1,73 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Vitaly Lifshits <vitaly.lifshits@intel.com>
|
||||
Date: Mon, 29 Apr 2024 10:10:40 -0700
|
||||
Subject: [PATCH] e1000e: change usleep_range to udelay in PHY mdic access
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This is a partial revert of commit 6dbdd4de0362 ("e1000e: Workaround
|
||||
for sporadic MDI error on Meteor Lake systems"). The referenced commit
|
||||
used usleep_range inside the PHY access routines, which are sometimes
|
||||
called from an atomic context. This can lead to a kernel panic in some
|
||||
scenarios, such as cable disconnection and reconnection on vPro systems.
|
||||
|
||||
Solve this by changing the usleep_range calls back to udelay.
|
||||
|
||||
Fixes: 6dbdd4de0362 ("e1000e: Workaround for sporadic MDI error on Meteor Lake systems")
|
||||
Cc: stable@vger.kernel.org
|
||||
Reported-by: Jérôme Carretero <cJ@zougloub.eu>
|
||||
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218740
|
||||
Closes: https://lore.kernel.org/lkml/a7eb665c74b5efb5140e6979759ed243072cb24a.camel@zougloub.eu/
|
||||
Co-developed-by: Sasha Neftin <sasha.neftin@intel.com>
|
||||
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
|
||||
Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
|
||||
Tested-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
|
||||
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
|
||||
Reviewed-by: Simon Horman <horms@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20240429171040.1152516-1-anthony.l.nguyen@intel.com
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
---
|
||||
drivers/net/ethernet/intel/e1000e/phy.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c
|
||||
index 93544f1cc2a5..f7ae0e0aa4a4 100644
|
||||
--- a/drivers/net/ethernet/intel/e1000e/phy.c
|
||||
+++ b/drivers/net/ethernet/intel/e1000e/phy.c
|
||||
@@ -157,7 +157,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
|
||||
* the lower time out
|
||||
*/
|
||||
for (i = 0; i < (E1000_GEN_POLL_TIMEOUT * 3); i++) {
|
||||
- usleep_range(50, 60);
|
||||
+ udelay(50);
|
||||
mdic = er32(MDIC);
|
||||
if (mdic & E1000_MDIC_READY)
|
||||
break;
|
||||
@@ -181,7 +181,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
|
||||
* reading duplicate data in the next MDIC transaction.
|
||||
*/
|
||||
if (hw->mac.type == e1000_pch2lan)
|
||||
- usleep_range(100, 150);
|
||||
+ udelay(100);
|
||||
|
||||
if (success) {
|
||||
*data = (u16)mdic;
|
||||
@@ -237,7 +237,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
|
||||
* the lower time out
|
||||
*/
|
||||
for (i = 0; i < (E1000_GEN_POLL_TIMEOUT * 3); i++) {
|
||||
- usleep_range(50, 60);
|
||||
+ udelay(50);
|
||||
mdic = er32(MDIC);
|
||||
if (mdic & E1000_MDIC_READY)
|
||||
break;
|
||||
@@ -261,7 +261,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
|
||||
* reading duplicate data in the next MDIC transaction.
|
||||
*/
|
||||
if (hw->mac.type == e1000_pch2lan)
|
||||
- usleep_range(100, 150);
|
||||
+ udelay(100);
|
||||
|
||||
if (success)
|
||||
return 0;
|
@ -0,0 +1,34 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Date: Wed, 3 Aug 2022 18:50:02 +0300
|
||||
Subject: [PATCH] KVM: x86: emulator: update the emulation mode after rsm
|
||||
|
||||
This ensures that RIP will be correctly written back,
|
||||
because the RSM instruction can switch the CPU mode from
|
||||
32 bit (or less) to 64 bit.
|
||||
|
||||
This fixes a guest crash in case the #SMI is received
|
||||
while the guest runs a code from an address > 32 bit.
|
||||
|
||||
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
arch/x86/kvm/emulate.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
|
||||
index 98b25a7af8ce..0616ee9cd977 100644
|
||||
--- a/arch/x86/kvm/emulate.c
|
||||
+++ b/arch/x86/kvm/emulate.c
|
||||
@@ -2638,6 +2638,11 @@ static int em_rsm(struct x86_emulate_ctxt *ctxt)
|
||||
if (ret != X86EMUL_CONTINUE)
|
||||
goto emulate_shutdown;
|
||||
|
||||
+
|
||||
+ ret = emulator_recalc_and_set_mode(ctxt);
|
||||
+ if (ret != X86EMUL_CONTINUE)
|
||||
+ goto emulate_shutdown;
|
||||
+
|
||||
/*
|
||||
* Note, the ctxt->ops callbacks are responsible for handling side
|
||||
* effects when writing MSRs and CRs, e.g. MMU context resets, CPUID
|
@ -1,48 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Li Zhang <zhanglikernel@gmail.com>
|
||||
Date: Tue, 18 Jun 2024 07:28:00 +0200
|
||||
Subject: [PATCH] virtio-pci: Check if is_avq is NULL
|
||||
|
||||
BugLink: https://bugs.launchpad.net/bugs/2067862
|
||||
|
||||
[bug]
|
||||
In the virtio_pci_common.c function vp_del_vqs, vp_dev->is_avq is involved
|
||||
to determine whether it is admin virtqueue, but this function vp_dev->is_avq
|
||||
may be empty. For installations, virtio_pci_legacy does not assign a value
|
||||
to vp_dev->is_avq.
|
||||
|
||||
[fix]
|
||||
Check whether it is vp_dev->is_avq before use.
|
||||
|
||||
[test]
|
||||
Test with virsh Attach device
|
||||
Before this patch, the following command would crash the guest system
|
||||
|
||||
After applying the patch, everything seems to be working fine.
|
||||
|
||||
Signed-off-by: Li Zhang <zhanglikernel@gmail.com>
|
||||
Message-Id: <1710566754-3532-1-git-send-email-zhanglikernel@gmail.com>
|
||||
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||||
|
||||
(cherry picked from commit c8fae27d141a32a1624d0d0d5419d94252824498)
|
||||
Signed-off-by: Matthew Ruffell <matthew.ruffell@canonical.com>
|
||||
Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
|
||||
Acked-by: Manuel Diewald <manuel.diewald@canonical.com>
|
||||
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
|
||||
---
|
||||
drivers/virtio/virtio_pci_common.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
|
||||
index b655fccaf773..3c18fc14cd66 100644
|
||||
--- a/drivers/virtio/virtio_pci_common.c
|
||||
+++ b/drivers/virtio/virtio_pci_common.c
|
||||
@@ -236,7 +236,7 @@ void vp_del_vqs(struct virtio_device *vdev)
|
||||
int i;
|
||||
|
||||
list_for_each_entry_safe(vq, n, &vdev->vqs, list) {
|
||||
- if (vp_dev->is_avq(vdev, vq->index))
|
||||
+ if (vp_dev->is_avq && vp_dev->is_avq(vdev, vq->index))
|
||||
continue;
|
||||
|
||||
if (vp_dev->per_vq_vectors) {
|
@ -0,0 +1,280 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Date: Wed, 3 Aug 2022 18:50:05 +0300
|
||||
Subject: [PATCH] KVM: x86: emulator/smm: add structs for KVM's smram layout
|
||||
|
||||
Those structs will be used to read/write the smram state image.
|
||||
|
||||
Also document the differences between KVM's SMRAM layout and SMRAM
|
||||
layout that is used by real Intel/AMD cpus.
|
||||
|
||||
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
arch/x86/kvm/emulate.c | 6 +
|
||||
arch/x86/kvm/kvm_emulate.h | 218 +++++++++++++++++++++++++++++++++++++
|
||||
arch/x86/kvm/x86.c | 1 +
|
||||
3 files changed, 225 insertions(+)
|
||||
|
||||
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
|
||||
index 0616ee9cd977..6866f09a5b53 100644
|
||||
--- a/arch/x86/kvm/emulate.c
|
||||
+++ b/arch/x86/kvm/emulate.c
|
||||
@@ -5829,3 +5829,9 @@ bool emulator_can_use_gpa(struct x86_emulate_ctxt *ctxt)
|
||||
|
||||
return true;
|
||||
}
|
||||
+
|
||||
+void __init kvm_emulator_init(void)
|
||||
+{
|
||||
+ __check_smram32_offsets();
|
||||
+ __check_smram64_offsets();
|
||||
+}
|
||||
diff --git a/arch/x86/kvm/kvm_emulate.h b/arch/x86/kvm/kvm_emulate.h
|
||||
index fb09cd22cb7f..0b2bbcce321a 100644
|
||||
--- a/arch/x86/kvm/kvm_emulate.h
|
||||
+++ b/arch/x86/kvm/kvm_emulate.h
|
||||
@@ -13,6 +13,7 @@
|
||||
#define _ASM_X86_KVM_X86_EMULATE_H
|
||||
|
||||
#include <asm/desc_defs.h>
|
||||
+#include <linux/build_bug.h>
|
||||
#include "fpu.h"
|
||||
|
||||
struct x86_emulate_ctxt;
|
||||
@@ -482,6 +483,223 @@ enum x86_intercept {
|
||||
nr_x86_intercepts
|
||||
};
|
||||
|
||||
+
|
||||
+/* 32 bit KVM's emulated SMM layout. Loosely based on Intel's layout */
|
||||
+
|
||||
+struct kvm_smm_seg_state_32 {
|
||||
+ u32 flags;
|
||||
+ u32 limit;
|
||||
+ u32 base;
|
||||
+} __packed;
|
||||
+
|
||||
+struct kvm_smram_state_32 {
|
||||
+ u32 reserved1[62];
|
||||
+ u32 smbase;
|
||||
+ u32 smm_revision;
|
||||
+ u32 reserved2[5];
|
||||
+ u32 cr4; /* CR4 is not present in Intel/AMD SMRAM image */
|
||||
+ u32 reserved3[5];
|
||||
+
|
||||
+ /*
|
||||
+ * Segment state is not present/documented in the Intel/AMD SMRAM image
|
||||
+ * Instead this area on Intel/AMD contains IO/HLT restart flags.
|
||||
+ */
|
||||
+ struct kvm_smm_seg_state_32 ds;
|
||||
+ struct kvm_smm_seg_state_32 fs;
|
||||
+ struct kvm_smm_seg_state_32 gs;
|
||||
+ struct kvm_smm_seg_state_32 idtr; /* IDTR has only base and limit */
|
||||
+ struct kvm_smm_seg_state_32 tr;
|
||||
+ u32 reserved;
|
||||
+ struct kvm_smm_seg_state_32 gdtr; /* GDTR has only base and limit */
|
||||
+ struct kvm_smm_seg_state_32 ldtr;
|
||||
+ struct kvm_smm_seg_state_32 es;
|
||||
+ struct kvm_smm_seg_state_32 cs;
|
||||
+ struct kvm_smm_seg_state_32 ss;
|
||||
+
|
||||
+ u32 es_sel;
|
||||
+ u32 cs_sel;
|
||||
+ u32 ss_sel;
|
||||
+ u32 ds_sel;
|
||||
+ u32 fs_sel;
|
||||
+ u32 gs_sel;
|
||||
+ u32 ldtr_sel;
|
||||
+ u32 tr_sel;
|
||||
+
|
||||
+ u32 dr7;
|
||||
+ u32 dr6;
|
||||
+ u32 gprs[8]; /* GPRS in the "natural" X86 order (EAX/ECX/EDX.../EDI) */
|
||||
+ u32 eip;
|
||||
+ u32 eflags;
|
||||
+ u32 cr3;
|
||||
+ u32 cr0;
|
||||
+} __packed;
|
||||
+
|
||||
+
|
||||
+static inline void __check_smram32_offsets(void)
|
||||
+{
|
||||
+#define __CHECK_SMRAM32_OFFSET(field, offset) \
|
||||
+ ASSERT_STRUCT_OFFSET(struct kvm_smram_state_32, field, offset - 0xFE00)
|
||||
+
|
||||
+ __CHECK_SMRAM32_OFFSET(reserved1, 0xFE00);
|
||||
+ __CHECK_SMRAM32_OFFSET(smbase, 0xFEF8);
|
||||
+ __CHECK_SMRAM32_OFFSET(smm_revision, 0xFEFC);
|
||||
+ __CHECK_SMRAM32_OFFSET(reserved2, 0xFF00);
|
||||
+ __CHECK_SMRAM32_OFFSET(cr4, 0xFF14);
|
||||
+ __CHECK_SMRAM32_OFFSET(reserved3, 0xFF18);
|
||||
+ __CHECK_SMRAM32_OFFSET(ds, 0xFF2C);
|
||||
+ __CHECK_SMRAM32_OFFSET(fs, 0xFF38);
|
||||
+ __CHECK_SMRAM32_OFFSET(gs, 0xFF44);
|
||||
+ __CHECK_SMRAM32_OFFSET(idtr, 0xFF50);
|
||||
+ __CHECK_SMRAM32_OFFSET(tr, 0xFF5C);
|
||||
+ __CHECK_SMRAM32_OFFSET(gdtr, 0xFF6C);
|
||||
+ __CHECK_SMRAM32_OFFSET(ldtr, 0xFF78);
|
||||
+ __CHECK_SMRAM32_OFFSET(es, 0xFF84);
|
||||
+ __CHECK_SMRAM32_OFFSET(cs, 0xFF90);
|
||||
+ __CHECK_SMRAM32_OFFSET(ss, 0xFF9C);
|
||||
+ __CHECK_SMRAM32_OFFSET(es_sel, 0xFFA8);
|
||||
+ __CHECK_SMRAM32_OFFSET(cs_sel, 0xFFAC);
|
||||
+ __CHECK_SMRAM32_OFFSET(ss_sel, 0xFFB0);
|
||||
+ __CHECK_SMRAM32_OFFSET(ds_sel, 0xFFB4);
|
||||
+ __CHECK_SMRAM32_OFFSET(fs_sel, 0xFFB8);
|
||||
+ __CHECK_SMRAM32_OFFSET(gs_sel, 0xFFBC);
|
||||
+ __CHECK_SMRAM32_OFFSET(ldtr_sel, 0xFFC0);
|
||||
+ __CHECK_SMRAM32_OFFSET(tr_sel, 0xFFC4);
|
||||
+ __CHECK_SMRAM32_OFFSET(dr7, 0xFFC8);
|
||||
+ __CHECK_SMRAM32_OFFSET(dr6, 0xFFCC);
|
||||
+ __CHECK_SMRAM32_OFFSET(gprs, 0xFFD0);
|
||||
+ __CHECK_SMRAM32_OFFSET(eip, 0xFFF0);
|
||||
+ __CHECK_SMRAM32_OFFSET(eflags, 0xFFF4);
|
||||
+ __CHECK_SMRAM32_OFFSET(cr3, 0xFFF8);
|
||||
+ __CHECK_SMRAM32_OFFSET(cr0, 0xFFFC);
|
||||
+#undef __CHECK_SMRAM32_OFFSET
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/* 64 bit KVM's emulated SMM layout. Based on AMD64 layout */
|
||||
+
|
||||
+struct kvm_smm_seg_state_64 {
|
||||
+ u16 selector;
|
||||
+ u16 attributes;
|
||||
+ u32 limit;
|
||||
+ u64 base;
|
||||
+};
|
||||
+
|
||||
+struct kvm_smram_state_64 {
|
||||
+
|
||||
+ struct kvm_smm_seg_state_64 es;
|
||||
+ struct kvm_smm_seg_state_64 cs;
|
||||
+ struct kvm_smm_seg_state_64 ss;
|
||||
+ struct kvm_smm_seg_state_64 ds;
|
||||
+ struct kvm_smm_seg_state_64 fs;
|
||||
+ struct kvm_smm_seg_state_64 gs;
|
||||
+ struct kvm_smm_seg_state_64 gdtr; /* GDTR has only base and limit*/
|
||||
+ struct kvm_smm_seg_state_64 ldtr;
|
||||
+ struct kvm_smm_seg_state_64 idtr; /* IDTR has only base and limit*/
|
||||
+ struct kvm_smm_seg_state_64 tr;
|
||||
+
|
||||
+ /* I/O restart and auto halt restart are not implemented by KVM */
|
||||
+ u64 io_restart_rip;
|
||||
+ u64 io_restart_rcx;
|
||||
+ u64 io_restart_rsi;
|
||||
+ u64 io_restart_rdi;
|
||||
+ u32 io_restart_dword;
|
||||
+ u32 reserved1;
|
||||
+ u8 io_inst_restart;
|
||||
+ u8 auto_hlt_restart;
|
||||
+ u8 reserved2[6];
|
||||
+
|
||||
+ u64 efer;
|
||||
+
|
||||
+ /*
|
||||
+ * Two fields below are implemented on AMD only, to store
|
||||
+ * SVM guest vmcb address if the #SMI was received while in the guest mode.
|
||||
+ */
|
||||
+ u64 svm_guest_flag;
|
||||
+ u64 svm_guest_vmcb_gpa;
|
||||
+ u64 svm_guest_virtual_int; /* unknown purpose, not implemented */
|
||||
+
|
||||
+ u32 reserved3[3];
|
||||
+ u32 smm_revison;
|
||||
+ u32 smbase;
|
||||
+ u32 reserved4[5];
|
||||
+
|
||||
+ /* ssp and svm_* fields below are not implemented by KVM */
|
||||
+ u64 ssp;
|
||||
+ u64 svm_guest_pat;
|
||||
+ u64 svm_host_efer;
|
||||
+ u64 svm_host_cr4;
|
||||
+ u64 svm_host_cr3;
|
||||
+ u64 svm_host_cr0;
|
||||
+
|
||||
+ u64 cr4;
|
||||
+ u64 cr3;
|
||||
+ u64 cr0;
|
||||
+ u64 dr7;
|
||||
+ u64 dr6;
|
||||
+ u64 rflags;
|
||||
+ u64 rip;
|
||||
+ u64 gprs[16]; /* GPRS in a reversed "natural" X86 order (R15/R14/../RCX/RAX.) */
|
||||
+};
|
||||
+
|
||||
+
|
||||
+static inline void __check_smram64_offsets(void)
|
||||
+{
|
||||
+#define __CHECK_SMRAM64_OFFSET(field, offset) \
|
||||
+ ASSERT_STRUCT_OFFSET(struct kvm_smram_state_64, field, offset - 0xFE00)
|
||||
+
|
||||
+ __CHECK_SMRAM64_OFFSET(es, 0xFE00);
|
||||
+ __CHECK_SMRAM64_OFFSET(cs, 0xFE10);
|
||||
+ __CHECK_SMRAM64_OFFSET(ss, 0xFE20);
|
||||
+ __CHECK_SMRAM64_OFFSET(ds, 0xFE30);
|
||||
+ __CHECK_SMRAM64_OFFSET(fs, 0xFE40);
|
||||
+ __CHECK_SMRAM64_OFFSET(gs, 0xFE50);
|
||||
+ __CHECK_SMRAM64_OFFSET(gdtr, 0xFE60);
|
||||
+ __CHECK_SMRAM64_OFFSET(ldtr, 0xFE70);
|
||||
+ __CHECK_SMRAM64_OFFSET(idtr, 0xFE80);
|
||||
+ __CHECK_SMRAM64_OFFSET(tr, 0xFE90);
|
||||
+ __CHECK_SMRAM64_OFFSET(io_restart_rip, 0xFEA0);
|
||||
+ __CHECK_SMRAM64_OFFSET(io_restart_rcx, 0xFEA8);
|
||||
+ __CHECK_SMRAM64_OFFSET(io_restart_rsi, 0xFEB0);
|
||||
+ __CHECK_SMRAM64_OFFSET(io_restart_rdi, 0xFEB8);
|
||||
+ __CHECK_SMRAM64_OFFSET(io_restart_dword, 0xFEC0);
|
||||
+ __CHECK_SMRAM64_OFFSET(reserved1, 0xFEC4);
|
||||
+ __CHECK_SMRAM64_OFFSET(io_inst_restart, 0xFEC8);
|
||||
+ __CHECK_SMRAM64_OFFSET(auto_hlt_restart, 0xFEC9);
|
||||
+ __CHECK_SMRAM64_OFFSET(reserved2, 0xFECA);
|
||||
+ __CHECK_SMRAM64_OFFSET(efer, 0xFED0);
|
||||
+ __CHECK_SMRAM64_OFFSET(svm_guest_flag, 0xFED8);
|
||||
+ __CHECK_SMRAM64_OFFSET(svm_guest_vmcb_gpa, 0xFEE0);
|
||||
+ __CHECK_SMRAM64_OFFSET(svm_guest_virtual_int, 0xFEE8);
|
||||
+ __CHECK_SMRAM64_OFFSET(reserved3, 0xFEF0);
|
||||
+ __CHECK_SMRAM64_OFFSET(smm_revison, 0xFEFC);
|
||||
+ __CHECK_SMRAM64_OFFSET(smbase, 0xFF00);
|
||||
+ __CHECK_SMRAM64_OFFSET(reserved4, 0xFF04);
|
||||
+ __CHECK_SMRAM64_OFFSET(ssp, 0xFF18);
|
||||
+ __CHECK_SMRAM64_OFFSET(svm_guest_pat, 0xFF20);
|
||||
+ __CHECK_SMRAM64_OFFSET(svm_host_efer, 0xFF28);
|
||||
+ __CHECK_SMRAM64_OFFSET(svm_host_cr4, 0xFF30);
|
||||
+ __CHECK_SMRAM64_OFFSET(svm_host_cr3, 0xFF38);
|
||||
+ __CHECK_SMRAM64_OFFSET(svm_host_cr0, 0xFF40);
|
||||
+ __CHECK_SMRAM64_OFFSET(cr4, 0xFF48);
|
||||
+ __CHECK_SMRAM64_OFFSET(cr3, 0xFF50);
|
||||
+ __CHECK_SMRAM64_OFFSET(cr0, 0xFF58);
|
||||
+ __CHECK_SMRAM64_OFFSET(dr7, 0xFF60);
|
||||
+ __CHECK_SMRAM64_OFFSET(dr6, 0xFF68);
|
||||
+ __CHECK_SMRAM64_OFFSET(rflags, 0xFF70);
|
||||
+ __CHECK_SMRAM64_OFFSET(rip, 0xFF78);
|
||||
+ __CHECK_SMRAM64_OFFSET(gprs, 0xFF80);
|
||||
+#undef __CHECK_SMRAM64_OFFSET
|
||||
+}
|
||||
+
|
||||
+union kvm_smram {
|
||||
+ struct kvm_smram_state_64 smram64;
|
||||
+ struct kvm_smram_state_32 smram32;
|
||||
+ u8 bytes[512];
|
||||
+};
|
||||
+
|
||||
+void __init kvm_emulator_init(void);
|
||||
+
|
||||
+
|
||||
/* Host execution mode. */
|
||||
#if defined(CONFIG_X86_32)
|
||||
#define X86EMUL_MODE_HOST X86EMUL_MODE_PROT32
|
||||
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
|
||||
index 7e817493667d..f62bce0a74f0 100644
|
||||
--- a/arch/x86/kvm/x86.c
|
||||
+++ b/arch/x86/kvm/x86.c
|
||||
@@ -12695,6 +12695,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_vmgexit_msr_protocol_exit);
|
||||
static int __init kvm_x86_init(void)
|
||||
{
|
||||
kvm_mmu_x86_module_init();
|
||||
+ kvm_emulator_init();
|
||||
mitigate_smt_rsb &= boot_cpu_has_bug(X86_BUG_SMT_RSB) && cpu_smt_possible();
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,214 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Date: Wed, 3 Aug 2022 18:50:06 +0300
|
||||
Subject: [PATCH] KVM: x86: emulator/smm: use smram structs in the common code
|
||||
|
||||
Switch from using a raw array to 'union kvm_smram'.
|
||||
|
||||
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
arch/x86/include/asm/kvm_host.h | 5 +++--
|
||||
arch/x86/kvm/emulate.c | 12 +++++++-----
|
||||
arch/x86/kvm/kvm_emulate.h | 3 ++-
|
||||
arch/x86/kvm/svm/svm.c | 8 ++++++--
|
||||
arch/x86/kvm/vmx/vmx.c | 4 ++--
|
||||
arch/x86/kvm/x86.c | 16 ++++++++--------
|
||||
6 files changed, 28 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
|
||||
index b2a98914a63c..4b1514a174b0 100644
|
||||
--- a/arch/x86/include/asm/kvm_host.h
|
||||
+++ b/arch/x86/include/asm/kvm_host.h
|
||||
@@ -200,6 +200,7 @@ typedef enum exit_fastpath_completion fastpath_t;
|
||||
|
||||
struct x86_emulate_ctxt;
|
||||
struct x86_exception;
|
||||
+union kvm_smram;
|
||||
enum x86_intercept;
|
||||
enum x86_intercept_stage;
|
||||
|
||||
@@ -1464,8 +1465,8 @@ struct kvm_x86_ops {
|
||||
void (*setup_mce)(struct kvm_vcpu *vcpu);
|
||||
|
||||
int (*smi_allowed)(struct kvm_vcpu *vcpu, bool for_injection);
|
||||
- int (*enter_smm)(struct kvm_vcpu *vcpu, char *smstate);
|
||||
- int (*leave_smm)(struct kvm_vcpu *vcpu, const char *smstate);
|
||||
+ int (*enter_smm)(struct kvm_vcpu *vcpu, union kvm_smram *smram);
|
||||
+ int (*leave_smm)(struct kvm_vcpu *vcpu, const union kvm_smram *smram);
|
||||
void (*enable_smi_window)(struct kvm_vcpu *vcpu);
|
||||
|
||||
int (*mem_enc_op)(struct kvm *kvm, void __user *argp);
|
||||
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
|
||||
index 6866f09a5b53..ae6f89b79ef2 100644
|
||||
--- a/arch/x86/kvm/emulate.c
|
||||
+++ b/arch/x86/kvm/emulate.c
|
||||
@@ -2566,16 +2566,18 @@ static int rsm_load_state_64(struct x86_emulate_ctxt *ctxt,
|
||||
static int em_rsm(struct x86_emulate_ctxt *ctxt)
|
||||
{
|
||||
unsigned long cr0, cr4, efer;
|
||||
- char buf[512];
|
||||
+ const union kvm_smram smram;
|
||||
u64 smbase;
|
||||
int ret;
|
||||
|
||||
+ BUILD_BUG_ON(sizeof(smram) != 512);
|
||||
+
|
||||
if ((ctxt->ops->get_hflags(ctxt) & X86EMUL_SMM_MASK) == 0)
|
||||
return emulate_ud(ctxt);
|
||||
|
||||
smbase = ctxt->ops->get_smbase(ctxt);
|
||||
|
||||
- ret = ctxt->ops->read_phys(ctxt, smbase + 0xfe00, buf, sizeof(buf));
|
||||
+ ret = ctxt->ops->read_phys(ctxt, smbase + 0xfe00, (void *)&smram, sizeof(smram));
|
||||
if (ret != X86EMUL_CONTINUE)
|
||||
return X86EMUL_UNHANDLEABLE;
|
||||
|
||||
@@ -2625,15 +2627,15 @@ static int em_rsm(struct x86_emulate_ctxt *ctxt)
|
||||
* state (e.g. enter guest mode) before loading state from the SMM
|
||||
* state-save area.
|
||||
*/
|
||||
- if (ctxt->ops->leave_smm(ctxt, buf))
|
||||
+ if (ctxt->ops->leave_smm(ctxt, &smram))
|
||||
goto emulate_shutdown;
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
if (emulator_has_longmode(ctxt))
|
||||
- ret = rsm_load_state_64(ctxt, buf);
|
||||
+ ret = rsm_load_state_64(ctxt, (const char *)&smram);
|
||||
else
|
||||
#endif
|
||||
- ret = rsm_load_state_32(ctxt, buf);
|
||||
+ ret = rsm_load_state_32(ctxt, (const char *)&smram);
|
||||
|
||||
if (ret != X86EMUL_CONTINUE)
|
||||
goto emulate_shutdown;
|
||||
diff --git a/arch/x86/kvm/kvm_emulate.h b/arch/x86/kvm/kvm_emulate.h
|
||||
index 0b2bbcce321a..3b37b3e17379 100644
|
||||
--- a/arch/x86/kvm/kvm_emulate.h
|
||||
+++ b/arch/x86/kvm/kvm_emulate.h
|
||||
@@ -19,6 +19,7 @@
|
||||
struct x86_emulate_ctxt;
|
||||
enum x86_intercept;
|
||||
enum x86_intercept_stage;
|
||||
+union kvm_smram;
|
||||
|
||||
struct x86_exception {
|
||||
u8 vector;
|
||||
@@ -233,7 +234,7 @@ struct x86_emulate_ops {
|
||||
|
||||
unsigned (*get_hflags)(struct x86_emulate_ctxt *ctxt);
|
||||
void (*exiting_smm)(struct x86_emulate_ctxt *ctxt);
|
||||
- int (*leave_smm)(struct x86_emulate_ctxt *ctxt, const char *smstate);
|
||||
+ int (*leave_smm)(struct x86_emulate_ctxt *ctxt, const union kvm_smram *smram);
|
||||
void (*triple_fault)(struct x86_emulate_ctxt *ctxt);
|
||||
int (*set_xcr)(struct x86_emulate_ctxt *ctxt, u32 index, u64 xcr);
|
||||
};
|
||||
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
|
||||
index af33aafcb410..76a35d939b9f 100644
|
||||
--- a/arch/x86/kvm/svm/svm.c
|
||||
+++ b/arch/x86/kvm/svm/svm.c
|
||||
@@ -4328,12 +4328,14 @@ static int svm_smi_allowed(struct kvm_vcpu *vcpu, bool for_injection)
|
||||
return !svm_smi_blocked(vcpu);
|
||||
}
|
||||
|
||||
-static int svm_enter_smm(struct kvm_vcpu *vcpu, char *smstate)
|
||||
+static int svm_enter_smm(struct kvm_vcpu *vcpu, union kvm_smram *smram)
|
||||
{
|
||||
struct vcpu_svm *svm = to_svm(vcpu);
|
||||
struct kvm_host_map map_save;
|
||||
int ret;
|
||||
|
||||
+ char *smstate = (char *)smram;
|
||||
+
|
||||
if (!is_guest_mode(vcpu))
|
||||
return 0;
|
||||
|
||||
@@ -4375,7 +4377,7 @@ static int svm_enter_smm(struct kvm_vcpu *vcpu, char *smstate)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int svm_leave_smm(struct kvm_vcpu *vcpu, const char *smstate)
|
||||
+static int svm_leave_smm(struct kvm_vcpu *vcpu, const union kvm_smram *smram)
|
||||
{
|
||||
struct vcpu_svm *svm = to_svm(vcpu);
|
||||
struct kvm_host_map map, map_save;
|
||||
@@ -4383,6 +4385,8 @@ static int svm_leave_smm(struct kvm_vcpu *vcpu, const char *smstate)
|
||||
struct vmcb *vmcb12;
|
||||
int ret;
|
||||
|
||||
+ const char *smstate = (const char *)smram;
|
||||
+
|
||||
if (!guest_cpuid_has(vcpu, X86_FEATURE_LM))
|
||||
return 0;
|
||||
|
||||
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
|
||||
index ab7141c1def4..f844864b5763 100644
|
||||
--- a/arch/x86/kvm/vmx/vmx.c
|
||||
+++ b/arch/x86/kvm/vmx/vmx.c
|
||||
@@ -7652,7 +7652,7 @@ static int vmx_smi_allowed(struct kvm_vcpu *vcpu, bool for_injection)
|
||||
return !is_smm(vcpu);
|
||||
}
|
||||
|
||||
-static int vmx_enter_smm(struct kvm_vcpu *vcpu, char *smstate)
|
||||
+static int vmx_enter_smm(struct kvm_vcpu *vcpu, union kvm_smram *smram)
|
||||
{
|
||||
struct vcpu_vmx *vmx = to_vmx(vcpu);
|
||||
|
||||
@@ -7666,7 +7666,7 @@ static int vmx_enter_smm(struct kvm_vcpu *vcpu, char *smstate)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int vmx_leave_smm(struct kvm_vcpu *vcpu, const char *smstate)
|
||||
+static int vmx_leave_smm(struct kvm_vcpu *vcpu, const union kvm_smram *smram)
|
||||
{
|
||||
struct vcpu_vmx *vmx = to_vmx(vcpu);
|
||||
int ret;
|
||||
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
|
||||
index f62bce0a74f0..3d282bcce9ef 100644
|
||||
--- a/arch/x86/kvm/x86.c
|
||||
+++ b/arch/x86/kvm/x86.c
|
||||
@@ -7489,9 +7489,9 @@ static void emulator_exiting_smm(struct x86_emulate_ctxt *ctxt)
|
||||
}
|
||||
|
||||
static int emulator_leave_smm(struct x86_emulate_ctxt *ctxt,
|
||||
- const char *smstate)
|
||||
+ const union kvm_smram *smram)
|
||||
{
|
||||
- return static_call(kvm_x86_leave_smm)(emul_to_vcpu(ctxt), smstate);
|
||||
+ return static_call(kvm_x86_leave_smm)(emul_to_vcpu(ctxt), smram);
|
||||
}
|
||||
|
||||
static void emulator_triple_fault(struct x86_emulate_ctxt *ctxt)
|
||||
@@ -9370,25 +9370,25 @@ static void enter_smm(struct kvm_vcpu *vcpu)
|
||||
struct kvm_segment cs, ds;
|
||||
struct desc_ptr dt;
|
||||
unsigned long cr0;
|
||||
- char buf[512];
|
||||
+ union kvm_smram smram;
|
||||
|
||||
- memset(buf, 0, 512);
|
||||
+ memset(smram.bytes, 0, sizeof(smram.bytes));
|
||||
#ifdef CONFIG_X86_64
|
||||
if (guest_cpuid_has(vcpu, X86_FEATURE_LM))
|
||||
- enter_smm_save_state_64(vcpu, buf);
|
||||
+ enter_smm_save_state_64(vcpu, (char *)&smram);
|
||||
else
|
||||
#endif
|
||||
- enter_smm_save_state_32(vcpu, buf);
|
||||
+ enter_smm_save_state_32(vcpu, (char *)&smram);
|
||||
|
||||
/*
|
||||
* Give enter_smm() a chance to make ISA-specific changes to the vCPU
|
||||
* state (e.g. leave guest mode) after we've saved the state into the
|
||||
* SMM state-save area.
|
||||
*/
|
||||
- static_call(kvm_x86_enter_smm)(vcpu, buf);
|
||||
+ static_call(kvm_x86_enter_smm)(vcpu, &smram);
|
||||
|
||||
kvm_smm_changed(vcpu, true);
|
||||
- kvm_vcpu_write_guest(vcpu, vcpu->arch.smbase + 0xfe00, buf, sizeof(buf));
|
||||
+ kvm_vcpu_write_guest(vcpu, vcpu->arch.smbase + 0xfe00, &smram, sizeof(smram));
|
||||
|
||||
if (static_call(kvm_x86_get_nmi_mask)(vcpu))
|
||||
vcpu->arch.hflags |= HF_SMM_INSIDE_NMI_MASK;
|
@ -0,0 +1,268 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Date: Wed, 3 Aug 2022 18:50:07 +0300
|
||||
Subject: [PATCH] KVM: x86: emulator/smm: use smram struct for 32 bit smram
|
||||
load/restore
|
||||
|
||||
Use kvm_smram_state_32 struct to save/restore 32 bit SMM state
|
||||
(used when X86_FEATURE_LM is not present in the guest CPUID).
|
||||
|
||||
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
arch/x86/kvm/emulate.c | 81 +++++++++++++++---------------------------
|
||||
arch/x86/kvm/x86.c | 75 +++++++++++++++++---------------------
|
||||
2 files changed, 60 insertions(+), 96 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
|
||||
index ae6f89b79ef2..36c45c89563c 100644
|
||||
--- a/arch/x86/kvm/emulate.c
|
||||
+++ b/arch/x86/kvm/emulate.c
|
||||
@@ -2343,25 +2343,17 @@ static void rsm_set_desc_flags(struct desc_struct *desc, u32 flags)
|
||||
desc->type = (flags >> 8) & 15;
|
||||
}
|
||||
|
||||
-static int rsm_load_seg_32(struct x86_emulate_ctxt *ctxt, const char *smstate,
|
||||
+static void rsm_load_seg_32(struct x86_emulate_ctxt *ctxt,
|
||||
+ const struct kvm_smm_seg_state_32 *state,
|
||||
+ u16 selector,
|
||||
int n)
|
||||
{
|
||||
struct desc_struct desc;
|
||||
- int offset;
|
||||
- u16 selector;
|
||||
-
|
||||
- selector = GET_SMSTATE(u32, smstate, 0x7fa8 + n * 4);
|
||||
-
|
||||
- if (n < 3)
|
||||
- offset = 0x7f84 + n * 12;
|
||||
- else
|
||||
- offset = 0x7f2c + (n - 3) * 12;
|
||||
|
||||
- set_desc_base(&desc, GET_SMSTATE(u32, smstate, offset + 8));
|
||||
- set_desc_limit(&desc, GET_SMSTATE(u32, smstate, offset + 4));
|
||||
- rsm_set_desc_flags(&desc, GET_SMSTATE(u32, smstate, offset));
|
||||
+ set_desc_base(&desc, state->base);
|
||||
+ set_desc_limit(&desc, state->limit);
|
||||
+ rsm_set_desc_flags(&desc, state->flags);
|
||||
ctxt->ops->set_segment(ctxt, selector, &desc, 0, n);
|
||||
- return X86EMUL_CONTINUE;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
@@ -2432,63 +2424,46 @@ static int rsm_enter_protected_mode(struct x86_emulate_ctxt *ctxt,
|
||||
}
|
||||
|
||||
static int rsm_load_state_32(struct x86_emulate_ctxt *ctxt,
|
||||
- const char *smstate)
|
||||
+ const struct kvm_smram_state_32 *smstate)
|
||||
{
|
||||
- struct desc_struct desc;
|
||||
struct desc_ptr dt;
|
||||
- u16 selector;
|
||||
- u32 val, cr0, cr3, cr4;
|
||||
int i;
|
||||
|
||||
- cr0 = GET_SMSTATE(u32, smstate, 0x7ffc);
|
||||
- cr3 = GET_SMSTATE(u32, smstate, 0x7ff8);
|
||||
- ctxt->eflags = GET_SMSTATE(u32, smstate, 0x7ff4) | X86_EFLAGS_FIXED;
|
||||
- ctxt->_eip = GET_SMSTATE(u32, smstate, 0x7ff0);
|
||||
+ ctxt->eflags = smstate->eflags | X86_EFLAGS_FIXED;
|
||||
+ ctxt->_eip = smstate->eip;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
- *reg_write(ctxt, i) = GET_SMSTATE(u32, smstate, 0x7fd0 + i * 4);
|
||||
-
|
||||
- val = GET_SMSTATE(u32, smstate, 0x7fcc);
|
||||
+ *reg_write(ctxt, i) = smstate->gprs[i];
|
||||
|
||||
- if (ctxt->ops->set_dr(ctxt, 6, val))
|
||||
+ if (ctxt->ops->set_dr(ctxt, 6, smstate->dr6))
|
||||
return X86EMUL_UNHANDLEABLE;
|
||||
-
|
||||
- val = GET_SMSTATE(u32, smstate, 0x7fc8);
|
||||
-
|
||||
- if (ctxt->ops->set_dr(ctxt, 7, val))
|
||||
+ if (ctxt->ops->set_dr(ctxt, 7, smstate->dr7))
|
||||
return X86EMUL_UNHANDLEABLE;
|
||||
|
||||
- selector = GET_SMSTATE(u32, smstate, 0x7fc4);
|
||||
- set_desc_base(&desc, GET_SMSTATE(u32, smstate, 0x7f64));
|
||||
- set_desc_limit(&desc, GET_SMSTATE(u32, smstate, 0x7f60));
|
||||
- rsm_set_desc_flags(&desc, GET_SMSTATE(u32, smstate, 0x7f5c));
|
||||
- ctxt->ops->set_segment(ctxt, selector, &desc, 0, VCPU_SREG_TR);
|
||||
+ rsm_load_seg_32(ctxt, &smstate->tr, smstate->tr_sel, VCPU_SREG_TR);
|
||||
+ rsm_load_seg_32(ctxt, &smstate->ldtr, smstate->ldtr_sel, VCPU_SREG_LDTR);
|
||||
|
||||
- selector = GET_SMSTATE(u32, smstate, 0x7fc0);
|
||||
- set_desc_base(&desc, GET_SMSTATE(u32, smstate, 0x7f80));
|
||||
- set_desc_limit(&desc, GET_SMSTATE(u32, smstate, 0x7f7c));
|
||||
- rsm_set_desc_flags(&desc, GET_SMSTATE(u32, smstate, 0x7f78));
|
||||
- ctxt->ops->set_segment(ctxt, selector, &desc, 0, VCPU_SREG_LDTR);
|
||||
|
||||
- dt.address = GET_SMSTATE(u32, smstate, 0x7f74);
|
||||
- dt.size = GET_SMSTATE(u32, smstate, 0x7f70);
|
||||
+ dt.address = smstate->gdtr.base;
|
||||
+ dt.size = smstate->gdtr.limit;
|
||||
ctxt->ops->set_gdt(ctxt, &dt);
|
||||
|
||||
- dt.address = GET_SMSTATE(u32, smstate, 0x7f58);
|
||||
- dt.size = GET_SMSTATE(u32, smstate, 0x7f54);
|
||||
+ dt.address = smstate->idtr.base;
|
||||
+ dt.size = smstate->idtr.limit;
|
||||
ctxt->ops->set_idt(ctxt, &dt);
|
||||
|
||||
- for (i = 0; i < 6; i++) {
|
||||
- int r = rsm_load_seg_32(ctxt, smstate, i);
|
||||
- if (r != X86EMUL_CONTINUE)
|
||||
- return r;
|
||||
- }
|
||||
+ rsm_load_seg_32(ctxt, &smstate->es, smstate->es_sel, VCPU_SREG_ES);
|
||||
+ rsm_load_seg_32(ctxt, &smstate->cs, smstate->cs_sel, VCPU_SREG_CS);
|
||||
+ rsm_load_seg_32(ctxt, &smstate->ss, smstate->ss_sel, VCPU_SREG_SS);
|
||||
|
||||
- cr4 = GET_SMSTATE(u32, smstate, 0x7f14);
|
||||
+ rsm_load_seg_32(ctxt, &smstate->ds, smstate->ds_sel, VCPU_SREG_DS);
|
||||
+ rsm_load_seg_32(ctxt, &smstate->fs, smstate->fs_sel, VCPU_SREG_FS);
|
||||
+ rsm_load_seg_32(ctxt, &smstate->gs, smstate->gs_sel, VCPU_SREG_GS);
|
||||
|
||||
- ctxt->ops->set_smbase(ctxt, GET_SMSTATE(u32, smstate, 0x7ef8));
|
||||
+ ctxt->ops->set_smbase(ctxt, smstate->smbase);
|
||||
|
||||
- return rsm_enter_protected_mode(ctxt, cr0, cr3, cr4);
|
||||
+ return rsm_enter_protected_mode(ctxt, smstate->cr0,
|
||||
+ smstate->cr3, smstate->cr4);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
@@ -2635,7 +2610,7 @@ static int em_rsm(struct x86_emulate_ctxt *ctxt)
|
||||
ret = rsm_load_state_64(ctxt, (const char *)&smram);
|
||||
else
|
||||
#endif
|
||||
- ret = rsm_load_state_32(ctxt, (const char *)&smram);
|
||||
+ ret = rsm_load_state_32(ctxt, &smram.smram32);
|
||||
|
||||
if (ret != X86EMUL_CONTINUE)
|
||||
goto emulate_shutdown;
|
||||
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
|
||||
index 3d282bcce9ef..c6b5c0543931 100644
|
||||
--- a/arch/x86/kvm/x86.c
|
||||
+++ b/arch/x86/kvm/x86.c
|
||||
@@ -9224,22 +9224,18 @@ static u32 enter_smm_get_segment_flags(struct kvm_segment *seg)
|
||||
return flags;
|
||||
}
|
||||
|
||||
-static void enter_smm_save_seg_32(struct kvm_vcpu *vcpu, char *buf, int n)
|
||||
+static void enter_smm_save_seg_32(struct kvm_vcpu *vcpu,
|
||||
+ struct kvm_smm_seg_state_32 *state,
|
||||
+ u32 *selector,
|
||||
+ int n)
|
||||
{
|
||||
struct kvm_segment seg;
|
||||
- int offset;
|
||||
|
||||
kvm_get_segment(vcpu, &seg, n);
|
||||
- put_smstate(u32, buf, 0x7fa8 + n * 4, seg.selector);
|
||||
-
|
||||
- if (n < 3)
|
||||
- offset = 0x7f84 + n * 12;
|
||||
- else
|
||||
- offset = 0x7f2c + (n - 3) * 12;
|
||||
-
|
||||
- put_smstate(u32, buf, offset + 8, seg.base);
|
||||
- put_smstate(u32, buf, offset + 4, seg.limit);
|
||||
- put_smstate(u32, buf, offset, enter_smm_get_segment_flags(&seg));
|
||||
+ *selector = seg.selector;
|
||||
+ state->base = seg.base;
|
||||
+ state->limit = seg.limit;
|
||||
+ state->flags = enter_smm_get_segment_flags(&seg);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
@@ -9260,54 +9256,47 @@ static void enter_smm_save_seg_64(struct kvm_vcpu *vcpu, char *buf, int n)
|
||||
}
|
||||
#endif
|
||||
|
||||
-static void enter_smm_save_state_32(struct kvm_vcpu *vcpu, char *buf)
|
||||
+static void enter_smm_save_state_32(struct kvm_vcpu *vcpu, struct kvm_smram_state_32 *smram)
|
||||
{
|
||||
struct desc_ptr dt;
|
||||
- struct kvm_segment seg;
|
||||
unsigned long val;
|
||||
int i;
|
||||
|
||||
- put_smstate(u32, buf, 0x7ffc, kvm_read_cr0(vcpu));
|
||||
- put_smstate(u32, buf, 0x7ff8, kvm_read_cr3(vcpu));
|
||||
- put_smstate(u32, buf, 0x7ff4, kvm_get_rflags(vcpu));
|
||||
- put_smstate(u32, buf, 0x7ff0, kvm_rip_read(vcpu));
|
||||
+ smram->cr0 = kvm_read_cr0(vcpu);
|
||||
+ smram->cr3 = kvm_read_cr3(vcpu);
|
||||
+ smram->eflags = kvm_get_rflags(vcpu);
|
||||
+ smram->eip = kvm_rip_read(vcpu);
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
- put_smstate(u32, buf, 0x7fd0 + i * 4, kvm_register_read_raw(vcpu, i));
|
||||
+ smram->gprs[i] = kvm_register_read_raw(vcpu, i);
|
||||
|
||||
kvm_get_dr(vcpu, 6, &val);
|
||||
- put_smstate(u32, buf, 0x7fcc, (u32)val);
|
||||
+ smram->dr6 = (u32)val;
|
||||
kvm_get_dr(vcpu, 7, &val);
|
||||
- put_smstate(u32, buf, 0x7fc8, (u32)val);
|
||||
+ smram->dr7 = (u32)val;
|
||||
|
||||
- kvm_get_segment(vcpu, &seg, VCPU_SREG_TR);
|
||||
- put_smstate(u32, buf, 0x7fc4, seg.selector);
|
||||
- put_smstate(u32, buf, 0x7f64, seg.base);
|
||||
- put_smstate(u32, buf, 0x7f60, seg.limit);
|
||||
- put_smstate(u32, buf, 0x7f5c, enter_smm_get_segment_flags(&seg));
|
||||
-
|
||||
- kvm_get_segment(vcpu, &seg, VCPU_SREG_LDTR);
|
||||
- put_smstate(u32, buf, 0x7fc0, seg.selector);
|
||||
- put_smstate(u32, buf, 0x7f80, seg.base);
|
||||
- put_smstate(u32, buf, 0x7f7c, seg.limit);
|
||||
- put_smstate(u32, buf, 0x7f78, enter_smm_get_segment_flags(&seg));
|
||||
+ enter_smm_save_seg_32(vcpu, &smram->tr, &smram->tr_sel, VCPU_SREG_TR);
|
||||
+ enter_smm_save_seg_32(vcpu, &smram->ldtr, &smram->ldtr_sel, VCPU_SREG_LDTR);
|
||||
|
||||
static_call(kvm_x86_get_gdt)(vcpu, &dt);
|
||||
- put_smstate(u32, buf, 0x7f74, dt.address);
|
||||
- put_smstate(u32, buf, 0x7f70, dt.size);
|
||||
+ smram->gdtr.base = dt.address;
|
||||
+ smram->gdtr.limit = dt.size;
|
||||
|
||||
static_call(kvm_x86_get_idt)(vcpu, &dt);
|
||||
- put_smstate(u32, buf, 0x7f58, dt.address);
|
||||
- put_smstate(u32, buf, 0x7f54, dt.size);
|
||||
+ smram->idtr.base = dt.address;
|
||||
+ smram->idtr.limit = dt.size;
|
||||
|
||||
- for (i = 0; i < 6; i++)
|
||||
- enter_smm_save_seg_32(vcpu, buf, i);
|
||||
+ enter_smm_save_seg_32(vcpu, &smram->es, &smram->es_sel, VCPU_SREG_ES);
|
||||
+ enter_smm_save_seg_32(vcpu, &smram->cs, &smram->cs_sel, VCPU_SREG_CS);
|
||||
+ enter_smm_save_seg_32(vcpu, &smram->ss, &smram->ss_sel, VCPU_SREG_SS);
|
||||
|
||||
- put_smstate(u32, buf, 0x7f14, kvm_read_cr4(vcpu));
|
||||
+ enter_smm_save_seg_32(vcpu, &smram->ds, &smram->ds_sel, VCPU_SREG_DS);
|
||||
+ enter_smm_save_seg_32(vcpu, &smram->fs, &smram->fs_sel, VCPU_SREG_FS);
|
||||
+ enter_smm_save_seg_32(vcpu, &smram->gs, &smram->gs_sel, VCPU_SREG_GS);
|
||||
|
||||
- /* revision id */
|
||||
- put_smstate(u32, buf, 0x7efc, 0x00020000);
|
||||
- put_smstate(u32, buf, 0x7ef8, vcpu->arch.smbase);
|
||||
+ smram->cr4 = kvm_read_cr4(vcpu);
|
||||
+ smram->smm_revision = 0x00020000;
|
||||
+ smram->smbase = vcpu->arch.smbase;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
@@ -9378,7 +9367,7 @@ static void enter_smm(struct kvm_vcpu *vcpu)
|
||||
enter_smm_save_state_64(vcpu, (char *)&smram);
|
||||
else
|
||||
#endif
|
||||
- enter_smm_save_state_32(vcpu, (char *)&smram);
|
||||
+ enter_smm_save_state_32(vcpu, &smram.smram32);
|
||||
|
||||
/*
|
||||
* Give enter_smm() a chance to make ISA-specific changes to the vCPU
|
@ -0,0 +1,279 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Date: Wed, 3 Aug 2022 18:50:08 +0300
|
||||
Subject: [PATCH] KVM: x86: emulator/smm: use smram struct for 64 bit smram
|
||||
load/restore
|
||||
|
||||
Use kvm_smram_state_64 struct to save/restore the 64 bit SMM state
|
||||
(used when X86_FEATURE_LM is present in the guest CPUID,
|
||||
regardless of 32-bitness of the guest).
|
||||
|
||||
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
arch/x86/kvm/emulate.c | 88 ++++++++++++++----------------------------
|
||||
arch/x86/kvm/x86.c | 75 ++++++++++++++++-------------------
|
||||
2 files changed, 62 insertions(+), 101 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
|
||||
index 36c45c89563c..eb2f5e43f6ad 100644
|
||||
--- a/arch/x86/kvm/emulate.c
|
||||
+++ b/arch/x86/kvm/emulate.c
|
||||
@@ -2357,24 +2357,16 @@ static void rsm_load_seg_32(struct x86_emulate_ctxt *ctxt,
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
-static int rsm_load_seg_64(struct x86_emulate_ctxt *ctxt, const char *smstate,
|
||||
- int n)
|
||||
+static void rsm_load_seg_64(struct x86_emulate_ctxt *ctxt,
|
||||
+ const struct kvm_smm_seg_state_64 *state,
|
||||
+ int n)
|
||||
{
|
||||
struct desc_struct desc;
|
||||
- int offset;
|
||||
- u16 selector;
|
||||
- u32 base3;
|
||||
-
|
||||
- offset = 0x7e00 + n * 16;
|
||||
-
|
||||
- selector = GET_SMSTATE(u16, smstate, offset);
|
||||
- rsm_set_desc_flags(&desc, GET_SMSTATE(u16, smstate, offset + 2) << 8);
|
||||
- set_desc_limit(&desc, GET_SMSTATE(u32, smstate, offset + 4));
|
||||
- set_desc_base(&desc, GET_SMSTATE(u32, smstate, offset + 8));
|
||||
- base3 = GET_SMSTATE(u32, smstate, offset + 12);
|
||||
|
||||
- ctxt->ops->set_segment(ctxt, selector, &desc, base3, n);
|
||||
- return X86EMUL_CONTINUE;
|
||||
+ rsm_set_desc_flags(&desc, state->attributes << 8);
|
||||
+ set_desc_limit(&desc, state->limit);
|
||||
+ set_desc_base(&desc, (u32)state->base);
|
||||
+ ctxt->ops->set_segment(ctxt, state->selector, &desc, state->base >> 32, n);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2468,71 +2460,49 @@ static int rsm_load_state_32(struct x86_emulate_ctxt *ctxt,
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
static int rsm_load_state_64(struct x86_emulate_ctxt *ctxt,
|
||||
- const char *smstate)
|
||||
+ const struct kvm_smram_state_64 *smstate)
|
||||
{
|
||||
- struct desc_struct desc;
|
||||
struct desc_ptr dt;
|
||||
- u64 val, cr0, cr3, cr4;
|
||||
- u32 base3;
|
||||
- u16 selector;
|
||||
int i, r;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
- *reg_write(ctxt, i) = GET_SMSTATE(u64, smstate, 0x7ff8 - i * 8);
|
||||
+ *reg_write(ctxt, i) = smstate->gprs[15 - i];
|
||||
|
||||
- ctxt->_eip = GET_SMSTATE(u64, smstate, 0x7f78);
|
||||
- ctxt->eflags = GET_SMSTATE(u32, smstate, 0x7f70) | X86_EFLAGS_FIXED;
|
||||
+ ctxt->_eip = smstate->rip;
|
||||
+ ctxt->eflags = smstate->rflags | X86_EFLAGS_FIXED;
|
||||
|
||||
- val = GET_SMSTATE(u64, smstate, 0x7f68);
|
||||
-
|
||||
- if (ctxt->ops->set_dr(ctxt, 6, val))
|
||||
+ if (ctxt->ops->set_dr(ctxt, 6, smstate->dr6))
|
||||
return X86EMUL_UNHANDLEABLE;
|
||||
-
|
||||
- val = GET_SMSTATE(u64, smstate, 0x7f60);
|
||||
-
|
||||
- if (ctxt->ops->set_dr(ctxt, 7, val))
|
||||
+ if (ctxt->ops->set_dr(ctxt, 7, smstate->dr7))
|
||||
return X86EMUL_UNHANDLEABLE;
|
||||
|
||||
- cr0 = GET_SMSTATE(u64, smstate, 0x7f58);
|
||||
- cr3 = GET_SMSTATE(u64, smstate, 0x7f50);
|
||||
- cr4 = GET_SMSTATE(u64, smstate, 0x7f48);
|
||||
- ctxt->ops->set_smbase(ctxt, GET_SMSTATE(u32, smstate, 0x7f00));
|
||||
- val = GET_SMSTATE(u64, smstate, 0x7ed0);
|
||||
+ ctxt->ops->set_smbase(ctxt, smstate->smbase);
|
||||
|
||||
- if (ctxt->ops->set_msr(ctxt, MSR_EFER, val & ~EFER_LMA))
|
||||
+ if (ctxt->ops->set_msr(ctxt, MSR_EFER, smstate->efer & ~EFER_LMA))
|
||||
return X86EMUL_UNHANDLEABLE;
|
||||
|
||||
- selector = GET_SMSTATE(u32, smstate, 0x7e90);
|
||||
- rsm_set_desc_flags(&desc, GET_SMSTATE(u32, smstate, 0x7e92) << 8);
|
||||
- set_desc_limit(&desc, GET_SMSTATE(u32, smstate, 0x7e94));
|
||||
- set_desc_base(&desc, GET_SMSTATE(u32, smstate, 0x7e98));
|
||||
- base3 = GET_SMSTATE(u32, smstate, 0x7e9c);
|
||||
- ctxt->ops->set_segment(ctxt, selector, &desc, base3, VCPU_SREG_TR);
|
||||
+ rsm_load_seg_64(ctxt, &smstate->tr, VCPU_SREG_TR);
|
||||
|
||||
- dt.size = GET_SMSTATE(u32, smstate, 0x7e84);
|
||||
- dt.address = GET_SMSTATE(u64, smstate, 0x7e88);
|
||||
+ dt.size = smstate->idtr.limit;
|
||||
+ dt.address = smstate->idtr.base;
|
||||
ctxt->ops->set_idt(ctxt, &dt);
|
||||
|
||||
- selector = GET_SMSTATE(u32, smstate, 0x7e70);
|
||||
- rsm_set_desc_flags(&desc, GET_SMSTATE(u32, smstate, 0x7e72) << 8);
|
||||
- set_desc_limit(&desc, GET_SMSTATE(u32, smstate, 0x7e74));
|
||||
- set_desc_base(&desc, GET_SMSTATE(u32, smstate, 0x7e78));
|
||||
- base3 = GET_SMSTATE(u32, smstate, 0x7e7c);
|
||||
- ctxt->ops->set_segment(ctxt, selector, &desc, base3, VCPU_SREG_LDTR);
|
||||
+ rsm_load_seg_64(ctxt, &smstate->ldtr, VCPU_SREG_LDTR);
|
||||
|
||||
- dt.size = GET_SMSTATE(u32, smstate, 0x7e64);
|
||||
- dt.address = GET_SMSTATE(u64, smstate, 0x7e68);
|
||||
+ dt.size = smstate->gdtr.limit;
|
||||
+ dt.address = smstate->gdtr.base;
|
||||
ctxt->ops->set_gdt(ctxt, &dt);
|
||||
|
||||
- r = rsm_enter_protected_mode(ctxt, cr0, cr3, cr4);
|
||||
+ r = rsm_enter_protected_mode(ctxt, smstate->cr0, smstate->cr3, smstate->cr4);
|
||||
if (r != X86EMUL_CONTINUE)
|
||||
return r;
|
||||
|
||||
- for (i = 0; i < 6; i++) {
|
||||
- r = rsm_load_seg_64(ctxt, smstate, i);
|
||||
- if (r != X86EMUL_CONTINUE)
|
||||
- return r;
|
||||
- }
|
||||
+ rsm_load_seg_64(ctxt, &smstate->es, VCPU_SREG_ES);
|
||||
+ rsm_load_seg_64(ctxt, &smstate->cs, VCPU_SREG_CS);
|
||||
+ rsm_load_seg_64(ctxt, &smstate->ss, VCPU_SREG_SS);
|
||||
+ rsm_load_seg_64(ctxt, &smstate->ds, VCPU_SREG_DS);
|
||||
+ rsm_load_seg_64(ctxt, &smstate->fs, VCPU_SREG_FS);
|
||||
+ rsm_load_seg_64(ctxt, &smstate->gs, VCPU_SREG_GS);
|
||||
|
||||
return X86EMUL_CONTINUE;
|
||||
}
|
||||
@@ -2607,7 +2577,7 @@ static int em_rsm(struct x86_emulate_ctxt *ctxt)
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
if (emulator_has_longmode(ctxt))
|
||||
- ret = rsm_load_state_64(ctxt, (const char *)&smram);
|
||||
+ ret = rsm_load_state_64(ctxt, &smram.smram64);
|
||||
else
|
||||
#endif
|
||||
ret = rsm_load_state_32(ctxt, &smram.smram32);
|
||||
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
|
||||
index c6b5c0543931..f309248fa888 100644
|
||||
--- a/arch/x86/kvm/x86.c
|
||||
+++ b/arch/x86/kvm/x86.c
|
||||
@@ -9239,20 +9239,17 @@ static void enter_smm_save_seg_32(struct kvm_vcpu *vcpu,
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
-static void enter_smm_save_seg_64(struct kvm_vcpu *vcpu, char *buf, int n)
|
||||
+static void enter_smm_save_seg_64(struct kvm_vcpu *vcpu,
|
||||
+ struct kvm_smm_seg_state_64 *state,
|
||||
+ int n)
|
||||
{
|
||||
struct kvm_segment seg;
|
||||
- int offset;
|
||||
- u16 flags;
|
||||
|
||||
kvm_get_segment(vcpu, &seg, n);
|
||||
- offset = 0x7e00 + n * 16;
|
||||
-
|
||||
- flags = enter_smm_get_segment_flags(&seg) >> 8;
|
||||
- put_smstate(u16, buf, offset, seg.selector);
|
||||
- put_smstate(u16, buf, offset + 2, flags);
|
||||
- put_smstate(u32, buf, offset + 4, seg.limit);
|
||||
- put_smstate(u64, buf, offset + 8, seg.base);
|
||||
+ state->selector = seg.selector;
|
||||
+ state->attributes = enter_smm_get_segment_flags(&seg) >> 8;
|
||||
+ state->limit = seg.limit;
|
||||
+ state->base = seg.base;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -9300,57 +9297,51 @@ static void enter_smm_save_state_32(struct kvm_vcpu *vcpu, struct kvm_smram_stat
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
-static void enter_smm_save_state_64(struct kvm_vcpu *vcpu, char *buf)
|
||||
+static void enter_smm_save_state_64(struct kvm_vcpu *vcpu, struct kvm_smram_state_64 *smram)
|
||||
{
|
||||
struct desc_ptr dt;
|
||||
- struct kvm_segment seg;
|
||||
unsigned long val;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
- put_smstate(u64, buf, 0x7ff8 - i * 8, kvm_register_read_raw(vcpu, i));
|
||||
+ smram->gprs[15 - i] = kvm_register_read_raw(vcpu, i);
|
||||
+
|
||||
+ smram->rip = kvm_rip_read(vcpu);
|
||||
+ smram->rflags = kvm_get_rflags(vcpu);
|
||||
|
||||
- put_smstate(u64, buf, 0x7f78, kvm_rip_read(vcpu));
|
||||
- put_smstate(u32, buf, 0x7f70, kvm_get_rflags(vcpu));
|
||||
|
||||
kvm_get_dr(vcpu, 6, &val);
|
||||
- put_smstate(u64, buf, 0x7f68, val);
|
||||
+ smram->dr6 = val;
|
||||
kvm_get_dr(vcpu, 7, &val);
|
||||
- put_smstate(u64, buf, 0x7f60, val);
|
||||
-
|
||||
- put_smstate(u64, buf, 0x7f58, kvm_read_cr0(vcpu));
|
||||
- put_smstate(u64, buf, 0x7f50, kvm_read_cr3(vcpu));
|
||||
- put_smstate(u64, buf, 0x7f48, kvm_read_cr4(vcpu));
|
||||
+ smram->dr7 = val;
|
||||
|
||||
- put_smstate(u32, buf, 0x7f00, vcpu->arch.smbase);
|
||||
+ smram->cr0 = kvm_read_cr0(vcpu);
|
||||
+ smram->cr3 = kvm_read_cr3(vcpu);
|
||||
+ smram->cr4 = kvm_read_cr4(vcpu);
|
||||
|
||||
- /* revision id */
|
||||
- put_smstate(u32, buf, 0x7efc, 0x00020064);
|
||||
+ smram->smbase = vcpu->arch.smbase;
|
||||
+ smram->smm_revison = 0x00020064;
|
||||
|
||||
- put_smstate(u64, buf, 0x7ed0, vcpu->arch.efer);
|
||||
+ smram->efer = vcpu->arch.efer;
|
||||
|
||||
- kvm_get_segment(vcpu, &seg, VCPU_SREG_TR);
|
||||
- put_smstate(u16, buf, 0x7e90, seg.selector);
|
||||
- put_smstate(u16, buf, 0x7e92, enter_smm_get_segment_flags(&seg) >> 8);
|
||||
- put_smstate(u32, buf, 0x7e94, seg.limit);
|
||||
- put_smstate(u64, buf, 0x7e98, seg.base);
|
||||
+ enter_smm_save_seg_64(vcpu, &smram->tr, VCPU_SREG_TR);
|
||||
|
||||
static_call(kvm_x86_get_idt)(vcpu, &dt);
|
||||
- put_smstate(u32, buf, 0x7e84, dt.size);
|
||||
- put_smstate(u64, buf, 0x7e88, dt.address);
|
||||
+ smram->idtr.limit = dt.size;
|
||||
+ smram->idtr.base = dt.address;
|
||||
|
||||
- kvm_get_segment(vcpu, &seg, VCPU_SREG_LDTR);
|
||||
- put_smstate(u16, buf, 0x7e70, seg.selector);
|
||||
- put_smstate(u16, buf, 0x7e72, enter_smm_get_segment_flags(&seg) >> 8);
|
||||
- put_smstate(u32, buf, 0x7e74, seg.limit);
|
||||
- put_smstate(u64, buf, 0x7e78, seg.base);
|
||||
+ enter_smm_save_seg_64(vcpu, &smram->ldtr, VCPU_SREG_LDTR);
|
||||
|
||||
static_call(kvm_x86_get_gdt)(vcpu, &dt);
|
||||
- put_smstate(u32, buf, 0x7e64, dt.size);
|
||||
- put_smstate(u64, buf, 0x7e68, dt.address);
|
||||
+ smram->gdtr.limit = dt.size;
|
||||
+ smram->gdtr.base = dt.address;
|
||||
|
||||
- for (i = 0; i < 6; i++)
|
||||
- enter_smm_save_seg_64(vcpu, buf, i);
|
||||
+ enter_smm_save_seg_64(vcpu, &smram->es, VCPU_SREG_ES);
|
||||
+ enter_smm_save_seg_64(vcpu, &smram->cs, VCPU_SREG_CS);
|
||||
+ enter_smm_save_seg_64(vcpu, &smram->ss, VCPU_SREG_SS);
|
||||
+ enter_smm_save_seg_64(vcpu, &smram->ds, VCPU_SREG_DS);
|
||||
+ enter_smm_save_seg_64(vcpu, &smram->fs, VCPU_SREG_FS);
|
||||
+ enter_smm_save_seg_64(vcpu, &smram->gs, VCPU_SREG_GS);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -9364,7 +9355,7 @@ static void enter_smm(struct kvm_vcpu *vcpu)
|
||||
memset(smram.bytes, 0, sizeof(smram.bytes));
|
||||
#ifdef CONFIG_X86_64
|
||||
if (guest_cpuid_has(vcpu, X86_FEATURE_LM))
|
||||
- enter_smm_save_state_64(vcpu, (char *)&smram);
|
||||
+ enter_smm_save_state_64(vcpu, &smram.smram64);
|
||||
else
|
||||
#endif
|
||||
enter_smm_save_state_32(vcpu, &smram.smram32);
|
98
patches/kernel/0022-KVM-x86-SVM-use-smram-structs.patch
Normal file
98
patches/kernel/0022-KVM-x86-SVM-use-smram-structs.patch
Normal file
@ -0,0 +1,98 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Date: Wed, 3 Aug 2022 18:50:09 +0300
|
||||
Subject: [PATCH] KVM: x86: SVM: use smram structs
|
||||
|
||||
This removes the last user of put_smstate/GET_SMSTATE so
|
||||
remove these functions as well.
|
||||
|
||||
Also add a sanity check that we don't attempt to enter the SMM
|
||||
on non long mode capable guest CPU with a running nested guest.
|
||||
|
||||
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
arch/x86/include/asm/kvm_host.h | 6 ------
|
||||
arch/x86/kvm/svm/svm.c | 21 ++++++---------------
|
||||
2 files changed, 6 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
|
||||
index 4b1514a174b0..95d609e67dd0 100644
|
||||
--- a/arch/x86/include/asm/kvm_host.h
|
||||
+++ b/arch/x86/include/asm/kvm_host.h
|
||||
@@ -1936,12 +1936,6 @@ static inline int kvm_cpu_get_apicid(int mps_cpu)
|
||||
#endif
|
||||
}
|
||||
|
||||
-#define put_smstate(type, buf, offset, val) \
|
||||
- *(type *)((buf) + (offset) - 0x7e00) = val
|
||||
-
|
||||
-#define GET_SMSTATE(type, buf, offset) \
|
||||
- (*(type *)((buf) + (offset) - 0x7e00))
|
||||
-
|
||||
int kvm_cpu_dirty_log_size(void);
|
||||
|
||||
int alloc_all_memslots_rmaps(struct kvm *kvm);
|
||||
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
|
||||
index 76a35d939b9f..ba3861d5114b 100644
|
||||
--- a/arch/x86/kvm/svm/svm.c
|
||||
+++ b/arch/x86/kvm/svm/svm.c
|
||||
@@ -4334,15 +4334,11 @@ static int svm_enter_smm(struct kvm_vcpu *vcpu, union kvm_smram *smram)
|
||||
struct kvm_host_map map_save;
|
||||
int ret;
|
||||
|
||||
- char *smstate = (char *)smram;
|
||||
-
|
||||
if (!is_guest_mode(vcpu))
|
||||
return 0;
|
||||
|
||||
- /* FED8h - SVM Guest */
|
||||
- put_smstate(u64, smstate, 0x7ed8, 1);
|
||||
- /* FEE0h - SVM Guest VMCB Physical Address */
|
||||
- put_smstate(u64, smstate, 0x7ee0, svm->nested.vmcb12_gpa);
|
||||
+ smram->smram64.svm_guest_flag = 1;
|
||||
+ smram->smram64.svm_guest_vmcb_gpa = svm->nested.vmcb12_gpa;
|
||||
|
||||
svm->vmcb->save.rax = vcpu->arch.regs[VCPU_REGS_RAX];
|
||||
svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP];
|
||||
@@ -4381,28 +4377,23 @@ static int svm_leave_smm(struct kvm_vcpu *vcpu, const union kvm_smram *smram)
|
||||
{
|
||||
struct vcpu_svm *svm = to_svm(vcpu);
|
||||
struct kvm_host_map map, map_save;
|
||||
- u64 saved_efer, vmcb12_gpa;
|
||||
struct vmcb *vmcb12;
|
||||
int ret;
|
||||
|
||||
- const char *smstate = (const char *)smram;
|
||||
-
|
||||
if (!guest_cpuid_has(vcpu, X86_FEATURE_LM))
|
||||
return 0;
|
||||
|
||||
/* Non-zero if SMI arrived while vCPU was in guest mode. */
|
||||
- if (!GET_SMSTATE(u64, smstate, 0x7ed8))
|
||||
+ if (!smram->smram64.svm_guest_flag)
|
||||
return 0;
|
||||
|
||||
if (!guest_cpuid_has(vcpu, X86_FEATURE_SVM))
|
||||
return 1;
|
||||
|
||||
- saved_efer = GET_SMSTATE(u64, smstate, 0x7ed0);
|
||||
- if (!(saved_efer & EFER_SVME))
|
||||
+ if (!(smram->smram64.efer & EFER_SVME))
|
||||
return 1;
|
||||
|
||||
- vmcb12_gpa = GET_SMSTATE(u64, smstate, 0x7ee0);
|
||||
- if (kvm_vcpu_map(vcpu, gpa_to_gfn(vmcb12_gpa), &map) == -EINVAL)
|
||||
+ if (kvm_vcpu_map(vcpu, gpa_to_gfn(smram->smram64.svm_guest_vmcb_gpa), &map) == -EINVAL)
|
||||
return 1;
|
||||
|
||||
ret = 1;
|
||||
@@ -4427,7 +4418,7 @@ static int svm_leave_smm(struct kvm_vcpu *vcpu, const union kvm_smram *smram)
|
||||
|
||||
vmcb12 = map.hva;
|
||||
nested_load_control_from_vmcb12(svm, &vmcb12->control);
|
||||
- ret = enter_svm_guest_mode(vcpu, vmcb12_gpa, vmcb12, false);
|
||||
+ ret = enter_svm_guest_mode(vcpu, smram->smram64.svm_guest_vmcb_gpa, vmcb12, false);
|
||||
|
||||
if (ret)
|
||||
goto unmap_save;
|
@ -0,0 +1,40 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Date: Wed, 3 Aug 2022 18:50:10 +0300
|
||||
Subject: [PATCH] KVM: x86: SVM: don't save SVM state to SMRAM when VM is not
|
||||
long mode capable
|
||||
|
||||
When the guest CPUID doesn't have support for long mode, 32 bit SMRAM
|
||||
layout is used and it has no support for preserving EFER and/or SVM
|
||||
state.
|
||||
|
||||
Note that this isn't relevant to running 32 bit guests on VM which is
|
||||
long mode capable - such VM can still run 32 bit guests in compatibility
|
||||
mode.
|
||||
|
||||
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
arch/x86/kvm/svm/svm.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
|
||||
index ba3861d5114b..ebbd2d3b4e53 100644
|
||||
--- a/arch/x86/kvm/svm/svm.c
|
||||
+++ b/arch/x86/kvm/svm/svm.c
|
||||
@@ -4337,6 +4337,15 @@ static int svm_enter_smm(struct kvm_vcpu *vcpu, union kvm_smram *smram)
|
||||
if (!is_guest_mode(vcpu))
|
||||
return 0;
|
||||
|
||||
+ /*
|
||||
+ * 32 bit SMRAM format doesn't preserve EFER and SVM state.
|
||||
+ * SVM should not be enabled by the userspace without marking
|
||||
+ * the CPU as at least long mode capable.
|
||||
+ */
|
||||
+
|
||||
+ if (!guest_cpuid_has(vcpu, X86_FEATURE_LM))
|
||||
+ return 1;
|
||||
+
|
||||
smram->smram64.svm_guest_flag = 1;
|
||||
smram->smram64.svm_guest_vmcb_gpa = svm->nested.vmcb12_gpa;
|
||||
|
@ -0,0 +1,180 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Date: Wed, 3 Aug 2022 18:50:11 +0300
|
||||
Subject: [PATCH] KVM: x86: emulator/smm: preserve interrupt shadow in SMRAM
|
||||
|
||||
When #SMI is asserted, the CPU can be in interrupt shadow
|
||||
due to sti or mov ss.
|
||||
|
||||
It is not mandatory in Intel/AMD prm to have the #SMI
|
||||
blocked during the shadow, and on top of
|
||||
that, since neither SVM nor VMX has true support for SMI
|
||||
window, waiting for one instruction would mean single stepping
|
||||
the guest.
|
||||
|
||||
Instead, allow #SMI in this case, but both reset the interrupt
|
||||
window and stash its value in SMRAM to restore it on exit
|
||||
from SMM.
|
||||
|
||||
This fixes rare failures seen mostly on windows guests on VMX,
|
||||
when #SMI falls on the sti instruction which mainfest in
|
||||
VM entry failure due to EFLAGS.IF not being set, but STI interrupt
|
||||
window still being set in the VMCS.
|
||||
|
||||
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
|
||||
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
||||
---
|
||||
arch/x86/kvm/emulate.c | 17 ++++++++++++++---
|
||||
arch/x86/kvm/kvm_emulate.h | 10 ++++++----
|
||||
arch/x86/kvm/x86.c | 12 ++++++++++++
|
||||
3 files changed, 32 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
|
||||
index eb2f5e43f6ad..7f5710c34f4e 100644
|
||||
--- a/arch/x86/kvm/emulate.c
|
||||
+++ b/arch/x86/kvm/emulate.c
|
||||
@@ -2419,7 +2419,7 @@ static int rsm_load_state_32(struct x86_emulate_ctxt *ctxt,
|
||||
const struct kvm_smram_state_32 *smstate)
|
||||
{
|
||||
struct desc_ptr dt;
|
||||
- int i;
|
||||
+ int i, r;
|
||||
|
||||
ctxt->eflags = smstate->eflags | X86_EFLAGS_FIXED;
|
||||
ctxt->_eip = smstate->eip;
|
||||
@@ -2454,8 +2454,16 @@ static int rsm_load_state_32(struct x86_emulate_ctxt *ctxt,
|
||||
|
||||
ctxt->ops->set_smbase(ctxt, smstate->smbase);
|
||||
|
||||
- return rsm_enter_protected_mode(ctxt, smstate->cr0,
|
||||
- smstate->cr3, smstate->cr4);
|
||||
+ r = rsm_enter_protected_mode(ctxt, smstate->cr0,
|
||||
+ smstate->cr3, smstate->cr4);
|
||||
+
|
||||
+ if (r != X86EMUL_CONTINUE)
|
||||
+ return r;
|
||||
+
|
||||
+ ctxt->ops->set_int_shadow(ctxt, 0);
|
||||
+ ctxt->interruptibility = (u8)smstate->int_shadow;
|
||||
+
|
||||
+ return X86EMUL_CONTINUE;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
@@ -2504,6 +2512,9 @@ static int rsm_load_state_64(struct x86_emulate_ctxt *ctxt,
|
||||
rsm_load_seg_64(ctxt, &smstate->fs, VCPU_SREG_FS);
|
||||
rsm_load_seg_64(ctxt, &smstate->gs, VCPU_SREG_GS);
|
||||
|
||||
+ ctxt->ops->set_int_shadow(ctxt, 0);
|
||||
+ ctxt->interruptibility = (u8)smstate->int_shadow;
|
||||
+
|
||||
return X86EMUL_CONTINUE;
|
||||
}
|
||||
#endif
|
||||
diff --git a/arch/x86/kvm/kvm_emulate.h b/arch/x86/kvm/kvm_emulate.h
|
||||
index 3b37b3e17379..a64c190abf28 100644
|
||||
--- a/arch/x86/kvm/kvm_emulate.h
|
||||
+++ b/arch/x86/kvm/kvm_emulate.h
|
||||
@@ -231,6 +231,7 @@ struct x86_emulate_ops {
|
||||
bool (*guest_has_rdpid)(struct x86_emulate_ctxt *ctxt);
|
||||
|
||||
void (*set_nmi_mask)(struct x86_emulate_ctxt *ctxt, bool masked);
|
||||
+ void (*set_int_shadow)(struct x86_emulate_ctxt *ctxt, u8 shadow);
|
||||
|
||||
unsigned (*get_hflags)(struct x86_emulate_ctxt *ctxt);
|
||||
void (*exiting_smm)(struct x86_emulate_ctxt *ctxt);
|
||||
@@ -497,7 +498,8 @@ struct kvm_smram_state_32 {
|
||||
u32 reserved1[62];
|
||||
u32 smbase;
|
||||
u32 smm_revision;
|
||||
- u32 reserved2[5];
|
||||
+ u32 reserved2[4];
|
||||
+ u32 int_shadow; /* KVM extension */
|
||||
u32 cr4; /* CR4 is not present in Intel/AMD SMRAM image */
|
||||
u32 reserved3[5];
|
||||
|
||||
@@ -545,6 +547,7 @@ static inline void __check_smram32_offsets(void)
|
||||
__CHECK_SMRAM32_OFFSET(smbase, 0xFEF8);
|
||||
__CHECK_SMRAM32_OFFSET(smm_revision, 0xFEFC);
|
||||
__CHECK_SMRAM32_OFFSET(reserved2, 0xFF00);
|
||||
+ __CHECK_SMRAM32_OFFSET(int_shadow, 0xFF10);
|
||||
__CHECK_SMRAM32_OFFSET(cr4, 0xFF14);
|
||||
__CHECK_SMRAM32_OFFSET(reserved3, 0xFF18);
|
||||
__CHECK_SMRAM32_OFFSET(ds, 0xFF2C);
|
||||
@@ -604,7 +607,7 @@ struct kvm_smram_state_64 {
|
||||
u64 io_restart_rsi;
|
||||
u64 io_restart_rdi;
|
||||
u32 io_restart_dword;
|
||||
- u32 reserved1;
|
||||
+ u32 int_shadow;
|
||||
u8 io_inst_restart;
|
||||
u8 auto_hlt_restart;
|
||||
u8 reserved2[6];
|
||||
@@ -642,7 +645,6 @@ struct kvm_smram_state_64 {
|
||||
u64 gprs[16]; /* GPRS in a reversed "natural" X86 order (R15/R14/../RCX/RAX.) */
|
||||
};
|
||||
|
||||
-
|
||||
static inline void __check_smram64_offsets(void)
|
||||
{
|
||||
#define __CHECK_SMRAM64_OFFSET(field, offset) \
|
||||
@@ -663,7 +665,7 @@ static inline void __check_smram64_offsets(void)
|
||||
__CHECK_SMRAM64_OFFSET(io_restart_rsi, 0xFEB0);
|
||||
__CHECK_SMRAM64_OFFSET(io_restart_rdi, 0xFEB8);
|
||||
__CHECK_SMRAM64_OFFSET(io_restart_dword, 0xFEC0);
|
||||
- __CHECK_SMRAM64_OFFSET(reserved1, 0xFEC4);
|
||||
+ __CHECK_SMRAM64_OFFSET(int_shadow, 0xFEC4);
|
||||
__CHECK_SMRAM64_OFFSET(io_inst_restart, 0xFEC8);
|
||||
__CHECK_SMRAM64_OFFSET(auto_hlt_restart, 0xFEC9);
|
||||
__CHECK_SMRAM64_OFFSET(reserved2, 0xFECA);
|
||||
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
|
||||
index f309248fa888..4ea0e8112c42 100644
|
||||
--- a/arch/x86/kvm/x86.c
|
||||
+++ b/arch/x86/kvm/x86.c
|
||||
@@ -7476,6 +7476,11 @@ static void emulator_set_nmi_mask(struct x86_emulate_ctxt *ctxt, bool masked)
|
||||
static_call(kvm_x86_set_nmi_mask)(emul_to_vcpu(ctxt), masked);
|
||||
}
|
||||
|
||||
+static void emulator_set_int_shadow(struct x86_emulate_ctxt *ctxt, u8 shadow)
|
||||
+{
|
||||
+ static_call(kvm_x86_set_interrupt_shadow)(emul_to_vcpu(ctxt), shadow);
|
||||
+}
|
||||
+
|
||||
static unsigned emulator_get_hflags(struct x86_emulate_ctxt *ctxt)
|
||||
{
|
||||
return emul_to_vcpu(ctxt)->arch.hflags;
|
||||
@@ -7545,6 +7550,7 @@ static const struct x86_emulate_ops emulate_ops = {
|
||||
.guest_has_fxsr = emulator_guest_has_fxsr,
|
||||
.guest_has_rdpid = emulator_guest_has_rdpid,
|
||||
.set_nmi_mask = emulator_set_nmi_mask,
|
||||
+ .set_int_shadow = emulator_set_int_shadow,
|
||||
.get_hflags = emulator_get_hflags,
|
||||
.exiting_smm = emulator_exiting_smm,
|
||||
.leave_smm = emulator_leave_smm,
|
||||
@@ -9294,6 +9300,8 @@ static void enter_smm_save_state_32(struct kvm_vcpu *vcpu, struct kvm_smram_stat
|
||||
smram->cr4 = kvm_read_cr4(vcpu);
|
||||
smram->smm_revision = 0x00020000;
|
||||
smram->smbase = vcpu->arch.smbase;
|
||||
+
|
||||
+ smram->int_shadow = static_call(kvm_x86_get_interrupt_shadow)(vcpu);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
@@ -9342,6 +9350,8 @@ static void enter_smm_save_state_64(struct kvm_vcpu *vcpu, struct kvm_smram_stat
|
||||
enter_smm_save_seg_64(vcpu, &smram->ds, VCPU_SREG_DS);
|
||||
enter_smm_save_seg_64(vcpu, &smram->fs, VCPU_SREG_FS);
|
||||
enter_smm_save_seg_64(vcpu, &smram->gs, VCPU_SREG_GS);
|
||||
+
|
||||
+ smram->int_shadow = static_call(kvm_x86_get_interrupt_shadow)(vcpu);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -9378,6 +9388,8 @@ static void enter_smm(struct kvm_vcpu *vcpu)
|
||||
kvm_set_rflags(vcpu, X86_EFLAGS_FIXED);
|
||||
kvm_rip_write(vcpu, 0x8000);
|
||||
|
||||
+ static_call(kvm_x86_set_interrupt_shadow)(vcpu, 0);
|
||||
+
|
||||
cr0 = vcpu->arch.cr0 & ~(X86_CR0_PE | X86_CR0_EM | X86_CR0_TS | X86_CR0_PG);
|
||||
static_call(kvm_x86_set_cr0)(vcpu, cr0);
|
||||
vcpu->arch.cr0 = cr0;
|
@ -1,14 +0,0 @@
|
||||
diff -Naur --no-dereference a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
|
||||
--- a/arch/x86/kvm/vmx/vmx.c 2024-07-01 21:03:34.000000000 +0300
|
||||
+++ b/arch/x86/kvm/vmx/vmx.c 2024-07-01 20:24:05.000000000 +0300
|
||||
@@ -6137,6 +6137,10 @@
|
||||
[EXIT_REASON_ENCLS] = handle_encls,
|
||||
[EXIT_REASON_BUS_LOCK] = handle_bus_lock_vmexit,
|
||||
[EXIT_REASON_NOTIFY] = handle_notify,
|
||||
+ [EXIT_REASON_RDTSC] = handle_rdtsc,
|
||||
+ [EXIT_REASON_RDTSCP] = handle_rdtscp,
|
||||
+ [EXIT_REASON_UMWAIT] = handle_umwait,
|
||||
+ [EXIT_REASON_TPAUSE] = handle_tpause,
|
||||
};
|
||||
|
||||
static const int kvm_vmx_max_exit_handlers =
|
@ -1,40 +0,0 @@
|
||||
diff -Naur --no-dereference a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
|
||||
--- a/arch/x86/kvm/vmx/vmx.c 2024-07-01 21:03:34.000000000 +0300
|
||||
+++ b/arch/x86/kvm/vmx/vmx.c 2024-07-01 20:24:05.000000000 +0300
|
||||
@@ -6079,6 +6079,36 @@
|
||||
return 1;
|
||||
}
|
||||
|
||||
+static int handle_rdtsc(struct kvm_vcpu *vcpu)
|
||||
+{
|
||||
+ u64 _rdtsc = rdtsc();
|
||||
+ printk_once("[HookEntry] hook entry function handle_rdtsc is working, return the rdtsc() if no hook , you can hook here!\n");
|
||||
+ vcpu->arch.regs[VCPU_REGS_RAX] = _rdtsc & -1u;
|
||||
+ vcpu->arch.regs[VCPU_REGS_RDX] = (_rdtsc >> 32) & -1u;
|
||||
+ return kvm_skip_emulated_instruction(vcpu);
|
||||
+}
|
||||
+
|
||||
+static int handle_rdtscp(struct kvm_vcpu *vcpu)
|
||||
+{
|
||||
+ u64 _rdtsc = rdtsc();
|
||||
+ printk_once("[HookEntry] hook entry function handle_rdtscp is working, return the rdtsc() if no hook , you can hook here!\n");
|
||||
+ vcpu->arch.regs[VCPU_REGS_RAX] = _rdtsc & -1u;
|
||||
+ vcpu->arch.regs[VCPU_REGS_RDX] = (_rdtsc >> 32) & -1u;
|
||||
+ return kvm_skip_emulated_instruction(vcpu);
|
||||
+}
|
||||
+
|
||||
+static int handle_umwait(struct kvm_vcpu *vcpu)
|
||||
+{
|
||||
+ kvm_skip_emulated_instruction(vcpu);
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static int handle_tpause(struct kvm_vcpu *vcpu)
|
||||
+{
|
||||
+ kvm_skip_emulated_instruction(vcpu);
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* The exit handlers return 1 if the exit was handled fully and guest execution
|
||||
* may resume. Otherwise they set the kvm_run parameter to indicate what needs
|
@ -1 +1 @@
|
||||
Subproject commit 52a389ffcb4a5a544790d46c53f79c845364692e
|
||||
Subproject commit 1e5c98582d147f016e297cf0936b2598779cd24c
|
@ -1 +1 @@
|
||||
Subproject commit f5c9e3a9a85e73ef96f02375a745b10115a319b3
|
||||
Subproject commit 66ef8d3dc8bdbf2ec44e3f452de4461f0bf4d4c1
|
Loading…
Reference in New Issue
Block a user