From patchwork Tue Apr 16 18:59:37 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: 789256 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:dcf:b0:346:15ad:a2a with SMTP id dw15csp439343wrb; Tue, 16 Apr 2024 12:03:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX7n8kazjFhC/flF7vFSHA7mE3/AE9M46P24CeN26cDgaOzk1zZWq9FQvrEGQlFOEjWIc08fJwVRrpajWexRE4L X-Google-Smtp-Source: AGHT+IFlH4CnudbjXTC/B8QbEzks0OvOZQy0/lAzu2xQ6JUfv4sSScB+we62vh6ku8TPzWRmSA/k X-Received: by 2002:a05:620a:262a:b0:78e:bd7f:4db4 with SMTP id z42-20020a05620a262a00b0078ebd7f4db4mr16788519qko.51.1713294219981; Tue, 16 Apr 2024 12:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713294219; cv=none; d=google.com; s=arc-20160816; b=OGhwla6hv3FnGi2Fgv0hIutwUAdrGIPbFS0MTIQXGexJtxZPJZgdVMmVq4J4GC+LdN BsqoEx4vAlAObTjwGQeBGDfteoCI34hjZQGNPzxoJco9/DK+9mKuPROPbSK3lWkT5zRt 8FhSrOEnWUglx3LZrz2igFByYUBOTWO8c9L6GuuiFO4ni9VjTtjjOBY1Onjll7p7saXr cKEZ7t2B06BstcMn4XjAg0bQEZgLF7kPvIqf4yMydpqLonieVqtkTsVTY/H1rZklmVR0 F4iuRPlGoUCX6LjQiA8a1yjS4VhZKfXoatLiTMp556aLMDy4SwAsa6m4sSp8VAcMrFd4 L92A== 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=h1653K/UfEWnXUTbr/YeJw2UmUosHHOUFfds+vppZrE=; fh=cQusuDe0NwnVa0lqDP4K3TS7P79nva3vadgtcy3608E=; b=HbIOs/DZDavvAHwCOkpr/yaz8RgcuZlbWtDRCdPv0dcCE6bLQr3IzWgkpbPiTrVXgA ClS0n8LnX0dzX6O9/imLdGvuoy2jAuRkSXribEbtwHKCetGf1vR+E6uEXo52ob6pCZru PFVwTrhF6c0HdbAteswnXsceZT0h8nVHAhTiui7XqcDwk9Vt9QjkRNuiLYWhOGD+8NeB bTBEFk3GqpheBSz+NKhRi6fsV+7UzZo7ZXZBu9M88fQOdRHdi1jD5RhYq4kWyaGLntKB LFIoeNRUQQe/AxzFJ8HkUYtn7PLL2GRY9h0qRRuMKXvRoc3ddpqBRC2Ffc3zihBYKgWI ZexA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m1uu1bXd; 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 s3-20020a05620a29c300b0078ef1cadd38si3735202qkp.685.2024.04.16.12.03.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Apr 2024 12:03:39 -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=m1uu1bXd; 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 1rwo4V-0005U0-SZ; Tue, 16 Apr 2024 15:02:23 -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 1rwo4F-0003go-Qp for qemu-devel@nongnu.org; Tue, 16 Apr 2024 15:02:08 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rwo4C-0005tr-Cm for qemu-devel@nongnu.org; Tue, 16 Apr 2024 15:02:07 -0400 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-516d727074eso6174608e87.0 for ; Tue, 16 Apr 2024 12:02:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713294122; x=1713898922; 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=h1653K/UfEWnXUTbr/YeJw2UmUosHHOUFfds+vppZrE=; b=m1uu1bXdSeZn95aU1obdUE+N8UpmxJNLlyH3r5X5RSKi06txBlJsLRQMVBh4ZsI6oF 5SYh+aa3YvHPNO7p7hmWL4GoJM6y+1BmZLf0oAN5c+VksvXVuAzi4WDIYOHa55cEmeuo p6kGy1xPcalKykCSlcGZNtkDDG2qDia+dPBWx8cqd6MWi2IuqEIJKXfs6Am7oqYbRWyh sE0DSE8LLy/rO7cGXPJ9ldDrUJUkz75P8fB1knZhlRw4cv8qbpwdRaR6GAwzVwvWlQaV /jPjxRMF7RgywrF0eqmm4sigJdTvVFCWIvenwqELTHiZJg5QDQQiAd3sIf69i3LZsdk6 kSCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713294122; x=1713898922; 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=h1653K/UfEWnXUTbr/YeJw2UmUosHHOUFfds+vppZrE=; b=cRo7V9DtRM702xcrFGDGenQ9NANCw55BAN3iDkzO0ND/dYr21hjOYzmRq0OGoSZ4iT Mn3ZEW2+zVkwG2NcvCz6L2GEXYkKkvwh2QC8lW72XTWd5OyG+/i9oYVW2gYKxgPGY/7Y 45DRWN+6uYXmbhF7eMfn1puY/nO9m77/YWkSPZ3CN9qc8i3BaFME6pu5vQK7Rx8626Pc r59VO3daQW1S9QOw7Xi0vgTaoIr3Z1UGWZ7RXk8ri64Wg7cV6NGm53dtU6Iibdt5nfez oQVCp0vjaBWWuG3f1ipQc4GXx+euCdr0pd1dtXPj6C1ke3Qyi6GO6Pwde2D4uf52tt8a 3o7g== X-Gm-Message-State: AOJu0YwAMy8zR1RlawLx1uNtOef68Q6JADFiGom7IU0p1N0bU5nQlDXd FaIQJXVAzaE3/N7/qHIqSX+ZpVGHoudYKqjBZanULnVH+uHjuwTOTfAJfNe0OGI+zVG99Lak6Cs 1 X-Received: by 2002:ac2:5a0f:0:b0:518:d259:8542 with SMTP id q15-20020ac25a0f000000b00518d2598542mr5101592lfn.2.1713294122153; Tue, 16 Apr 2024 12:02:02 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.61]) by smtp.gmail.com with ESMTPSA id y9-20020a170906470900b00a51a74409dcsm7262977ejq.221.2024.04.16.12.01.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 16 Apr 2024 12:02:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Thomas Huth Cc: "Michael S. Tsirkin" , qemu-riscv@nongnu.org, David Hildenbrand , Igor Mammedov , kvm@vger.kernel.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Marcelo Tosatti Subject: [PATCH v4 21/22] target/i386: Remove X86CPU::kvm_no_smi_migration field Date: Tue, 16 Apr 2024 20:59:37 +0200 Message-ID: <20240416185939.37984-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240416185939.37984-1-philmd@linaro.org> References: <20240416185939.37984-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=philmd@linaro.org; helo=mail-lf1-x136.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 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: 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 --- 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 6b05738079..5b016d6667 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2018,9 +2018,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 33760a2ee1..f9991e7398 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -7905,8 +7905,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 e68cbe9293..88f4a7da33 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -4337,6 +4337,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()) { @@ -4351,12 +4352,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) {