From nobody Mon Apr 6 12:13:52 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1773915144; cv=none; d=zohomail.com; s=zohoarc; b=fTdEf5DEkAMz0F22T9z2Y0n8RcbGzLtHBOqtRXXQFMPbx5HdJyWwZwz43TBwr6tpuBLwoDW6QRLRnTvlAOpjlixrd3U0JozJzertbmS+gXNrgUk53g6fhL5EZwEgwN7Whjk2u8epx38koo9AykxLzuZgT6hfjcKuyQ14Gv+Q1lA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773915144; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8k2dL6NiY1MZVbnAT4dWt1HFJQUIJsjtqhbLDfxcAs8=; b=HgnacA754c0ZgsUeEbG5lXJFyB76CJaIbxO5ZPZD1IAqulimS0YS4aLrTAAQQakKWvAiUGA0nCpN+dQoEFi5Rfco3obGRFCNhb4kVHE83bS7ndw33KWZEsQ24L6gAL85JBjTZzlF79O+hez+QVxwfrMPJhHEkuqAwVwKXOP/81I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773915144519870.8301189632385; Thu, 19 Mar 2026 03:12:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w3AM7-0001bb-I3; Thu, 19 Mar 2026 06:11:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w3AM6-0001bB-2A for qemu-devel@nongnu.org; Thu, 19 Mar 2026 06:11:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w3AM4-0007ba-MA for qemu-devel@nongnu.org; Thu, 19 Mar 2026 06:11:53 -0400 Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-460-IRJvkzmJMwutjRshAtIpeA-1; Thu, 19 Mar 2026 06:11:50 -0400 Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-82a73ec7290so746482b3a.1 for ; Thu, 19 Mar 2026 03:11:50 -0700 (PDT) Received: from rhel9-box.lan ([122.163.114.34]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-82a6bbb2f34sm5594319b3a.30.2026.03.19.03.11.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2026 03:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773915112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8k2dL6NiY1MZVbnAT4dWt1HFJQUIJsjtqhbLDfxcAs8=; b=ZBHKeiegwTQ0lPcWS1dHjjwoqvUY3bFYSoQ6uema7B+dtcEfAgw8CEhGpFYn6DEbwgSzFx 8cQmc/WXWQTfkDua6MErtOowMNwV/CUaJzbyTxl9Zh7YTFdSXKTSj4iCf9ESrHgcu185iw Y/oJYri/BeF5u9Z5vazGUWnEGcJS0KE= X-MC-Unique: IRJvkzmJMwutjRshAtIpeA-1 X-Mimecast-MFC-AGG-ID: IRJvkzmJMwutjRshAtIpeA_1773915110 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1773915109; x=1774519909; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8k2dL6NiY1MZVbnAT4dWt1HFJQUIJsjtqhbLDfxcAs8=; b=ERnuRCbaDn5Mg8NeuV1ChAkbTaM3fAk9HiMG07eFBp3f+nvKauqZz/OYxaMZcGMpaX NESFSiea8zqtzCP4NZpVqKqM9QSh891XKovON0MSu1y77gyRknAa9h/3aF6HJLehgpr+ ZGVef2to24MMumAOhpXioMKGdf/s+cx8jk8xxLYS4fzWdM1J5AjUvG3evvcTaPK6doQ2 cCx90SOTBTrQ282Cb3VfQ065p9YoBPaZ4euKP2FzQbNzeLZr4bor+aYjlF0WiOOnGFXP LWSBzOp3f/x/wtblflgkkGe6MGKH9Vx8nJ95RlmzMODG/GD26TCN4hSOpaHaNa0ndZYR 6hzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773915109; x=1774519909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8k2dL6NiY1MZVbnAT4dWt1HFJQUIJsjtqhbLDfxcAs8=; b=n96XKTwUpXPsyHAEU8D8TdR5Fxd5l9sSV29lW6y5eNq7I5xeaF0FoOYwhybQJYr0jB M3K/Q8bDu971TtQatvgbhg3ptG9NiEmXV2UGY9Ina2WErRO3LaRD2u005SEHTs+2ooZV Uwc7wkHWLV7dqicUb+8kteLCsocudPFvCr40fbYon8avxdKG00yxHHb7hbXWqjiY8l+B eCx6Iuk6JBjB47IXBlaKRN95rGxUnKxDWYgLpJzOwRP63K7CUlJA9RU1q6ANxf58jGRV vzycgS8KkObxzufCwvF48k4kJZDYB6qhmder6IK/zrTA62MEs7RwkoEmZo1kvPvwSpIo CyDQ== X-Forwarded-Encrypted: i=1; AJvYcCW6Zfgc8St7xT+hC+OwpwtEBaUBbDLTzWtCIEQXcQA24mOdwW3OxjyYGSQU2STy6UocX69egm69Eou+@nongnu.org X-Gm-Message-State: AOJu0YyksfG3/DaSIL+o2W6nMYWsl4puF1LeRQjL7mk4/23boUC0V3af lxQv1XBjaaUDjrTPKZIH2jtuUzUWuEavBysX2kXNImGx+/f9ASdqRarIaweCRePOqTKttmBqAwh WLCYVK3CoN97TW7jMcPSptC1QKli7ZOkgaZSE6OpSNvWsfxoemVZPWSQu X-Gm-Gg: ATEYQzzTmlKw5ACNi5k+wSnYQnHRQqTUyFttaUYRZ38TRzrHQcJhqy1VqlAPeI3xU9y rPJKBSANmNB+PPEvteI9/l7pcqA3gyylWp2FbEKOcYcGeWhm92CAd5PZNNcjpIVL1h85bvM6xj8 y8srcKjyhJnZFQSfuL2qQddYaIhet7HXX0gdCZYc5CV/U5E7gUPJc0IWpriAgX/JBFf1+nJzNsZ O6mal0S+Knau48fkMP5ypZr/P1ZApmykNlWq5UFMi+xz5uVW0oFA1Ay71IEE3uH8SbHlfivYcjR TMwZtedkV3RnmDBvqZ6TH3GF8rnuIjV4xQQoqOPDFkZce90EnN+0nKLfmpXU4iunjseqzMySBTC 5KrcPrBZPn5qKhlatS5MUHWKMNDK0wLHiIp0lPq3Fz7XAmOliGz9cneM= X-Received: by 2002:a05:6a00:a85:b0:82a:17b8:1474 with SMTP id d2e1a72fcca58-82a6ac3a360mr6470390b3a.1.1773915109488; Thu, 19 Mar 2026 03:11:49 -0700 (PDT) X-Received: by 2002:a05:6a00:a85:b0:82a:17b8:1474 with SMTP id d2e1a72fcca58-82a6ac3a360mr6470368b3a.1.1773915109099; Thu, 19 Mar 2026 03:11:49 -0700 (PDT) From: Ani Sinha To: Paolo Bonzini , Marcelo Tosatti Cc: Ani Sinha , philmd@linaro.org, Michale Tokarev , kvm@vger.kernel.org, qemu-devel@nongnu.org Subject: [PATCH for-11.0 2/2] i386/hyperv: add stubs for synic enablement Date: Thu, 19 Mar 2026 15:41:28 +0530 Message-ID: <20260319101128.116301-3-anisinha@redhat.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20260319101128.116301-1-anisinha@redhat.com> References: <20260319101128.116301-1-anisinha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=anisinha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1773915147752158500 Content-Type: text/plain; charset="utf-8" Add a new call hyperv_enable_synic() that can be called whether or not CONFIG_HYPERV is enabled. This way genetic code in i396/kvm.c can call this function to enable synic for hyperv. For non-hyperv cases, the stub will be a noop. Reported-by: Michale Tokarev Signed-off-by: Ani Sinha --- target/i386/kvm/hyperv-stub.c | 5 +++++ target/i386/kvm/hyperv.c | 9 +++++++++ target/i386/kvm/hyperv.h | 1 + target/i386/kvm/kvm.c | 12 +++++------- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/target/i386/kvm/hyperv-stub.c b/target/i386/kvm/hyperv-stub.c index 5836f53c23..767a4c7e1a 100644 --- a/target/i386/kvm/hyperv-stub.c +++ b/target/i386/kvm/hyperv-stub.c @@ -61,3 +61,8 @@ uint64_t hyperv_syndbg_query_options(void) { return 0; } + +int hyperv_enable_synic(X86CPU *cpu) +{ + return 0; +} diff --git a/target/i386/kvm/hyperv.c b/target/i386/kvm/hyperv.c index f7a81bd270..bd3c26d02b 100644 --- a/target/i386/kvm/hyperv.c +++ b/target/i386/kvm/hyperv.c @@ -24,6 +24,15 @@ int hyperv_x86_synic_add(X86CPU *cpu) return 0; } =20 +int hyperv_enable_synic(X86CPU *cpu) +{ + int ret =3D 0; + if (!hyperv_is_synic_enabled()) { + ret =3D hyperv_x86_synic_add(cpu); + } + return ret; +} + /* * All devices possibly using SynIC have to be reset before calling this t= o let * them remove their SINT routes first. diff --git a/target/i386/kvm/hyperv.h b/target/i386/kvm/hyperv.h index e45a4512fe..a393a5d428 100644 --- a/target/i386/kvm/hyperv.h +++ b/target/i386/kvm/hyperv.h @@ -23,6 +23,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exi= t *exit); #endif =20 int hyperv_x86_synic_add(X86CPU *cpu); +int hyperv_enable_synic(X86CPU *cpu); void hyperv_x86_synic_reset(X86CPU *cpu); void hyperv_x86_synic_update(X86CPU *cpu); =20 diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index a29f757c16..9e352882c8 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -1754,13 +1754,11 @@ static int hyperv_init_vcpu(X86CPU *cpu) return ret; } =20 - if (!hyperv_is_synic_enabled()) { - ret =3D hyperv_x86_synic_add(cpu); - if (ret < 0) { - error_report("failed to create HyperV SynIC: %s", - strerror(-ret)); - return ret; - } + ret =3D hyperv_enable_synic(cpu); + if (ret < 0) { + error_report("failed to create HyperV SynIC: %s", + strerror(-ret)); + return ret; } } =20 --=20 2.42.0