From patchwork Mon Jun 17 07:11:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 804857 Delivered-To: patch@linaro.org Received: by 2002:adf:fb90:0:b0:360:93e7:1765 with SMTP id a16csp434638wrr; Mon, 17 Jun 2024 00:14:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUBlKP3Ie0/o6NDYVsHfUFm2JTsXHbRwFptWm7jybMcKSny/Bu8ZhIT5zfdf1OBFx+pikrQVXp6+kvXscbA5utY X-Google-Smtp-Source: AGHT+IFh7undI5cJ3jYtmNlcy9ag1L2TFKNkki7u5KGzcVuQYyMb4tur5akT4YbrVo6L6OyAIuMF X-Received: by 2002:a05:6214:15ce:b0:6b2:9d0b:6134 with SMTP id 6a1803df08f44-6b2afc6f0camr83171616d6.12.1718608456112; Mon, 17 Jun 2024 00:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718608456; cv=none; d=google.com; s=arc-20160816; b=iFGlO4udaJ4R73+29hCB/qh4N4ZN3d/nLqp3PnB4Z2u4es4QLTQqhj3K6Swgma76+V GQ+kudQruS1Rj3c6dqR8CqcIpb27sSdjWaE7ZtxKxa36NfI8dCDGgkdoQYIreMzJ3NiA ZSScj35REFtpdwOnqL7cvXS52h53EkeBMTvMiqggknMlch7gXF1wLhc6jwVfHXKgzTA1 SW+c1UP3w7Tljw7smI4ZiM5hfGfUEZtHmRQjL6MD1hAosGiRwNQhOrTY5/TLJRsuVLp8 d3EL9i/w9/Goi1ypL+2j40Zf2KRJ8nu2lUbUWbHIQfI6qr5MS9moUp+sZeAXYANhjlKd xi9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UhKelacngo3+27BBQ2bi8+2Xt3BwJYNr5sZIoXjck/k=; fh=XIzGkbZ9xrsE15aeaym144l0IFwslylqk/yZM/JLY5M=; b=gkY8yOGF2Bo/S4FP6GZCnGZ8dzE3QYixBYioVMKLUdwPTHYSCTO6bHA2HTfa5XC9+R kqeYMjOlGCDqcPpyBeEF+kc0jpXK2d78vYFbO2cyXNO/4bCQyFRvI47MHrLKx9dUayHX 8e8XfwcxFdP2eUzRFkJwHsYuSnfDxJdZS5E8/qg0XNhWdKab4NQybJg5Izf2yF2hBiyR k0ZOs8R5Ky66/+WIR711TuQeD/J9j4ay3NNzREzPskPTrhda3Ec4U50m0EBKi/ozJUt4 ZKDoQAbTeOoX5DNnAFrA8rSfE7HuWvJKOzzH/qdw7zNnuMvrqOCnZlmh28CgGhD/fZ8n dwng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ihVUpJ0q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6b2a5b6ff36si93001196d6.498.2024.06.17.00.14.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Jun 2024 00:14:16 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ihVUpJ0q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJ6Yh-0001UI-TX; Mon, 17 Jun 2024 03:13:43 -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 1sJ6YS-0000ph-PZ for qemu-devel@nongnu.org; Mon, 17 Jun 2024 03:13:29 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJ6YQ-0002Sn-WA for qemu-devel@nongnu.org; Mon, 17 Jun 2024 03:13:28 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a6f85f82ffeso86058566b.0 for ; Mon, 17 Jun 2024 00:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718608405; x=1719213205; 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=UhKelacngo3+27BBQ2bi8+2Xt3BwJYNr5sZIoXjck/k=; b=ihVUpJ0qtUgU2h9Sw/FJZRsqSGQOP/IShwbad5SKcoV7Jt0clyjm7cs6uBezPrhsFU wMOgbf3pnbn+QzOtANVsVzW6YPBQzrYmKhh/JbY3h8ulBbSdSzOx2++6XEOde2ZMhoYX ALmkGVCdem1DMFvD3GNxVm1vE9xQKe4lNeONcstKYsDrUK2zEKFO+Rxqgum4GMhNBkyh jLYcArY59ps3dMzocJ+GomDhVUhc/q9EQA87S1A9Z6iFKFDA/W43aTx0E0ngFjHipwCJ eHKMR57E1E9BfP3/uvBGSOP0NDasioEg4J4tUnYWNh6G5+quv72H2hMoHXv9O8PcUWne vn0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718608405; x=1719213205; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UhKelacngo3+27BBQ2bi8+2Xt3BwJYNr5sZIoXjck/k=; b=sbm6D4XFtj8q7yrgKB032rBY5TOfRRcuMB3ErmPjY+g9eBww5HuASNKpft1DJ9tA9S Gf0PckXVgyK8nwXd4/mNQDCKNNsPWB5On8mkgZUtg+owRARLMgBcuq+6GDw4emYfuEsz WQOQ190y4/YSo8RAqVec1BPHcI3EAqMok3uxVOAvh5b0w3hFfgWOz6uBUdo3U4L7s2C8 m2X6qUrKY3jwOmwWXAnmz5fHi/xoqXDpFkswik66Qwv1eKQlaG3XGtPChuqkQxQDCQuz PNo7JfXwiYgVIC2FDLxY48ba2B+DuIh9cyCrE7rc8o6njp6fpa/3pv5CeuH35X+aIMqc PfMQ== X-Gm-Message-State: AOJu0YwUFHteGrad50/AcUq3fcicRjv7yeqCeLKVIfg4a3yXl0x7ys1z HQIs7rO5XwKNDvvmBXxt/ywsdZ40xNyb2jMmiLTDDVTr6DTpfAeRX3WTFXYdo87sQz0P82SQCjz lyxI= X-Received: by 2002:a17:906:2c0f:b0:a6f:4a1e:8ae0 with SMTP id a640c23a62f3a-a6f60dc1eeamr559030866b.57.1718608404872; Mon, 17 Jun 2024 00:13:24 -0700 (PDT) Received: from m1x-phil.lan ([176.176.169.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56f41adesm482236966b.165.2024.06.17.00.13.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 17 Jun 2024 00:13:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Igor Mammedov , "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Zhao Liu , Thomas Huth Subject: [PATCH v6 22/23] target/i386: Remove X86CPU::kvm_no_smi_migration field Date: Mon, 17 Jun 2024 09:11:17 +0200 Message-ID: <20240617071118.60464-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240617071118.60464-1-philmd@linaro.org> References: <20240617071118.60464-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=philmd@linaro.org; helo=mail-ej1-x632.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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X86CPU::kvm_no_smi_migration was only used by the pc-i440fx-2.3 machine, which got removed. Remove it and simplify kvm_put_vcpu_events(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu Reviewed-by: Thomas Huth Reviewed-by: Igor Mammedov --- target/i386/cpu.h | 3 --- target/i386/cpu.c | 2 -- target/i386/kvm/kvm.c | 7 +------ 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 8fe28b67e0..bba1d73aed 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2107,9 +2107,6 @@ struct ArchCPU { /* if set, limit maximum value for phys_bits when host_phys_bits is true */ uint8_t host_phys_bits_limit; - /* Stop SMI delivery for migration compatibility with old machines */ - bool kvm_no_smi_migration; - /* Forcefully disable KVM PV features not exposed in guest CPUIDs */ bool kvm_pv_enforce_cpuid; diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 7466217d5e..a5af56405b 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -8283,8 +8283,6 @@ static Property x86_cpu_properties[] = { DEFINE_PROP_BOOL("x-vendor-cpuid-only", X86CPU, vendor_cpuid_only, true), DEFINE_PROP_BOOL("lmce", X86CPU, enable_lmce, false), DEFINE_PROP_BOOL("l3-cache", X86CPU, enable_l3_cache, true), - DEFINE_PROP_BOOL("kvm-no-smi-migration", X86CPU, kvm_no_smi_migration, - false), DEFINE_PROP_BOOL("kvm-pv-enforce-cpuid", X86CPU, kvm_pv_enforce_cpuid, false), DEFINE_PROP_BOOL("vmware-cpuid-freq", X86CPU, vmware_cpuid_freq, true), diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 912f5d5a6b..7ad8072748 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -4474,6 +4474,7 @@ static int kvm_put_vcpu_events(X86CPU *cpu, int level) events.sipi_vector = env->sipi_vector; if (has_msr_smbase) { + events.flags |= KVM_VCPUEVENT_VALID_SMM; events.smi.smm = !!(env->hflags & HF_SMM_MASK); events.smi.smm_inside_nmi = !!(env->hflags2 & HF2_SMM_INSIDE_NMI_MASK); if (kvm_irqchip_in_kernel()) { @@ -4488,12 +4489,6 @@ static int kvm_put_vcpu_events(X86CPU *cpu, int level) events.smi.pending = 0; events.smi.latched_init = 0; } - /* Stop SMI delivery on old machine types to avoid a reboot - * on an inward migration of an old VM. - */ - if (!cpu->kvm_no_smi_migration) { - events.flags |= KVM_VCPUEVENT_VALID_SMM; - } } if (level >= KVM_PUT_RESET_STATE) {