From nobody Sun Nov 24 13:59:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1722424773; cv=none; d=zohomail.com; s=zohoarc; b=RZjKc5rItpqJW17sk72Udxj7oJDh3HKxBYTMvU0m3U29yspRyN+C09VTB50MUW0qk4oeNUeYvwbON6bfIJMsKmUafWytaYkyBh14p5ErusjAzXbpmCuRR11PEM1rvlYI8TUGdoURPHP7KQ3IcHmEJjVbMIfOMY8mBtvz+7P+W78= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722424773; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cJcXNK/y8GUg9fYFr/3hXtvxWP19H58fRdjkvKirAyQ=; b=WeONXUrAE5AA+9oIAUmmYuS+diPpLIGH6OUdl+V3jtgvbmTvdpfGreh0ENYAMNwzFNZHDP5gN9ABk8fZSVB3+ktRCbxtV2C6yP+fhNrHIpcxaVp5c+bVMjMf+t5iVaA9h2Pze2ElEgMrKpL4+Tths5yHu3LRxNXX+cS/gkxwkhQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722424773680335.71785644490217; Wed, 31 Jul 2024 04:19:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZ7LX-0004pD-A7; Wed, 31 Jul 2024 07:18:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7LV-0004oY-KI for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7LU-0006l2-55 for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:17 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-207-2UQTITpJP4-rNxeh31SVVw-1; Wed, 31 Jul 2024 07:18:13 -0400 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5a113d5cd1eso3589893a12.1 for ; Wed, 31 Jul 2024 04:18:13 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5afb9422c41sm6936753a12.82.2024.07.31.04.18.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 04:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722424695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cJcXNK/y8GUg9fYFr/3hXtvxWP19H58fRdjkvKirAyQ=; b=ZQSWovgG7UiDPSRjy0++QbTdXLRVvbmUdqqiOPAjNQv2cz4mEW+3c9jcvXga69M7YydS14 AODTBgsmtkjX2eMxwSfARZRC5K1Wu89m7EEcRs2UnNJg09KihCcnP6QphPHAaFQtX7L8rf NdKMvIY147dq4lFPNel2MlSIJqKERKk= X-MC-Unique: 2UQTITpJP4-rNxeh31SVVw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722424692; x=1723029492; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cJcXNK/y8GUg9fYFr/3hXtvxWP19H58fRdjkvKirAyQ=; b=oz9CeKZsy6DMGGd9agCM9jXopFlcDSjodK5JtiF9rllsTHvNTEybxky/Mxn//wnO0/ h++BQSo2/IGcirvLqzQJdKGz2Vmak4otGkIENkAMlcCdbC1gUmheOlR9QZiGL2EmmSht 3mWH3I50XrIlZnk0zrosEu8AfM0CUTNTBjexyDPSLT3938OjeL0ngh5d9BIr+1VLWvM3 rCKiSNlkQ0bCUqj9bdu0SEQXaZU20xUTFrmjuCSl98QGYJbMO0dh/DGW6S9AmpwH3pgv 3KNz5ZnuWhHYLMVrErkAASQ6kmL5B9NaCRYWvk5xyHl+TU6n2ALuaFyeb4S5E1QeEhNo L3JQ== X-Gm-Message-State: AOJu0YwpoQM+1FTqrI+4Tuh2QEcapcK04ByOSWfctyuRLPzBQ5FIHgx5 ix10RZuTUbJYEEvjZ3sKuEb3LzhArj/c/Xns5WNPW5AFkhY/bV/4AjIByqw8Ce86D9hmTdyBR41 rYCkOuzoiZEc3yYG8ppVYYdvA4X1r9rFlHlKqwZCpvQhNW3TWR28QX2oyN3IjoicYZ/SUxlrQ1Q s7d67kmGgfy9LLy0CYP4s7PFMAa+KxrPZfW3Am X-Received: by 2002:a05:6402:1e93:b0:5a2:97d7:c728 with SMTP id 4fb4d7f45d1cf-5b01d84be21mr14234840a12.0.1722424692124; Wed, 31 Jul 2024 04:18:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvSQ9s2SmCECaS66Hpze2CS/qV9pFevKhYb8Djj58QrRlhZfgEP7EiphYbvEL0xx+WJjMStg== X-Received: by 2002:a05:6402:1e93:b0:5a2:97d7:c728 with SMTP id 4fb4d7f45d1cf-5b01d84be21mr14234814a12.0.1722424691455; Wed, 31 Jul 2024 04:18:11 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 01/10] tests/vm/openbsd: Install tomli Date: Wed, 31 Jul 2024 13:17:57 +0200 Message-ID: <20240731111806.167225-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240731111806.167225-1-pbonzini@redhat.com> References: <20240731111806.167225-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.126, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1722424774749116600 Content-Type: text/plain; charset="utf-8" From: Richard Henderson OpenBSD still defaults to python 3.10, therefore tomli is now required by c= onfigure. Signed-off-by: Richard Henderson Link: https://lore.kernel.org/r/20240729051244.436851-1-richard.henderson@l= inaro.org Signed-off-by: Paolo Bonzini --- tests/vm/openbsd | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/vm/openbsd b/tests/vm/openbsd index 5e646f7c51e..49cab087825 100755 --- a/tests/vm/openbsd +++ b/tests/vm/openbsd @@ -32,6 +32,7 @@ class OpenBSDVM(basevm.BaseVM): "pkgconf", "bzip2", "xz", "ninja", + "py3-tomli", =20 # gnu tools "bash", --=20 2.45.2 From nobody Sun Nov 24 13:59:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1722424797; cv=none; d=zohomail.com; s=zohoarc; b=bWbn0REpysHyjo1oyRoKMC3U/T4ArQo1dDeLY7RHXd4GGuucj1qWYnsZtX620fMLqZgEchrRjbhap5oeYPxdhuuyT4Jgfe3yE8biwcxM06LSqZCwRnoFwewfcKy9PnVg59MaLwBzog7kpM1ueEYQ+26EmxXbcGXYn1hCncl3vwo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722424797; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=aYyzfF6IqNI/L5NVj2X9zCG1qLPKn4/0ehGgl/Nh5hs=; b=gK6JsLswkbUjyg3c5uQNdV3Zz/bcNuOca7CCKY+NMMSpR7neNL8V4R5w8p5RyX6iDlL0Q0G8zAXMlZsqfZE2z+AcAMFKUmp2oyiJXuJz4Taet9pexJFrPbYkIyYfWU/VpkYBvirQEtSUWRzDG0gKemodw3hsgDm6vw3H7s1+8AM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722424797326986.0992050903935; Wed, 31 Jul 2024 04:19:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZ7LZ-0004zS-Ua; Wed, 31 Jul 2024 07:18:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7LY-0004uM-HD for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7LW-0006lT-VC for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:20 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-304-bhX0ubxlOEi-_9zCJzCpGg-1; Wed, 31 Jul 2024 07:18:16 -0400 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5a766a51b0dso6173771a12.1 for ; Wed, 31 Jul 2024 04:18:16 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ac6358fa5esm8548783a12.32.2024.07.31.04.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 04:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722424698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aYyzfF6IqNI/L5NVj2X9zCG1qLPKn4/0ehGgl/Nh5hs=; b=EuiOMw1o1DolyvdA5smgeeZ/LDYgJiujcLPAomvxR2zPfOXmTdMgnMkYfuvgSCwTYO31Wy REkdYr8an0zLOJwxfqRbyb1MWeu0bZPnlFtQRqYmlS+scVKUySRJt7k0BxUg/2fgc+LudV xwcBV/goP0vYt8IfHvpIbnxijPMwuoY= X-MC-Unique: bhX0ubxlOEi-_9zCJzCpGg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722424694; x=1723029494; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aYyzfF6IqNI/L5NVj2X9zCG1qLPKn4/0ehGgl/Nh5hs=; b=KAZjc8R5N58hHkBsaDlS1GM/UAP27pRIgqtRoLUo2gwz87NTb80Hm+MZohzDlQqUgM e6EDE7Vf7i2liEb+bjesw+AA45pxQd6Hxxp5lCiyd4Rxsw6KM7wwqz95yrXqG7Fzc8Ae 9AtZEkVElj6f1Ba9fgOdvYfj7MBEeDlCYAkKBhNJkFKRnLYnZZECJe2zhl/AjKzC8mCJ 92M/iOFu2xm2/fonvP1066zlAQdh0o87rBNM7977Jd9HIvTBb4R65XCENH0yyjfsG9Js XFDXp7lx7Zq2Z5WRr8cvsjvhSh23GPSqV5fOnYXkezZWVpSypyws/wg/wlC1mKxaSLC1 V8Ow== X-Gm-Message-State: AOJu0YxpOLFMscu6j2NVxnhyP8VdDu8cgPF5o3Gxdx7rHx6wMcevcZcT OjUT1JBUIJt5LCbqr1QzCkML1E0xPzfLcQUUwwmH4xpatTzHuRnGJAMKKqZ3tLOk9Zqk5wdTPgk 62pjkdtTrpKyKjbhcJiurDpc3kYIwiUwnl+dqdFHRBKuch/Vx4GuQgD+3P8QOehqogcmvdRIXMw 6ROE1GHXnPZGg+bpovpfeuPiCjbj/Gz6Oj+0rb X-Received: by 2002:a50:d4d5:0:b0:5af:874d:1b7b with SMTP id 4fb4d7f45d1cf-5b02000c604mr9118256a12.1.1722424694534; Wed, 31 Jul 2024 04:18:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHscWNXIyOaWDoq+cl3VgCRoKNVrM48mtyCKBkDpOwgWt1IUGSvzqZe7lPZBmQ5SWbYdV/rKQ== X-Received: by 2002:a50:d4d5:0:b0:5af:874d:1b7b with SMTP id 4fb4d7f45d1cf-5b02000c604mr9118231a12.1.1722424694044; Wed, 31 Jul 2024 04:18:14 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Xiong Zhang Subject: [PULL 02/10] target/i386: Change unavail from u32 to u64 Date: Wed, 31 Jul 2024 13:17:58 +0200 Message-ID: <20240731111806.167225-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240731111806.167225-1-pbonzini@redhat.com> References: <20240731111806.167225-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.126, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1722424799010116600 Content-Type: text/plain; charset="utf-8" From: Xiong Zhang The feature word 'r' is a u64, and "unavail" is a u32, the operation 'r &=3D ~unavail' clears the high 32 bits of 'r'. This causes many vmx cases in kvm-unit-tests to fail. Changing 'unavail' from u32 to u64 fixes this issue. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2442 Fixes: 0b2757412cb1 ("target/i386: drop AMD machine check bits from Intel C= PUID") Signed-off-by: Xiong Zhang Link: https://lore.kernel.org/r/20240730082927.250180-1-xiong.y.zhang@linux= .intel.com 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 4688d140c2d..ef06da54c63 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6039,7 +6039,7 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *c= pu, FeatureWord w) { FeatureWordInfo *wi =3D &feature_word_info[w]; uint64_t r =3D 0; - uint32_t unavail =3D 0; + uint64_t unavail =3D 0; =20 if (kvm_enabled()) { switch (wi->type) { --=20 2.45.2 From nobody Sun Nov 24 13:59:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1722424773; cv=none; d=zohomail.com; s=zohoarc; b=K0GWTx2KUOwGyMPt4jNMl9PPh6JZd/bEuycMLKHl+Jx9SRUmO/nydngIX+z540BLtCJfy9sahpk2eYXs6Nj1idZetU7jeZz/zBjvmWFuO6qJIPeJEqp9iF0MO4QZnCVRtv3HycXyfn54ZYddpKbwAwqOt47eLCzonrfyFtlgUxs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722424773; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UXQp/6q+UgrnD2vb9HkCYwGfgn5PjByeKn38gVNGzJM=; b=hvzrME1597UVulVt0WcTHhL5ofSJ9a02+GkIBrKRovGkEG5m5rRhA+HCquiV4svXOWh6DZZnjgogSD582cLIbKYDlWmfKnIbuBYl7X2epqdgM1QXZNiqhNAfgYI5sXe92muoUhtSBcCu8lz/ImSGMnm0K52tIn0vraoB+owXIA0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722424773046780.7790234621554; Wed, 31 Jul 2024 04:19:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZ7Lc-0005BR-Qm; Wed, 31 Jul 2024 07:18:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7Lb-00056R-JU for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7LZ-0006ly-Ug for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:23 -0400 Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-404-HyYRgSHOPsiakK2bnpQqng-1; Wed, 31 Jul 2024 07:18:19 -0400 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-52eff10441fso6390606e87.3 for ; Wed, 31 Jul 2024 04:18:19 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ac63590cedsm8530617a12.29.2024.07.31.04.18.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 04:18:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722424700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UXQp/6q+UgrnD2vb9HkCYwGfgn5PjByeKn38gVNGzJM=; b=RqvWZ8WmGA1WDfRE21p71VvSIAlCnjdvXhgATWv4+csRDQvIrZSjk9nWaOCzH9odXuIKMf axPBmHBMmLQnk4JeZK2A1RTDP2vAkVeg5sqlsr8ZBJCKmt7CEPixImBpmRRS3pwedf8r51 Uu4khnxyKprIZoaHscdFZVhT7bG8OaM= X-MC-Unique: HyYRgSHOPsiakK2bnpQqng-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722424697; x=1723029497; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UXQp/6q+UgrnD2vb9HkCYwGfgn5PjByeKn38gVNGzJM=; b=PbfGVMIUkT5FbfKlu+cz0fJsjKYCqcCSXHcPShdg2hhBNxEQcCF2Kum8nJJUZADJYe +G39AMdWcygcesPH9NfFmu7EtbrQe7aCJOXunzuD9enWNAi+myfky0BYG+/goa4monIh D2Iu6i2yMJw+Oi1i+eNcbWypNb1/FK0QfTQvRTrhP6TpSuJonzukfFwbUk5N74yOYGxD FqAgsVoEgYLI54nbS5vNqFCAxVFOFnAfVqG91S03ufQba5Mvi4ek1qLSb42fR4Q0A9ds 1nAc6pf3NytJUBj9AfH0ddL/awTMYq0o3318pB9Ti30hZLZ1NQ12WbbYW6aqhn0tIdpo 7veQ== X-Gm-Message-State: AOJu0Yy7DBkE6lc/5Evmr+2eU1s4MI3l37nHaknn/YcVqmVVbL0Kqt5E 2MwRlUH1Kwt/bVxRq2+3K3ounKlEEW+AyLrU98izzfAoO6FZQtr/giiSWXN8dAX2B1MsXg+jXdQ NMYCckR05FZA6lJQ/CuK7T2J+1RUpk7vc/kHl6FvBPjGTgDtKIW4Wzr+T/oEgs3IXZ39M/1/6e0 rSN2zEBCGN7NNDjvQ5bzJ4fp9m2FiluSXjXY8k X-Received: by 2002:a05:6512:286:b0:52f:c2ef:a76a with SMTP id 2adb3069b0e04-5309b2720a2mr7918448e87.18.1722424697394; Wed, 31 Jul 2024 04:18:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERpqr58GDaaFTu+Ox4BYb5uKLqIsNilOjryoHAFCWA5/YvTgu4GL8ve4O+U+WZWCL7g19peQ== X-Received: by 2002:a05:6512:286:b0:52f:c2ef:a76a with SMTP id 2adb3069b0e04-5309b2720a2mr7918438e87.18.1722424696873; Wed, 31 Jul 2024 04:18:16 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Zhao Liu Subject: [PULL 03/10] target/i386/cpu: Remove unnecessary SGX feature words checks Date: Wed, 31 Jul 2024 13:17:59 +0200 Message-ID: <20240731111806.167225-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240731111806.167225-1-pbonzini@redhat.com> References: <20240731111806.167225-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.126, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1722424774756116600 Content-Type: text/plain; charset="utf-8" From: Zhao Liu CPUID.0x7.0.ebx and CPUID.0x7.0.ecx leaves have been expressed as the feature word lists, and the Host capability support has been checked in x86_cpu_filter_features(). Therefore, such checks on SGX feature "words" are redundant, and the follow-up adjustments to those feature "words" will not actually take effect. Remove unnecessary SGX feature words related checks. Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20240730045544.2516284-2-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ef06da54c63..a9535284aa9 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6537,8 +6537,6 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, = uint32_t count, case 7: /* Structured Extended Feature Flags Enumeration Leaf */ if (count =3D=3D 0) { - uint32_t eax_0_unused, ebx_0, ecx_0, edx_0_unused; - /* Maximum ECX value for sub-leaves */ *eax =3D env->cpuid_level_func7; *ebx =3D env->features[FEAT_7_0_EBX]; /* Feature flags */ @@ -6548,20 +6546,8 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,= uint32_t count, } *edx =3D env->features[FEAT_7_0_EDX]; /* Feature flags */ =20 - /* - * SGX cannot be emulated in software. If hardware does not - * support enabling SGX and/or SGX flexible launch control, - * then we need to update the VM's CPUID values accordingly. - */ - x86_cpu_get_supported_cpuid(0x7, 0, - &eax_0_unused, &ebx_0, - &ecx_0, &edx_0_unused); - if ((*ebx & CPUID_7_0_EBX_SGX) && !(ebx_0 & CPUID_7_0_EBX_SGX)= ) { - *ebx &=3D ~CPUID_7_0_EBX_SGX; - } - if ((*ecx & CPUID_7_0_ECX_SGX_LC) - && (!(*ebx & CPUID_7_0_EBX_SGX) || !(ecx_0 & CPUID_7_0= _ECX_SGX_LC))) { + && (!(*ebx & CPUID_7_0_EBX_SGX))) { *ecx &=3D ~CPUID_7_0_ECX_SGX_LC; } } else if (count =3D=3D 1) { --=20 2.45.2 From nobody Sun Nov 24 13:59:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1722424784; cv=none; d=zohomail.com; s=zohoarc; b=jTLFANGw3h4H+k12MOd6DVjNQyvUmAlbirvmr0Q5w/OgsQG8/ircHHXrRBwTORMLV7WBEMSMV6T0N5O4i46m66KDiVMvoU3kbEi+n1yz+UKY5qHIG7WboCXE1is/RXr6FCIW+ZrMQDsl8KlZz7/qwUHogiMDhXV2HcKORYN2ygo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722424784; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YVLZx9cxauGLNxxqCHWm1ysmO8J+eGcn2LcW4LTM8N0=; b=FkNyFL1R734VYK8irSd4guHcEEjoP5j4AIJja60eJ69QF5FDs84VjnMtvQ0NQoVTe0EUv4FrXbBcVV3qe6TgcTUYE8Du07xjSe167vLWzlTzpkqiTIAy6e5MjejgX90ArQTmLjDS46Jd9pH6fDioLZjIRg0eZPqTJJEXhZW8XZc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722424784441839.7504522316381; Wed, 31 Jul 2024 04:19:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZ7Lf-0005KJ-7A; Wed, 31 Jul 2024 07:18:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7Ld-0005Dv-FF for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7Lb-0006mG-SJ for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:25 -0400 Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-428-JmyQJ760P1OasYS_1BeFMw-1; Wed, 31 Jul 2024 07:18:22 -0400 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-530ad977bccso1388905e87.0 for ; Wed, 31 Jul 2024 04:18:21 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7d8288832fsm217166966b.6.2024.07.31.04.18.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 04:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722424703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YVLZx9cxauGLNxxqCHWm1ysmO8J+eGcn2LcW4LTM8N0=; b=gGrEDrZZIkaqpH9/4Uz1Md1Kgo2bMOEKJutUU+0l7Jtw5rW0OPAJe3WLbDzcvN7AEb9oSR ms3xDc3TyHYbw+m6JH9mfUk4lZ1D16UmJm9sfgcqqU911BspupMLXzqpjRajiXQpyzCaLv B4kOU0K2g5TeUn1cLeOqX02R3n+zdjs= X-MC-Unique: JmyQJ760P1OasYS_1BeFMw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722424700; x=1723029500; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YVLZx9cxauGLNxxqCHWm1ysmO8J+eGcn2LcW4LTM8N0=; b=Nc13yNIDUfnjoUSbrSCHHnDAWI++Y1xWoNe21mBGjE49qlP9+lpcQM/jQl5KF0wxKy /a/j24X/koOgBriIqSk9LvQMsZ6x/jxIa6gV83rLPNpwNbFqXIm3KrITFpGx5yO5ES8e vdpY51ZCKggWgDSG1SlDSW4SzOxN0hMH6btL7s8tQEj6fqzNg7NvYFvRmjkhRbfKOaNP d7xOMpucpbNjHaDKWLQ0FGPrzUd8YQZI+TMfAgocHNIN7CFLRZxpLp6dzE1nNYflsVeK SHHj/E6b+UaxVNDAIdaZp+M9nW/l7VK8NI2R4D5yvs6+o6hkU82BQN2VIPmKAelwxaUu XJGQ== X-Gm-Message-State: AOJu0YwSyGWBX5CzICHfnlMRM7pNHPcnCz5Ssw2CV9C6IilJXW4yoIua cqmHA5MqttpUgR8HOj9KH8H9sA3m8KY/PCEC0btt3rKLwlAB3ndPjdTa2Nr1Q1pAdQe4Qj0gqrk +Hy4OvmKeuVwIi9rY+Ejvez1Ri5Yzjl8zeGcW4lfJglYVRMfMK8kRRJY6j9emkG7M5G6snePK8R Zw/r0AxlL6TPspEoAO5KrJMIO5DM8Uiav5fZpb X-Received: by 2002:ac2:4d19:0:b0:52c:dbc6:8eb0 with SMTP id 2adb3069b0e04-5309b27227dmr7613412e87.21.1722424700072; Wed, 31 Jul 2024 04:18:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbGV33v66AXlYzL0Rxv2r3llQ3tFveEhGcUPGUm69usdUj9r72dpteDIYmB5t0Pb09dk4FIg== X-Received: by 2002:ac2:4d19:0:b0:52c:dbc6:8eb0 with SMTP id 2adb3069b0e04-5309b27227dmr7613394e87.21.1722424699512; Wed, 31 Jul 2024 04:18:19 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Zhao Liu Subject: [PULL 04/10] target/i386/cpu: Explicitly express SGX_LC and SGX feature words dependency Date: Wed, 31 Jul 2024 13:18:00 +0200 Message-ID: <20240731111806.167225-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240731111806.167225-1-pbonzini@redhat.com> References: <20240731111806.167225-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.126, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1722424784879116600 Content-Type: text/plain; charset="utf-8" From: Zhao Liu At present, cpu_x86_cpuid() silently masks off SGX_LC if SGX is absent. This is not proper because the user is not told about the dependency between the two. So explicitly define the dependency between SGX_LC and SGX feature words, so that user could get a warning when SGX_LC is enabled but SGX is absent. Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20240730045544.2516284-3-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index a9535284aa9..e864f55d4fc 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1730,6 +1730,10 @@ static FeatureDep feature_dependencies[] =3D { .from =3D { FEAT_7_1_EAX, CPUID_7_1_EAX_WRMSRNS }, .to =3D { FEAT_7_1_EAX, CPUID_7_1_EAX_FRED }, }, + { + .from =3D { FEAT_7_0_EBX, CPUID_7_0_EBX_SGX }, + .to =3D { FEAT_7_0_ECX, CPUID_7_0_ECX_SGX_LC }, + }, }; =20 typedef struct X86RegisterInfo32 { @@ -6545,11 +6549,6 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,= uint32_t count, *ecx |=3D CPUID_7_0_ECX_OSPKE; } *edx =3D env->features[FEAT_7_0_EDX]; /* Feature flags */ - - if ((*ecx & CPUID_7_0_ECX_SGX_LC) - && (!(*ebx & CPUID_7_0_EBX_SGX))) { - *ecx &=3D ~CPUID_7_0_ECX_SGX_LC; - } } else if (count =3D=3D 1) { *eax =3D env->features[FEAT_7_1_EAX]; *edx =3D env->features[FEAT_7_1_EDX]; --=20 2.45.2 From nobody Sun Nov 24 13:59:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1722424772; cv=none; d=zohomail.com; s=zohoarc; b=E9awM8eQ1fBeRr5k923AKMkQomE+0FRXhglS5Z+fXPU6gUcBNiuc6krcYfaSpGCMon7m04Mfyj509QNUs4uakBg57VViBtP2VNaWhYtZxzrb/nPt/5IDxDrRhFI727hvI6zyJgmoTg5d8LjwSXAY35jl3Zu70ul8ZkyOTHNu+Fc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722424772; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0Bnh2khxE06uRGlglbrZqD8PmhxT2BPf5aSSDHqB2mU=; b=JNHGMbZ9s3elrf3HUQOIJG5utI95fmQRoESgWRz7JnUOAFpp9bdvbABQdxZred7BM4KDrjKASDnWH6IVwEyt5qLM0HwFG0dhUF6l+yC21FcAgjV6tu7Pt8SAB77oTChUB6i2fYCmj3jxQsayvGSR84/ve9y2IGN7schnRRvauiU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722424772967429.84551111255416; Wed, 31 Jul 2024 04:19:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZ7Lj-0005a1-Tf; Wed, 31 Jul 2024 07:18:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7Lh-0005UE-FD for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7Lf-0006mc-L4 for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:29 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-307-SDkhY_fPN9OugKcDUiKjQg-1; Wed, 31 Jul 2024 07:18:24 -0400 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a7aa56d8b14so502985566b.1 for ; Wed, 31 Jul 2024 04:18:24 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7acada27ddsm749995166b.184.2024.07.31.04.18.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 04:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722424706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0Bnh2khxE06uRGlglbrZqD8PmhxT2BPf5aSSDHqB2mU=; b=CjPFQs2wxwhMap8AsvibqOvY1J1QoG3895JwWrDgPD800vSE4Yg1gqS3WBlKumopaEJeNy uFjqYbcySFoCKZyEDaVt2DXu1Kr+bigvaoMLk4oIgBqILh5oQgiZDoweVqm0AgheDYGCeT D1Yv1L85+odSTQvjEd3CakbUjkUFvjc= X-MC-Unique: SDkhY_fPN9OugKcDUiKjQg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722424702; x=1723029502; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0Bnh2khxE06uRGlglbrZqD8PmhxT2BPf5aSSDHqB2mU=; b=MW8mwkk6bhTGA7zi/ev0kmX2VfkF4+xooeoplEyozqtCDygT4WT2Sy04JdlHgzHWjm qaTe2m29QLxI1oxa8tyhS3iJ9DHXMp8d/RF4RxVXwcLDCximYmvPVH7I5R+DhwOCMjxB Q+Y2rqXeQU69wVlcZQrQDf6EvLqs4WT8Pn/pRxkMu530mx1FXPjqJBIHdsa4Rr4anAVI D4YFBXkJAxgsN4HfxGOcRGQSBJLgl7ZY/hb2GxhRnNEISDL1GgE2XXYNORPhrJNKfcIm dQL/aPa1R7bG6UkeF/10IjyM9/MZINlHdgrgXnb5igUEqM50m2GeaJtZFmUz7mDGjvgB TOtA== X-Gm-Message-State: AOJu0YyNI+3pmJ6CEqrsy1BYqZ1xItcLsvjzYZw6NjIhcEdjrTNk8aQY 9a/Y0RrzF/qQgXCqIau+sbYLVjF/Tb+8WH98KIcvxKo6weF9AL/QNUdQ80293Jjx9nfrhKxl24T qftnsEttxKJHnHHXywe9P14LDd55qLG0RftxyqumiFxPBD/MURzG12J1xfctKN/W62QSs9UPceq BZMkNeGwIJezq05IGErtLtXTAi8A64iPBYK8vx X-Received: by 2002:a17:907:3f23:b0:a7a:a4be:2f95 with SMTP id a640c23a62f3a-a7d3fdb6696mr1138242266b.5.1722424702632; Wed, 31 Jul 2024 04:18:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGRYsE9dnpqXe/IuPJvNHRIYHejj7MEooJagaN1SWluCATfzErb1yyMtGrZsLLtGG4jxTvgIA== X-Received: by 2002:a17:907:3f23:b0:a7a:a4be:2f95 with SMTP id a640c23a62f3a-a7d3fdb6696mr1138239866b.5.1722424702200; Wed, 31 Jul 2024 04:18:22 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Zhao Liu Subject: [PULL 05/10] target/i386/cpu: Add dependencies of CPUID 0x12 leaves Date: Wed, 31 Jul 2024 13:18:01 +0200 Message-ID: <20240731111806.167225-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240731111806.167225-1-pbonzini@redhat.com> References: <20240731111806.167225-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.126, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1722424774754116600 Content-Type: text/plain; charset="utf-8" From: Zhao Liu As SDM stated, CPUID 0x12 leaves depend on CPUID_7_0_EBX_SGX (SGX feature word). Since FEAT_SGX_12_0_EAX, FEAT_SGX_12_0_EBX and FEAT_SGX_12_1_EAX define multiple feature words, add the dependencies of those registers to report the warning to user if SGX is absent. Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20240730045544.2516284-4-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index e864f55d4fc..28b46ef536f 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1734,6 +1734,18 @@ static FeatureDep feature_dependencies[] =3D { .from =3D { FEAT_7_0_EBX, CPUID_7_0_EBX_SGX }, .to =3D { FEAT_7_0_ECX, CPUID_7_0_ECX_SGX_LC }, }, + { + .from =3D { FEAT_7_0_EBX, CPUID_7_0_EBX_SGX }, + .to =3D { FEAT_SGX_12_0_EAX, ~0ull }, + }, + { + .from =3D { FEAT_7_0_EBX, CPUID_7_0_EBX_SGX }, + .to =3D { FEAT_SGX_12_0_EBX, ~0ull }, + }, + { + .from =3D { FEAT_7_0_EBX, CPUID_7_0_EBX_SGX }, + .to =3D { FEAT_SGX_12_1_EAX, ~0ull }, + }, }; =20 typedef struct X86RegisterInfo32 { --=20 2.45.2 From nobody Sun Nov 24 13:59:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1722424801; cv=none; d=zohomail.com; s=zohoarc; b=fOeQ1cqSAWXehCwiYi/6S8p2IUT7vMtSCIwXl1pz00Eem5dw8BvAvanOzeRKn49TyXhUcE6yfNYUKjFnbp7T3UkZVQ09Ufk+z3IxPQ+3tS8SRmWAS1rq1vxy7xMIlD6pop707TR/0MOrSKg5pTzcQxD4XBPAIWH6NbeIoFsWg14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722424801; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=D3GWXk89dFoCnN0qZrsb3fQ2QxGZwcvcR/+7hFQmEt0=; b=NBteGnFl4D8Ph2xHTIUFzsm86pNJzavgH0kN0aKEcCg8+7YhlMgkhgjcBwBlSmvS1aWn4292KpgrxhaTGEjohRzv13JSv1GgOuAMuyecAvdr8kiDzqPLTLILLE0sk8PZTXsTMSlyjRUjLSckYIcLTWZod69Rmkd3wUFFfaUWt14= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722424801013596.7033578602424; Wed, 31 Jul 2024 04:20:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZ7Ls-00063K-Nr; Wed, 31 Jul 2024 07:18:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7Lp-0005qn-7z for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7Ln-0006n6-FN for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:36 -0400 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-328-7KxeTYmOMqqjzgSRFg7Ccg-1; Wed, 31 Jul 2024 07:18:28 -0400 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5a7b5bd019cso5549982a12.0 for ; Wed, 31 Jul 2024 04:18:28 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ac65481320sm8494703a12.81.2024.07.31.04.18.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 04:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722424714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D3GWXk89dFoCnN0qZrsb3fQ2QxGZwcvcR/+7hFQmEt0=; b=R8MN1KnpJu51lprFVhmlyyR3c3qgPHiwwdUmhGhKZuqxerfTWKrmmuXrLT4Av8O/v8DjGS 26jIXASiU0pjVXlanHMEkHdm0dJLBWw6/nd/kWJztxdPVALIYgcgb1a3h4IuUfGQoj/b/X +Dmqd2I/MGQhxyyF2Vj22DFKWGGFKtA= X-MC-Unique: 7KxeTYmOMqqjzgSRFg7Ccg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722424705; x=1723029505; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D3GWXk89dFoCnN0qZrsb3fQ2QxGZwcvcR/+7hFQmEt0=; b=BVZwBScqx5iEo9N1p/9T76fHVZ3rIXsni8kFcMAQBhbE1wBiFEotlODOm3oHaFudF/ DZoFNfpnoVCVz+hQp9LH8AHxFpMnJkPNTu8Dywh7MH/yu2qsUrZ14jfJips3Oz1omo0f Sais+JcEkdHtGtsyq2Bs0+reMqGzmW4sUD+4KnnuUcIaxhdYrZ75HKARb/gMx5mHsD0T t0NHRiTf3mDHe2GaYL7VFbqjxrsxi8H4CuIDfSEbwcAKJiZkH2xU5LM75A6KOTgLY3Ww 9MC2QY1tNocK3UwZz7H3x+gWgc1MMxclK54Q0AZ7ogHBIwVogI3XOJu51AjRX6jVlz7w S3PA== X-Gm-Message-State: AOJu0YxixkrhalqkIPZK1dM87TE6LLz0DNQl8jjFvWajGrHq6xPbgOXr ODm9Hx8/2I6nysWSENM9//ZE0q9FZtTvoXCTgy05b9RsbjRBmdM92rOXk1AJrQi0nNkkIBzeyva XTjGC4U8w3Ndsxls3IaMGRareZ3VPbjyklAU7vGdw2rP1I2/Be43HYSFUq+hLKnLthaCdvlteH4 d2JRKGkxC8iye19nWsZFofb0N8lNUEmp0g0gIX X-Received: by 2002:a50:9504:0:b0:57d:4f47:d9ee with SMTP id 4fb4d7f45d1cf-5b0221f0afcmr9571326a12.31.1722424705606; Wed, 31 Jul 2024 04:18:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcF+AFAG7W2hYI8niZxggMhrLUEleNnv0O4IkDAX34xFe9ShitPIMxEIT5xLTQJuNUC3AWGg== X-Received: by 2002:a50:9504:0:b0:57d:4f47:d9ee with SMTP id 4fb4d7f45d1cf-5b0221f0afcmr9571305a12.31.1722424704991; Wed, 31 Jul 2024 04:18:24 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Zhao Liu Subject: [PULL 06/10] target/i386/cpu: Mask off SGX/SGX_LC feature words for non-PC machine Date: Wed, 31 Jul 2024 13:18:02 +0200 Message-ID: <20240731111806.167225-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240731111806.167225-1-pbonzini@redhat.com> References: <20240731111806.167225-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.126, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1722424802855116600 Content-Type: text/plain; charset="utf-8" From: Zhao Liu Only PC machine supports SGX, so mask off SGX related feature words for non-PC machine (microvm). Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20240730045544.2516284-5-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- include/hw/i386/sgx-epc.h | 1 + hw/i386/sgx-stub.c | 5 +++++ hw/i386/sgx.c | 8 ++++++++ target/i386/cpu.c | 15 +++++++++++++++ 4 files changed, 29 insertions(+) diff --git a/include/hw/i386/sgx-epc.h b/include/hw/i386/sgx-epc.h index 3e00efd870c..41d55da4799 100644 --- a/include/hw/i386/sgx-epc.h +++ b/include/hw/i386/sgx-epc.h @@ -58,6 +58,7 @@ typedef struct SGXEPCState { int nr_sections; } SGXEPCState; =20 +bool check_sgx_support(void); bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size); void sgx_epc_build_srat(GArray *table_data); =20 diff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c index 16b1dfd90bb..38ff75e9f37 100644 --- a/hw/i386/sgx-stub.c +++ b/hw/i386/sgx-stub.c @@ -32,6 +32,11 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms) memset(&pcms->sgx_epc, 0, sizeof(SGXEPCState)); } =20 +bool check_sgx_support(void) +{ + return false; +} + bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size) { return true; diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c index 849472a1286..4900dd414a1 100644 --- a/hw/i386/sgx.c +++ b/hw/i386/sgx.c @@ -266,6 +266,14 @@ void hmp_info_sgx(Monitor *mon, const QDict *qdict) size); } =20 +bool check_sgx_support(void) +{ + if (!object_dynamic_cast(qdev_get_machine(), TYPE_PC_MACHINE)) { + return false; + } + return true; +} + bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size) { PCMachineState *pcms =3D diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 28b46ef536f..85ef7452c04 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6103,6 +6103,21 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *= cpu, FeatureWord w) } break; =20 + case FEAT_7_0_EBX: +#ifndef CONFIG_USER_ONLY + if (!check_sgx_support()) { + unavail =3D CPUID_7_0_EBX_SGX; + } +#endif + break; + case FEAT_7_0_ECX: +#ifndef CONFIG_USER_ONLY + if (!check_sgx_support()) { + unavail =3D CPUID_7_0_ECX_SGX_LC; + } +#endif + break; + default: break; } --=20 2.45.2 From nobody Sun Nov 24 13:59:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1722424772; cv=none; d=zohomail.com; s=zohoarc; b=FTcHlptmBpS4+5C15x4KLVka8yhFf/qm/MBTKFFVBsCGcQnZBvZ2Qs3Q2fwxN30LV3avPBvrd7phgtN3CH+rfpRKA6beS/Pwsl7KtUD3E3oTq4CETOhqkKi6pYxXvXLpRz91OdpvxGFRDHMfBS0H8QiYAAUmYb/uldo9DG9tpNE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722424772; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DLy0sdEp2Wnrm9eD4P6E+5mw/BzvIrbLw2Ba6SR4iAA=; b=Ew5p8EDOeXsY3lugwBCV3szv6FfgmuyT8Hz4lWgQ6KHrf39+Pw+5Ih+8QbrooO82JLXUUn0IhrtUdXNp5uEXuz/n+nfQbWUM25f2tT/lJX+oszBLCNeNRFxBKrQg6t1K4WcbW1GKNkcbbfG1djj0XhhFWf00zZi2NQUPjiE+sDg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722424772950909.7906689103718; Wed, 31 Jul 2024 04:19:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZ7Lp-0005qv-QM; Wed, 31 Jul 2024 07:18:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7Ln-0005q1-Lo for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7Ll-0006mr-IF for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:35 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-402-uITCLyngOCqMHzmmev9jOw-1; Wed, 31 Jul 2024 07:18:29 -0400 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a7275e17256so568537866b.0 for ; Wed, 31 Jul 2024 04:18:29 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7d9043ca41sm148185366b.72.2024.07.31.04.18.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 04:18:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722424712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DLy0sdEp2Wnrm9eD4P6E+5mw/BzvIrbLw2Ba6SR4iAA=; b=WH8X/Kw0bUHLndjXJ4rzcAxeLe1My41r1A4oFvemydKfgPUeikb+w+K/WjBGEf8r3MWsN2 Qbddw8wrWoHOD0w3vHhDbp9lezmMJMyRxlqvcMssDQ4pweBg3trhPqrH7q/zjJ3Kk/efZl H2xkEcTSz3Y1IMn/PgB4/nmHI2efH/s= X-MC-Unique: uITCLyngOCqMHzmmev9jOw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722424708; x=1723029508; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DLy0sdEp2Wnrm9eD4P6E+5mw/BzvIrbLw2Ba6SR4iAA=; b=Tuthy6cmqdPy0VgwodP7D3jPnYkWCu7xUnE9nPWSczjzXuRXszfCaRNGKoRW8+63xe F3XR0VM4rxmcK4r/uIJ40MDrIcQGKb0SzmbWPOzXHZInAMklIgYCFQNx2gEDAsQDSOgI WAuE6cN5pQ1cnh/qMchFUmXKODSzORyOWKhxzuMisyggubuAns0KGw9pu/onCfppbRS4 IYJpYpLGNH5Ii55IHqNzVVYyZOJRXhV9K6TmBGBWsWLMGD7YNoZXrhdA0mhfgjgbJ3LL GqATYZCvqLgP6rD6OR8U5sCeVZFBJaYVMqS641Vbft3nJJWZoaiwGg6nX2bEvrcNJr9I HhVA== X-Gm-Message-State: AOJu0YxT3EunkmXVwLiAo8t6AIrD2S5sziz8CpWXGEyiACVe+IM9iQSx qBY+fqM0i56FRGI6+Rg9iu4u8KSIRuiNk9atzwXip2Wc3imV0zxzl5gDIq4uDPZGlplgGuuKggm IHCoBIWai+9KcaCLajvRT71Sk09hTdLw3k186PTmm428cqgXlLDESHhbhZ0GPwtsNEmzGY3fR0r BRwFK3ZIMbLDWEXmjNinc2NXuxPmOr2gDrzd/G X-Received: by 2002:a17:906:d54f:b0:a77:de2a:aef7 with SMTP id a640c23a62f3a-a7d40150ad2mr1032012266b.44.1722424708137; Wed, 31 Jul 2024 04:18:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEd6FvfL4RnnSElTY80AYlYfZV9d1vWEZnrHe6i02iCVhI11f10D2a8OGal0TNReq4Uh8ed2g== X-Received: by 2002:a17:906:d54f:b0:a77:de2a:aef7 with SMTP id a640c23a62f3a-a7d40150ad2mr1032010766b.44.1722424707768; Wed, 31 Jul 2024 04:18:27 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Anthony Harivel Subject: [PULL 07/10] target/i386: Fix typo that assign same value twice Date: Wed, 31 Jul 2024 13:18:03 +0200 Message-ID: <20240731111806.167225-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240731111806.167225-1-pbonzini@redhat.com> References: <20240731111806.167225-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.126, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1722424774746116600 Content-Type: text/plain; charset="utf-8" From: Anthony Harivel Should fix: CID 1558553 Signed-off-by: Anthony Harivel Link: https://lore.kernel.org/r/20240726102632.1324432-2-aharivel@redhat.com Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index b4aab9a410b..31f149c9902 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -2694,8 +2694,8 @@ static void *kvm_msr_energy_thread(void *data) =20 while (true) { /* Get all qemu threads id */ - g_autofree pid_t *thread_ids =3D - thread_ids =3D vmsr_get_thread_ids(vmsr->pid, &num_threads); + g_autofree pid_t *thread_ids + =3D vmsr_get_thread_ids(vmsr->pid, &num_threads); =20 if (thread_ids =3D=3D NULL) { goto clean; --=20 2.45.2 From nobody Sun Nov 24 13:59:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1722424776; cv=none; d=zohomail.com; s=zohoarc; b=Q1YIAL17Tlus4HW+Xm5VTjNiwmddTYb9XgvWiw92vtFqgzFmv9rEVDHHYCviFUNV23qu2KCpRi+/Nj525F9L+X5YH2mXWEz7Fehpt3wvheI6jhuL6j2sayTAB4fdLgJXjmV+aRtxS4dB7ZkxAw3T7pIqfsqPfwFOL3f2T0dsrr4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722424776; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=18y0TLtURaACI8V2aaTdx66LDye0ViTKACpdUCycGOc=; b=Dg82wrL72IWmi7zyiTYJB4Awo1D+O60VaxDwpH54DfEFG4kClOPfNKAFWPMoptYxYUFH3p6K6lS90q4yuf7ZQjAI/rcSZoFkJarpZaj47nVWFiOPxZ9p3eqMwrthoFQgMmqmcb6f+a/WM9BUCrAQSf6u+vKjM16jWurDHl631n8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 172242477656624.952134543747093; Wed, 31 Jul 2024 04:19:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZ7Lq-0005vk-Ty; Wed, 31 Jul 2024 07:18:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7Lo-0005qU-Q8 for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7Lm-0006n0-Jd for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:36 -0400 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-62-mZP7SxbPNEe1Dib0YLDEdA-1; Wed, 31 Jul 2024 07:18:32 -0400 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a7d2f42df2dso112414866b.1 for ; Wed, 31 Jul 2024 04:18:32 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7acadb9a12sm753487266b.213.2024.07.31.04.18.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 04:18:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722424714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=18y0TLtURaACI8V2aaTdx66LDye0ViTKACpdUCycGOc=; b=MWZoVF8MdPGpmVoW8Wn9/uDMXVOF1K/IAjxEw6A7SHzWGRZhbHe9uwT18yBASJcExJpxpN IekJvWH0yPpN6A1cabhEvvJWpq2MuLq5CJhAbDSnek/lEOCFtqhQGpOIjH0kCsZyKFilsM bH8j1TofYkxQCv5SSIMgeUR8Sj2/8Mc= X-MC-Unique: mZP7SxbPNEe1Dib0YLDEdA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722424711; x=1723029511; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=18y0TLtURaACI8V2aaTdx66LDye0ViTKACpdUCycGOc=; b=b5Jr5BQUvuKhIi22yqDengmRDEgJ/nc67LXhACCXOWyCfrVvReLOeIKBUn5teyG5aW D4Ubk4J1AKyLSImTyCTtgkWH4im8tvbcEqcMGUgtGY/rNFqHSQdl95c1wIlZuNbGQOQ3 /n/nKBdsKza6elEzSWvPxEQyx9BzYL21C2ec5qqBSStZspBxp8soUnFYeKfVnuioo1at GQ+xSTS+83qFSNCjb2RsbF8FBanL8hoks74yPPuVH6eb0XMyiu4IcWkbxE4DxmzkOIPO phclIP1RuHMnDL4vrbgilJJc+ULeYCAtDkWdNgYQ5hf0d7881t7Y9X0coDrCRpbOoSo9 a+gA== X-Gm-Message-State: AOJu0Yx+WOXXAxKxZJiYZ2MXADuhJYPJ0hITYpoEvl61Eo2oeHi6nIRA Zv9dgIWcISc4QuFulqra8Al+dMBVvnkuou3PpvvvldM/akth/bejOKMpbDRHQX0NimcFanvwIRJ P2tCzSvnI8uCNYZf41NduKgiflXd9azS+vVtVgPt8UffrSs3q8Je2NGIk22DxralEuFIPfinqT0 Gc/kiNkjpESXpbzBai5ZLJgurP8CtC8dWN0bTX X-Received: by 2002:a17:906:ee88:b0:a72:7b17:5d68 with SMTP id a640c23a62f3a-a7d858bb113mr453611066b.3.1722424710969; Wed, 31 Jul 2024 04:18:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFrpNWcr2QiySQj46ryyYBfW4GM0BDhjlW41oxX5veSGug3PpZi9xTYcCb6m1pC3vXggA/FA== X-Received: by 2002:a17:906:ee88:b0:a72:7b17:5d68 with SMTP id a640c23a62f3a-a7d858bb113mr453609066b.3.1722424710518; Wed, 31 Jul 2024 04:18:30 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Anthony Harivel Subject: [PULL 08/10] target/i386: Clean up error cases for vmsr_read_thread_stat() Date: Wed, 31 Jul 2024 13:18:04 +0200 Message-ID: <20240731111806.167225-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240731111806.167225-1-pbonzini@redhat.com> References: <20240731111806.167225-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.126, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1722424778750116600 Content-Type: text/plain; charset="utf-8" From: Anthony Harivel Fix leaking memory of file handle in case of error Erase unused "pid =3D -1" Add clearer error_report Should fix Coverity CID 1558557. Signed-off-by: Anthony Harivel Link: https://lore.kernel.org/r/20240726102632.1324432-3-aharivel@redhat.com Signed-off-by: Paolo Bonzini --- target/i386/kvm/vmsr_energy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/i386/kvm/vmsr_energy.c b/target/i386/kvm/vmsr_energy.c index a1d78f2f2ae..7e064c5aef3 100644 --- a/target/i386/kvm/vmsr_energy.c +++ b/target/i386/kvm/vmsr_energy.c @@ -270,7 +270,7 @@ void vmsr_read_thread_stat(pid_t pid, =20 FILE *file =3D fopen(path, "r"); if (file =3D=3D NULL) { - pid =3D -1; + error_report("Error opening %s", path_name); return; } =20 @@ -279,7 +279,8 @@ void vmsr_read_thread_stat(pid_t pid, " %*u %*u %*u %*u %*u %*u %*u %*u %*u %*d %*u %*u %u", utime, stime, cpu_id) !=3D 3) { - pid =3D -1; + fclose(file); + error_report("Error fscanf did not report the right amount of item= s"); return; } =20 --=20 2.45.2 From nobody Sun Nov 24 13:59:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1722424790; cv=none; d=zohomail.com; s=zohoarc; b=cIRyr+p2nqUERekMHYNb+nmD9/vBYmikdSCwsqZX0R8QrnZBAGYUkiKodoH/eQ56Y9oMW4m5M55W7MUjpYxlMWRA1NB4VTr4gnTuKqZnUL9IpfBzQEOlVdY/d2I71ZvOR0HNbFDvyn8s2nSklMy+DUtEnBllWlsJpEhmTGsoWsw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722424790; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=mVez8TyHo7hNenUkEAcWhE2tawtL+vOCnY0ZoqSQIew=; b=BLYEXcDkFcby8uhHo/I/RZnLhyLOVEzD1RerBGgXSAkiDyGLH0u4I16zRb9VzS4unYZGwUknlpxW5NagvQa+00RMNN6vsOilRJxmI7sPbd6J4l1SE1CR49uJAKMZNTqJwfj1vl5GQAzmR2qmi0TLa9EdAFPwctasEcfDnGQdafU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722424790703973.8135976788476; Wed, 31 Jul 2024 04:19:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZ7MC-0006fN-93; Wed, 31 Jul 2024 07:19:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7MA-0006dl-Rn for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7M9-0006pr-GF for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:58 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-605-p-ww0tNsMAyJTxLCtZZq1g-1; Wed, 31 Jul 2024 07:18:53 -0400 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5a2ceb035f9so1157871a12.0 for ; Wed, 31 Jul 2024 04:18:53 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5b52ab8f09dsm1517584a12.26.2024.07.31.04.18.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 04:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722424736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mVez8TyHo7hNenUkEAcWhE2tawtL+vOCnY0ZoqSQIew=; b=d6k+dRs44Yfz4ThblBHX604BeXMa4X6z8yuTuK4l1dFYGBS92sAlzxSn1D6yIZ1BF1TFFL yreNLkbo6TvCnRyhnTbj2RGZqPmWhGO4SQeo0nwFCXHTle4QGiBACU6OOktyocEMlwmmv0 sgIm2rCrpibisPeBfhZS1o1uYUSbL1E= X-MC-Unique: p-ww0tNsMAyJTxLCtZZq1g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722424732; x=1723029532; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mVez8TyHo7hNenUkEAcWhE2tawtL+vOCnY0ZoqSQIew=; b=HwG9HH/JJcDzC76SxeHNqIguO7C3OygGQYXBkUcHLP+WnNP2dhVlPVWeChS+uUlgO2 ioqaHXRugfl/ZO5eKBuIkUxi7nJIYtimdBCE368vyIPmcuY1B50BaYnRu9FmTbC0H01i BmO6Zu98XEvhwRERGAAdzW+Jhh1OSu6wAS4oYOV+zI153Ni8AwiXv9N3BjfJz0Cjuquu fDh1SxhaUjhdNjP1f3x9WaflJreXOF2krwSKTX7NU9SNOGEeUFeIYdx7tX276MICyocu RXR5NKFQGYhXEws7ljU5lZLdBuk2QiamXqGseBJzVnsMEL5W+ZAEmnq0rwnG1o/fJGJv cHQQ== X-Gm-Message-State: AOJu0YyLx7Pxjo47wEtxeRYTyRwOJIdrkpMzYyQmPQmx718mDmP5LJOK vn8J/4ZxxSGuk5Xw50jkqo9dI/uoPO2nRShdw9I4k1oI/LWkV0YXxi5E0HFPwO2iyK9kaqo0Jqc MUcV8HF7qavLuS2ISUj0e+YzkgQCINYXb/zJTev3apZVizY0+GfTEsXOqvhJwsXQ5Uk7eXdxSUn ZsteOJ8+fg0wEb+NKwqh2idlNsv8y1OO4zWhCR X-Received: by 2002:a50:c08a:0:b0:59c:50c3:af65 with SMTP id 4fb4d7f45d1cf-5b46ca289c3mr4398819a12.14.1722424732041; Wed, 31 Jul 2024 04:18:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0/9R4hN4m/6w66/xqgyBcFI3rVGskcB8eVM72vvXb/NGiYh5ZQvZUY+xl7gLxdI/zlM7epA== X-Received: by 2002:a50:c08a:0:b0:59c:50c3:af65 with SMTP id 4fb4d7f45d1cf-5b46ca289c3mr4398182a12.14.1722424713579; Wed, 31 Jul 2024 04:18:33 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 09/10] qemu-vmsr-helper: fix socket loop breakage Date: Wed, 31 Jul 2024 13:18:05 +0200 Message-ID: <20240731111806.167225-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240731111806.167225-1-pbonzini@redhat.com> References: <20240731111806.167225-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.126, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1722424792807116600 Content-Type: text/plain; charset="utf-8" Between v5 and v6 of the series, the socket loop of qemu-vmsr-helper was ch= anged to allow sending multiple requests on the same socket. Unfortunately, the con= dition of the while loop is botched and the loop will never be entered. Clean it = up, and also unify the handling of error reporting. Signed-off-by: Paolo Bonzini --- tools/i386/qemu-vmsr-helper.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/i386/qemu-vmsr-helper.c b/tools/i386/qemu-vmsr-helper.c index ebf562c3ff8..585eaf88b37 100644 --- a/tools/i386/qemu-vmsr-helper.c +++ b/tools/i386/qemu-vmsr-helper.c @@ -227,19 +227,17 @@ static void coroutine_fn vh_co_entry(void *opaque) &peer_pid, &local_err); if (r < 0) { - error_report_err(local_err); goto out; } =20 - while (r < 0) { + for (;;) { /* * Read the requested MSR * Only RAPL MSR in rapl-msr-index.h is allowed */ - r =3D qio_channel_read_all(QIO_CHANNEL(client->ioc), - (char *) &request, sizeof(request), &local= _err); - if (r < 0) { - error_report_err(local_err); + r =3D qio_channel_read_all_eof(QIO_CHANNEL(client->ioc), + (char *) &request, sizeof(request), &= local_err); + if (r <=3D 0) { break; } =20 @@ -261,11 +259,15 @@ static void coroutine_fn vh_co_entry(void *opaque) sizeof(vmsr), &local_err); if (r < 0) { - error_report_err(local_err); break; } } + out: + if (local_err) { + error_report_err(local_err); + } + object_unref(OBJECT(client->ioc)); g_free(client); } --=20 2.45.2 From nobody Sun Nov 24 13:59:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1722424814; cv=none; d=zohomail.com; s=zohoarc; b=M8uMxaGEyzxKd7/SGmLoJQbNyR+VPg99FdRD539xKqkgcTJ/tTB3WXiIAQT3Cz8mp4C/y0Ew8UgGlZvu5ZlyAKRNMYhktpk0kchMgUBWtyDXfra8rFfyW6IBQpjKMZjyLGeblQL0tOfsuKwKVPMkctCQ6QZHUxnKm8PrTyb0dCI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722424814; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=EV2mr0xjlD8I0ffhcoIthBmy7Vwwm1tNrboAunzoeDA=; b=UDUCoMb+L/YZOjhYwfwezC/Udn405vEvnE78YYmalIcu6dLBccA9CDV66BIGfNJ9zYO3bnVrIwRRsWaC7CD2CaNRIxBl4qvRXDNyX8ftHq8ZtGnES+6k64HUg9/7o7u5JPBmwlXQAb80pTVxfgsqKBaqYEAlksSLlQs8Hw6Wf4s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722424814073433.6155579297323; Wed, 31 Jul 2024 04:20:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZ7MD-0006iL-2K; Wed, 31 Jul 2024 07:19:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7MC-0006eu-1a for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:19:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ7MA-0006pz-Lj for qemu-devel@nongnu.org; Wed, 31 Jul 2024 07:18:59 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-629-r-7XXpaIO0qX3M_Oy2I2Kw-1; Wed, 31 Jul 2024 07:18:56 -0400 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a7a8a38a4bcso248894366b.0 for ; Wed, 31 Jul 2024 04:18:56 -0700 (PDT) Received: from avogadro.local ([151.95.101.29]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5afc05c7a44sm6913068a12.6.2024.07.31.04.18.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 04:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722424738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EV2mr0xjlD8I0ffhcoIthBmy7Vwwm1tNrboAunzoeDA=; b=LKPwr/pck0uaFPWXR8d7T+7LpPw3p+7sCoyaQ53jFaO61ph1OavMEA1wTJvzFIDg+bhl4b lpty99bkKNpUSiLCsbYuzGTs/QkQ+4Omq35VdSblefmy/La86BiN9efjiBkjW7AjLaIz3e Fo7Uarh1D66ow6gp+BL5LjVtuV9W73Q= X-MC-Unique: r-7XXpaIO0qX3M_Oy2I2Kw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722424734; x=1723029534; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EV2mr0xjlD8I0ffhcoIthBmy7Vwwm1tNrboAunzoeDA=; b=uEvjmnDGRZwyNDRhwPP1awM13cWCCh9gChQ1OuSSd2QCloC7Z6vL4fZaWLD/Di7nZJ Orwo2x/8pAj14NDM6XMGvfYqWzlSqWqSnKaUYTrmiLDlYWw9XaGA/EJTJFCpq4Ln748c plT3TUGJG/NmQ6jfDwjInAnP567pAIWJfnqmSeNQXAEIaa6+DIWLEuO+Ffdt64aVvZpv 9Sdc48mhjCR1o+p1ojgCz2oEMxyspiv7AC2IT1fZKxNkVFuiCaiRLZE/sfFO8z63dLWv JQrlqFLGlubiUvMB+ka1RpOjylKUsXPCmcsEw3o+aiUDkycMvKXQwwipU/LDQTTVBeCx Rbgg== X-Gm-Message-State: AOJu0YxSv6CZLM6GRKVNi1xXb8tBNFjW+dfLTcWnValFyErSt/r3cU/v 9Qxt9c+0Ecxx3GL4vhAR9w34iQUDIDb8joWlhCbWfzUVwMSaPgS2GxdYnlH8//FGIZfUNZtLFEv 2UP+XHsglI+wfe9GjS7fdHhsoZLVBksPDCDz7MRN4gTUxDM+vlUAbCdogYdY6N8GH9xU+ceB9az LbgmgKrzGTW4o+UnAO/bKNTo+6lREf67ObRyHp X-Received: by 2002:a05:6402:26d6:b0:57d:669:caf2 with SMTP id 4fb4d7f45d1cf-5b02317d0a3mr14495172a12.25.1722424734653; Wed, 31 Jul 2024 04:18:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7zHnVt7DRPrWIor5mqy5dZIgpU/a4Mw86c+ii0dl1hXAuomGRwncvq1aI6v6Bj/amnhQYZw== X-Received: by 2002:a05:6402:26d6:b0:57d:669:caf2 with SMTP id 4fb4d7f45d1cf-5b02317d0a3mr14495160a12.25.1722424734273; Wed, 31 Jul 2024 04:18:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 10/10] qemu-vmsr-helper: implement --verbose/-v Date: Wed, 31 Jul 2024 13:18:06 +0200 Message-ID: <20240731111806.167225-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240731111806.167225-1-pbonzini@redhat.com> References: <20240731111806.167225-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.126, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1722424814878116600 Content-Type: text/plain; charset="utf-8" Similar to qemu-pr-helper, do not print errors from the socket handling loop unless a --verbose or -v option is provided explicitly on the command line. Signed-off-by: Paolo Bonzini --- tools/i386/qemu-vmsr-helper.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/i386/qemu-vmsr-helper.c b/tools/i386/qemu-vmsr-helper.c index 585eaf88b37..a35dcb88a3f 100644 --- a/tools/i386/qemu-vmsr-helper.c +++ b/tools/i386/qemu-vmsr-helper.c @@ -54,6 +54,7 @@ static enum { RUNNING, TERMINATE, TERMINATING } state; static QIOChannelSocket *server_ioc; static int server_watch; static int num_active_sockets =3D 1; +static bool verbose; =20 #ifdef CONFIG_LIBCAP_NG static int uid =3D -1; @@ -265,7 +266,11 @@ static void coroutine_fn vh_co_entry(void *opaque) =20 out: if (local_err) { - error_report_err(local_err); + if (!verbose) { + error_free(local_err); + } else { + error_report_err(local_err); + } } =20 object_unref(OBJECT(client->ioc)); @@ -431,6 +436,9 @@ int main(int argc, char **argv) case 'd': daemonize =3D true; break; + case 'v': + verbose =3D true; + break; case 'T': trace_opt_parse(optarg); break; --=20 2.45.2