From nobody Tue Nov 11 12:50:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563635968; cv=none; d=zoho.com; s=zohoarc; b=aq2O12prgPtC2KVPeOemRrH4aN1iJsD8X8iumCbpfAiW/rzNbCs5oEqwctGDLmIjh5fB30cUJXn0D3CvcoLp5MmtBf2nbkJTVy1EYqCaOuKgUoIL5K8YGhIxcqBTZow63W2XrwUGfSLdwu9iGH/EtXhitHXwbTD48IoAEUCJhrE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563635968; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=yiDc/TEXPQasznA1y4wzCBkJJW+skyq8/HgGa6nZqFY=; b=mk9WqD5Z4ob9TI960QkG7ig6OkUwwsu2tmgB/o5FS4SMLgYqmsrTrtPeBsqcIIEe/KJQtF3g0VgqhhEul/rb55XcB2WbTzfVmo1PuVstdr4i19BkGNzxBznGQ2yzBKRiomsxbtin83hwdgqgUdVrKne8cDsCypqf4wrmyf0BgLw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156363596864981.01782020080088; Sat, 20 Jul 2019 08:19:28 -0700 (PDT) Received: from localhost ([::1]:51594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor8x-0007NB-40 for importer@patchew.org; Sat, 20 Jul 2019 11:19:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39784) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor8P-0005n1-RE for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hor8O-00084S-8y for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:53 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:55359) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hor8O-000841-13 for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:52 -0400 Received: by mail-wm1-x342.google.com with SMTP id a15so31256010wmj.5 for ; Sat, 20 Jul 2019 08:18:51 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:8501:6b03:f18c:74f8]) by smtp.gmail.com with ESMTPSA id 4sm77517291wro.78.2019.07.20.08.18.48 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 08:18:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yiDc/TEXPQasznA1y4wzCBkJJW+skyq8/HgGa6nZqFY=; b=QAH9R5N2b0+/dYNyJgfXQW+rZ1D/yXMamb6cgawPaFOLgX2GY7XujvSzwYLyRHYKwj H6lSqNSeh9YV2DZ4xWyPSS4Dqvk7WlrFuf/kBg66xgXM2JaORwnxXoLscRGUPZXTzgR6 7aOGjDonvzOvbyiJMBDoIWdqtoalWce5eTQYgubS4vT7LMHbg6Pfrd1ILzD9+HInmpKb fSwv/nXPxz7b15yr9v/lJjcx55cbPXUl7vUI91l4eRF6T5x6r2SMue1N8Vk8xtxdQoh8 xzr1fnGkGl6cjrg/6mjYQ1LfLzBzC1tSZS/8DOV7JJM4B8VzXMGc9rJjSK6AcbYRyDmU VoZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=yiDc/TEXPQasznA1y4wzCBkJJW+skyq8/HgGa6nZqFY=; b=FvYzFz1uwqzhDJTQrGJXKnu9zFi8i83CJ7HOepvs2CwjNcjXpiTIAjV0GMXa+sBZTP ormzz/bRPyKXVm7/M+pOOBLjJ+7Ao2FdpQY68PLFax/UlGQZe9XUI3t1Qs51XDW1athp qEJ0FC/pzqyOyvmPfHlRn9Z2uILaRB02DSNJdaDMF9h0z3m2h4dn+r9ArhL00F89JPba JxxJCLVx9BlRYGpb8JT4eSPaQl9/4fizJE6C6D5dBHRTO0hYGcxSfwRQWgXGMXu5shyB 5YDwZmBLXu5sbsfx8bEIz/J3C5mQkeIpAXsibhpg4F6hPH+VBWUcLZvtX5KRm8MtptPW jG7A== X-Gm-Message-State: APjAAAWRVkXiSvgCR2B32MtWuit44nEQHbrHG3fqWjiXF3IWmERl6tvm OdESopsANURM0JoacI2QzxN+HzqdDvs= X-Google-Smtp-Source: APXvYqypOoEvUqv1Jr8zQN4SuewT+AB1Mz7v7OrJLM2PpkxLZMoEJ3mCxTvNqtDhqb7u8iDZndfbWQ== X-Received: by 2002:a7b:c8c3:: with SMTP id f3mr56398553wml.124.1563635930626; Sat, 20 Jul 2019 08:18:50 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 20 Jul 2019 17:18:35 +0200 Message-Id: <20190720151846.7450-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190720151846.7450-1-pbonzini@redhat.com> References: <20190720151846.7450-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 Subject: [Qemu-devel] [PULL 01/12] target/i386: kvm: Demand nested migration kernel capabilities only when vCPU may have enabled VMX X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joao Martins , Liran Alon , Maran Wilson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Liran Alon Previous to this change, a vCPU exposed with VMX running on a kernel without KVM_CAP_NESTED_STATE or KVM_CAP_EXCEPTION_PAYLOAD resulted in adding a migration blocker. This was because when the code was written it was thought there is no way to reliably know if a vCPU is utilising VMX or not at runtime. However, it turns out that this can be known to some extent: In order for a vCPU to enter VMX operation it must have CR4.VMXE set. Since it was set, CR4.VMXE must remain set as long as the vCPU is in VMX operation. This is because CR4.VMXE is one of the bits set in MSR_IA32_VMX_CR4_FIXED1. There is one exception to the above statement when vCPU enters SMM mode. When a vCPU enters SMM mode, it temporarily exits VMX operation and may also reset CR4.VMXE during execution in SMM mode. When the vCPU exits SMM mode, vCPU state is restored to be in VMX operation and CR4.VMXE is restored to its original state of being set. Therefore, when the vCPU is not in SMM mode, we can infer whether VMX is being used by examining CR4.VMXE. Otherwise, we cannot know for certain but assume the worse that vCPU may utilise VMX. Summaring all the above, a vCPU may have enabled VMX in case CR4.VMXE is set or vCPU is in SMM mode. Therefore, remove migration blocker and check before migration (cpu_pre_save()) if the vCPU may have enabled VMX. If true, only then require relevant kernel capabilities. While at it, demand KVM_CAP_EXCEPTION_PAYLOAD only when the vCPU is in guest-mode and there is a pending/injected exception. Otherwise, this kernel capability is not required for proper migration. Reviewed-by: Joao Martins Signed-off-by: Liran Alon Reviewed-by: Maran Wilson Tested-by: Maran Wilson Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 22 ++++++++++++++++++++++ target/i386/kvm.c | 26 ++++++-------------------- target/i386/kvm_i386.h | 1 + target/i386/machine.c | 24 ++++++++++++++++++++---- 4 files changed, 49 insertions(+), 24 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 05393cf..8b3dc55 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1877,6 +1877,28 @@ static inline bool cpu_has_vmx(CPUX86State *env) return env->features[FEAT_1_ECX] & CPUID_EXT_VMX; } =20 +/* + * In order for a vCPU to enter VMX operation it must have CR4.VMXE set. + * Since it was set, CR4.VMXE must remain set as long as vCPU is in + * VMX operation. This is because CR4.VMXE is one of the bits set + * in MSR_IA32_VMX_CR4_FIXED1. + * + * There is one exception to above statement when vCPU enters SMM mode. + * When a vCPU enters SMM mode, it temporarily exit VMX operation and + * may also reset CR4.VMXE during execution in SMM mode. + * When vCPU exits SMM mode, vCPU state is restored to be in VMX operation + * and CR4.VMXE is restored to it's original value of being set. + * + * Therefore, when vCPU is not in SMM mode, we can infer whether + * VMX is being used by examining CR4.VMXE. Otherwise, we cannot + * know for certain. + */ +static inline bool cpu_vmx_maybe_enabled(CPUX86State *env) +{ + return cpu_has_vmx(env) && + ((env->cr[4] & CR4_VMXE_MASK) || (env->hflags & HF_SMM_MASK)); +} + /* fpu_helper.c */ void update_fp_status(CPUX86State *env); void update_mxcsr_status(CPUX86State *env); diff --git a/target/i386/kvm.c b/target/i386/kvm.c index ec7870c..4542f0f 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -128,6 +128,11 @@ bool kvm_has_adjust_clock_stable(void) return (ret =3D=3D KVM_CLOCK_TSC_STABLE); } =20 +bool kvm_has_exception_payload(void) +{ + return has_exception_payload; +} + bool kvm_allows_irq0_override(void) { return !kvm_irqchip_in_kernel() || kvm_has_gsi_routing(); @@ -1342,7 +1347,6 @@ static int hyperv_init_vcpu(X86CPU *cpu) } =20 static Error *invtsc_mig_blocker; -static Error *nested_virt_mig_blocker; =20 #define KVM_MAX_CPUID_ENTRIES 100 =20 @@ -1653,22 +1657,6 @@ int kvm_arch_init_vcpu(CPUState *cs) !!(c->ecx & CPUID_EXT_SMX); } =20 - if (cpu_has_vmx(env) && !nested_virt_mig_blocker && - ((kvm_max_nested_state_length() <=3D 0) || !has_exception_payload)= ) { - error_setg(&nested_virt_mig_blocker, - "Kernel do not provide required capabilities for " - "nested virtualization migration. " - "(CAP_NESTED_STATE=3D%d, CAP_EXCEPTION_PAYLOAD=3D%d)", - kvm_max_nested_state_length() > 0, - has_exception_payload); - r =3D migrate_add_blocker(nested_virt_mig_blocker, &local_err); - if (local_err) { - error_report_err(local_err); - error_free(nested_virt_mig_blocker); - return r; - } - } - if (env->mcg_cap & MCG_LMCE_P) { has_msr_mcg_ext_ctl =3D has_msr_feature_control =3D true; } @@ -1683,7 +1671,7 @@ int kvm_arch_init_vcpu(CPUState *cs) if (local_err) { error_report_err(local_err); error_free(invtsc_mig_blocker); - goto fail2; + return r; } } } @@ -1752,8 +1740,6 @@ int kvm_arch_init_vcpu(CPUState *cs) =20 fail: migrate_del_blocker(invtsc_mig_blocker); - fail2: - migrate_del_blocker(nested_virt_mig_blocker); =20 return r; } diff --git a/target/i386/kvm_i386.h b/target/i386/kvm_i386.h index 3057ba4..06fe06b 100644 --- a/target/i386/kvm_i386.h +++ b/target/i386/kvm_i386.h @@ -35,6 +35,7 @@ bool kvm_allows_irq0_override(void); bool kvm_has_smm(void); bool kvm_has_adjust_clock_stable(void); +bool kvm_has_exception_payload(void); void kvm_synchronize_all_tsc(void); void kvm_arch_reset_vcpu(X86CPU *cs); void kvm_arch_do_init_vcpu(X86CPU *cs); diff --git a/target/i386/machine.c b/target/i386/machine.c index 704ba6d..ac2d1d1 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -7,6 +7,7 @@ #include "hw/isa/isa.h" #include "migration/cpu.h" #include "hyperv.h" +#include "kvm_i386.h" =20 #include "sysemu/kvm.h" #include "sysemu/tcg.h" @@ -232,10 +233,25 @@ static int cpu_pre_save(void *opaque) } =20 #ifdef CONFIG_KVM - /* Verify we have nested virtualization state from kernel if required = */ - if (kvm_enabled() && cpu_has_vmx(env) && !env->nested_state) { - error_report("Guest enabled nested virtualization but kernel " - "does not support saving of nested state"); + /* + * In case vCPU may have enabled VMX, we need to make sure kernel have + * required capabilities in order to perform migration correctly: + * + * 1) We must be able to extract vCPU nested-state from KVM. + * + * 2) In case vCPU is running in guest-mode and it has a pending excep= tion, + * we must be able to determine if it's in a pending or injected state. + * Note that in case KVM don't have required capability to do so, + * a pending/injected exception will always appear as an + * injected exception. + */ + if (kvm_enabled() && cpu_vmx_maybe_enabled(env) && + (!env->nested_state || + (!kvm_has_exception_payload() && (env->hflags & HF_GUEST_MASK) && + env->exception_injected))) { + error_report("Guest maybe enabled nested virtualization but kernel= " + "does not support required capabilities to save vCPU " + "nested state"); return -EINVAL; } #endif --=20 1.8.3.1 From nobody Tue Nov 11 12:50:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563636008; cv=none; d=zoho.com; s=zohoarc; b=LS2+FU7M0G9LDfjNlleKyYj9ZXFV8rODbnm+v3UGi5A7f0U1WB92Nfd6zJUJLiR3QTuij21I6IvPKOPcLShEa/AOpWqw8slIetOW3V9cjcdPFvtKdj/BoXQE7ystiqK9XUYAQ+y4dplK2YLuOf3UPgzK7L6dneorVUpl0GjL0Z8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563636008; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Arm9ZHazdpD84Li58k4dV1gofBpEGq70Z3WCUo90whY=; b=fIKgbLF2J4kWjH/StPdelhBkBNzXHmjpC6m2PMt2JHQemlKlYI18f8ROQotgC/FX8MClEGOph7zyUIIg5cQ8oo4AKltGIMzGlDOKta1sXACrjZZ86k+2AWMzEz9Eiwpycq0gWPIAdygdQ+ghlPNjyjvJN+yzWieVGVZ2NQbijWw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563636008604428.5993767584472; Sat, 20 Jul 2019 08:20:08 -0700 (PDT) Received: from localhost ([::1]:51616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor9b-0001nD-1r for importer@patchew.org; Sat, 20 Jul 2019 11:20:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39798) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor8Q-0005n2-IB for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hor8P-00084y-4Z for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:54 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:36376) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hor8O-00084W-UP for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:53 -0400 Received: by mail-wm1-x329.google.com with SMTP id g67so27401685wme.1 for ; Sat, 20 Jul 2019 08:18:52 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:8501:6b03:f18c:74f8]) by smtp.gmail.com with ESMTPSA id 4sm77517291wro.78.2019.07.20.08.18.50 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 08:18:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Arm9ZHazdpD84Li58k4dV1gofBpEGq70Z3WCUo90whY=; b=b3uMLfT5BbE9Ky2kA4f993N5IyqstzcRm5aTa3ilU2F0anVRGJCbKxRYTWa9VtXq1z Kw8/acwP2O5mFWyuc16F1T3IEVgQ3H48ViJe/sb91xg+Wtz3yo+Ln00gAw/UTsS4zUOS d7XWEbM/+PYq8rdin3UCkjgxSKbQh0Elc/gM9SVDX9cXxPZMztAq6VFRDilvg/lbYFyL P7LtHXA7AUprXBP/Be8JnnMjnUzPBhePgZnwBEe1/Ywy/iGyQAw2m4XjnkPQXIcmcxSX ElkaE8RuI/BlGonIQlpuvlRIrYXm5D6MHfBw7OqioYxDtmjInP7ctHCO5bPA/8DbEwfO CBvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Arm9ZHazdpD84Li58k4dV1gofBpEGq70Z3WCUo90whY=; b=n39b5ze9I8+ygdXB2p6urJWFdTT/VHhO/zQPGB+TE6aUwcFfL+cKvMnT4QTuLVSB8x cwQa8wrRysm5WZoalyBDw2XQ1QZJVfJqQWxodbzY74Udx0vxu9UzoNW1C2OTKwz/CK54 V5DDuqdJ3RYO2RlFvF/BS2AHzqo+hVp7StM306QYsIiP7qTXKKKF+MgM9LJlBUrW3ZwS daTMdvSo5H2s9ar+rD53/tRr3XuNb2UHRjW2USeDiDcZcT5vZxXStJBpCYSaVurG/HcP 0hpjT5qDDuDRCqCloWBoZIHjB/KNswRit/cCPr8OXChoTAvj1x6k76LedFwRnuofiAPF HUVA== X-Gm-Message-State: APjAAAU4OR71fasDX4PQTnfTG/i4mt3WwvbWNj8uxtJk3P1wlPL0+WFJ IPOuFlLkoHI1RbO1kI3+excAanq4oSA= X-Google-Smtp-Source: APXvYqyLEuoTihZrzSCOGFXsIdar8OD2sXowEbZ1dQqj/Fs7FC65BmRrmq1MBGWkuh1+1BSRawe9yg== X-Received: by 2002:a1c:3:: with SMTP id 3mr54334214wma.6.1563635931703; Sat, 20 Jul 2019 08:18:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 20 Jul 2019 17:18:36 +0200 Message-Id: <20190720151846.7450-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190720151846.7450-1-pbonzini@redhat.com> References: <20190720151846.7450-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::329 Subject: [Qemu-devel] [PULL 02/12] target/i386: skip KVM_GET/SET_NESTED_STATE if VMX disabled, or for SVM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Do not allocate env->nested_state unless we later need to migrate the nested virtualization state. With this change, nested_state_needed() will return false if the VMX flag is not included in the virtual machine. KVM_GET/SET_NESTED_STATE is also disabled for SVM which is safer (we know that at least the NPT root and paging mode have to be saved/loaded), and thus the corresponding subsection can go away as well. Inspired by a patch from Liran Alon. Signed-off-by: Paolo Bonzini --- target/i386/kvm.c | 16 ++++++++-------- target/i386/machine.c | 21 +-------------------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 4542f0f..ada89d2 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -1711,15 +1711,15 @@ int kvm_arch_init_vcpu(CPUState *cs) max_nested_state_len =3D kvm_max_nested_state_length(); if (max_nested_state_len > 0) { assert(max_nested_state_len >=3D offsetof(struct kvm_nested_state,= data)); - env->nested_state =3D g_malloc0(max_nested_state_len); =20 - env->nested_state->size =3D max_nested_state_len; - - if (IS_INTEL_CPU(env)) { - struct kvm_vmx_nested_state_hdr *vmx_hdr =3D - &env->nested_state->hdr.vmx; + if (cpu_has_vmx(env)) { + struct kvm_vmx_nested_state_hdr *vmx_hdr; =20 + env->nested_state =3D g_malloc0(max_nested_state_len); + env->nested_state->size =3D max_nested_state_len; env->nested_state->format =3D KVM_STATE_NESTED_FORMAT_VMX; + + vmx_hdr =3D &env->nested_state->hdr.vmx; vmx_hdr->vmxon_pa =3D -1ull; vmx_hdr->vmcs12_pa =3D -1ull; } @@ -3515,7 +3515,7 @@ static int kvm_put_nested_state(X86CPU *cpu) CPUX86State *env =3D &cpu->env; int max_nested_state_len =3D kvm_max_nested_state_length(); =20 - if (max_nested_state_len <=3D 0) { + if (!env->nested_state) { return 0; } =20 @@ -3529,7 +3529,7 @@ static int kvm_get_nested_state(X86CPU *cpu) int max_nested_state_len =3D kvm_max_nested_state_length(); int ret; =20 - if (max_nested_state_len <=3D 0) { + if (!env->nested_state) { return 0; } =20 diff --git a/target/i386/machine.c b/target/i386/machine.c index ac2d1d1..b114609 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -1035,31 +1035,13 @@ static const VMStateDescription vmstate_vmx_nested_= state =3D { } }; =20 -static bool svm_nested_state_needed(void *opaque) -{ - struct kvm_nested_state *nested_state =3D opaque; - - return (nested_state->format =3D=3D KVM_STATE_NESTED_FORMAT_SVM); -} - -static const VMStateDescription vmstate_svm_nested_state =3D { - .name =3D "cpu/kvm_nested_state/svm", - .version_id =3D 1, - .minimum_version_id =3D 1, - .needed =3D svm_nested_state_needed, - .fields =3D (VMStateField[]) { - VMSTATE_END_OF_LIST() - } -}; - static bool nested_state_needed(void *opaque) { X86CPU *cpu =3D opaque; CPUX86State *env =3D &cpu->env; =20 return (env->nested_state && - (vmx_nested_state_needed(env->nested_state) || - svm_nested_state_needed(env->nested_state))); + vmx_nested_state_needed(env->nested_state)); } =20 static int nested_state_post_load(void *opaque, int version_id) @@ -1121,7 +1103,6 @@ static const VMStateDescription vmstate_kvm_nested_st= ate =3D { }, .subsections =3D (const VMStateDescription*[]) { &vmstate_vmx_nested_state, - &vmstate_svm_nested_state, NULL } }; --=20 1.8.3.1 From nobody Tue Nov 11 12:50:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563635970; cv=none; d=zoho.com; s=zohoarc; b=Ve+1YTkEFgz5OwGGOfvCSE2ex7f4hfWui1mbc4JUYCxHo58cRqPrdtWojL+OBcDMcDfCKTbnMm3e+LXJ3Dn5KBOx8sScPtGPd6JPLIspv3Lqx5S26ZAQeZzHDHAECJGnDAoYSljSdxlIOx5dHX2MxxkuR/JgbaBz1Wd3t6PzZxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563635970; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=SQLl5pe9XLgrjyvZkhfrZn2lNfT/vPI403Fp6t7gA2M=; b=e3uj9MSa2YmYQfod6bbM+gE8Ds5Zdi1r2En++cqi9tq3Bi/gxpb9ffq8q2G+0160oFmnxvH18b9hidzls4F7NUM4PJ58/86vkicC+S3MUowZveZn93cTKrgkkYybp91NdqlmcgG66Ac5nTdGIcGHIYAnAUjXRhVS1c7wxAB4L00= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563635970208529.114010568924; Sat, 20 Jul 2019 08:19:30 -0700 (PDT) Received: from localhost ([::1]:51596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor8y-0007Vt-8s for importer@patchew.org; Sat, 20 Jul 2019 11:19:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39817) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor8R-0005oH-9D for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hor8Q-00085d-42 for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:55 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:41364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hor8P-000858-U0 for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:54 -0400 Received: by mail-wr1-x42b.google.com with SMTP id c2so31816173wrm.8 for ; Sat, 20 Jul 2019 08:18:53 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:8501:6b03:f18c:74f8]) by smtp.gmail.com with ESMTPSA id 4sm77517291wro.78.2019.07.20.08.18.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 08:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SQLl5pe9XLgrjyvZkhfrZn2lNfT/vPI403Fp6t7gA2M=; b=joaipStDf5rp95HabufaQ3UIZCkLx+jsndLAci9cYg1T3aclvb/VXFpX/bqfZNTuNk n6ORjfUhM8wf46HuLBiGfab6E2esukD4zzK9g28pUHX8H7VaTPl7mBE2eS9ZS6ytRNAt H9iGHw2A4KLAgWywAXW7tu0BIFy/g+C+Y0fw4Cv5sys25Q9edx6/EMMH8C5/v+47exHf UoBQvDAtFjHpIDxYmWhLl2a3LIYaWivoPqMBMpJlu0GVHGq5cx5Z+kEf/mkQGLfsIhZD nVyQzNjoBEgFhHzzI85RxGb099oO7CdvXzJfjCqoRurK58Pd+E+naoCFpb26taoNOkuU 18FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=SQLl5pe9XLgrjyvZkhfrZn2lNfT/vPI403Fp6t7gA2M=; b=X2dBiAODLRgNVK0RUAca1XcdXnoNMm+sDF/ncSABX+JBD2c2ByCp1qoU1p5KEwwrVn btjcSGVSM6cXvZxt+c/6jg6dvdFIpqjehVVZJRJuqLjKT4J3M3PZ7olGh+jzypy2CWjc 02HxHMiuAmdDgH43JtbPdLRhiDJRThcO4RWbE1CEsOSi0997QRALsioVQ/9eCgJ8gOvU aUb98wruxYmKq3xhV72/xm2/pu9tQHgNTSRPscgmKHE6Tbm1ZsgdlXVCdp+a7GE5fxCr yhVSDpMWzUWCYwGfe5vLjMbawwUIdsXp/6Tek2nguodRghnvSO3/0s2BTKY3TRezzhLO ZRvw== X-Gm-Message-State: APjAAAWDhbYnx4FfeKsu2SFaiYlKJy/8CU4JXJT+R08ryTQ2wmPd1vB9 IxqeyoLXa7aGwTxyFC9tAAR070ONvZQ= X-Google-Smtp-Source: APXvYqwEahsoqXZFULB70OGYgD877L3lTAVmB6k+zGbC4AVyWEzGUSZ60Hd2+JSjzcT3ieh5zeyKnQ== X-Received: by 2002:adf:ef8d:: with SMTP id d13mr60874914wro.60.1563635932596; Sat, 20 Jul 2019 08:18:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 20 Jul 2019 17:18:37 +0200 Message-Id: <20190720151846.7450-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190720151846.7450-1-pbonzini@redhat.com> References: <20190720151846.7450-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42b Subject: [Qemu-devel] [PULL 03/12] virtio-scsi: remove unused argument to virtio_scsi_common_realize X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The argument is not used and passing it clutters error propagation in the callers. So, get rid of it. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- hw/scsi/vhost-scsi.c | 2 +- hw/scsi/vhost-user-scsi.c | 2 +- hw/scsi/virtio-scsi.c | 4 ++-- include/hw/virtio/virtio-scsi.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 4090f99..76bb875 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -262,7 +262,7 @@ static void vhost_scsi_unrealize(DeviceState *dev, Erro= r **errp) vhost_dev_cleanup(&vsc->dev); g_free(vqs); =20 - virtio_scsi_common_unrealize(dev, errp); + virtio_scsi_common_unrealize(dev); } =20 static Property vhost_scsi_properties[] =3D { diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c index a9fd8ea..a0b69fb 100644 --- a/hw/scsi/vhost-user-scsi.c +++ b/hw/scsi/vhost-user-scsi.c @@ -125,7 +125,7 @@ static void vhost_user_scsi_unrealize(DeviceState *dev,= Error **errp) vhost_dev_cleanup(&vsc->dev); g_free(vqs); =20 - virtio_scsi_common_unrealize(dev, errp); + virtio_scsi_common_unrealize(dev); vhost_user_cleanup(&s->vhost_user); } =20 diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 61ce365..d0bdbff 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -922,7 +922,7 @@ static void virtio_scsi_device_realize(DeviceState *dev= , Error **errp) virtio_scsi_dataplane_setup(s, errp); } =20 -void virtio_scsi_common_unrealize(DeviceState *dev, Error **errp) +void virtio_scsi_common_unrealize(DeviceState *dev) { VirtIODevice *vdev =3D VIRTIO_DEVICE(dev); VirtIOSCSICommon *vs =3D VIRTIO_SCSI_COMMON(dev); @@ -936,7 +936,7 @@ static void virtio_scsi_device_unrealize(DeviceState *d= ev, Error **errp) VirtIOSCSI *s =3D VIRTIO_SCSI(dev); =20 qbus_set_hotplug_handler(BUS(&s->bus), NULL, &error_abort); - virtio_scsi_common_unrealize(dev, errp); + virtio_scsi_common_unrealize(dev); } =20 static Property virtio_scsi_properties[] =3D { diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scs= i.h index 4c0bcdb..122f7c4 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -145,7 +145,7 @@ void virtio_scsi_common_realize(DeviceState *dev, VirtIOHandleOutput cmd, Error **errp); =20 -void virtio_scsi_common_unrealize(DeviceState *dev, Error **errp); +void virtio_scsi_common_unrealize(DeviceState *dev); bool virtio_scsi_handle_event_vq(VirtIOSCSI *s, VirtQueue *vq); bool virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq); bool virtio_scsi_handle_ctrl_vq(VirtIOSCSI *s, VirtQueue *vq); --=20 1.8.3.1 From nobody Tue Nov 11 12:50:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563636052; cv=none; d=zoho.com; s=zohoarc; b=djRciZJR9R1kaPj4qcTTTvU3zyQ/59/mcLn2sIj/lCQHF/Ar2cLX+J9EHox075ldQmLk2+Wq3Z5VPVfcXPc822bBn+zJps6sp2dLxPxxA5Tyf0Bb55xoemhB6+cvyn5YYoIanlLx1v4o0CuvG+onCCqDHPNubar3UGZVNSryOrU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563636052; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Cnx1rgP4vCPMdBzxOJnmvGYzuuFVyS3iImpvp8s2dHs=; b=ATBEp4z1gHP116FBt53DPqYmPtHM8KxRRUWTXZW1FV+V1o73iZn5a9aT8O1D9gH7p1IzBcOfTpX5FUijMTIGH8qyHi3zbZF7bItXy96QEBOad5YS1KUwQYsWYcYrKHE761gUMg9uejAXsZk+rS1jIjB0cWAlH8rgGvTWpo9B07c= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563636052739823.9978967499575; Sat, 20 Jul 2019 08:20:52 -0700 (PDT) Received: from localhost ([::1]:51644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1horAJ-0005DV-3W for importer@patchew.org; Sat, 20 Jul 2019 11:20:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39833) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor8R-0005rg-Uc for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hor8R-00086T-12 for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:55 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:39314) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hor8Q-00085h-RF for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:54 -0400 Received: by mail-wm1-x32e.google.com with SMTP id u25so21150873wmc.4 for ; Sat, 20 Jul 2019 08:18:54 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:8501:6b03:f18c:74f8]) by smtp.gmail.com with ESMTPSA id 4sm77517291wro.78.2019.07.20.08.18.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 08:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Cnx1rgP4vCPMdBzxOJnmvGYzuuFVyS3iImpvp8s2dHs=; b=rvUDObsAW+sIc0IuEYdvyWt5rcPzKGlCc7pv0Hky6ZWUIxx1+INH/4strtkendaZPk jPcwuFoPVBGMUGkhK/F6hV7+DJGoiXtazpU8ICbWzV8q46VlaCvD0pvrllQ4cfpvDHXJ 6fFVsMdZvx0k9PuP2sBfD038ZYJ2XjObIEz6E/Lw625SgNLr+9xQ9i8Z/gfL/ioztzsN 5wWm9xrHkVLWwQT3rJYVsXlMrdfulHSFnT4++WqBAz4vDY/HJMQ5+bEtZLdeLC6nVIsO 0PBqTal79T9G/MdU15BbJjgRHozc9lQNTZTUo8P1Qx3AbhbjjREBJMUNxHEmBJRemO9M NXsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Cnx1rgP4vCPMdBzxOJnmvGYzuuFVyS3iImpvp8s2dHs=; b=VDepK2F9MS9Bf+cUPvkmxN92w+CrsoMGt4sHAbAZGXoF3II8/jJcHWNL0O/TDQ0RYV dPt8z7xpDKR/eRrigmH4yVEfZxelWVI1efsKL03/N1ASG0R/LFifnmkAS71NzvdP9Rvj eZ2hgrOCPdv5cYPMwNQjAhV/2gH+S6FcQwLiS6inCH9Kq8zOC8+UqIj4cfoUYDIucFuh ZJnnkETGBwpJE5oPYPyRrcRNcZYG7R6HLb14HzjIPSnrAaf30CAEXQVg10PtflcpMA8t 4gGEBeO/a8i/e/FybIY8/Dh5RohozUDYehHYcS/YKaE9Q89FpdtT7QroXtoFBfT+WUUH s1zQ== X-Gm-Message-State: APjAAAXOS6vFv0OHsDsDM12jSJ216pmLDYx8lZIrWfYWtZSCTFWgQCaB iRBXPOzhY2uFkH29lP9R5NxmO95XOno= X-Google-Smtp-Source: APXvYqycAWAn+LX1DKOCIGLO0wHaJO3PfY8NQy5ODe34D6+dF1yqrREXUwu6yO3E2IQLi0jSB6DdKQ== X-Received: by 2002:a1c:7e90:: with SMTP id z138mr51983855wmc.128.1563635933613; Sat, 20 Jul 2019 08:18:53 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 20 Jul 2019 17:18:38 +0200 Message-Id: <20190720151846.7450-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190720151846.7450-1-pbonzini@redhat.com> References: <20190720151846.7450-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e Subject: [Qemu-devel] [PULL 04/12] vhost-scsi: Call virtio_scsi_common_unrealize() when device realize failed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xie Yongji Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Xie Yongji This avoids memory leak when device hotplug is failed. Signed-off-by: Xie Yongji Message-Id: <20190717004606.12444-1-xieyongji@baidu.com> Signed-off-by: Paolo Bonzini --- hw/scsi/vhost-scsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 76bb875..343ca8b 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -210,7 +210,7 @@ static void vhost_scsi_realize(DeviceState *dev, Error = **errp) if (err) { error_propagate(errp, err); error_free(vsc->migration_blocker); - goto close_fd; + goto free_virtio; } } =20 @@ -240,6 +240,8 @@ static void vhost_scsi_realize(DeviceState *dev, Error = **errp) migrate_del_blocker(vsc->migration_blocker); } g_free(vsc->dev.vqs); + free_virtio: + virtio_scsi_common_unrealize(dev); close_fd: close(vhostfd); return; --=20 1.8.3.1 From nobody Tue Nov 11 12:50:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563636020; cv=none; d=zoho.com; s=zohoarc; b=Uv4zY0ljvaQrdL/QykVn0spcWXYflsSuRadvc+23vVegtqdmTq5lJZX/gCJkWboxa86ZWNrD7+NfVnqp8bkY1Cvl32M+HcrOEjgRrWqzhpQbDY2na6jnfMaLX1BF8bPUfzbNRLO9nTN45XMHnJriTrYy5cmNOQ/+/WwyepyRGcI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563636020; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=gEyNtMZO6zjfyzbu3zzmhWKRQ42+siiVg/LlDUHOq+c=; b=g9LNLSzdFfGErsDg1jvDeXZ8217z8ti5C5SY7K7z9qdAqigsdaEEZgNDoo9Kk/uei+bzy6yBMgQlUQAajT1sJIqHFQf+o0eDbLtxVgJroP1tZirz964UlJrJpcGkZltKVo0DpWoOcEmnUFpWsYGRePSJ9knRLasW5DVMT1YlueI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563636020748714.6916456482272; Sat, 20 Jul 2019 08:20:20 -0700 (PDT) Received: from localhost ([::1]:51620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor9j-0002SU-Qa for importer@patchew.org; Sat, 20 Jul 2019 11:20:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39847) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor8S-0005wR-Vu for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hor8R-00087S-SP for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:56 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:42934) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hor8R-00086d-Lh for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:55 -0400 Received: by mail-wr1-x431.google.com with SMTP id x1so20022821wrr.9 for ; Sat, 20 Jul 2019 08:18:55 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:8501:6b03:f18c:74f8]) by smtp.gmail.com with ESMTPSA id 4sm77517291wro.78.2019.07.20.08.18.53 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 08:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gEyNtMZO6zjfyzbu3zzmhWKRQ42+siiVg/LlDUHOq+c=; b=j+mvkvVCSTi0ypnxPSjFFSFtm5hSzfk7JxmV91Q9Dk77VcLQuL6ULdGpyDQdCJWbTQ LQLDAJMafu0QbAcmWdUwLkma3fmGPVrRTg5NMoDh8cl5+83TLfxaw7WSG/HoJhAUKWM4 vu71CwwvbgJiDAINDRsrPfhZ2VK/OwTez+wGON3E3WyDQ7ZiVU9PaidjmtcjYhZwLh4V d4G4ccsSG5eN0MplgHgIefjzIEn5lrhSmcDyk2Cj1NVplghxNdqRdkErdT2/Sd66L5DZ pU5EYwccDbfqle7OY1KU9hziZiwKERLd476QiSqi1U04FQvUnxLERYj8bmagR4KC8G4R 30iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=gEyNtMZO6zjfyzbu3zzmhWKRQ42+siiVg/LlDUHOq+c=; b=l4TqYU8A9C6t2EJSHVR+m7Bo6P4wdWKSWDm/Qa48VuT1+nXUMIvpZM9bFAQ2VHtGRS WA1vzfD7HIyVod0sBqboBdlnc0VN/bQnEpeOdREzRztidW04WYHJVJGU4PncORebmHvd 4RI2V0X2fA0YZ5UN98bY7eY4GE5c293ct+Bj4EZudcnP8Hr2/jtQNrhqQlpbk9dAP344 3tRjhUdQk6G/ImMLquptSyulZb/FtBZ7Tfq5qre47xlLc6S0b/xDRZgd3hA3azd8s9PY z6VkLljqiACVzMAmeXQ4KJwMF/xhCUomGfP9Ma/4CcpuHZl55uj4dni0bAoERZbth4cd 93nQ== X-Gm-Message-State: APjAAAWRjf3rKKOxepgiY4JtzbCy1EJQ3gG44/Jc2CfR/MUIGAh4J5fi PhBmxiNV5WmKn3rlAi4wYKZeOLP+hzw= X-Google-Smtp-Source: APXvYqzqY/Uk/1g0Q98sK4OuEgomBt5kEe/JS9CtMdDYUI/esmTanpqv/kYCNSdrhsqADNt+02j9bA== X-Received: by 2002:adf:aac8:: with SMTP id i8mr18862560wrc.56.1563635934464; Sat, 20 Jul 2019 08:18:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 20 Jul 2019 17:18:39 +0200 Message-Id: <20190720151846.7450-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190720151846.7450-1-pbonzini@redhat.com> References: <20190720151846.7450-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::431 Subject: [Qemu-devel] [PULL 05/12] vhost-user-scsi: Call virtio_scsi_common_unrealize() when device realize failed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xie Yongji Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Xie Yongji This avoids memory leak when device hotplug is failed. Signed-off-by: Xie Yongji Message-Id: <20190717004606.12444-2-xieyongji@baidu.com> Signed-off-by: Paolo Bonzini --- hw/scsi/vhost-user-scsi.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c index a0b69fb..fcee67d 100644 --- a/hw/scsi/vhost-user-scsi.c +++ b/hw/scsi/vhost-user-scsi.c @@ -87,7 +87,7 @@ static void vhost_user_scsi_realize(DeviceState *dev, Err= or **errp) } =20 if (!vhost_user_init(&s->vhost_user, &vs->conf.chardev, errp)) { - return; + goto free_virtio; } =20 vsc->dev.nvqs =3D 2 + vs->conf.num_queues; @@ -101,15 +101,21 @@ static void vhost_user_scsi_realize(DeviceState *dev,= Error **errp) if (ret < 0) { error_setg(errp, "vhost-user-scsi: vhost initialization failed: %s= ", strerror(-ret)); - vhost_user_cleanup(&s->vhost_user); - g_free(vqs); - return; + goto free_vhost; } =20 /* Channel and lun both are 0 for bootable vhost-user-scsi disk */ vsc->channel =3D 0; vsc->lun =3D 0; vsc->target =3D vs->conf.boot_tpgt; + + return; + +free_vhost: + vhost_user_cleanup(&s->vhost_user); + g_free(vqs); +free_virtio: + virtio_scsi_common_unrealize(dev); } =20 static void vhost_user_scsi_unrealize(DeviceState *dev, Error **errp) --=20 1.8.3.1 From nobody Tue Nov 11 12:50:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563635977; cv=none; d=zoho.com; s=zohoarc; b=a1KI0qAKwmtfaETQ81sTcmGC9QjOj9zh6axjWQ5zUKxpDd5WqVN5Lvt2I0UvyPyLgidlP9lL7RhPAisLTxKgctBN/QMA2zhseEGsn47GP9Gy/HVGUsduODewLZ8fVv5yPb+ePSInVIu6F32PWfSCeJC10WmnThVifgjjWg4zEbo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563635977; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=gj1dzVnsDBAhFX864QFCDoNoirTM3GNCZ/rXgc7TqQ8=; b=iBVr34dBXcP2k2S9vFGwXH25u9fWFmWJPoqcXXpNW75N+YVi36VARyhERz5PClLX8mEokPlMhEeb3B773FD4DXricQKjuaksp9HEDlB3MgAxEKUfavZffd5ffpB9+eG1i8cUDX6izhoTCrAUi4tKTfId9hKYjidee+Sl+QfUnEc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563635977786462.7803058104819; Sat, 20 Jul 2019 08:19:37 -0700 (PDT) Received: from localhost ([::1]:51598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor96-0007z9-8U for importer@patchew.org; Sat, 20 Jul 2019 11:19:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39858) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor8U-00061I-1X for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hor8S-00088H-SM for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:57 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:38907) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hor8S-00087f-LY for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:56 -0400 Received: by mail-wm1-x341.google.com with SMTP id s15so10148286wmj.3 for ; Sat, 20 Jul 2019 08:18:56 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:8501:6b03:f18c:74f8]) by smtp.gmail.com with ESMTPSA id 4sm77517291wro.78.2019.07.20.08.18.54 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 08:18:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gj1dzVnsDBAhFX864QFCDoNoirTM3GNCZ/rXgc7TqQ8=; b=BRWkQsYh5UjdBwmJmtyzBJuul/vu9LtLCtYntBXNp3blYAyact2pYhqP1i5tCO9fgq E9dneQTEZO7ew4SHJ1ubL6X76OHGzvs9/pF9qoD2wXr22UUHIb0DKKQc/50Zueuw5D93 8LcJ1eN5RLyIP1QbNGbvizIaMKxP7IzCzTe/ZgFXwd7a+QkKS4AdG3guD1pO3rFOinrk qFt07XmXpW6i8e5SYo3rw4bqafghgymf6hfZVrt8eRd5h9WtlYwiYy0e/sOUa01tzSqs zOx82vsyCEJG0YJGKxSQxN6mYfmH/yH0S7WhYG0bQBKeVb7aUvXmQredu0QVdUktQGRW XWgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=gj1dzVnsDBAhFX864QFCDoNoirTM3GNCZ/rXgc7TqQ8=; b=qnY1mSzRK/R+YS9VhVw+Ao+PUwoVbwmru67ERlsMam8oCzFJR5Acet4VKp6FZcZCZB mWMqdwnmBhDvLE//kXaGzc52SYuMlq/Fkku9dJj7KbFm+bIk1Nt4oVLlIwo8a6SUdk/0 mda+LD9zssO3O60zyI9OEvx3YkkS01LQxsqIFRftei7Knn4//ajrTSJA2BCVhuTcSclv GKhYLdIrJMjHMLLMTjFrxnb0olZGiKm82eD/ttA3+oIOk0FC0+ag2zF3tTphUZKzt0BT BEgdjQVfDwIm2igCtoChdRc2jAh9EjxlO1UaUeGYIFsjTPRDZzRtNaVNsrYJq49nOvTD S7Gg== X-Gm-Message-State: APjAAAW/M6DwiyJg+u+W/v7s4Pu1xI++QA/IR65soJqZCd6r67S7jqsK MG7PW4bJDsuyHFsC9vWwmfBpf2HFv48= X-Google-Smtp-Source: APXvYqxb1/nRGycAEQnyHsE2l4l+SfshJdkzW2stlOm5vCZKaaqV4N+uE4ykL6tIDAa13Efdrmix1w== X-Received: by 2002:a1c:5f09:: with SMTP id t9mr56460259wmb.112.1563635935411; Sat, 20 Jul 2019 08:18:55 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 20 Jul 2019 17:18:40 +0200 Message-Id: <20190720151846.7450-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190720151846.7450-1-pbonzini@redhat.com> References: <20190720151846.7450-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 Subject: [Qemu-devel] [PULL 06/12] scsi-generic: Check sense key before request snooping and patching X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Shin'ichiro Kawasaki Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Shin'ichiro Kawasaki When READ CAPACITY command completes, scsi_read_complete() function snoops the command result and updates SCSIDevice members blocksize and max_lba . However, this update is executed even when READ CAPACITY command indicates an error in sense data. This causes unexpected blocksize update with zero value for SCSI devices without READ CAPACITY(10) command support and eventually results in a divide by zero. An emulated device by TCMU-runner is an example of a device that doesn't support READ CAPACITY(10) command. To avoid the unexpected update, add sense key check in scsi_read_complete() function. The function already checks the sense key for VPD Block Limits emulation. Do the scsi_parse_sense_buf() call for all requests rather than just for VPD Block Limits emulation, so that blocksize and max_lba are only updated if READ CAPACITY returns zero sense key. Signed-off-by: Shin'ichiro Kawasaki [Extend the check to all requests, not just READ CAPACITY] Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-generic.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c index f07891b..c11a0c9 100644 --- a/hw/scsi/scsi-generic.c +++ b/hw/scsi/scsi-generic.c @@ -254,24 +254,28 @@ static void scsi_read_complete(void * opaque, int ret) =20 r->len =3D -1; =20 - /* - * Check if this is a VPD Block Limits request that - * resulted in sense error but would need emulation. - * In this case, emulate a valid VPD response. - */ - if (s->needs_vpd_bl_emulation && ret =3D=3D 0 && - (r->io_header.driver_status & SG_ERR_DRIVER_SENSE) && - r->req.cmd.buf[0] =3D=3D INQUIRY && - (r->req.cmd.buf[1] & 0x01) && - r->req.cmd.buf[2] =3D=3D 0xb0) { + if (r->io_header.driver_status & SG_ERR_DRIVER_SENSE) { SCSISense sense =3D scsi_parse_sense_buf(r->req.sense, r->io_header.sb_len_wr); - if (sense.key =3D=3D ILLEGAL_REQUEST) { + + /* + * Check if this is a VPD Block Limits request that + * resulted in sense error but would need emulation. + * In this case, emulate a valid VPD response. + */ + if (sense.key =3D=3D ILLEGAL_REQUEST && + s->needs_vpd_bl_emulation && + r->req.cmd.buf[0] =3D=3D INQUIRY && + (r->req.cmd.buf[1] & 0x01) && + r->req.cmd.buf[2] =3D=3D 0xb0) { len =3D scsi_generic_emulate_block_limits(r, s); /* - * No need to let scsi_read_complete go on and handle an + * It's okay to jup to req_complete: no need to + * let scsi_handle_inquiry_reply handle an * INQUIRY VPD BL request we created manually. */ + } + if (sense.key) { goto req_complete; } } --=20 1.8.3.1 From nobody Tue Nov 11 12:50:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563636084; cv=none; d=zoho.com; s=zohoarc; b=FACgMtsDLYga7FkZZf3VAIkH+Cy80MQmixUbOS8X0AC4t6UvWEKYAsfmmAi03y4GEOOwmLSnIJryZVHg7o42KqLECblJ6Zj0C3s5uydXMzSTIR9oPaBOh0AYGAUhAWbnRCCHBFIE9E/zX+fzknp3QY0o3SnA8PU8vWFrtstWpCo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563636084; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=CvisqMqCgktfbG7D7mGm20gBvrSkT0GKy3tcYKFSGT4=; b=dPjjG+U2Gz4h7xVDxc7XSBk5SNNaxbhY5ijJMsda9KXy+/0jrgtcSlyBkgcYsDFOTBElUDwJfAzL1f3T+SXp9Fu0qeMIvQjwIVQzaxiEEyWiTxBwl0Fzt7+tEhO3QUheYCdbi9nfnbdDVuvIeajQGDHSoUQYV48uX2pNlZPlqIY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156363608409063.80108529969175; Sat, 20 Jul 2019 08:21:24 -0700 (PDT) Received: from localhost ([::1]:51666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1horAo-0007bM-My for importer@patchew.org; Sat, 20 Jul 2019 11:21:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39872) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor8U-00065A-Sh for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hor8T-00088g-LX for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:58 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:33209) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hor8T-00088N-Ey for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:57 -0400 Received: by mail-wm1-x32c.google.com with SMTP id h19so25664324wme.0 for ; Sat, 20 Jul 2019 08:18:57 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:8501:6b03:f18c:74f8]) by smtp.gmail.com with ESMTPSA id 4sm77517291wro.78.2019.07.20.08.18.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 08:18:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CvisqMqCgktfbG7D7mGm20gBvrSkT0GKy3tcYKFSGT4=; b=jJE+zQmrTqMiagwWgm8Djh9E/IlRskjc2TCv4LLSHPHb0rV+g9Hlo0Hq5ma/ilM520 CGXFlSyg7c9gjqVbUIR/4FI1jydzkfqIM1uoJZCuLDVwGiqgMEAMUrC3RajeUDoGdB8s B9Y91eEojg3eQPBohIe8xNSB5psu5FxG1GTHmeAsWYOLyu2yVEDCZkt5KK4uYz1Meutu i4qxRrWis5wAs01ljLRCFYsLlHqs/zqA+vovdQD6BL+ln6iXJH2+x4F7f4sTs0VMz24C T6M3ckADIzDh5LsuRI0fJwBuPPdbFBy37M49krTBPxkCsGIi4oWocI6WXVK7cN7JPXL7 vT2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=CvisqMqCgktfbG7D7mGm20gBvrSkT0GKy3tcYKFSGT4=; b=Xx/zH7cMMWPTwfUZM0AH4BooJmGvGxCUp5/SpnQ1xPhj202OB576cPi088PT8kaszF V9ghVkhw3ThvqRglwZXY+hOqjNEpi9MrcozpIk6bGWR00WjT1nxxYYDriFyZ6OZsQhY9 OE3KBBt/BhQ9NAb2wsuaq9occEHKrbT7xZbJOLlrx81k6eBrnB2U9zCHFnLDko5i5HUG 980gOCY1tRsRQyZFpBZxpx0vw8F/cZrxxralL3mv+rGkxkGsV/6II975wWMT1RMcq332 K+8WFgDChOg3KRQvK2rr8TtgTKrYo5DOaFCIKVfxrAZRiffhO9VGv44HJ+OJfl1ocgFT HZDg== X-Gm-Message-State: APjAAAXNeQ6cReYPQJlRdUWGJkNBWANAZTndEKW7JitNbTuxMPq6Xpp4 1UiPoCHF6kdnt/vQrnQVOwkeiFzpR7M= X-Google-Smtp-Source: APXvYqz2sL8pfratX9X1MZN5NaAwN6k+T9Y25BYTWkgz30OZR0aO7GuSHXSDlzAAPVVMApPaLkIsGQ== X-Received: by 2002:a1c:d10c:: with SMTP id i12mr53885997wmg.152.1563635936322; Sat, 20 Jul 2019 08:18:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 20 Jul 2019 17:18:41 +0200 Message-Id: <20190720151846.7450-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190720151846.7450-1-pbonzini@redhat.com> References: <20190720151846.7450-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32c Subject: [Qemu-devel] [PULL 07/12] test-bitmap: add test for bitmap_set X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wei Yang , Peter Xu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Wei Yang Add a test for bitmap_set. There are three cases: * Both start and end is BITS_PER_LONG aligned * Only start is BITS_PER_LONG aligned * Only end is BITS_PER_LONG aligned Signed-off-by: Wei Yang Message-Id: <20190718010456.4234-3-richardw.yang@linux.intel.com> Reviewed-by: Peter Xu Signed-off-by: Paolo Bonzini --- tests/test-bitmap.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 55 insertions(+) diff --git a/tests/test-bitmap.c b/tests/test-bitmap.c index cb7c5e4..18aa584 100644 --- a/tests/test-bitmap.c +++ b/tests/test-bitmap.c @@ -59,12 +59,67 @@ static void check_bitmap_copy_with_offset(void) g_free(bmap3); } =20 +typedef void (*bmap_set_func)(unsigned long *map, long i, long len); +static void bitmap_set_case(bmap_set_func set_func) +{ + unsigned long *bmap; + int offset; + + bmap =3D bitmap_new(BMAP_SIZE); + + /* Both Aligned, set bits [BITS_PER_LONG, 3*BITS_PER_LONG] */ + set_func(bmap, BITS_PER_LONG, 2 * BITS_PER_LONG); + g_assert_cmpuint(bmap[1], =3D=3D, -1ul); + g_assert_cmpuint(bmap[2], =3D=3D, -1ul); + g_assert_cmpint(find_first_bit(bmap, BITS_PER_LONG), =3D=3D, BITS_PER_= LONG); + g_assert_cmpint(find_next_zero_bit(bmap, 3 * BITS_PER_LONG, BITS_PER_L= ONG), + =3D=3D, 3 * BITS_PER_LONG); + + for (offset =3D 0; offset <=3D BITS_PER_LONG; offset++) { + bitmap_clear(bmap, 0, BMAP_SIZE); + /* End Aligned, set bits [BITS_PER_LONG - offset, 3*BITS_PER_LONG]= */ + set_func(bmap, BITS_PER_LONG - offset, 2 * BITS_PER_LONG + offset); + g_assert_cmpuint(bmap[1], =3D=3D, -1ul); + g_assert_cmpuint(bmap[2], =3D=3D, -1ul); + g_assert_cmpint(find_first_bit(bmap, BITS_PER_LONG), + =3D=3D, BITS_PER_LONG - offset); + g_assert_cmpint(find_next_zero_bit(bmap, + 3 * BITS_PER_LONG, + BITS_PER_LONG - offset), + =3D=3D, 3 * BITS_PER_LONG); + } + + for (offset =3D 0; offset <=3D BITS_PER_LONG; offset++) { + bitmap_clear(bmap, 0, BMAP_SIZE); + /* Start Aligned, set bits [BITS_PER_LONG, 3*BITS_PER_LONG + offse= t] */ + set_func(bmap, BITS_PER_LONG, 2 * BITS_PER_LONG + offset); + g_assert_cmpuint(bmap[1], =3D=3D, -1ul); + g_assert_cmpuint(bmap[2], =3D=3D, -1ul); + g_assert_cmpint(find_first_bit(bmap, BITS_PER_LONG), + =3D=3D, BITS_PER_LONG); + g_assert_cmpint(find_next_zero_bit(bmap, + 3 * BITS_PER_LONG + offset, + BITS_PER_LONG), + =3D=3D, 3 * BITS_PER_LONG + offset); + } + + g_free(bmap); +} + +static void check_bitmap_set(void) +{ + bitmap_set_case(bitmap_set); + bitmap_set_case(bitmap_set_atomic); +} + int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); =20 g_test_add_func("/bitmap/bitmap_copy_with_offset", check_bitmap_copy_with_offset); + g_test_add_func("/bitmap/bitmap_set", + check_bitmap_set); =20 g_test_run(); =20 --=20 1.8.3.1 From nobody Tue Nov 11 12:50:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563636025; cv=none; d=zoho.com; s=zohoarc; b=NkOWmSenM/78+ih7hmFYQst+aYEF80PEFzXEGSLin5h9rTwbNGXJc+b1OQ3sHxlseknsV5JU6QKKNpgnSod+tjR5iGVXVHwdYRu0FVmt4nvZUf2WKdLJzAlmbcZYK5GeBzbH05lfVsSUpx9f4znf7v2+R4qkHpNKwmKoC4lqsIk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563636025; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=VBJk++nebu5jmHNwt1imGPj0wqleJbW5DLRUX54D6/4=; b=Mo44/jmNUJy6J0KGRADhPFCPsoxkbJ6f8AODWxVjkMX7FE6fje9uQ3gw7UsfurNDCrgW80r1U0apG6TH/V46JtV1WXqF4eUvG8u+Wx5rGPfX66SQ8HaWVTR1NDALv3UltMMxnRNjMsHrJFFNz5ThJ1Hl4fBT7ZgaEO0mgYkSLso= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563636025778770.8245200198705; Sat, 20 Jul 2019 08:20:25 -0700 (PDT) Received: from localhost ([::1]:51627 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor9s-00031E-Ci for importer@patchew.org; Sat, 20 Jul 2019 11:20:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39890) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor8W-0006A6-0h for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:19:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hor8U-00089F-Jf for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:59 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:37447) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hor8U-00088o-Ci for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:58 -0400 Received: by mail-wm1-x333.google.com with SMTP id f17so31488909wme.2 for ; Sat, 20 Jul 2019 08:18:58 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:8501:6b03:f18c:74f8]) by smtp.gmail.com with ESMTPSA id 4sm77517291wro.78.2019.07.20.08.18.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 08:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VBJk++nebu5jmHNwt1imGPj0wqleJbW5DLRUX54D6/4=; b=OgJMV5cvE/QkBaY2XX7+62GD5t7UB7FUCxYP0kWVg9NbinL0+TIBiaE8UVN9eYhUkV 4Ta3Zrz/qXbGIcpUeOrW05dyT7I1F9AHcaml8DMOipAQ/+0dLfzgoFkeu1xglcKqO2cp hAzM9gtF7QCVWUaCtka1xyj6gNZs+oGRmBMZKTio5TK9PhusQuFor/NZ7GKGyVI+hHXC j0vBeVRQkyJL8sqRqHeq8ubMG07r7k7U3oj2uj0SwjMm9zcW4zVBHE3vPTV0KdVTNceM 39r1qrJ/Z4QlZEVellJvAxBj4T6e85G2sXP4P64o6T8h0Pn1IDWNCzVYPiKo9BmvXhkZ Ea9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=VBJk++nebu5jmHNwt1imGPj0wqleJbW5DLRUX54D6/4=; b=LvS8ZOhEuw+QEKS4G+t9w645SKpzivpK5Iiy6lbE6boS/WVT453SGaHsGAgRlCahiM UtueXJvOhtSD3DJOVdyy5IetDImwgWxBM+XvgW7G79aJT3zchjWAzuDv39OKZi3gQ6g2 mE7V1qURNiQ6ncWIll3YzeUJU5y4jsL8NCscMVoPgALgkzmJPj2n2PKks3o5iCAMVYqn tMNFVdJpYIEwCTW59Pn7kY/+ih0x98wPNT0vK0n+wnWDZlWmiPnlC5tnpV5ol2W5eD4S t/c7exn1mP4XWJVjuukDlgNP7O8cJa6nqiri7t/71I+GXJO1NkFXODCZYT9tUoydDWSg F9nw== X-Gm-Message-State: APjAAAXOkuuM+oIfGOCHggkD6gQv8C8nq+geX5ZiPWzi+dYQG62D3Acj iW0spmYTBC3IWrWqrIPsl8Q0TYUYTBQ= X-Google-Smtp-Source: APXvYqzsMBRceFO+BYko5tFiBxrsKzibpORqR8dUU5fsi6eJygF2HVaJdtqSefMKM60C3njSFKts8Q== X-Received: by 2002:a05:600c:1008:: with SMTP id c8mr54303524wmc.133.1563635937141; Sat, 20 Jul 2019 08:18:57 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 20 Jul 2019 17:18:42 +0200 Message-Id: <20190720151846.7450-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190720151846.7450-1-pbonzini@redhat.com> References: <20190720151846.7450-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::333 Subject: [Qemu-devel] [PULL 08/12] hmp: Print if memory section is registered with an accelerator X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Alexey Kardashevskiy This adds an accelerator name to the "into mtree -f" to tell the user if a particular memory section is registered with the accelerator; the primary user for this is KVM and such information is useful for debugging purposes. This adds a has_memory() callback to the accelerator class allowing any accelerator to have a label in that memory tree dump. Since memory sections are passed to memory listeners and get registered in accelerators (rather than memory regions), this only prints new labels for flatviews attached to the system address space. An example: Root memory region: system 0000000000000000-0000002fffffffff (prio 0, ram): /objects/mem0 kvm 0000003000000000-0000005fffffffff (prio 0, ram): /objects/mem1 kvm 0000200000000020-000020000000003f (prio 1, i/o): virtio-pci 0000200080000000-000020008000003f (prio 0, i/o): capabilities Signed-off-by: Alexey Kardashevskiy Message-Id: <20190614015237.82463-1-aik@ozlabs.ru> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 38 ++++++++++++++++++++++++++++++++++++++ include/sysemu/accel.h | 3 +++ memory.c | 22 ++++++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 35ea3cb..f450f25 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -111,6 +111,13 @@ struct KVMState /* memory encryption */ void *memcrypt_handle; int (*memcrypt_encrypt_data)(void *handle, uint8_t *ptr, uint64_t len); + + /* For "info mtree -f" to tell if an MR is registered in KVM */ + int nr_as; + struct KVMAs { + KVMMemoryListener *ml; + AddressSpace *as; + } *as; }; =20 KVMState *kvm_state; @@ -1159,6 +1166,14 @@ void kvm_memory_listener_register(KVMState *s, KVMMe= moryListener *kml, kml->listener.priority =3D 10; =20 memory_listener_register(&kml->listener, as); + + for (i =3D 0; i < s->nr_as; ++i) { + if (!s->as[i].as) { + s->as[i].as =3D as; + s->as[i].ml =3D kml; + break; + } + } } =20 static MemoryListener kvm_io_listener =3D { @@ -1809,6 +1824,12 @@ static int kvm_init(MachineState *ms) s->nr_slots =3D 32; } =20 + s->nr_as =3D kvm_check_extension(s, KVM_CAP_MULTI_ADDRESS_SPACE); + if (s->nr_as <=3D 1) { + s->nr_as =3D 1; + } + s->as =3D g_new0(struct KVMAs, s->nr_as); + kvm_type =3D qemu_opt_get(qemu_get_machine_opts(), "kvm-type"); if (mc->kvm_type) { type =3D mc->kvm_type(ms, kvm_type); @@ -2828,11 +2849,28 @@ int kvm_get_one_reg(CPUState *cs, uint64_t id, void= *target) return r; } =20 +static bool kvm_accel_has_memory(MachineState *ms, AddressSpace *as, + hwaddr start_addr, hwaddr size) +{ + KVMState *kvm =3D KVM_STATE(ms->accelerator); + int i; + + for (i =3D 0; i < kvm->nr_as; ++i) { + if (kvm->as[i].as =3D=3D as && kvm->as[i].ml) { + return NULL !=3D kvm_lookup_matching_slot(kvm->as[i].ml, + start_addr, size); + } + } + + return false; +} + static void kvm_accel_class_init(ObjectClass *oc, void *data) { AccelClass *ac =3D ACCEL_CLASS(oc); ac->name =3D "KVM"; ac->init_machine =3D kvm_init; + ac->has_memory =3D kvm_accel_has_memory; ac->allowed =3D &kvm_allowed; } =20 diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h index 81293cd..89ce57e 100644 --- a/include/sysemu/accel.h +++ b/include/sysemu/accel.h @@ -25,6 +25,7 @@ =20 #include "qom/object.h" #include "hw/qdev-properties.h" +#include "exec/hwaddr.h" =20 typedef struct AccelState { /*< private >*/ @@ -39,6 +40,8 @@ typedef struct AccelClass { const char *name; int (*init_machine)(MachineState *ms); void (*setup_post)(MachineState *ms, AccelState *accel); + bool (*has_memory)(MachineState *ms, AddressSpace *as, + hwaddr start_addr, hwaddr size); bool *allowed; /* * Array of global properties that would be applied when specific diff --git a/memory.c b/memory.c index d4579bb..5d8c9a9 100644 --- a/memory.c +++ b/memory.c @@ -30,7 +30,9 @@ #include "sysemu/kvm.h" #include "sysemu/sysemu.h" #include "sysemu/tcg.h" +#include "sysemu/accel.h" #include "hw/qdev-properties.h" +#include "hw/boards.h" #include "migration/vmstate.h" =20 //#define DEBUG_UNASSIGNED @@ -2999,6 +3001,8 @@ struct FlatViewInfo { int counter; bool dispatch_tree; bool owner; + AccelClass *ac; + const char *ac_name; }; =20 static void mtree_print_flatview(gpointer key, gpointer value, @@ -3061,6 +3065,17 @@ static void mtree_print_flatview(gpointer key, gpoin= ter value, if (fvi->owner) { mtree_print_mr_owner(mr); } + + if (fvi->ac) { + for (i =3D 0; i < fv_address_spaces->len; ++i) { + as =3D g_array_index(fv_address_spaces, AddressSpace*, i); + if (fvi->ac->has_memory(current_machine, as, + int128_get64(range->addr.start), + MR_SIZE(range->addr.size) + 1)) { + qemu_printf(" %s", fvi->ac_name); + } + } + } qemu_printf("\n"); range++; } @@ -3101,6 +3116,13 @@ void mtree_info(bool flatview, bool dispatch_tree, b= ool owner) }; GArray *fv_address_spaces; GHashTable *views =3D g_hash_table_new(g_direct_hash, g_direct_equ= al); + AccelClass *ac =3D ACCEL_GET_CLASS(current_machine->accelerator); + + if (ac->has_memory) { + fvi.ac =3D ac; + fvi.ac_name =3D current_machine->accel ? current_machine->acce= l : + object_class_get_name(OBJECT_CLASS(ac)); + } =20 /* Gather all FVs in one table */ QTAILQ_FOREACH(as, &address_spaces, address_spaces_link) { --=20 1.8.3.1 From nobody Tue Nov 11 12:50:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563636019; cv=none; d=zoho.com; s=zohoarc; b=FdPbzLD8yyIxmhAvH3f3o6L0cPG2e638PnSYeZJnGiYK5rSX55yEbmMd3YKVU4KpK8uazeeoLJAy2cjClmecRpeenJOaU0VAwupXz1wJisAXNz9B1WdulWH5GLDS4ZadU+C7ut+JwbxoJoMwSk2icbUFCEw1Hd+kQyN9NFS7DEA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563636019; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=1o9UgFGkc03JEexjlaP2KvbGOgKiLs/glyHI3+FA/V0=; b=VddH3BNYRJ5TsRkQruWx8KBgeKs5oZlj0xhPtYMQPHXQqmA5ZDUOS5ajK6ILEfF+9RaHEJ8Z5BE90PakAlkXE5shFlLvghaSDaoZSDESfDpi1Syt/pyDnYH0Oyhpx4C27rYgjyj0Y3FIS5TAmyyAzBph4zi9JGFnohtkfgIWhP0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563636019208933.4685743810616; Sat, 20 Jul 2019 08:20:19 -0700 (PDT) Received: from localhost ([::1]:51618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor9i-0002Oi-JG for importer@patchew.org; Sat, 20 Jul 2019 11:20:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39894) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor8W-0006Ar-60 for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:19:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hor8V-00089Z-AI for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:19:00 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:42937) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hor8V-00089A-4C for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:18:59 -0400 Received: by mail-wr1-x434.google.com with SMTP id x1so20022969wrr.9 for ; Sat, 20 Jul 2019 08:18:59 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:8501:6b03:f18c:74f8]) by smtp.gmail.com with ESMTPSA id 4sm77517291wro.78.2019.07.20.08.18.57 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 08:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1o9UgFGkc03JEexjlaP2KvbGOgKiLs/glyHI3+FA/V0=; b=DlEbn/CH51FGSdv1Hj9C3oYJIHxKPqCXEEjvwM0Df7ZQtTxpEqyE+XkKh2axeQaqty si4zvG0e0RPHIdmKNuGAPoqgNjrLRhyb4U/gRQt8kZ0ZFo5T5guIovRFSdl17qBBUI5A /9HBSGwrJA3KqonFhytK1UFnP/o9/75+Giy737veQJs+NCzJMwrVZiz4ojNZSv2Itc01 60zRZi3eP/wJxOPCp9ELCmVhG4+qy+8SNi0AJ7LEt4zCROMOIiv+LZMwSvE4jH0B6UBt z2f/ObiQ2Ylf1oxWtreE6iHf38HSNSfAf/1XvFRpAjuG5GR2voDBWAcGPjKe8xGKTWBU /pWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=1o9UgFGkc03JEexjlaP2KvbGOgKiLs/glyHI3+FA/V0=; b=HKXaooaDGhaJsiAS0+wCIMCMmW5FoLQYIExz8JPTaP4OrSRiPycrald+GQu7lugaes sVqBK+MrYKFiuIr3f3+GwdBE1UWCsbJmBPvkrw97v73TDsSv1oA9Vxrj0x6Wp3g9vWJS 9rGjMMVy5a77+NE8NSM8BbLnNqJdSqV/Sz3lrt9fIZzEIt1asYqpEKR9+eDBVId9b7ZA Y39TjWKycZ++N42JSm88vcDKkmbJz1PNCfDkXDkmWjVPOFZvcc+OybmPmqaTefNwFJgk L9gdLpfVqbvQ+MiGegNqk3sn4lPrOhtIQEXnfs9MKdYhthVy4mbpwafxJe6Hn4hWh5B7 Etvg== X-Gm-Message-State: APjAAAUeDmi8QG7VOYnUa/EuX3Du+Hf82G3zhb+tyjnhBRUPIh5kaXYT edfKXjbOw8ZqME2mES6/B4rqnYr3cK8= X-Google-Smtp-Source: APXvYqwv1hYKhP1/Yi4OeAzStmcxU3DoaIwUbkKWTIfczdTEX9LssZ9EkZAbNl6QVzhy8i9dyNj/+g== X-Received: by 2002:adf:eb49:: with SMTP id u9mr59220683wrn.215.1563635937934; Sat, 20 Jul 2019 08:18:57 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 20 Jul 2019 17:18:43 +0200 Message-Id: <20190720151846.7450-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190720151846.7450-1-pbonzini@redhat.com> References: <20190720151846.7450-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::434 Subject: [Qemu-devel] [PULL 09/12] qmp: don't emit the RESET event on wakeup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cornelia Huck , Nicholas Piggin Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Nicholas Piggin Commit 1405819637f53 ("qmp: don't emit the RESET event on wakeup from S3") changed system wakeup to avoid calling qapi_event_send_reset. Commit 76ed4b18debfe ("s390/ipl: fix ipl with -no-reboot") appears to have inadvertently broken that logic. Acked-by: Cornelia Huck Signed-off-by: Nicholas Piggin Message-Id: <20190718103951.10027-2-npiggin@gmail.com> Signed-off-by: Paolo Bonzini --- vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vl.c b/vl.c index a5808f9..cefe5a3 100644 --- a/vl.c +++ b/vl.c @@ -1550,7 +1550,7 @@ void qemu_system_reset(ShutdownCause reason) } else { qemu_devices_reset(); } - if (reason !=3D SHUTDOWN_CAUSE_SUBSYSTEM_RESET) { + if (reason && reason !=3D SHUTDOWN_CAUSE_SUBSYSTEM_RESET) { qapi_event_send_reset(shutdown_caused_by_guest(reason), reason); } cpu_synchronize_all_post_reset(); --=20 1.8.3.1 From nobody Tue Nov 11 12:50:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563636086; cv=none; d=zoho.com; s=zohoarc; b=a27m1PLCDBYRfmZgHaLUS048L8Y6CLNysXUB5FcO8QG8AzSJHJPa4/XJLsiVioTiAemwO7ie0dI4bRZzAqJGkfPCm5ny4vlcPbmvYzMTifUWiJbykhLQc+v7VPgrKNyzWv0PoTysha+5JMC0XQS0RSX3/ErB3pzeJ1SYaXi1nKg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563636086; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=2jXZXn8D0C4OSjVChn2Rnr8HsT29F+x6ytM6XlvQE38=; b=hfH9juul/xUcM4C3Of7TR7xhXqNMWm9hwcD/jKhFwqHOLRBMEoXPLIm32aBS6pokc+Stbq4AWAQmzgiY/Ec6rrHgJ/8TKdakoz5hhOsPjBUt0uuNvDj24/4jSkF98AOYKuRnZx7RSnXhHuHwY1baks6siUdtO6r/PZeQaf7LaPk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563636086443538.2803216580552; Sat, 20 Jul 2019 08:21:26 -0700 (PDT) Received: from localhost ([::1]:51676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1horAr-0007sh-AD for importer@patchew.org; Sat, 20 Jul 2019 11:21:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39917) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor8Y-0006Gi-Ho for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:19:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hor8W-0008Bl-FP for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:19:01 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:34069) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hor8W-00089n-8x for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:19:00 -0400 Received: by mail-wr1-x42e.google.com with SMTP id 31so35071197wrm.1 for ; Sat, 20 Jul 2019 08:19:00 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:8501:6b03:f18c:74f8]) by smtp.gmail.com with ESMTPSA id 4sm77517291wro.78.2019.07.20.08.18.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 08:18:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2jXZXn8D0C4OSjVChn2Rnr8HsT29F+x6ytM6XlvQE38=; b=c4NGI7ON9/d4x/xi6Sl/EIwYaTZA94XoqpbiNdE5DtLM743R+zBIqYLiYtCD/OKUcz OyoOlBt7NpnIUxPVAwBrRc0o8dO+LJGwiNb7caWnLUDxdEFUQ/Oj8axb1d7LIrP+nrI0 9rhkBjUuUrovWW6EaZ0DQFaTAfbADT0lHZ119XPnEVVSbyKtjQT59ZYSvNJ88QIsdqWp jvnrUGtwEPc9ZnBt2bvpw79XnGdKGovi/wavCXsT84UHZaHJ3Ff6HMoCbQ+a/caeZDEf 6k61tBjLFbtQgayNR/fTbSpjO8BbnwHtSdXHua+4V02558silM24pFXDO1JU6jToVeTU hdMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=2jXZXn8D0C4OSjVChn2Rnr8HsT29F+x6ytM6XlvQE38=; b=Crn7h9c5bpi2QcHMaUNL8r9wiji6VJTDKyEpl5uRb1Lu02raaaBff+w2VNM3/f5EJt 5UsbV0azKkVrJxz/ReMV9jqtfJPNp1RG7lRh2/St6wxvBakD2OH+Qr98F1SwfQDGNwnZ KybsncOiRi+wh9GV1w1rnPSSjMrlVw0j2Hn0DpNx1GZR5rCX3P+tbN+TDC0n4QDhgEIv vnR8ym3Pc/giJ0bWsb0Yju6Nh5drjih0GirNbFp1uecD5uyvC1HD33f9UZYL9/TH+gFa yacwnP/e5WhsTlU3g51PzFrK0L4FZr0d2SL+tRYL310UKPvZ5TYSUvT3PZCvdSI5k4PW k+Yg== X-Gm-Message-State: APjAAAUALYWtrDDQArJesq0aCHck3Oy8q11xST0eEMnqRGPGRbrhVpPc Ocmy8VsLqKjYumXNVPxKNu97kw7r2NE= X-Google-Smtp-Source: APXvYqz9s6lYir+VZbY9LbmB4TG32+jvQ9irvM6UMPs/nBCIkX3mDpo899b4Z8gxd1JvcidgbgIMNg== X-Received: by 2002:a5d:4101:: with SMTP id l1mr7062821wrp.202.1563635939034; Sat, 20 Jul 2019 08:18:59 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 20 Jul 2019 17:18:44 +0200 Message-Id: <20190720151846.7450-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190720151846.7450-1-pbonzini@redhat.com> References: <20190720151846.7450-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42e Subject: [Qemu-devel] [PULL 10/12] build-sys: do no support modules on Windows X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau Our module system does not support Windows, because it relies on resolving symbols from the main executable. If there is enough interest in supporting modules on Windows, we could generate an import library for the executable and link with it: https://stackoverflow.com/questions/15454968/dll-plugin-that-uses-functions= -defined-in-the-main-executable However, there is a small chicken egg problem, since the executable link and exports extra symbols needed by the library... Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20190718120413.27678-1-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 99c64be..7be0e68 100755 --- a/configure +++ b/configure @@ -1752,7 +1752,7 @@ disabled with --disable-FEATURE, default is enabled i= f available: guest-agent build the QEMU Guest Agent guest-agent-msi build guest agent Windows MSI installation package pie Position Independent Executables - modules modules support + modules modules support (non-Windows) debug-tcg TCG debugging (default is disabled) debug-info debugging information sparse sparse checker @@ -2007,6 +2007,11 @@ else QEMU_CFLAGS=3D"$QEMU_CFLAGS -Wno-missing-braces" fi =20 +# Our module code doesn't support Windows +if test "$modules" =3D "yes" && test "$mingw32" =3D "yes" ; then + error_exit "Modules are not available for Windows" +fi + # Static linking is not possible with modules or PIE if test "$static" =3D "yes" ; then if test "$modules" =3D "yes" ; then --=20 1.8.3.1 From nobody Tue Nov 11 12:50:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563636060; cv=none; d=zoho.com; s=zohoarc; b=cX0/m4Xc3fEe2Fff6HIO0spcLgQ7JqnbYIW2c9UEyUtG90kMdMMWJWUDQPI3Y4t6Jd0qcXtcFe3whCQeMOIIxXs/ugJsxLy+K/JtMDcXaTbSdVkXHIeUw+04F3Q696MDYycr6RaVWE7nLa7iqLwRRB0zVQFAvkZJBqdkbDC1+Q8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563636060; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=v8dpyNBhtLVCL3x1WrV5A15VpIlNKEu8CU2xcQnGtNs=; b=QEdP4uthzetLn58kM7MwUBj2c6n4HBslKW+/pSl/JDJGTthC2DykShBtok15SbSVJQXGWfLpk+U1bxsarHrBHdjAount/w33NhXWu1BKoyQAGkW3s6JXIplfWRsJyjmS5DXEPw246RXbndRQlzv++x52xVzYOjmhYWF04nsdK9A= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15636360604981.1587175623728854; Sat, 20 Jul 2019 08:21:00 -0700 (PDT) Received: from localhost ([::1]:51648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1horAR-0005th-7O for importer@patchew.org; Sat, 20 Jul 2019 11:20:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39922) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor8Y-0006KJ-Hx for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:19:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hor8X-0008Ce-A4 for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:19:02 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:44981) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hor8X-0008Bp-2t for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:19:01 -0400 Received: by mail-wr1-x429.google.com with SMTP id p17so34986183wrf.11 for ; Sat, 20 Jul 2019 08:19:01 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:8501:6b03:f18c:74f8]) by smtp.gmail.com with ESMTPSA id 4sm77517291wro.78.2019.07.20.08.18.59 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 08:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v8dpyNBhtLVCL3x1WrV5A15VpIlNKEu8CU2xcQnGtNs=; b=KHrWALR9QKdOmEKqRPGwJWplCLF+xTAG0/cj83BL90uw+Q9O/abxFBYSfM8xqNztB8 dzRvLhC2JTgOfapaEsxaaCDy6gw9zTDm4jg6HdTdh1PtrFQioxuoYexG1Gk6afdVc7HG //81V4aCFrEsNGyobnj2MMGAP7wrZw90EqegliQBfctM6GxU0xQ2V2E7qKrR6pp802uf A39gd7+lqit5oaPQjixzXgkKnXJDAVJwW0VTjjv5qYJzDo675ehkKG3nHOBxn5Ptd+P3 sPT45Mc1O8FhYPD0hD61FKdeuJ3qauzyb/wA+GulPDk5Y72fJ6MxCz2DeDWFZRhuj4ZT nzbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=v8dpyNBhtLVCL3x1WrV5A15VpIlNKEu8CU2xcQnGtNs=; b=Z2lO7TEaNrtFaYphLmgOHm95ogheepBYBpGLQUMh4252NpiFUPzPP2sP6A6pRJyI6h aNt09Pdx2oiccgfsym5PhbwI1bFmPvm8sTaMsLkBG61ggLyTRSKYrOC/tKIb8gaGS05A //niy09GyNF2uUvYf2YFKzD1uyInEqBufVWeyxLdiHRuy51V/iULla6Cgwf9GtbKi9T9 MnjtFLhZEAVgLnU1RukNNtSMmnjVDd4TywIzTrgzbAnoZ4ifn+G53rrgKTMCcbrbqcmh 2xkjJDs05VpoFq1J8uCdn6XPclKAz7YmavSub7vLDdmMQBtk5pcSJ5sY12FfsBsCJDzj X15A== X-Gm-Message-State: APjAAAU0htSQgQqdh0qmpPMNwEfE52y/LZ3qY5HTjsqmv3D+09tjgxJn HZ3FwIKZZdsVlcF25gBBIdPosnkSGpA= X-Google-Smtp-Source: APXvYqxVzjBkj4vMkIXcUTFPYYb6yU+oIUxVX6+oqdEfGcfIHASAjLhc+EDSdAht7ZCd1jW9+7ey8g== X-Received: by 2002:a5d:6b11:: with SMTP id v17mr13847516wrw.323.1563635939904; Sat, 20 Jul 2019 08:18:59 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 20 Jul 2019 17:18:45 +0200 Message-Id: <20190720151846.7450-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190720151846.7450-1-pbonzini@redhat.com> References: <20190720151846.7450-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::429 Subject: [Qemu-devel] [PULL 11/12] i386: indicate that 'pconfig' feature was removed intentionally X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Denis V. Lunev" , Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Denis V. Lunev" pconfig feature was added in 5131dc433df and removed in 712f807e196. This patch mark this feature as known to QEMU and removed by intentinally. This follows the convention of 9ccb9784b57 and f1a23522b03 dealing with 'osxsave' and 'ospke'. Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Richard Henderson CC: Eduardo Habkost Message-Id: <20190719111222.14943-1-den@openvz.org> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 805ce95..e3320f5 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1083,7 +1083,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORD= S] =3D { NULL, NULL, NULL, NULL, NULL, NULL, "md-clear", NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, + NULL, NULL, NULL /* pconfig */, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "spec-ctrl", "stibp", NULL, "arch-capabilities", "core-capability", "ssbd", --=20 1.8.3.1 From nobody Tue Nov 11 12:50:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563636059; cv=none; d=zoho.com; s=zohoarc; b=aP8nO/KTEwVbICz+5pfqqTr1fz9KduAea1UFGjaqgc7YrpCK9q3vc3xynYyFUzCTKJPrAh7cYJaoGwcdtYyao3MemWYv42+6ElKv0blq4UIvq6LUV9iT9NvvfuqEyajwad8we+pUR3dfyvRnlgU0pCsPQy1B3U3JsD64bGPKK1I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563636059; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=l+J1eu/SZQQm+GtTAYitv1nWk4WmFZ80tCb3ExUS/1Q=; b=cTSlH6Bd7qFKx5bh4pwrwinKLlDmPdQfFy7KOCuB4Kkn8JcrxUQNoRoXVdlHQDHY3Uol/tSOLiwYUgF/h9HCMLB0ED8yrG/98nx6lumJ9elPCY9VKIvfVl17Cb/rYPBJ/27ftjS5bNCFGu4EmYO5BAl+68iiHAYLC/Ea/0UEJr0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563636059893766.9253798637035; Sat, 20 Jul 2019 08:20:59 -0700 (PDT) Received: from localhost ([::1]:51646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1horAQ-0005mz-GE for importer@patchew.org; Sat, 20 Jul 2019 11:20:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39934) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hor8Z-0006PD-Fb for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:19:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hor8Y-0008D6-Dj for qemu-devel@nongnu.org; Sat, 20 Jul 2019 11:19:03 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:44985) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hor8Y-0008Ck-7G; Sat, 20 Jul 2019 11:19:02 -0400 Received: by mail-wr1-x42d.google.com with SMTP id p17so34986216wrf.11; Sat, 20 Jul 2019 08:19:02 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:8501:6b03:f18c:74f8]) by smtp.gmail.com with ESMTPSA id 4sm77517291wro.78.2019.07.20.08.18.59 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 08:19:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l+J1eu/SZQQm+GtTAYitv1nWk4WmFZ80tCb3ExUS/1Q=; b=FYGEZ9ThezjDxFUfIwLnLQTbwI+Iha0ngGZGTgzYGPmrsm4Vp4iL/hH12/Kh+kt+Us iMlw4OeFTw8NeLSEmAVytBoVh5gVG23zYn/puXnTdIv/HJj8TIGZo3HXXZF0lKUkN3VW bJJws3yGrQONjEJ2HrqQf64rkVppHkcXrPY+bmsINyLibanKR/k5rhhPaZzyHNMYPjOk YQO9iQ54g7Pn2zdoWBSsi2qtNjPTIGzaWqlGMny1PE30yrWOseeGBw7uPPY5tHUXJOQV 7iFNmkIA37Lgep05eO/sMX+MLoWzOE8aHFJYUixfyq6GbJWc2zxmz4RVWgLMytsLU1S2 /Aag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=l+J1eu/SZQQm+GtTAYitv1nWk4WmFZ80tCb3ExUS/1Q=; b=oYswCxFxb0FNecx2b+a3FNHnQXfdOtgu3XbcN2EE5KAtluQmazdhUctnzwZr1mvU/k QEznrYSPXjNM06XEjDQKjqz4qL8Z/7lKeroT6H6SX5u3Iq9+MyYATFG0t66U+IJ2BMA5 2iidJ0ohPsN7Xttj7gpLj0fsED9gUzmlnB/KH0v4FIwDbb0/ZHLnruM9w2Oivux3cSIk mhv1OqOmAXNn+CgT7MiA3SngQttvRviTyKX2nOsqnlOvUsYLuqk3l4hIak/H9+smUn4a 6SPfwkmyXato7wn8XRfoQHD7htjmi3KV3/4XyhUEUV38OxmbU9wRyPPgf4FIuLABtoDI l4Yw== X-Gm-Message-State: APjAAAVdoO9YviUuYftPaYFbMCyIcYZ5Vw1zpBddDb6KC+yXoRb/Wal7 qH0x/Tjw6i78iBlE2dy3Nzsw15vZXrQ= X-Google-Smtp-Source: APXvYqyLorEFJb1XdL9hYBkyye3rCs1M602bzfRclHmBwjNUXZR7LmJNRHH9HLeMmv18IRdBzcPTKQ== X-Received: by 2002:adf:df8b:: with SMTP id z11mr7993398wrl.62.1563635940958; Sat, 20 Jul 2019 08:19:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 20 Jul 2019 17:18:46 +0200 Message-Id: <20190720151846.7450-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190720151846.7450-1-pbonzini@redhat.com> References: <20190720151846.7450-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d Subject: [Qemu-devel] [PULL 12/12] target/i386: sev: fix failed message typos X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Lendacky , Brijesh Singh , Eduardo Habkost , qemu-trivial@nongnu.org, Jiri Slaby , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Jiri Slaby In these multiline messages, there were typos. Fix them -- add a missing space and remove a superfluous apostrophe. Inspired by Tom's patch. Signed-off-by: Jiri Slaby Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: qemu-trivial@nongnu.org Cc: Brijesh Singh Cc: Tom Lendacky Message-Id: <20190719104118.17735-1-jslaby@suse.cz> Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 5ba1384..f1423cb 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -763,7 +763,7 @@ sev_guest_init(const char *id) "reduced-phys-bits", NULL); if (s->reduced_phys_bits < 1) { error_report("%s: reduced_phys_bits check failed, it should be >= =3D1," - "' requested '%d'", __func__, s->reduced_phys_bits); + " requested '%d'", __func__, s->reduced_phys_bits); goto err; } =20 @@ -783,7 +783,7 @@ sev_guest_init(const char *id) ret =3D sev_platform_ioctl(s->sev_fd, SEV_PLATFORM_STATUS, &status, &fw_error); if (ret) { - error_report("%s: failed to get platform status ret=3D%d" + error_report("%s: failed to get platform status ret=3D%d " "fw_error=3D'%d: %s'", __func__, ret, fw_error, fw_error_to_str(fw_error)); goto err; --=20 1.8.3.1