Cover Letter Detail
Show a cover letter.
GET /api/covers/2217765/?format=api
{ "id": 2217765, "url": "http://patchwork.ozlabs.org/api/covers/2217765/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/cover/20260330143123.1685142-1-peter.maydell@linaro.org/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/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": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260330143123.1685142-1-peter.maydell@linaro.org>", "list_archive_url": null, "date": "2026-03-30T14:31:21", "name": "[0/2] linux-user: Fix incorrect sign-extension of guest addresses", "submitter": { "id": 5111, "url": "http://patchwork.ozlabs.org/api/people/5111/?format=api", "name": "Peter Maydell", "email": "peter.maydell@linaro.org" }, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/cover/20260330143123.1685142-1-peter.maydell@linaro.org/mbox/", "series": [ { "id": 498040, "url": "http://patchwork.ozlabs.org/api/series/498040/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=498040", "date": "2026-03-30T14:31:22", "name": "linux-user: Fix incorrect sign-extension of guest addresses", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498040/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/covers/2217765/comments/", "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=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=J8ag3eHl;\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 4fkty04YX5z1yG8\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 01:32:40 +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 1w7Deq-0001Aj-RX; Mon, 30 Mar 2026 10:32:00 -0400", "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 <peter.maydell@linaro.org>)\n id 1w7DeO-00014y-TU\n for qemu-devel@nongnu.org; Mon, 30 Mar 2026 10:31:33 -0400", "from mail-wm1-x332.google.com ([2a00:1450:4864:20::332])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>)\n id 1w7DeK-0002cl-8e\n for qemu-devel@nongnu.org; Mon, 30 Mar 2026 10:31:30 -0400", "by mail-wm1-x332.google.com with SMTP id\n 5b1f17b1804b1-482f454be5bso53022255e9.0\n for <qemu-devel@nongnu.org>; Mon, 30 Mar 2026 07:31:27 -0700 (PDT)", "from lanath.. (wildly.archaic.org.uk. [81.2.115.145])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-48722d49c18sm279767145e9.14.2026.03.30.07.31.24\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 30 Mar 2026 07:31:24 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1774881085; x=1775485885; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=qTjsNxfP1bTzgwndOT7LQzFk5ouNPuqMxWEm+bT+blw=;\n b=J8ag3eHlsKdg2Q6rQy1WswW/bfpux8Kt/Vki7ZW9Jq4ruUFmLPEjzeRftmwB2K9zfF\n v//W6l/2BBRBDQ5voPmj7rxypWlOEs5fE+haJ4bgfG/EV5kVD6ufTUGDmwY5aENFwtPe\n nTRTA75FjXfvC0j3EnY0AEg5RenRIryVzn2y/DlgKM7IgREAtH48LD3vHW6THVDUIF6T\n ObzA9Xu8ic+eNcydGHPr0EkxS8AyHwYbsFWtaVjuVzFKfdMrT27o3SmJ8EJYA5+5H3Td\n V/Lt2F68hJa6+L5FozmkedsUxecVNEs6PITmmiIGDlptgsMExABInZSdpk5usuFj0b7C\n O5/w==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774881085; x=1775485885;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=qTjsNxfP1bTzgwndOT7LQzFk5ouNPuqMxWEm+bT+blw=;\n b=bdUuL5k70+seLNhyq1TAmWh6FHPzuP22Bs7aw75wilOTc1Mo4rhbEkNL1Av+B30QDu\n y2urzFvEDEkpxwV9dkKosQ8WbAUwV3fTd9vyXGIjoIqe4TW2ASSXZVsV3raOLvpV2YPv\n Poxs+ivz/EwW5uqAj36jt/OiTS5eGulYg8+Q3zrb50pfznAtAne8YpzbZUZc8BrtrslR\n BF4EvQsoVBeqA4CnGf4RwEOEONQNbuRb06kj1NXDKRo5+sn1zPS2OGjtsFS/tjASUZ8O\n TyEKfeQlb/gn9GUfXeKmlXcXJSISjTJoHwwmN4FwdTFmocnzThkFx/ElxHfy+m406j7x\n JDmA==", "X-Gm-Message-State": "AOJu0YzeMrFVoc7m4EP8fFB9qG7GhLosu6lqLnUuRDXcMRuvwT8ir7gz\n Q2GIvj1jxIxBipsxp5MuO8aM4yXTM1MJYfrUEZc97uUkqWUGHenxB5LHPAIQvrXA9ZVThDIyhca\n wOguhvRs=", "X-Gm-Gg": "ATEYQzwQu5lQqIPjaANVxFBiSRFGGOGR/50wLQwaH9fW1LJVf4qt/UkWXAN9Gsj07Mf\n 1sjgznggCHfdYEbSlcERkBVJHOaGshSteVQDK/Ss0WEWxnC7tkNbgE5GjuREUxTCqGicluJdMV7\n 8ZQk+5cT2caPLrWEh5L9DvPwEDZAbI5LlogYIkD4j+KjWT69p7fPrO626Iaw4yQyU9Hi6WYpZ/A\n UANfGZmoQESmFhbGZrsEgKTV053L5VhJAeY1+ka7yd+a2JC5XMIbF5KyuoArpjxpGiwz3LaCdwb\n eiGKi4b5kks1yBmzObuRBHhhZaxPnuNO+aK2uK8ZFCsAjlXiB7PkjX2S9wZe/omm+9HM9NUh0Rc\n ZnL53f9wDSkLfOtK28BiQ42iTJGMFAVnscd/267VqWQXr+l4UTcdIMjX0qhBlB8vsyNcs3PVGIk\n 5nbT1rsm9/Ua0NdL3KZ//f0oq4/n1didqYjBQQGYjKo9K1rD9UcHzejcnFUwA1dxd8Z2ml3LnhH\n HQFqCrOV14w03Y/0gGLeiBjZ8l6ecI=", "X-Received": "by 2002:a05:600c:8289:b0:47e:e59c:67c5 with SMTP id\n 5b1f17b1804b1-487290de830mr193724365e9.8.1774881085354;\n Mon, 30 Mar 2026 07:31:25 -0700 (PDT)", "From": "Peter Maydell <peter.maydell@linaro.org>", "To": "qemu-devel@nongnu.org", "Cc": "qemu-stable@nongnu.org, Richard Henderson <richard.henderson@linaro.org>,\n Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>,\n Laurent Vivier <laurent@vivier.eu>,\n Pierrick Bouvier <pierrick.bouvier@linaro.org>", "Subject": "[PATCH 0/2] linux-user: Fix incorrect sign-extension of guest\n addresses", "Date": "Mon, 30 Mar 2026 15:31:21 +0100", "Message-ID": "<20260330143123.1685142-1-peter.maydell@linaro.org>", "X-Mailer": "git-send-email 2.43.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=2a00:1450:4864:20::332;\n envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.google.com", "X-Spam_score_int": "-20", "X-Spam_score": "-2.1", "X-Spam_bar": "--", "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=unavailable 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": "In commit 7804c84a (\"include/user: Use vaddr in guest-host.h\") we\nchanged all the functions in guest-host.h that took or returned their\nguest address argument in type abi_ptr to instead use vaddr.\n\nThis introduced regressions for the case of a 32-bit guest and an\naddress above 2GB for the common situation where the address is a\nsyscall argument stored in a variable of type 'abi_long'. With\nabi_ptr (which will be an unsigned 32-bit type for 32-bit guests),\nthe address is cast to unsigned 32-bit, and then zero-extended to\n64-bits in g2h_untagged_vaddr(). With the switch to vaddr (which is\nalways a 64-bit unsigned type), the guest address will instead be\nsign-extended to 64 bits, which gives the wrong answer.\n\nThis is https://gitlab.com/qemu-project/qemu/-/work_items/3333\n\nThere are multiple ways we could fix this, and I wasn't really\nvery enthusiastic about any of the ways I thought of:\n\n * we could require all the code that has guest addresses in\n abi_long variables to carefully make sure it casts them\n to abi_ptr before calling any of the relevant functions.\n That would be making changes to quite a lot of code, and\n it feels somewhat bug-prone because the \"obvious\" way to\n write code (...\"g2h(arg1)\"...) is the wrong way.\n\n * we could try to abstract away direct calls to these functions\n (as a comment in the header says, we likely need to do that\n at some point if we ever want to have usermode softmmu), as\n we already do somewhat with the lock_user() and unlock_user()\n primitives. But that would be a huge upheaval not suitable\n for fixing a regression.\n\n * we could make the \"normal\" versions of these functions the\n same as they've traditionally been in QEMU, and provide\n variants specifically using vaddr for the small amount of\n code that needs them and is being compiled only once.\n This is at least minimally invasive and fairly obviously\n reviewable for correctness, but having two versions of each\n function is a bit ugly.\n\nIn this patchset I've opted for the last of these possibilities.\nIf anybody has a better idea I didn't think of, feel free to\nsuggest it :-)\n\nPatch 1 in this series isn't a requirement for patch 2;\nbut cutting down the number of places where we include the\nheader helped make me more confident that I wasn't missing\nany uses.\n\nthanks\n-- PMM\n\nPeter Maydell (2):\n include: Don't include guest-host.h in cpu-ldst.h\n include/user/guest-host.h: Provide g2h etc for both abi_ptr and vaddr\n\n accel/tcg/user-exec.c | 26 +++++++--------\n bsd-user/qemu.h | 1 +\n include/accel/tcg/cpu-ldst.h | 4 ---\n include/user/guest-host.h | 62 ++++++++++++++++++++++++++++++++----\n linux-user/qemu.h | 1 +\n 5 files changed, 71 insertions(+), 23 deletions(-)" }