Date: Mon, 22 Feb 2021 21:11:03 GMT From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 23e875fd97fb - main - vm_kern: Avoid sign extension in the KVA_QUANTUM definition Message-ID: <202102222111.11MLB3g1096900@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=23e875fd97fb9f17b3f5dc2b26082f25e1a86b6f commit 23e875fd97fb9f17b3f5dc2b26082f25e1a86b6f Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-02-22 20:50:09 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-02-22 20:50:09 +0000 vm_kern: Avoid sign extension in the KVA_QUANTUM definition Otherwise, on a powerpc64 NUMA system with hashed page tables, the first-level superpage reservation size is large enough that the value of the kernel KVA arena import quantum, KVA_NUMA_IMPORT_QUANTUM, is negative and gets sign-extended when passed to vmem_set_import(). This results in a boot-time hang on such platforms. Reported by: bdragon MFC after: 3 days --- sys/vm/vm_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index e8e24c3ca8a3..637298eb2caa 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -127,7 +127,7 @@ SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, /* On non-superpage architectures we want large import sizes. */ #define KVA_QUANTUM_SHIFT (8 + PAGE_SHIFT) #endif -#define KVA_QUANTUM (1 << KVA_QUANTUM_SHIFT) +#define KVA_QUANTUM (1ul << KVA_QUANTUM_SHIFT) #define KVA_NUMA_IMPORT_QUANTUM (KVA_QUANTUM * 128) extern void uma_startup2(void);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102222111.11MLB3g1096900>