5.0が出たので.config
がどう変更されるのか見てみた.以下 -
は削除されたもの,+
は追加されたもの.汎用指向の環境.Btrfs だと swap file が使えなかった(禁止されていた)のだが,Btrfs: support swap filesにより復活.
-
+CONFIG_CRYPTO_ADIANTUM=m
Adiantumが含まれるようになったので
m
にしてみた.依存するCONFIG_CRYPTO_NHPOLY1305
,CONFIG_CRYPTO_POLY1305
,CONFIG_CRYPTO_CHACHA20
もm
になる. -
-CONFIG_XXHASH=m
+CONFIG_XXHASH=y
ksm: replace jhash2 with xxhash
KSM (Kernel Samepage Merging) が checksum の計算を jhash2 から xxhash に変更(xxhashの方が早いため).
CONFIG_KSM=y
なのでy
になった.echo 1 > /sys/kernel/mm/ksm/run
しておくと同一ページがマージされる(KVM使用時に有効). -
+CONFIG_CC_HAS_ASM_GOTO=y
jump_label: move ‘asm goto’ support test to Kconfig
自動判定.
CONFIG_JUMP_LABEL
がこれに依存する. -
-CONFIG_AUDIT_WATCH=y
-CONFIG_AUDIT_TREE=y
audit: remove WATCH and TREE config options
削除された.
-
+CONFIG_HAVE_MOVE_PMD=y
mm: speed up mremap by 20x on large regions
X86
でselectされる. -
-CONFIG_IOSCHED_NOOP=y
-CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=y
-CONFIG_CFQ_GROUP_IOSCHED=y
-CONFIG_DEFAULT_CFQ=y
-CONFIG_DEFAULT_IOSCHED="cfq"
block: remove legacy IO schedulers
削除された.
-
+CONFIG_SKB_EXTENSIONS=y
sk_buff: add skb extension infrastructure
net: convert bridge_nf to use skb extension infrastructureCONFIG_XFRM
,CONFIG_BRIDGE_NETFILTER
等でselectされる. -
-CONFIG_NF_NAT_PROTO_SCTP=y
netfilter: nat: remove nf_nat_l4proto struct
netfilter: nat: remove l4proto->manip_pktnf_nat_proto_udp.c が nf_nat_proto.c に rename されて,他の機能もここに統合.
-
+CONFIG_HAVE_EISA=y
-
+CONFIG_HAVE_PCI=y
PCI: consolidate PCI config entry in drivers/pci
X86
でselectされる. -
+CONFIG_RAID6_PQ_BENCHMARK=y
lib/raid6: add option to skip algo benchmarking
BTRFSの起動時の RAID benchmark をskip可能(250msの起動時間短縮)とするために追加された.BTRFSのRAIDを利用していないけど y にしておく.
-
-CONFIG_DMA_DIRECT_OPS=y
dma-mapping: always build the direct mapping code
CONFIG_HAS_DMA=y
で常にdirect.o
がbuildされるようになった(そのため削除). -
-CONFIG_ARCH_HAS_SG_CHAIN=y
arch: switch the default on ARCH_HAS_SG_CHAIN
CONFIG_ARCH_NO_SG_CHAIN=n
に置き換えられた. -
+CONFIG_CC_HAS_KASAN_GENERIC=y
kasan: add CONFIG_KASAN_GENERIC and CONFIG_KASAN_SW_TAGS
KASAN (kernel address sanitizer infrastructure) 関連.コンパイラが
-fsanitize=kernel-address
をサポートしていたら y になる. -
+CONFIG_KASAN_STACK=1
kasan: turn off asan-stack for clang-8 and earlier
KASAN (kernel address sanitizer infrastructure) 関連.
CONFIG_CC_IS_GCC=y
なら 1 になる.いずれにせよ
CONFIG_KASAN=n
としている. -
+CONFIG_DYNAMIC_EVENTS=y
tracing: Add unified dynamic event framework
CONFIG_UPROBE_EVENTS
,CONFIG_KPROBE_EVENTS
で select される.
DKMS
案の定 nvidia-kernel-dkms (390.87-8~deb9u1) と nvidia-legacy-340xx-kernel-dkms (340.107-2~bpo9+1) が compile できない.broadcom-sta-dkms は今回試さず.エラーは以下のようなもの(抜粋).
/var/lib/dkms/nvidia-current/390.87/build/nvidia/os-interface.c:434:5: error: implicit declaration of function ‘do_gettimeofday’ [-Werror=implicit-function-declaration]
do_gettimeofday(&tm);
^~~~~~~~~~~~~~~
/var/lib/dkms/nvidia-current/390.87/build/nvidia-drm/nvidia-drm-gem.h:82:5: error: implicit declaration of function ‘drm_gem_object_unreference_unlocked’ [-Werror=implicit-function-declaration]
drm_gem_object_unreference_unlocked(&nv_gem->base);
- timekeeping: remove obsolete time accessorsで
do_gettimeofday
が削除されたのと, - DRM関連の古い関数への compatibility alias の削除
do_gettimeofday
は適当に関数を用意して,DRMについては以下のとおり置換で対応.
-drm_gem_object_unreference_unlocked(object);
+drm_gem_object_put_unlocked(object);
-drm_gem_object_unreference(object);
+drm_gem_object_put(object);
-drm_framebuffer_reference(object);
+drm_framebuffer_get(object);
-drm_framebuffer_unreference(object);
+drm_framebuffer_put(object);
-drm_dev_unref(object);
+drm_dev_put(object);
以下 nvidia-kernel-dkms (390.87-8~deb9u1) の patch.conftest.sh
で NV_DRM_DEV_UNREF_PRESENT
が define されなくなるので,逆に else の方を修正(drm_dev_free
は更に古い I/F).とりあえず stable の package ベースでやり過ごすためだけのパッチ.
--- a/common/inc/nv-linux.h
+++ b/common/inc/nv-linux.h
@@ -1893,4 +1893,13 @@ static inline NvU64 nv_expand_nvlink_addr(NvU64 addr47)
#include <linux/backlight.h>
#endif
+static inline void do_gettimeofday(struct timeval *tv)
+{
+ struct timespec64 now;
+
+ ktime_get_real_ts64(&now);
+ tv->tv_sec = now.tv_sec;
+ tv->tv_usec = now.tv_nsec/1000;
+}
+
#endif /* _NV_LINUX_H_ */
diff --git a/nvidia-drm/nvidia-drm-gem.h b/nvidia-drm/nvidia-drm-gem.h
index f5964e2..a9f057d 100644
--- a/nvidia-drm/nvidia-drm-gem.h
+++ b/nvidia-drm/nvidia-drm-gem.h
@@ -79,7 +79,7 @@ static inline int nv_drm_gem_handle_create_drop_reference(
/* drop reference from allocate - handle holds it now */
- drm_gem_object_unreference_unlocked(&nv_gem->base);
+ drm_gem_object_put_unlocked(&nv_gem->base);
return ret;
}
@@ -153,13 +153,13 @@ static inline struct nv_drm_gem_object *nv_drm_gem_object_lookup(
static inline void
nv_drm_gem_object_unreference_unlocked(struct nv_drm_gem_object *nv_gem)
{
- drm_gem_object_unreference_unlocked(&nv_gem->base);
+ drm_gem_object_put_unlocked(&nv_gem->base);
}
static inline void
nv_drm_gem_object_unreference(struct nv_drm_gem_object *nv_gem)
{
- drm_gem_object_unreference(&nv_gem->base);
+ drm_gem_object_put(&nv_gem->base);
}
static inline int nv_drm_gem_handle_create(struct drm_file *filp,
diff --git a/nvidia-drm/nvidia-drm-helper.c b/nvidia-drm/nvidia-drm-helper.c
index 4ccf819..429f346 100644
--- a/nvidia-drm/nvidia-drm-helper.c
+++ b/nvidia-drm/nvidia-drm-helper.c
@@ -149,12 +149,12 @@ void nv_drm_atomic_clean_old_fb(struct drm_device *dev,
if (ret == 0) {
struct drm_framebuffer *new_fb = plane->state->fb;
if (new_fb)
- drm_framebuffer_reference(new_fb);
+ drm_framebuffer_get(new_fb);
plane->fb = new_fb;
plane->crtc = plane->state->crtc;
if (plane->old_fb)
- drm_framebuffer_unreference(plane->old_fb);
+ drm_framebuffer_put(plane->old_fb);
}
plane->old_fb = NULL;
}
diff --git a/nvidia-drm/nvidia-drm-helper.h b/nvidia-drm/nvidia-drm-helper.h
index ab61c7e..e002d7c 100644
--- a/nvidia-drm/nvidia-drm-helper.h
+++ b/nvidia-drm/nvidia-drm-helper.h
@@ -39,7 +39,7 @@ static inline void nv_drm_dev_free(struct drm_device *dev)
#if defined(NV_DRM_DEV_UNREF_PRESENT)
drm_dev_unref(dev);
#else
- drm_dev_free(dev);
+ drm_dev_put(dev);
#endif
}
diff --git a/nvidia-drm/nvidia-drm-linux.c b/nvidia-drm/nvidia-drm-linux.c
index 333bfe1..d3614b9 100644
--- a/nvidia-drm/nvidia-drm-linux.c
+++ b/nvidia-drm/nvidia-drm-linux.c
@@ -156,6 +156,15 @@ void nv_drm_vunmap(void *address)
vunmap(address);
}
+static inline void do_gettimeofday(struct timeval *tv)
+{
+ struct timespec64 now;
+
+ ktime_get_real_ts64(&now);
+ tv->tv_sec = now.tv_sec;
+ tv->tv_usec = now.tv_nsec/1000;
+}
+
uint64_t nv_drm_get_time_usec(void)
{
struct timeval tv;
diff --git a/nvidia-modeset/nvidia-modeset-linux.c b/nvidia-modeset/nvidia-modeset-linux.c
index 6f51178..07c207e 100644
--- a/nvidia-modeset/nvidia-modeset-linux.c
+++ b/nvidia-modeset/nvidia-modeset-linux.c
@@ -208,6 +208,15 @@ void NVKMS_API_CALL nvkms_usleep(NvU64 usec)
}
}
+static inline void do_gettimeofday(struct timeval *tv)
+{
+ struct timespec64 now;
+
+ ktime_get_real_ts64(&now);
+ tv->tv_sec = now.tv_sec;
+ tv->tv_usec = now.tv_nsec/1000;
+}
+
NvU64 NVKMS_API_CALL nvkms_get_usec(void)
{
struct timeval tv;
以下 nvidia-legacy-340xx-kernel-dkms (340.107-2~bpo9+1) 向け patch.
--- a/nv-drm.c
+++ b/nv-drm.c
@@ -252,7 +252,7 @@ RM_STATUS NV_API_CALL nv_alloc_os_descriptor_handle(
goto done;
}
- drm_gem_object_unreference_unlocked(&nv_obj->base);
+ drm_gem_object_put_unlocked(&nv_obj->base);
status = RM_OK;
diff --git a/os-interface.c b/os-interface.c
index 7e3d362..f1ca725 100644
--- a/os-interface.c
+++ b/os-interface.c
@@ -433,6 +433,15 @@ void NV_API_CALL os_free_mem(void *address)
*
*****************************************************************************/
+static inline void do_gettimeofday(struct timeval *tv)
+{
+ struct timespec64 now;
+
+ ktime_get_real_ts64(&now);
+ tv->tv_sec = now.tv_sec;
+ tv->tv_usec = now.tv_nsec/1000;
+}
+
RM_STATUS NV_API_CALL os_get_current_time(
NvU32 *seconds,
NvU32 *useconds
diff --git a/uvm/nvidia_uvm_lite.c b/uvm/nvidia_uvm_lite.c
index 19e3b36..9f1a479 100644
--- a/uvm/nvidia_uvm_lite.c
+++ b/uvm/nvidia_uvm_lite.c
@@ -2008,6 +2008,15 @@ void umvlite_destroy_per_process_gpu_resources(UvmGpuUuid *gpuUuidStruct)
// Function to check for ECC errors and returns true if an ECC DBE error
// has happened.
//
+static inline void do_gettimeofday(struct timeval *tv)
+{
+ struct timespec64 now;
+
+ ktime_get_real_ts64(&now);
+ tv->tv_sec = now.tv_sec;
+ tv->tv_usec = now.tv_nsec/1000;
+}
+
static RM_STATUS _check_ecc_errors(UvmGpuMigrationTracking *pMigTracker,
NvBool *pIsEccErrorSet)
{
ともに Linux 5.0 より前の version で動かすことは考えていない.