{"id":2216004,"url":"http://patchwork.ozlabs.org/api/patches/2216004/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260325164453.72127-10-pbonzini@redhat.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","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":"<20260325164453.72127-10-pbonzini@redhat.com>","list_archive_url":null,"date":"2026-03-25T16:44:43","name":"[PULL,09/19] target/i386: emulate: add new callbacks","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"880dfc2b847f648704287d86c595f8d094d8b8af","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/?format=json","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260325164453.72127-10-pbonzini@redhat.com/mbox/","series":[{"id":497473,"url":"http://patchwork.ozlabs.org/api/series/497473/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=497473","date":"2026-03-25T16:44:34","name":"[PULL,01/19] tests/functional: preserve PYTHONPATH entries","version":1,"mbox":"http://patchwork.ozlabs.org/series/497473/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2216004/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2216004/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 (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=ZA+QL2/l;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=google header.b=iQ5ILKyq;\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 4fgt7c63TWz1xy3\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 03:45:32 +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 1w5RM6-0004tJ-QP; Wed, 25 Mar 2026 12:45:18 -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 <pbonzini@redhat.com>)\n id 1w5RM5-0004rm-LF\n for qemu-devel@nongnu.org; Wed, 25 Mar 2026 12:45:17 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.129.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <pbonzini@redhat.com>)\n id 1w5RM3-0004dv-T4\n for qemu-devel@nongnu.org; Wed, 25 Mar 2026 12:45:17 -0400","from mail-wr1-f69.google.com (mail-wr1-f69.google.com\n [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-371-LBxyhtXbP6eaYcTxyLDq3Q-1; Wed, 25 Mar 2026 12:45:13 -0400","by mail-wr1-f69.google.com with SMTP id\n ffacd0b85a97d-4362197d1easo2237311f8f.2\n for <qemu-devel@nongnu.org>; Wed, 25 Mar 2026 09:45:13 -0700 (PDT)","from [192.168.10.48] ([151.49.85.67])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43b919df903sm886778f8f.30.2026.03.25.09.45.10\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 25 Mar 2026 09:45:10 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1774457115;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=iMwtdu8zITy6FiC5AzTGmGzrMXxG2qh+5n3w3ZMaSQU=;\n b=ZA+QL2/lkDGfxxQ1f5apcaizDDPpKn4I0DSaOyCJeynDnnfoRFKr2mtfcpyqvs4XvDwBb5\n RLYK5mMw6oPhP1J1ALxHsw1QfGjOPy6DcpVacophNUbpBE/7R9/HCZa+OyIUg0EI4lgCoQ\n OthSCKUpSspweXmQi9mHQDgiMqTtRW8=","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1774457112; x=1775061912; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=iMwtdu8zITy6FiC5AzTGmGzrMXxG2qh+5n3w3ZMaSQU=;\n b=iQ5ILKyqB+vyjqTodZWQ7hgiN9S7Gnoq67JHB0JTE5s1lGgERaxCKDox74EIFpaBbH\n AZ7t9z+fKJ1T1AVwXEgf3/ky5WZuQz73Le38/v8dBiKpSPJiOJ+UazkyaNKS1aYzuKb3\n sbDPuRE0LjXOtYtEZ8fXJpNMced98GKvNxAQWDmQqhTB1gfG0Nf97eGzMInYPsYN+Jf0\n l5Qkq02zhyMYyiaM7nfYw6/u8EWs6JuHaFSr1VPc1j1pFaVZER9tl8O+shof8XjqNLRK\n A1ipDdqMXOUsYa6i7NLmqoPRw2Q4D+Czdrnn/AYCYAXscsf8MJ0ACxk8r/QotJuyYKcc\n cEiA=="],"X-MC-Unique":"LBxyhtXbP6eaYcTxyLDq3Q-1","X-Mimecast-MFC-AGG-ID":"LBxyhtXbP6eaYcTxyLDq3Q_1774457112","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774457112; x=1775061912;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=iMwtdu8zITy6FiC5AzTGmGzrMXxG2qh+5n3w3ZMaSQU=;\n b=LWvY1fwKyXJ+2zWdgdGn6q0J2lMqp72mAczNBsX7WFBQ9fyf3lKByyC3DAbt/cPfla\n +hnc7VQUJjg90eMHRVqYpEBAolTWXWmKVmvJpjGzxqv0BGR2msZliHs3yTWPqz0guBTp\n 9fchr7V8XztiTynXBNSqE/AZhlgRFmx9NLOn3Y0qaHBRa7zc+G+QaQkzT4nQbpTOHgxC\n xcLzc8pqJhC4Rl4URmJ23VBrYhgnda3AGxyxMyT7xvjmV24ijsvtI8s3SfHq0eqExnrZ\n MBwBDW/EcnPhc9/16vlj/1V8gzkPpfgEbz+uWWF4PiHRIgukk86V4npPW6+Xf1Erj1pr\n sMfQ==","X-Gm-Message-State":"AOJu0Yyut0rpNIRFq4G9imiNTtQO2ThT3ymunsi08SNcy84qbhYjf9L8\n oy7JdyE+kveTqrHGzSVD/7JJ+9wIdca63/J5oIab1SFuwWNfRzB4zHa2b61N6ANS86xy+R9d1HD\n TWIFf9Cm2b4dbhcePtBke6B+n8eu/Qx0rUtSFKkxlxyveSsKX43y4vN1KV+2W0DoyzdXZGMQQQ7\n u/+ljyhuWjY2OQaslP2/J4xNM46NFpjARZskyLoo6V","X-Gm-Gg":"ATEYQzwpPGQ3SGZlpbzcZUGj/0rxKEBSoodtHuVVcUp8m4lQ8I7sJ5tJnTK1zW5mxE9\n cJM7Jq6FtWFIZJQpgI0OTynUBNBhrxmaTxZWaXsEwtRNCKw8NPS09c1VqEybxK6bhChjcLmPvmr\n 91Dx4YECFdhx0WHyJekestMRNnwOj8z+nhWfUqqyt2k4rzRUxCO9UuuyB0slVyICBfsISEEDIUF\n utHrGLT2kilvj089N/9MsyTtgd5YExzvsg98TP1eTkSPehH1TFA5AZjS/GKaaTCz9etB6COEZz8\n z40jqEi+/oLGsm5U5VSnhFmCAhsaWTb82vwrQDRpN1gVQ98Pm+rK0jCD/tdXcDKJ5gHuqgK6NlW\n DekpGhg16UTe03bd+f8CZX6CVSgEYTiAZpFoHIwENsNH4Ufqa9LtOJA3wVV07EzGYGMTd4Eqqen\n h5FNAl7jHpmSx2pALhBz0iqvmR","X-Received":["by 2002:a05:600c:1548:b0:487:338:b4df with SMTP id\n 5b1f17b1804b1-48715fffad0mr67833705e9.15.1774457111618;\n Wed, 25 Mar 2026 09:45:11 -0700 (PDT)","by 2002:a05:600c:1548:b0:487:338:b4df with SMTP id\n 5b1f17b1804b1-48715fffad0mr67833235e9.15.1774457111068;\n Wed, 25 Mar 2026 09:45:11 -0700 (PDT)"],"From":"Paolo Bonzini <pbonzini@redhat.com>","To":"qemu-devel@nongnu.org","Cc":"Mohamed Mediouni <mohamed@unpredictable.fr>","Subject":"[PULL 09/19] target/i386: emulate: add new callbacks","Date":"Wed, 25 Mar 2026 17:44:43 +0100","Message-ID":"<20260325164453.72127-10-pbonzini@redhat.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260325164453.72127-1-pbonzini@redhat.com>","References":"<20260325164453.72127-1-pbonzini@redhat.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=170.10.129.124;\n envelope-from=pbonzini@redhat.com;\n helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,\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":"From: Mohamed Mediouni <mohamed@unpredictable.fr>\n\nOn Hyper-V fetching some guest registers is really expensive, so\nadd a way to query some state from information provided by Hyper-V\nto save time on vmexits.\n\nSigned-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>\nLink: https://lore.kernel.org/r/20260324151323.74473-7-mohamed@unpredictable.fr\nSigned-off-by: Paolo Bonzini <pbonzini@redhat.com>\n---\n target/i386/emulate/x86_emu.h     | 3 +++\n target/i386/emulate/x86_helpers.c | 6 ++++++\n target/i386/emulate/x86_mmu.c     | 3 +++\n 3 files changed, 12 insertions(+)","diff":"diff --git a/target/i386/emulate/x86_emu.h b/target/i386/emulate/x86_emu.h\nindex 0f284b0c3d1..4ed970bd536 100644\n--- a/target/i386/emulate/x86_emu.h\n+++ b/target/i386/emulate/x86_emu.h\n@@ -32,6 +32,9 @@ struct x86_emul_ops {\n                       int size, int count);\n     void (*simulate_rdmsr)(CPUState *cs);\n     void (*simulate_wrmsr)(CPUState *cs);\n+    bool (*is_protected_mode)(CPUState *cpu);\n+    bool (*is_long_mode)(CPUState *cpu);\n+    bool (*is_user_mode)(CPUState *cpu);\n };\n \n extern const struct x86_emul_ops *emul_ops;\ndiff --git a/target/i386/emulate/x86_helpers.c b/target/i386/emulate/x86_helpers.c\nindex 024f9a2afcf..ebbf40f2b05 100644\n--- a/target/i386/emulate/x86_helpers.c\n+++ b/target/i386/emulate/x86_helpers.c\n@@ -211,6 +211,9 @@ bool x86_is_protected(CPUState *cpu)\n     X86CPU *x86_cpu = X86_CPU(cpu);\n     CPUX86State *env = &x86_cpu->env;\n     uint64_t cr0 = env->cr[0];\n+    if (emul_ops->is_protected_mode) {\n+        return emul_ops->is_protected_mode(cpu);\n+    }\n \n     return cr0 & CR0_PE_MASK;\n }\n@@ -234,6 +237,9 @@ bool x86_is_long_mode(CPUState *cpu)\n     uint64_t efer = env->efer;\n     uint64_t lme_lma = (MSR_EFER_LME | MSR_EFER_LMA);\n \n+    if (emul_ops->is_long_mode) {\n+        return emul_ops->is_long_mode(cpu);\n+    }\n     return ((efer & lme_lma) == lme_lma);\n }\n \ndiff --git a/target/i386/emulate/x86_mmu.c b/target/i386/emulate/x86_mmu.c\nindex 4e39bae025e..670939acdba 100644\n--- a/target/i386/emulate/x86_mmu.c\n+++ b/target/i386/emulate/x86_mmu.c\n@@ -49,6 +49,9 @@\n \n static bool is_user(CPUState *cpu)\n {\n+    if (emul_ops->is_user_mode) {\n+        return emul_ops->is_user_mode(cpu);\n+    }\n     return false;\n }\n \n","prefixes":["PULL","09/19"]}