From nobody Sat May 18 12:47:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594662349; cv=none; d=zohomail.com; s=zohoarc; b=ZYLKPSBR23hlm+wtbEjb8ISpuQeQFgeXOfa2s8coKk4W2LwNKJvsQxybmRp2uqc86OI7EHhdSaUxiEzl9EXNy2uPOzt6BPJB86c/B8uQlrNqSoAcpQQbm0+orWVPlwjK54Yd3sYcwyqHsb0RDUFNzVNDoTn0ggPWdPW820c2pWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594662349; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=dPLor3KzpV4mHSKycnc7wxI7UGmjgfPDt2KsA+UjJuQ=; b=MQpdkpwMPCE+utSZmb5Y2pVtRyXsXVMvNZGR8F1nLhV+NsQLmz2f96wjO9t58TvTvsa/Am4y1qBEwi6X9xTEo0sKXNiQcO5GEYf0QoxdLoFHC1jVO6aSULzb+jXBm4uFdQaEbf/ZJ3nXmmUgxyLbD34j4tCCA07PToZfehbDvaw= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 159466234964811.51019549351463; Mon, 13 Jul 2020 10:45:49 -0700 (PDT) Received: from localhost ([::1]:40688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv2WS-0008Vu-EE for importer@patchew.org; Mon, 13 Jul 2020 13:45:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv2Vb-0007Xi-6L for qemu-devel@nongnu.org; Mon, 13 Jul 2020 13:44:55 -0400 Received: from mga12.intel.com ([192.55.52.136]:22540) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv2VZ-0006H5-L6 for qemu-devel@nongnu.org; Mon, 13 Jul 2020 13:44:54 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2020 10:44:42 -0700 Received: from lxy-dell.sh.intel.com ([10.239.159.21]) by fmsmga002.fm.intel.com with ESMTP; 13 Jul 2020 10:44:40 -0700 IronPort-SDR: VdpbSh94qc86LbhMnGPOwSi8LVbLxH+WtF9BXXuM6RAagJwC+Zz6+fiZuzhViVjOc9JkDuDcdc ihCqTboeAwBQ== X-IronPort-AV: E=McAfee;i="6000,8403,9681"; a="128255221" X-IronPort-AV: E=Sophos;i="5.75,348,1589266800"; d="scan'208";a="128255221" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False IronPort-SDR: Mid/vTm4r0/SC53IQ1ely7ARftn2DMgoMt9gdDmXy0Up1EKiHsMBweBNsb8aKim1iC9jIVH352 IBkCPiOhz90A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,348,1589266800"; d="scan'208";a="317450488" From: Xiaoyao Li To: Eduardo Habkost , Paolo Bonzini , Richard Henderson Subject: [PATCH 1/2] i368/cpu: Clear env->user_features after loading versioned CPU model Date: Tue, 14 Jul 2020 01:44:35 +0800 Message-Id: <20200713174436.41070-2-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20200713174436.41070-1-xiaoyao.li@intel.com> References: <20200713174436.41070-1-xiaoyao.li@intel.com> 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=192.55.52.136; envelope-from=xiaoyao.li@intel.com; helo=mga12.intel.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/13 13:44:48 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaoyao Li , qemu-devel@nongnu.org, Chenyi Qiang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Features defined in versioned CPU model are recorded in env->user_features since they are updated as property. It's unwated because they are not user specified. Simply clear env->user_features as a fix. It won't clear user specified features because user specified features are filled to env->user_features later in x86_cpu_expand_features(). Cc: Chenyi Qiang Suggested-by: Eduardo Habkost Signed-off-by: Xiaoyao Li Reviewed-by: Eduardo Habkost --- target/i386/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 1e5123251d74..9812d5747f35 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5159,6 +5159,12 @@ static void x86_cpu_load_model(X86CPU *cpu, X86CPUMo= del *model) object_property_set_str(OBJECT(cpu), "vendor", vendor, &error_abort); =20 x86_cpu_apply_version_props(cpu, model); + + /* Properties in versioned CPU model are not user specified features. + * We can simply clear env->user_features here since it will be filled= later + * in x86_cpu_expand_features() based on plus_features and minus_featu= res. + */ + memset(&env->user_features, 0, sizeof(env->user_features)); } =20 #ifndef CONFIG_USER_ONLY --=20 2.18.4 From nobody Sat May 18 12:47:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594662417; cv=none; d=zohomail.com; s=zohoarc; b=GoNGGAtUUjThZGbVpRAB8bqUpA9884LD8UBnZr0rkheDKX8RcSx9DWGEtMKjiKCy0368y1nFf8efrsy6gULoWKROGzg3lknJl+y1o9DO37p+yBTZpAa9xCsAmcDZ4w+cLuHHSA4uGqBHR8lmhkH4Q28aYBkDlyT86811J1HANcI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594662417; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=Tokl4KyZ8jlFeKzoNd6VKDoi7cphtspU1MRszth/gqQ=; b=GelCK1rUk/Nv1kHxZjIW7I2myutK027xQdvSk19XgJ1ZSSv4lB3likMjkFW3wsS+6FUt6fWfzLcWE/rJOPI3r8RSSt+feH//4BcUXGdaXrWRdU7i1Reb+AatyyW2Uq2n+y1le3xsFth/nQ9XO7WODbsa5tbc8tfFEXeNmFfG8uc= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 1594662417373506.16004094928996; Mon, 13 Jul 2020 10:46:57 -0700 (PDT) Received: from localhost ([::1]:43780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv2XY-0001NE-38 for importer@patchew.org; Mon, 13 Jul 2020 13:46:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv2Vc-0007Yd-16 for qemu-devel@nongnu.org; Mon, 13 Jul 2020 13:44:56 -0400 Received: from mga12.intel.com ([192.55.52.136]:22549) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv2Va-0006HW-G2 for qemu-devel@nongnu.org; Mon, 13 Jul 2020 13:44:55 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2020 10:44:43 -0700 Received: from lxy-dell.sh.intel.com ([10.239.159.21]) by fmsmga002.fm.intel.com with ESMTP; 13 Jul 2020 10:44:42 -0700 IronPort-SDR: B52PYn5EC7VDRNVCIuFryVUb73+yUtJD+9yy+/ifZaXmuiuCvDjvYvSLQce6gW1AYULXck3i6G EDsYWKWfHrSg== X-IronPort-AV: E=McAfee;i="6000,8403,9681"; a="128255226" X-IronPort-AV: E=Sophos;i="5.75,348,1589266800"; d="scan'208";a="128255226" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False IronPort-SDR: 5kHW9S5hH1wdF2yLeOyytcYmx2bx3pRHOKhWwrHdcOVVjskJ6TjnlclejT1chDlNMIrCbUJR26 OpCcyCCpOXgQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,348,1589266800"; d="scan'208";a="317450493" From: Xiaoyao Li To: Eduardo Habkost , Paolo Bonzini , Richard Henderson Subject: [PATCH 2/2] i386/cpu: Don't add unavailable_features to env->user_features Date: Tue, 14 Jul 2020 01:44:36 +0800 Message-Id: <20200713174436.41070-3-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20200713174436.41070-1-xiaoyao.li@intel.com> References: <20200713174436.41070-1-xiaoyao.li@intel.com> 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=192.55.52.136; envelope-from=xiaoyao.li@intel.com; helo=mga12.intel.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/13 13:44:48 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaoyao Li , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Features unavailable due to absent of their dependent features should not be added to env->user_features. env->user_features only contains the feature explicity specified with -feature/+feature by user. Fixes: 99e24dbdaa68 ("target/i386: introduce generic feature dependency mec= hanism") Signed-off-by: Xiaoyao Li Reviewed-by: Eduardo Habkost --- target/i386/cpu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 9812d5747f35..fb1de1bd6165 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6370,7 +6370,6 @@ static void x86_cpu_expand_features(X86CPU *cpu, Erro= r **errp) unavailable_features & env->user_fea= tures[d->to.index], "This feature depends on other featu= res that were not requested"); =20 - env->user_features[d->to.index] |=3D unavailable_features; env->features[d->to.index] &=3D ~unavailable_features; } } --=20 2.18.4