NetBSD Problem Report #57626

From martin@aprisoft.de  Sun Sep 24 09:29:51 2023
Return-Path: <martin@aprisoft.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 2FEEE1A9238
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 24 Sep 2023 09:29:51 +0000 (UTC)
Message-Id: <20230924092941.7AA435CC7A2@emmas.aprisoft.de>
Date: Sun, 24 Sep 2023 11:29:41 +0200 (CEST)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: rump does not work on architectures with variadic page size when host page size is != 4k
X-Send-Pr-Version: 3.95

>Number:         57626
>Category:       kern
>Synopsis:       rump does not work on architectures with variadic page size when host page size is != 4k
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 24 09:30:01 +0000 2023
>Closed-Date:    Sun Sep 24 09:36:08 +0000 2023
>Last-Modified:  Sun Sep 24 09:36:08 +0000 2023
>Originator:     Martin Husemann
>Release:        NetBSD 10.99.9
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD nelly.aprisoft.de 10.99.9 NetBSD 10.99.9 (NELLY) #75: Sun Sep 24 09:30:35 CEST 2023 martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/sparc64/compile/NELLY sparc
Architecture: sparc
Machine: sparc
>Description:



>How-To-Repeat:

run sparc (32bit) userland on a sparc with not 4k pagesize, e.g. on a sparc64
machine under netbsd32 emulation and do:

$ cd /usr/tests/net/bpfjit
$ atf-run t_bpfjit

This will show several rump kernel panics like this:

[   1.0500050] panic: uvm_km_alloc failed
[   1.0500050] rump kernel halting...

This is due to the PAGE_SIZE used by the rump components being set to 4k,
see

#define FAKE_PAGE_SHIFT 12

in sys/rump/librump/rumpkern/vm.c

>Fix:
query hypervisor for actual page size

>Release-Note:

>Audit-Trail:
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57626 CVS commit: src
Date: Sun, 24 Sep 2023 09:33:27 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun Sep 24 09:33:27 UTC 2023

 Modified Files:
 	src/lib/librumpuser: rumpuser.c
 	src/sys/rump/include/rump: rumpuser.h
 	src/sys/rump/librump/rumpkern: vm.c

 Log Message:
 PR kern/57626: instead of an (arbitrary) FAKE_PAGE_SHIFT (and always
 using 4k pages), query the hypervisor for the real page size of the host
 kernel and use that for architectures that do not have compile time
 constant page sizes.


 To generate a diff of this commit:
 cvs rdiff -u -r1.67 -r1.68 src/lib/librumpuser/rumpuser.c
 cvs rdiff -u -r1.116 -r1.117 src/sys/rump/include/rump/rumpuser.h
 cvs rdiff -u -r1.196 -r1.197 src/sys/rump/librump/rumpkern/vm.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Sun, 24 Sep 2023 09:36:08 +0000
State-Changed-Why:
Fixed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.