From patchwork Wed Mar 27 09:51:22 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: 783112 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2107690wrt; Wed, 27 Mar 2024 02:54:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUGPH1Xy4oJ4ZQQ76Pzbbs0f91rq/rxI5OOiV4CXt59dq5/qHUigSdeD6PNiwljLpjmqc5w1cXEeX9ipG2eGjh7 X-Google-Smtp-Source: AGHT+IGah6ZGU4U6IMBnnFH49jUgEA2Vp8czcn1mBbdUE8HQ1AERw9hGg2DM/novyQBGB2E05UZS X-Received: by 2002:a05:6214:f0d:b0:690:ca82:55f7 with SMTP id gw13-20020a0562140f0d00b00690ca8255f7mr2870136qvb.19.1711533278158; Wed, 27 Mar 2024 02:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711533278; cv=none; d=google.com; s=arc-20160816; b=IB0mwcsdqsgRZAKf+/5RTFOnXak2GRCdy680x+GdZxUGF9H7gXEvQ1WCC+wZsfkHCd sBXI9L97F1yIMi2/jkUa/jiwXdS3jAuygMSiTT+ngcoI0x0TnbTeqp7riIJ/ONBPfAC7 nbG9zTsws6PxntM3XfbWDjOVbvxDAHxV5BOOarjO3xcHYHJdy1cTDIKcl8yVO2dJ7N24 i4G2r+xvKzfGmX+fTwB4tqVXtzLPR+4X+uJCZP6ShuhzR7QE/ZrsnfcomUOUrKz65HJi DnaJt7rYouQiLUHaflwZh26nioePrd29B5Qs1Sc+Y023Wa4Vj81mnrpJiyIUWvMg74Hg 0wqQ== 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=GNAyK3lGFt7pCi07DIyw1qVnA4J8LeB4ju/ikziy2DE=; fh=L3SDrsUOmgI4xfwPxJS3lnaiysCAukfrjzmj7Q83kMM=; b=riLrFtMrQDOnfDmzrw48+MNRZtiukjxcu0MEwm+zMd/DBTQSRli6XbDDpKMwwDDpkt zYfoJG79Ni3RRjkIFCnOTLMrMg6VWxLCLfpMQOXvQ0Ed+gO5dQjZNaIkMq+cpWiyOP5X eVfzr22Tg00WEgRCZV/Xf/sH527jvqKo29j66AiDxrkYoF9g9bj/YCYlI6Evw4/Hdd3L 79KcR30oea8vsA51o4f/eFVWsjpwsxN2GHPfpKSb7qdrl5CIN+C9+zME2Op4WCo4XrBp BfP0W0o1z1m6u2xZ76CtR0nrHV2DiMBY/ONUT9fduHn2IlLWGiylJJ6YKzb3DmM2yCBn Rhlg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Lza21vgm; 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 jm14-20020ad45ece000000b0068cd9703420si12050540qvb.332.2024.03.27.02.54.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2024 02:54:38 -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=Lza21vgm; 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 1rpPzE-0008OG-Vc; Wed, 27 Mar 2024 05:54:25 -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 1rpPyV-0007fJ-16 for qemu-devel@nongnu.org; Wed, 27 Mar 2024 05:53:42 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpPyT-000750-7q for qemu-devel@nongnu.org; Wed, 27 Mar 2024 05:53:38 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a466fc8fcccso829713666b.1 for ; Wed, 27 Mar 2024 02:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711533211; x=1712138011; 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=GNAyK3lGFt7pCi07DIyw1qVnA4J8LeB4ju/ikziy2DE=; b=Lza21vgmE04xxElR9tJzMEGgyx7FbKoJ5hTUJzGu2bCbqu13jjtVMQLtNNJz2QjTxF nQjwdwXGf0LqTQ+U6iJ02eXRbBksxglxTiWX8BQ2KmHTCy1bumkKt3G1ntm+pqV7sR2h jir55obDRwc2QbtM5/0z/CCTb1ofOCkWy4cf+cn7HgQW2jOGtzIXzVHWUzrI3n5I/Zon CBqM5eAbQ3P4TRccU1VjIdSfH/X4asJXrIIaQyJTf/Hw/QUKsxu4tzvIEKivzzepXwYS cxS5KoDSCX7zRGzBzeFPxCokJogD7vGpsQmM5Qy5d8J0kUeDqiXhPc3muVQhhWcfTOIk JWYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711533211; x=1712138011; 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=GNAyK3lGFt7pCi07DIyw1qVnA4J8LeB4ju/ikziy2DE=; b=F3y00a9qFX/x/XiK+wp9QBY++vCrZJ1wlAveRRM2ESfYk/Y7kz6g/CqR7YlGCpTyme 4Urk9BGeSfbfRemDc3yQPCoKeYqG0QQevWsTi2okE/toKvbXvOXjIu+lH7fw9keRlHXF AVRjEaLklZ6oIKOMIBxC83N7oW6CD4qTAX8lR41wO2UZWMQlnx3fKdDNQI4rRk4E+5fv JKFXXBeeqOPKOzO8UnlwXUbND05Iu7DGqTZVAjPTKQYA4zPlrPvgGoiwhu1BOQIeAeER CEGJORRHi70PiCOy5Xufx0IVtjyXiz4hD3QAVQgS9nVE2FiHVmVtFLDScuyHCIz/iyl7 S3/A== X-Forwarded-Encrypted: i=1; AJvYcCVRSl/fI+1paP0DN+9UwruFTeGVJuelqt4UN+7VDPYamj2NDKnhnhgryThVQytXS2/DYlJ1Mzk4sj955KrF3Zu+h8CJUnw= X-Gm-Message-State: AOJu0YxQzZUh9OFcw3gxKr6u/6JzGEBdo1XN9d5xle0GW5Qa6OBOg3Ab PlBhG2zsGj3dLW8rOfoMbU3en+atQ2F+xNTcvRuBI/sFfLshKOaloftLxs8IxlpoR85V158K94N 4 X-Received: by 2002:a17:906:b257:b0:a47:39c6:8970 with SMTP id ce23-20020a170906b25700b00a4739c68970mr2716915ejb.39.1711533211584; Wed, 27 Mar 2024 02:53:31 -0700 (PDT) Received: from m1x-phil.lan ([176.187.205.175]) by smtp.gmail.com with ESMTPSA id n6-20020a170906700600b00a474b3c90c4sm4437161ejj.24.2024.03.27.02.53.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 27 Mar 2024 02:53:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , qemu-devel@nongnu.org, Igor Mammedov Cc: Paolo Bonzini , devel@lists.libvirt.org, Zhao Liu , Gerd Hoffmann , "Michael S. Tsirkin" , Ani Sinha , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcelo Tosatti , kvm@vger.kernel.org Subject: [PATCH-for-9.1 v2 20/21] target/i386: Remove X86CPU::kvm_no_smi_migration field Date: Wed, 27 Mar 2024 10:51:22 +0100 Message-ID: <20240327095124.73639-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240327095124.73639-1-philmd@linaro.org> References: <20240327095124.73639-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.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=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 --- 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) {