From nobody Sun May 19 21:56:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1575449962; cv=none; d=zohomail.com; s=zohoarc; b=COSZx3PVoIsDhXNqOrRmHD9KtnLslRy6HeB+EFW6nvWi6zQgUiuagz7peDqI2LHYuwuN128nvOdmNhteCgjiqT16LH6SJYj4mw7SMDV210a1Q6h43q4joEoE8oyeqCgZV674z5p6rDARxlpHmZDkCVVvlUM6hcUyeVVniu3ju0k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575449962; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=EOhS8JDsg867aMPTPPeteOvbmqqjsw5vk6vXxMRaXi4=; b=mmdX99+/U+vwjk0LN3cGx6Scy4l79Q3YthA3Zv3OZH3b27UJX9nKcGdhBx1jEcrCC0+am127HY25+Ivhrp4ltlg8QCloqT8WIDQOMLwTU7WjLcALwnsGkFZ1aS7zvxJPD5/mnFbAsNfu/pwGjm2qPNnG7EdxuoiXKI8TmJWBtHM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=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 1575449962595693.4987262289253; Wed, 4 Dec 2019 00:59:22 -0800 (PST) Received: from localhost ([::1]:35838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icQVC-0002dg-Hy for importer@patchew.org; Wed, 04 Dec 2019 03:59:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60981) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icQOg-0000zX-A6 for qemu-devel@nongnu.org; Wed, 04 Dec 2019 03:52:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icQOb-000490-9a for qemu-devel@nongnu.org; Wed, 04 Dec 2019 03:52:30 -0500 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:42431) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1icQOb-0003cC-2P for qemu-devel@nongnu.org; Wed, 04 Dec 2019 03:52:29 -0500 Received: by mail-qt1-x842.google.com with SMTP id j5so6932601qtq.9 for ; Wed, 04 Dec 2019 00:52:22 -0800 (PST) Received: from host.localdomain (104.129.187.94.16clouds.com. [104.129.187.94]) by smtp.gmail.com with ESMTPSA id q187sm3351795qkd.92.2019.12.04.00.52.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Dec 2019 00:52:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=EOhS8JDsg867aMPTPPeteOvbmqqjsw5vk6vXxMRaXi4=; b=pxvE9MO5f9p/yUNdCgDLZQPjNTm3GpliVlCjX11Hc+NODaKH6B35Fyscwpgn+cqcL7 zgpfCuNw51xheY4xzL8Y/cgbvP6WlKdZaPbxpSYadkpH0eOPZyVMUet8SINxpFRAT5C5 8j1P+Zuhjznd1SmYvp+uwrQ1JYs6dhjkzGCBzq9SbfWoGrSeZbbJrHDRuqLjtbZMrLtJ qkg6dWhdASyMNvhH2pr3ApZYbmEXt5U2Zn/8K3L2ljh7h/hrcc0+R+vHa0C7+5xaH6LU AM5skbDP2Holn90xSPgdwTNonumP/m7RHu92H28cMcYVjPihj0ltD2J+iW6sO6ZjRqWP MQKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EOhS8JDsg867aMPTPPeteOvbmqqjsw5vk6vXxMRaXi4=; b=ERO8PryI2Z4WCXQ194pbs7viyd1/9c5UQrTIrFgmIbymA4uoTjgLmLLmGTrFFyB7B+ JSUU3uJomCubOqQdPXSWdLqQ60Db/tda1hGg1tCylJVu6ZTH4Z1MMYt51tH37t7s2Uo4 tcKjOsv6pEmdANQhYlH0PTLXRKeOR1Cz3bNg3qd1C5A0yP1OlVcuCfhMYGEUrrN3mncZ Eqc/wh8uKYZOaugBiTJ+KTPhKkOmKlEGADCfkNdU7Hd7b/DTBxEhbkJLVPYzpgxPLKqy 7KK6lnutDIRDxq4X5w0jVEOTD5NFxxfDFWYumu1TEShTkLihRvwdkX6V53zO/hrYvWOR omoA== X-Gm-Message-State: APjAAAXHqw7OnPEEZgTQQlidGujjH1eh9QQCTst+YmY6aUOUOkR7Tco1 o0WmN3LbKu3kYYeol47Okj4= X-Google-Smtp-Source: APXvYqzTEn4f5QtgZACc5msyimnIHXttn0a0OY37DJuQ0hHUQX9gHuGApLqlXXYZrGFZEr/p65/7TQ== X-Received: by 2002:ac8:23a5:: with SMTP id q34mr1570560qtq.83.1575449539835; Wed, 04 Dec 2019 00:52:19 -0800 (PST) From: Catherine Ho To: Paolo Bonzini , Marcelo Tosatti , qemu-devel@nongnu.org Subject: [PATCH] target/i386: relax assert when old host kernels don't include msrs Date: Wed, 4 Dec 2019 03:50:30 -0500 Message-Id: <1575449430-23366-1-git-send-email-catherine.hecx@gmail.com> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::842 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: Paolo Bonzini , Catherine Ho , Eduardo Habkost , kvm@vger.kernel.org, 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-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Commit 20a78b02d315 ("target/i386: add VMX features") unconditionally add vmx msr entry although older host kernels don't include them. But old host kernel + newest qemu will cause a qemu crash as follows: qemu-system-x86_64: error: failed to set MSR 0x480 to 0x0 target/i386/kvm.c:2932: kvm_put_msrs: Assertion `ret =3D=3D cpu->kvm_msr_buf->nmsrs' failed. This fixes it by relaxing the condition. Cc: Paolo Bonzini Signed-off-by: Catherine Ho --- target/i386/kvm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index bf16556..a8c44bf 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -2936,7 +2936,7 @@ static int kvm_put_msrs(X86CPU *cpu, int level) (uint32_t)e->index, (uint64_t)e->data); } =20 - assert(ret =3D=3D cpu->kvm_msr_buf->nmsrs); + assert(ret <=3D cpu->kvm_msr_buf->nmsrs); return 0; } =20 --=20 1.7.1