From nobody Mon Oct 07 08:25:02 2024 X-Original-To: dev-commits-src-main@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 4XMXJb0Yskz5XW6t; Mon, 07 Oct 2024 08:25:03 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XMXJZ5yQtz4shk; Mon, 7 Oct 2024 08:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728289502; 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=TqT+gWxuHSUn5VxPVGTCTHpMuSyfXWsXGMiahCcrGSo=; b=iXogUh0GSP+18B941P4tAEMQIdY1zlc0zIpJ6uJQWkdLUffOLJz/4x61sOmSZ8ZgiTFpSm D8Da2mUXRtcBs68xJWdv2edyjQ66fbpofIANtWSFu3gamU12S24aP1M4mkzjW7fkzHwTMz 2risFk81hBky340LgzMjMmmSlhgvgPA7fqoEPmeIWLbZ29NoiHK8hRwQWIoh257yqUlkoN Wt59pSJr/ypxSq4VsUNbOc2Hfg8ra0ZS8vEyDrIyRm/VFQkUtos5988NNdyNjY97+QEFoo GkUadYuvKoPA2stwMxM0ezj2okkDp8WIx+qOZkiHC8YkSm6V7kWSvDac3BqbdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728289502; 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=TqT+gWxuHSUn5VxPVGTCTHpMuSyfXWsXGMiahCcrGSo=; b=IMi2wrr+gYeAFCQf1bgnGwHIhbTEPmP4IxsbcVkkZRQnXPBCpvmCSpBWYJ4qg3FQQ31XYW LfLk6F7+sCAwdOVj2BxzP0p6NCqDMWqxkV3B6/lc6Ymu9smDX15eOJfaCPGyApqxLJVtN2 xz7X2dULeAxJNMu2t7HSM2U7UqOc7AmdjGzhlN5fLo+pA5+IzFSNor1WFG9zsENHC4uqbv ateGW/SqDJlHPDSP2+ZgQYKNR+UBPdNJ22UJd5dodAigd6uum6MF0yneh7O0wHxdhSFqZD VCIGGls9ICGu+JzuRaURF+IOqJCUQ2tESn6dE0DwwhaVChTHSEbm5091ToF1GA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728289502; a=rsa-sha256; cv=none; b=NFROCWAIomO7Fhff9PagZAImoH5E0zPiVh/3NHhTHHlqIT0PgWQZNqqseT5QRCNzaP5049 HBw7bsPuwRpMUefn9dRmreNBqdn5DLU3FbnmP2/uu8yXgZIngZlBPYaBUhls3Jj6aQS+Fq MfEbsDM+XuzZ5AFXxGOtqcFrqFVuBphuZKSwvtwW3TEZ1y4zAQ+uV+PQCPvJfppQoLw96A SkT6hsgC3qUP5ilGuaIqzl6iCGrRwLqAqFssflfZbk+iJV9B9NNPVxGKUUs+dGqhi89tgg YEgRTRjXVMYaS7lmyfLq4LlUGTdCEpfklOcYW916b56foMM6H8PwR4jgmmSO6Q== 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 4XMXJZ4dblzfXP; Mon, 7 Oct 2024 08:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4978P23q011966; Mon, 7 Oct 2024 08:25:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4978P20f011963; Mon, 7 Oct 2024 08:25:02 GMT (envelope-from git) Date: Mon, 7 Oct 2024 08:25:02 GMT Message-Id: <202410070825.4978P20f011963@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d3dd6bd40395 - main - kinfo_vmentry: report mappings of the SysV shm segments List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d3dd6bd4039573eb74cd77da5b92e68b04296888 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d3dd6bd4039573eb74cd77da5b92e68b04296888 commit d3dd6bd4039573eb74cd77da5b92e68b04296888 Author: Konstantin Belousov AuthorDate: 2024-10-05 09:15:12 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-07 08:22:12 +0000 kinfo_vmentry: report mappings of the SysV shm segments Mark such mappings with the new flag KVME_FLAG_SYSVSHM. Provide segment key in kve_vn_fileid, vnode never can back shm mapping. Provide sequence number in kve_vn_fsid_freebsd11. Reviewed by: markj (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46959 --- sys/kern/kern_proc.c | 10 ++++++++++ sys/sys/user.h | 1 + 2 files changed, 11 insertions(+) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index c47f5a15f252..02d3b9fd69cd 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -2615,6 +2617,8 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) vm_offset_t addr; unsigned int last_timestamp; int error; + key_t key; + unsigned short seq; bool guard, super; PROC_LOCK_ASSERT(p, MA_OWNED); @@ -2705,6 +2709,12 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) kve->kve_ref_count = obj->ref_count; kve->kve_shadow_count = obj->shadow_count; VM_OBJECT_RUNLOCK(obj); + if ((lobj->flags & OBJ_SYSVSHM) != 0) { + kve->kve_flags |= KVME_FLAG_SYSVSHM; + shmobjinfo(lobj, &key, &seq); + kve->kve_vn_fileid = key; + kve->kve_vn_fsid_freebsd11 = seq; + } if (vp != NULL) { vn_fullpath(vp, &fullpath, &freepath); kve->kve_vn_type = vntype_to_kinfo(vp->v_type); diff --git a/sys/sys/user.h b/sys/sys/user.h index cd0535f0d765..00cfbf09b4d6 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -514,6 +514,7 @@ struct kinfo_lockf { #define KVME_FLAG_GROWS_UP 0x00000010 #define KVME_FLAG_GROWS_DOWN 0x00000020 #define KVME_FLAG_USER_WIRED 0x00000040 +#define KVME_FLAG_SYSVSHM 0x00000080 #if defined(__amd64__) #define KINFO_OVMENTRY_SIZE 1168