From nobody Tue Jan 24 22:10:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P1h4d6bpzz3bf6y; Tue, 24 Jan 2023 22:10:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P1h4d3k21z4M71; Tue, 24 Jan 2023 22:10:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NreEpkkCvSvvPOR0PJpKLz7dLJPQfCqMSQXTy/h7b38=; b=VCKGYhkneUPc4ROvDzml02l1zaK7DW1Y+UNaCu12cOF3wcskrH3/imaGeUhJ4L638zFnPM biYEdRbv7Vh5dDuh/dw+Ax5v11YK11hAahdlMeOc7zJeZ/3yVmRrnCZBvifovJF5ONS+58 KI6n7JifFaOPYrYkyZeUHYfUO+Or4CqdhkmpfcgL8Zjlf3m+HexD79UbaWfolDsQRuw0Ea SdB7tKBRgCKGDqvULyQyNpDe5ex8YI6Zh6k8++36cb3rCYnCOxc+KrYkz9fiFYKwb2DakS uoiTvSJdq4pFepIKYpW8HmnhX0WT/2xUKY4CpzNbPbjgMdN0sHiHBhLW07O1sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NreEpkkCvSvvPOR0PJpKLz7dLJPQfCqMSQXTy/h7b38=; b=Z1rAb9I+4fZU0RN70U7k6mOUiWH1cWpZKl4Li1MiAPfhFvZ+4woG9dsOF2SDSJnPEczfU4 Mc1I35CIxp0PsYRF9ZTH7PZ1ksnzPeWQaQn4ooCwlkZ105nJrtPsi8CdI88BAxLn16q39w 3IttfTD2GHToWEBvkS7P6zNsccYKBQkrj7sJ+OsYORo8JtTeap9jA2rV3ezCOAZCkAPdF7 myyGNJWFEJc6QlDY0ynQJaLRPTVuyldZbqYEb/z3ckUJo1OlZUQ9N87s7q+0Q6ZZm9GUzS 9/rzeN0wB5Devngp31P8wJzMfW5nQqeAXfPZMIR0e6I2zpcmPCCSGxBE+lKSZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598257; a=rsa-sha256; cv=none; b=tHd0vTRRi5hutV3/WfO/0P9PTXVuwO21y4z7NCwPhxZ8x3DBOJpfaSXBY5QHa7ptoBDxLP VyA33+JrbqeOP/KdOzBgXJ8yvNagi53QuX6VMy8JYB4uRf3W4R/2mBpXYh7X0PuCC4/DVr +VESjQkdlg9sSgyB33ENoCD8ucT5yWWfagWrcA6ci8JigJuGTA6kjqq0DGVKAYAMzcXSIF Z7J8fDzuX3rM15gV8hPeGxTV/whC0k8ZIvx/wl6xmgV7emRfDjWvGdcJwliaA2q0Tq+RJr P8cxN5NN990GozdwDkujq0V/UjUcnpWTd7+ZUZrk8RLj8GAST3v3pS7IYEMnJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P1h4d2rFbzQNn; Tue, 24 Jan 2023 22:10:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30OMAvDG083239; Tue, 24 Jan 2023 22:10:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OMAvP7083238; Tue, 24 Jan 2023 22:10:57 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:10:57 GMT Message-Id: <202301242210.30OMAvP7083238@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 7743778bf19a - stable/13 - kboot: Implement munmap(2) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7743778bf19a1625ef4a2e801fee91dab3c934bb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7743778bf19a1625ef4a2e801fee91dab3c934bb commit 7743778bf19a1625ef4a2e801fee91dab3c934bb Author: Warner Losh AuthorDate: 2022-06-27 23:49:21 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:24 +0000 kboot: Implement munmap(2) Define host_munmap so we can use it in the x86 code to find things for the BIOS/CMS boot path and unmap after we find it. Sponsored by: Netflix (cherry picked from commit 76949f503f008b28865bd0fd026a550a3cb48619) --- stand/kboot/arch/amd64/syscall_nr.h | 1 + stand/kboot/arch/powerpc64/syscall_nr.h | 1 + stand/kboot/host_syscall.h | 1 + stand/kboot/host_syscalls.c | 6 ++++++ 4 files changed, 9 insertions(+) diff --git a/stand/kboot/arch/amd64/syscall_nr.h b/stand/kboot/arch/amd64/syscall_nr.h index c22c80ea7cb9..7813eff92890 100644 --- a/stand/kboot/arch/amd64/syscall_nr.h +++ b/stand/kboot/arch/amd64/syscall_nr.h @@ -4,6 +4,7 @@ #define SYS_kexec_load 246 #define SYS_lseek 8 #define SYS_mmap 9 +#define SYS_munmap 11 #define SYS_newfstat 5 #define SYS_newfstatat 262 #define SYS_openat 257 diff --git a/stand/kboot/arch/powerpc64/syscall_nr.h b/stand/kboot/arch/powerpc64/syscall_nr.h index aa94e6a82bb7..9471fd48ceb2 100644 --- a/stand/kboot/arch/powerpc64/syscall_nr.h +++ b/stand/kboot/arch/powerpc64/syscall_nr.h @@ -5,6 +5,7 @@ #define SYS_kexec_load 268 #define SYS_llseek 140 #define SYS_mmap 90 +#define SYS_munmap 91 #define SYS_newfstat SYS_fstat #define SYS_newfstatat 291 #define SYS_openat 286 diff --git a/stand/kboot/host_syscall.h b/stand/kboot/host_syscall.h index 6ff20f7ba393..8007f29feb9d 100644 --- a/stand/kboot/host_syscall.h +++ b/stand/kboot/host_syscall.h @@ -96,6 +96,7 @@ int host_gettimeofday(struct host_timeval *a, void *b); int host_kexec_load(uint32_t start, int nsegs, uint32_t segs, uint32_t flags); ssize_t host_llseek(int fd, int32_t offset_high, int32_t offset_lo, uint64_t *result, int whence); void *host_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off); +int host_munmap(void *addr, size_t len); int host_open(const char *path, int flags, int mode); ssize_t host_read(int fd, void *buf, size_t nbyte); int host_reboot(int, int, int, uintptr_t); diff --git a/stand/kboot/host_syscalls.c b/stand/kboot/host_syscalls.c index 9cc6c6cd873e..3cfccdc0c718 100644 --- a/stand/kboot/host_syscalls.c +++ b/stand/kboot/host_syscalls.c @@ -57,6 +57,12 @@ host_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off) return (void *)host_syscall(SYS_mmap, (uintptr_t)addr, len, prot, flags, fd, off); } +int +host_munmap(void *addr, size_t len) +{ + return host_syscall(SYS_munmap, (uintptr_t)addr, len); +} + int host_open(const char *path, int flags, int mode) {