Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2196187/?format=api
{ "id": 2196187, "url": "http://patchwork.ozlabs.org/api/patches/2196187/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260213034556.13471-2-mohamed@unpredictable.fr/", "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": "<20260213034556.13471-2-mohamed@unpredictable.fr>", "list_archive_url": null, "date": "2026-02-13T03:45:44", "name": "[v2,01/10] target/i386: emulate, hvf: move x86_mmu to common code", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "5910f070fabcb6891848c380b64f177ce90973a7", "submitter": { "id": 91318, "url": "http://patchwork.ozlabs.org/api/people/91318/?format=api", "name": "Mohamed Mediouni", "email": "mohamed@unpredictable.fr" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260213034556.13471-2-mohamed@unpredictable.fr/mbox/", "series": [ { "id": 492055, "url": "http://patchwork.ozlabs.org/api/series/492055/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=492055", "date": "2026-02-13T03:45:43", "name": "whpx: x86 updates (2026-02)", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/492055/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2196187/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2196187/checks/", "tags": {}, "related": [], "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=unpredictable.fr header.i=@unpredictable.fr\n header.a=rsa-sha256 header.s=sig1 header.b=ILdscb1k;\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 4fBylY3yB6z1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 13 Feb 2026 14:46:48 +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 1vqk8H-0008Eu-A1; Thu, 12 Feb 2026 22:46:17 -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 <mohamed@unpredictable.fr>)\n id 1vqk8F-0008E9-2p\n for qemu-devel@nongnu.org; Thu, 12 Feb 2026 22:46:15 -0500", "from p-west1-cluster5-host8-snip4-6.eps.apple.com ([57.103.66.247]\n helo=outbound.pv.icloud.com)\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <mohamed@unpredictable.fr>)\n id 1vqk8D-0005A9-0h\n for qemu-devel@nongnu.org; Thu, 12 Feb 2026 22:46:14 -0500", "from outbound.pv.icloud.com (unknown [127.0.0.2])\n by p00-icloudmta-asmtp-us-west-1a-60-percent-11 (Postfix) with ESMTPS id\n E1D8718000BF; Fri, 13 Feb 2026 03:46:07 +0000 (UTC)", "from localhost.localdomain (unknown [17.56.9.36])\n by p00-icloudmta-asmtp-us-west-1a-60-percent-11 (Postfix) with ESMTPSA id\n 60DA318000A3; Fri, 13 Feb 2026 03:46:04 +0000 (UTC)" ], "Dkim-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr;\n s=sig1; t=1770954369; x=1773546369;\n bh=pDdswD4Xub7IE+kNZc1mjsSEBI8ZIi+2CDn72stJol0=;\n h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme;\n b=ILdscb1kM/tDeesmZbu2JvoMrZiS0o64WIk7RPh6HW0IjIKGRBvLCArBCjCMLrSF9tnrxOT6zxPyrYzrQtrLYNlHjuT0TEEj5XiYg2i69TBnQvFChDTf71/9u0kWkrgSr8eEJRnjcRnXNdtxeSNe+LkEa21cUHrsDvkmPg3ZEb4v2hoorl383xEjwJaBJqbd+aCT8n9ZdHWMUjoAq9f8IJE93LF3btCs9rK7YRJhpJXOigdqyMYuKohr11X57I1shXt/Zyu9XFxde0vYtYnS9Jr7ovZnqTS34Usyy9J5jrTeJGXhQeuPqKpLAFe7uaZ4xYujaRRyUAQk4I6EVk1MTw==", "mail-alias-created-date": "1752046281608", "From": "Mohamed Mediouni <mohamed@unpredictable.fr>", "To": "qemu-devel@nongnu.org", "Cc": "=?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,\n Magnus Kulke <magnuskulke@linux.microsoft.com>, =?utf-8?q?Philippe_Mathieu-?=\n\t=?utf-8?q?Daud=C3=A9?= <philmd@linaro.org>,\n Bernhard Beschow <shentey@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>,\n Mohamed Mediouni <mohamed@unpredictable.fr>, Wei Liu <wei.liu@kernel.org>,\n Pedro Barbuda <pbarbuda@microsoft.com>, Cameron Esfahani <dirty@apple.com>,\n Peter Maydell <peter.maydell@linaro.org>,\n Phil Dennis-Jordan <phil@philjordan.eu>, Zhao Liu <zhao1.liu@intel.com>,\n Roman Bolshakov <rbolshakov@ddn.com>,\n =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>", "Subject": "[PATCH v2 01/10] target/i386: emulate,\n hvf: move x86_mmu to common code", "Date": "Fri, 13 Feb 2026 04:45:44 +0100", "Message-ID": "<20260213034556.13471-2-mohamed@unpredictable.fr>", "X-Mailer": "git-send-email 2.50.1", "In-Reply-To": "<20260213034556.13471-1-mohamed@unpredictable.fr>", "References": "<20260213034556.13471-1-mohamed@unpredictable.fr>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Proofpoint-ORIG-GUID": "WEGHwlj-INwMP_fB0eqnFiPfO-aklu6P", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwMjEzMDAyNSBTYWx0ZWRfX0DJurA441ZAe\n sbIrYarwS0b0oJC+w7q4/AJ4XCfjRH8TbVpJ1AEbzHO5/tD1uxKc412C//ZoDGeCcAYefYi95XG\n q6aIoKyIX/6m1LsIgxOp82sGW2YWyz2DBmcbcz8N6+d8zO6BFNYKGmNLM8OAJii1i+VU1Gu4dYm\n 3TFGkTir5Y3AeG3waRCfE+QsWW+fnnniTIAL3lJPmikfjn9egLoXupDad9OzFhvgPrCDCXkqteo\n v01vPXjDF/eX87NiJwmTYzG1e+zaEcx7unrSP3VIJntBr6TDNEX3hGe+EOIF5OR0e0s0q0Kk+tq\n ub0Zxi3URbTBFYKHM4w9OoSFyFoDovWJmz/bpVRS/kz5dscSkUZdqtleU2YN3o=", "X-Authority-Info-Out": "v=2.4 cv=Lv6fC3dc c=1 sm=1 tr=0 ts=698e9e80\n cx=c_apl:c_apl_out:c_pps a=azHRBMxVc17uSn+fyuI/eg==:117\n a=azHRBMxVc17uSn+fyuI/eg==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22\n a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=j-fo9BjxNM0Z7X-A5OoA:9", "X-Proofpoint-GUID": "WEGHwlj-INwMP_fB0eqnFiPfO-aklu6P", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-02-12_05,2026-02-12_03,2025-10-01_01", "X-Proofpoint-Spam-Details": "rule=notspam policy=default score=0 spamscore=0\n adultscore=0 bulkscore=0 clxscore=1030 lowpriorityscore=0 malwarescore=0\n mlxlogscore=999 phishscore=0 suspectscore=0 mlxscore=0 classifier=spam\n authscore=0 adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000\n definitions=main-2602130025", "X-JNJ": "\n AAAAAAABJf74yhZYx7mDBQ8nApoM607M0KqYPKSlsvqJIAw5XWIoxJCHy2R0r3Z9ZsN+c8XCZVBVicLO8QqbfBCsy4g9qhRSFZ4ESqVtiXKWCttzQtNV86hw1HKwkOkSHhWCdX2NXA2YC/shHbOAEZvmxl+vjaB71I83q+w9xXLwDUZA9qK+3XOudaGAqB9rt26EuPRnSiqU/O44mqeHwbWCp3bPNEQIYHEX0bOq6FqZoT0448VZ5YFyVTsgLbQpFdetixJEnbrrGCVCFHTtmIzX+qxLwfNcK5I0QFt92U/ihrOed7m6cVuos98iT2NJJgnoaZ5fxH+hi31oWlP54aj67vRSjWfTd1vKLPzb88j2L/NKzVtHrnihiG7FDp5WUfn6nMbBO8f5BycXBvGULUgZmnihfPBaiQo/4aGutVv0DwfHoJxTDCKLuMm0kGmfKzdzQRJ+YKfCgT+5cKYpTKObbtGgraG8Db/es0G9g5gFV+oEDGW5N1VHfxQ2BICaRUZgxWQI5xV/Gsw/y2muxEwnPC/WxYt4Zo0w81o/9T+WOydce79xH2YJ3K08uAGWnAdpa6ikv3M7QzARhJFWy0oEgCurPcx/57dnwo0nUXbZCzphH0ELOYNVzmySNcR0Q78E80i5FVmCaqXzaOG+zQ7pZri/AlrPtJTXMc7urwUslA9SCL/ZgVhJ013JCDylPDiRStt3IVfjgNi7WPUCjJqgvxJ+HPURLy/ICn/H4L9K8XR7B80G5JokECSnP9WnM5RgZXpPM9ayYG1iNcqguw==", "Received-SPF": "pass client-ip=57.103.66.247;\n envelope-from=mohamed@unpredictable.fr; helo=outbound.pv.icloud.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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_PASS=-0.001, SPF_PASS=-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": "Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>\n---\n target/i386/emulate/meson.build | 1 +\n target/i386/{hvf => emulate}/x86_mmu.c | 14 +++++++++-----\n target/i386/{hvf => emulate}/x86_mmu.h | 0\n target/i386/hvf/hvf.c | 6 +++++-\n target/i386/hvf/meson.build | 1 -\n target/i386/hvf/x86.c | 2 +-\n target/i386/hvf/x86_task.c | 2 +-\n 7 files changed, 17 insertions(+), 9 deletions(-)\n rename target/i386/{hvf => emulate}/x86_mmu.c (95%)\n rename target/i386/{hvf => emulate}/x86_mmu.h (100%)", "diff": "diff --git a/target/i386/emulate/meson.build b/target/i386/emulate/meson.build\nindex b6dafb6a5b..dd047c424a 100644\n--- a/target/i386/emulate/meson.build\n+++ b/target/i386/emulate/meson.build\n@@ -2,6 +2,7 @@ emulator_files = files(\n 'x86_decode.c',\n 'x86_emu.c',\n 'x86_flags.c',\n+ 'x86_mmu.c'\n )\n \n i386_system_ss.add(when: [hvf, 'CONFIG_HVF'], if_true: emulator_files)\ndiff --git a/target/i386/hvf/x86_mmu.c b/target/i386/emulate/x86_mmu.c\nsimilarity index 95%\nrename from target/i386/hvf/x86_mmu.c\nrename to target/i386/emulate/x86_mmu.c\nindex afc5c17d5d..7d069a172a 100644\n--- a/target/i386/hvf/x86_mmu.c\n+++ b/target/i386/emulate/x86_mmu.c\n@@ -19,10 +19,10 @@\n #include \"qemu/osdep.h\"\n #include \"panic.h\"\n #include \"cpu.h\"\n+#include \"system/address-spaces.h\"\n+#include \"system/memory.h\"\n #include \"emulate/x86.h\"\n-#include \"x86_mmu.h\"\n-#include \"vmcs.h\"\n-#include \"vmx.h\"\n+#include \"emulate/x86_mmu.h\"\n \n #define pte_present(pte) (pte & PT_PRESENT)\n #define pte_write_access(pte) (pte & PT_WRITE)\n@@ -99,6 +99,8 @@ static bool get_pt_entry(CPUState *cpu, struct gpt_translation *pt,\n static bool test_pt_entry(CPUState *cpu, struct gpt_translation *pt,\n int level, int *largeness, bool pae)\n {\n+ X86CPU *x86_cpu = X86_CPU(cpu);\n+ CPUX86State *env = &x86_cpu->env;\n uint64_t pte = pt->pte[level];\n \n if (pt->write_access) {\n@@ -127,7 +129,7 @@ static bool test_pt_entry(CPUState *cpu, struct gpt_translation *pt,\n pt->err_code |= MMU_PAGE_PT;\n }\n \n- uint32_t cr0 = rvmcs(cpu->accel->fd, VMCS_GUEST_CR0);\n+ uint32_t cr0 = env->cr[0];\n /* check protection */\n if (cr0 & CR0_WP_MASK) {\n if (pt->write_access && !pte_write_access(pte)) {\n@@ -179,9 +181,11 @@ static inline uint64_t large_page_gpa(struct gpt_translation *pt, bool pae,\n static bool walk_gpt(CPUState *cpu, target_ulong addr, int err_code,\n struct gpt_translation *pt, bool pae)\n {\n+ X86CPU *x86_cpu = X86_CPU(cpu);\n+ CPUX86State *env = &x86_cpu->env;\n int top_level, level;\n int largeness = 0;\n- target_ulong cr3 = rvmcs(cpu->accel->fd, VMCS_GUEST_CR3);\n+ target_ulong cr3 = env->cr[3];\n uint64_t page_mask = pae ? PAE_PTE_PAGE_MASK : LEGACY_PTE_PAGE_MASK;\n \n memset(pt, 0, sizeof(*pt));\ndiff --git a/target/i386/hvf/x86_mmu.h b/target/i386/emulate/x86_mmu.h\nsimilarity index 100%\nrename from target/i386/hvf/x86_mmu.h\nrename to target/i386/emulate/x86_mmu.h\ndiff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c\nindex ce54020f00..9c5d85453d 100644\n--- a/target/i386/hvf/hvf.c\n+++ b/target/i386/hvf/hvf.c\n@@ -62,7 +62,7 @@\n #include \"emulate/x86.h\"\n #include \"x86_descr.h\"\n #include \"emulate/x86_flags.h\"\n-#include \"x86_mmu.h\"\n+#include \"emulate/x86_mmu.h\"\n #include \"emulate/x86_decode.h\"\n #include \"emulate/x86_emu.h\"\n #include \"x86_task.h\"\n@@ -254,6 +254,10 @@ static void hvf_read_segment_descriptor(CPUState *s, struct x86_segment_descript\n \n static void hvf_read_mem(CPUState *cpu, void *data, target_ulong gva, int bytes)\n {\n+ X86CPU *x86_cpu = X86_CPU(cpu);\n+ CPUX86State *env = &x86_cpu->env;\n+ env->cr[0] = rvmcs(cpu->accel->fd, VMCS_GUEST_CR0);\n+ env->cr[3] = rvmcs(cpu->accel->fd, VMCS_GUEST_CR3);\n vmx_read_mem(cpu, data, gva, bytes);\n }\n \ndiff --git a/target/i386/hvf/meson.build b/target/i386/hvf/meson.build\nindex 519d190f0e..22bf886978 100644\n--- a/target/i386/hvf/meson.build\n+++ b/target/i386/hvf/meson.build\n@@ -3,7 +3,6 @@ i386_system_ss.add(when: [hvf, 'CONFIG_HVF'], if_true: files(\n 'x86.c',\n 'x86_cpuid.c',\n 'x86_descr.c',\n- 'x86_mmu.c',\n 'x86_task.c',\n 'x86hvf.c',\n 'hvf-cpu.c',\ndiff --git a/target/i386/hvf/x86.c b/target/i386/hvf/x86.c\nindex 5c75ec9a00..2fa210ff60 100644\n--- a/target/i386/hvf/x86.c\n+++ b/target/i386/hvf/x86.c\n@@ -23,7 +23,7 @@\n #include \"emulate/x86_emu.h\"\n #include \"vmcs.h\"\n #include \"vmx.h\"\n-#include \"x86_mmu.h\"\n+#include \"emulate/x86_mmu.h\"\n #include \"x86_descr.h\"\n \n /* static uint32_t x86_segment_access_rights(struct x86_segment_descriptor *var)\ndiff --git a/target/i386/hvf/x86_task.c b/target/i386/hvf/x86_task.c\nindex bdf8b51ae6..b1e541a642 100644\n--- a/target/i386/hvf/x86_task.c\n+++ b/target/i386/hvf/x86_task.c\n@@ -16,7 +16,7 @@\n #include \"vmx.h\"\n #include \"emulate/x86.h\"\n #include \"x86_descr.h\"\n-#include \"x86_mmu.h\"\n+#include \"emulate/x86_mmu.h\"\n #include \"emulate/x86_decode.h\"\n #include \"emulate/x86_emu.h\"\n #include \"x86_task.h\"\n", "prefixes": [ "v2", "01/10" ] }