Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2198016/?format=api
{ "id": 2198016, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2198016/?format=api", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.0/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260218-bsd-user-claude-v3-20-0137b37b221e@bsdimp.com>", "date": "2026-02-19T05:22:43", "name": "[v3,20/24] bsd-user: Add message queue implementations", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "fe1203b7450b0bae8d38ce36eb055d39f41ec384", "submitter": { "id": 1896, "url": "http://patchwork.ozlabs.org/api/1.0/people/1896/?format=api", "name": "Warner Losh", "email": "imp@bsdimp.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260218-bsd-user-claude-v3-20-0137b37b221e@bsdimp.com/mbox/", "series": [ { "id": 492638, "url": "http://patchwork.ozlabs.org/api/1.0/series/492638/?format=api", "date": "2026-02-19T05:22:26", "name": "bsd-user: Upstream misc system calls (System V IPC, reboot, etc)", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/492638/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2198016/checks/", "tags": {}, "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=bsdimp-com.20230601.gappssmtp.com\n header.i=@bsdimp-com.20230601.gappssmtp.com header.a=rsa-sha256\n header.s=20230601 header.b=aqCqdrfu;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fGhd941SQz1xpl\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 16:24:13 +1100 (AEDT)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vswVJ-0002tu-4I; Thu, 19 Feb 2026 00:23:09 -0500", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <imp@bsdimp.com>) id 1vswVH-0002qF-BY\n for qemu-devel@nongnu.org; Thu, 19 Feb 2026 00:23:07 -0500", "from mail-oa1-x33.google.com ([2001:4860:4864:20::33])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <imp@bsdimp.com>) id 1vswVF-00025I-P3\n for qemu-devel@nongnu.org; Thu, 19 Feb 2026 00:23:07 -0500", "by mail-oa1-x33.google.com with SMTP id\n 586e51a60fabf-40974bf7781so1198049fac.0\n for <qemu-devel@nongnu.org>; Wed, 18 Feb 2026 21:23:05 -0800 (PST)", "from rebo.bsdimp.com ([50.253.99.174])\n by smtp.gmail.com with ESMTPSA id\n 006d021491bc7-674758eb709sm14215326eaf.12.2026.02.18.21.23.03\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 18 Feb 2026 21:23:03 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1771478584; x=1772083384;\n darn=nongnu.org;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:from:to:cc:subject:date:message-id\n :reply-to; bh=7t1lbj/19tURG7IylL2GT+TzNhn9D96Ws9Y+o1fDcfM=;\n b=aqCqdrfuPFdBDCpqPe3xnWhvy6dz7d+Gwoh4cXzan+yAQEZA+GbMHnwn8KbqR+CwMW\n mjzipF/qNKivtKmx57ZWAfkDgfX36zvsJe+WpSbF+H5ZIMoukvixEf2jfaM4stg8hQXP\n OLHYTxsN8DH7wus1Efj6x9mf1jac7NIRd/V0Wc1gmgGGN7ycnkmiiOA7KbO32uGdxfSi\n fk9V7tR9UAqmB1l13ziOMlO6HGr9uJ2qsqYrN1C7TAnhOwaH6K5HgRxgv1smHLy8YR0a\n 2UgIStGwJtOjVGLnrAjzBQbAnieSWHGgD0k6d5dq1m1EB+shK7dLJ9VdKCmeg2qrDJEz\n 4KhQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1771478584; x=1772083384;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=7t1lbj/19tURG7IylL2GT+TzNhn9D96Ws9Y+o1fDcfM=;\n b=CVFARrMYXWWF7hmmuqdbj5I+1gEIWlP1wvXxxDQ1nLxi5wQrhIHaCg1QTMKmXeCPOP\n oofEC40bRPfy60I4cRqllizPbCUCV3TUTdrra5WFhsA9HW4TOehGsxftLAAh7RVe3VT0\n bCibTf0jLIOmLjNCOcb2ktRUi2UHKo9S4XGdaXPSLwVQ5AEccGjPul72or/a0P0HIxwg\n UCarZayW16XCR4z6vWBT2cQBfcUNP8qKQCTWvq9LF3OBPrexmidICwoY1k/5h5nNGyx2\n y06+DR77Z3xwS5tgx1sMKis9cFVhvYjGma7t54F9kKYxSYICl84wQ8I5w0yNQvow1I+G\n fl4w==", "X-Gm-Message-State": "AOJu0YwMGsgUvvdr1bOExFSVLcPHQk5eNRamfrLAYZeWD5k48J2E2EZO\n 7pAhZys4FwzynJb3yJsHf917ehC9i7IHOeDRQ+oHzMsMP3QHbERjojmlxFeYhwW1/Jg=", "X-Gm-Gg": "AZuq6aLmiWKspakUKY2quO3q0Ddp6lxatfYYKndcgZ3yDYh0LlhwLQ2n8/6w5nTzxdQ\n TURPr+NhCTS3DPYZwIHPY5pHjVaxVsv077IOXrLHyktwR/UkyN7j2QW87VAeixmgQ0QPuy1YehE\n g1nbjPWnJm71g3xjiurD/w9DDIONVZFyQarcEeg2dda1QAv27rdbM5mKNE2hju1zc5CrkvO56Pu\n 1vv492o2lN20ORW/+IizzqGYGhBpv7KfqlAbT1EJZqMb6KJKSSlX4mf4OvEBTNi3C6WYFh7uzXf\n YnK18Kn4mkl3Zneh06NYqE3Afw2KI5TzfejMCssS5tfi2WZogzzVW7mjnZjd4iDVh3voaj2PZ22\n S3vSrvQzDVwGvqR1GGmjr8m3Nq7tqWQEYJJyu0Pq4PyTPyX3rDDfD7suYPwrn91+TOhujRX00UW\n Jcw4L6q2bkSQ==", "X-Received": "by 2002:a05:6820:2207:b0:674:db9f:2e2a with SMTP id\n 006d021491bc7-679b1016ed3mr480186eaf.35.1771478584565;\n Wed, 18 Feb 2026 21:23:04 -0800 (PST)", "From": "Warner Losh <imp@bsdimp.com>", "Date": "Wed, 18 Feb 2026 22:22:43 -0700", "Subject": "[PATCH v3 20/24] bsd-user: Add message queue implementations", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "Message-Id": "<20260218-bsd-user-claude-v3-20-0137b37b221e@bsdimp.com>", "References": "<20260218-bsd-user-claude-v3-0-0137b37b221e@bsdimp.com>", "In-Reply-To": "<20260218-bsd-user-claude-v3-0-0137b37b221e@bsdimp.com>", "To": "qemu-devel@nongnu.org", "Cc": "=?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>,\n Kyle Evans <kevans@freebsd.org>,\n =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,\n Paolo Bonzini <pbonzini@redhat.com>,\n =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>,\n Riku Voipio <riku.voipio@iki.fi>, Warner Losh <imp@bsdimp.com>,\n Stacey Son <sson@FreeBSD.org>,\n Richard Henderson <richard.henderson@linaro.org>", "X-Mailer": "b4 0.14.3", "X-Developer-Signature": "v=1; a=openpgp-sha256; l=3717; i=imp@bsdimp.com;\n h=from:subject:message-id; bh=afl0VBRiyNDawiuJsZs7VyEaZkBdCj8dDbjBLqtmfh0=;\n b=owEBbQKS/ZANAwAKAWwc0Sh9sBEAAcsmYgBplp4s0GsdVCDrbgW9p/Aw1DgwLFVwp3VtmH1Nj\n iw+x/7HGFWJAjMEAAEKAB0WIQQgNfiUsAqjz3zN4bdsHNEofbARAAUCaZaeLAAKCRBsHNEofbAR\n AIFIEACtHPV8dsvuoRYYSL+4hDy/UxYekD9ykKwu/jZLMmAjU6gjboJfyLrHYS7Jy0gmcFHCzLi\n TOEBmSBPIOjU4laiPxOSMn2wRJ+Re/CC7aD4zNXOgntxCEdLtWBL3y7SI/ih7X+YZpMEkOVTJgd\n KG7M6VA06UYP3aWWOFXDHgKq6d/9p9pdZRVeLoNqqD/3HUobwhTtSUAkvueIbLC9NcErFf8dkFV\n VSYmuQFL1rwTyGpMx02A4dQI60bKvorOIvue6ToFljZT/vJl31wrVeejzHDnJ8aN48LT6OvnPzH\n Aom4GuWJSuUJqgJRMbToyLu0s0p/SEixnzLIm9btW6GxGMTUy8ur2ykgiOAtKKdik5viKJGnJBn\n RhHmy8yr+yhjkKzEvIddoB6DxSezaz/A0L1U4oJLFaZhBQBcOB7ulMreXnufadTDsWMPu9Zoytk\n FB1tGgnleFOi7cGss/W+tldmixyj5kRCg2H/8DI9BKMOYgb9zqF1lqnqh0/iEZRJ1wuliFF4Mhh\n M5/rrkAg2Gouv1Ka6eleFonrVLyHT/u1rPbATZeGOYmcI3MQGd2q233yLBntHMgOKTv3tTuBEcd\n OdZLv2wE41vo4FQBa1B8tjzo1Q1y0hFsix9sbkj8z/UjwGuoJ8TytjW05BZQ3eGlf7mjYIRA0+k\n dqHy9oz5YdDxz4g==", "X-Developer-Key": "i=imp@bsdimp.com; a=openpgp;\n fpr=2035F894B00AA3CF7CCDE1B76C1CD1287DB01100", "Received-SPF": "none client-ip=2001:4860:4864:20::33;\n envelope-from=imp@bsdimp.com; helo=mail-oa1-x33.google.com", "X-Spam_score_int": "-18", "X-Spam_score": "-1.9", "X-Spam_bar": "-", "X-Spam_report": "(-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_NONE=0.001 autolearn=ham autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "qemu development <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "From: Stacey Son <sson@FreeBSD.org>\n\nAdd implementations for:\n- msgsnd(2): Send message to queue with size validation\n- msgget(2): Get message queue identifier\n- msgrcv(2): Receive message from queue with size validation\n\nSigned-off-by: Stacey Son <sson@FreeBSD.org>\nReviewed-by: Richard Henderson <richard.henderson@linaro.org>\nSigned-off-by: Warner Losh <imp@bsdimp.com>\n---\n bsd-user/bsd-misc.h | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 97 insertions(+)", "diff": "diff --git a/bsd-user/bsd-misc.h b/bsd-user/bsd-misc.h\nindex 9837b9654c..fa8041fadc 100644\n--- a/bsd-user/bsd-misc.h\n+++ b/bsd-user/bsd-misc.h\n@@ -17,6 +17,8 @@\n \n #include \"qemu-bsd.h\"\n \n+static int bsd_msgmax;\n+\n /* quotactl(2) */\n static inline abi_long do_bsd_quotactl(abi_ulong path, abi_long cmd,\n __unused abi_ulong target_addr)\n@@ -262,6 +264,101 @@ static inline abi_long do_bsd_msgctl(int msgid, int target_cmd, abi_long ptr)\n return ret;\n }\n \n+struct kern_mymsg {\n+ long mtype;\n+ char mtext[1];\n+};\n+\n+static inline abi_long bsd_validate_msgsz(abi_ulong msgsz)\n+{\n+ /* Fetch msgmax the first time we need it. */\n+ if (bsd_msgmax == 0) {\n+ size_t len = sizeof(bsd_msgmax);\n+\n+ if (sysctlbyname(\"kern.ipc.msgmax\", &bsd_msgmax, &len, NULL, 0) == -1) {\n+ return -TARGET_EINVAL;\n+ }\n+ }\n+\n+ if (msgsz > bsd_msgmax) {\n+ return -TARGET_EINVAL;\n+ }\n+ return 0;\n+}\n+\n+/* msgsnd(2) */\n+static inline abi_long do_bsd_msgsnd(int msqid, abi_long msgp,\n+ abi_ulong msgsz, int msgflg)\n+{\n+ struct target_msgbuf *target_mb;\n+ struct kern_mymsg *host_mb;\n+ abi_long ret;\n+\n+ ret = bsd_validate_msgsz(msgsz);\n+ if (is_error(ret)) {\n+ return ret;\n+ }\n+ if (!lock_user_struct(VERIFY_READ, target_mb, msgp, 0)) {\n+ return -TARGET_EFAULT;\n+ }\n+ host_mb = g_malloc(msgsz + sizeof(long));\n+ host_mb->mtype = (abi_long) tswapal(target_mb->mtype);\n+ memcpy(host_mb->mtext, target_mb->mtext, msgsz);\n+ ret = get_errno(msgsnd(msqid, host_mb, msgsz, msgflg));\n+ g_free(host_mb);\n+ unlock_user_struct(target_mb, msgp, 0);\n+\n+ return ret;\n+}\n+\n+/* msgget(2) */\n+static inline abi_long do_bsd_msgget(abi_long key, abi_long msgflag)\n+{\n+ abi_long ret;\n+\n+ ret = get_errno(msgget(key, msgflag));\n+ return ret;\n+}\n+\n+/* msgrcv(2) */\n+static inline abi_long do_bsd_msgrcv(int msqid, abi_long msgp,\n+ abi_ulong msgsz, abi_long msgtyp, int msgflg)\n+{\n+ struct target_msgbuf *target_mb = NULL;\n+ char *target_mtext;\n+ struct kern_mymsg *host_mb;\n+ abi_long ret = 0;\n+\n+ ret = bsd_validate_msgsz(msgsz);\n+ if (is_error(ret)) {\n+ return ret;\n+ }\n+ if (!lock_user_struct(VERIFY_WRITE, target_mb, msgp, 0)) {\n+ return -TARGET_EFAULT;\n+ }\n+ host_mb = g_malloc(msgsz + sizeof(long));\n+ ret = get_errno(msgrcv(msqid, host_mb, msgsz, tswapal(msgtyp), msgflg));\n+ if (ret > 0) {\n+ abi_ulong target_mtext_addr = msgp + sizeof(abi_ulong);\n+ target_mtext = lock_user(VERIFY_WRITE, target_mtext_addr, ret, 0);\n+ if (target_mtext == NULL) {\n+ ret = -TARGET_EFAULT;\n+ goto end;\n+ }\n+ memcpy(target_mb->mtext, host_mb->mtext, ret);\n+ unlock_user(target_mtext, target_mtext_addr, ret);\n+ }\n+ if (!is_error(ret)) {\n+ target_mb->mtype = tswapal(host_mb->mtype);\n+ }\n+end:\n+ if (target_mb != NULL) {\n+ unlock_user_struct(target_mb, msgp, 1);\n+ }\n+ g_free(host_mb);\n+ return ret;\n+}\n+\n /* getdtablesize(2) */\n static inline abi_long do_bsd_getdtablesize(void)\n {\n", "prefixes": [ "v3", "20/24" ] }