From nobody Sun Feb 8 19:43:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601563326; cv=none; d=zohomail.com; s=zohoarc; b=cmj9oXUS2gz3UJ038lJ6/7Z84R/PugbwUJrR42t/CPVQkkfVZKm8DRiFI9pC0nBsHVrLMWcqF1/UCkWZ66LOb3BFK6wbSoljliXnaoNt2B2/HkbcCpYAgSxZAvfR1LjG8lSQiYz3PZPqIlEMsdntd8B6KERIvy8R5kQwvdKA2qs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601563326; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=ZpPmzecL1JnaAFfxJvQhWfBsNXB+MnX+YoPFlhUhAaM=; b=mlZBJBnYp93hT9uVhwO4ccno72ZXvcf4mtXKioS/QzPxBe1AVshZ3X5kODWmrKZSafYlXjeu4CZob3YRPT5jdhKTIGzdQiFyDcpzjcDOtzeey1Euu/mFgHsu51iKwaoHhcDCpJsPOGYDjjCtme6fDssjJsNZZiLZqbEWbpwv8UA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1601563326016104.58119999349151; Thu, 1 Oct 2020 07:42:06 -0700 (PDT) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-424-GW3PQ8vqPHe-xlVgL3NEtg-1; Thu, 01 Oct 2020 10:42:01 -0400 Received: by mail-wr1-f69.google.com with SMTP id f18so2134242wrv.19 for ; Thu, 01 Oct 2020 07:42:01 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id z67sm235870wme.41.2020.10.01.07.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 07:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601563324; 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=ZpPmzecL1JnaAFfxJvQhWfBsNXB+MnX+YoPFlhUhAaM=; b=U9TB4DrjWuvon25dQbFKgL4aZWnfQ45FU1NYRq2d3agPmUcVju801FM7i3zckzK4Odaqpo qpk4y3kf86MDOhMkbp43km6CsXOM7AE4RF6pj1wHwGwqD63xgUi1/bM7QCjf/6SHlWRgtr QJ71ZYScrxnwhTZtbavuGgsyUsOToxo= X-MC-Unique: GW3PQ8vqPHe-xlVgL3NEtg-1 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZpPmzecL1JnaAFfxJvQhWfBsNXB+MnX+YoPFlhUhAaM=; b=a80yqtTgbAcd/LJ9W9VPNPgV3JSgP4LX45pvD9KlJvh8IJllLbb52W5HoHzOCc3+NU ReNPaHsNFMcFM+T+g7hMYJynyyTdN2P6RE6tBJE5XgM87FoRRVjsjBqoNU7s5T7RoGA+ LAf1bV+hfz2tPEyhB2DXQftYEaVIHFnw5Q63cJH8Y4x1vdU7IWg+5miGCxOaRzHDKTFk FVS1UKZxjfcJH67HGWY5EQjiZvmqSjVwAgzXkhXOltqopzXAVri3qKbXXkSo1lVv/C7a dLcU2hAqtJ09OeVHd/EuedLJvHFVBY4XICDi+dqFPHcG2EijZb1irJAKHkk1OEimdCiy 1CDg== X-Gm-Message-State: AOAM530srr8+WCxEepaQ4k3Q4nLNZVKxry8qwMEDvt4zrvq5Ibc/KQrK 59CoxsS4vqklxfiyTUUbxFvT/QVaJ2l7Px5RmjiamNbf+3/qMhoBNiJ1+FZY4Ef/W4c2YRZIhMl 8apXB/CAAnccfRA== X-Received: by 2002:a1c:1fc6:: with SMTP id f189mr389801wmf.20.1601563319923; Thu, 01 Oct 2020 07:41:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2AAR5AwX//vaLlPmReSLdJYvN2sSBWcXdstcx/2WdlHHsuG5ZThU4FZ3f6fFxfbGf2Mb3Lg== X-Received: by 2002:a1c:1fc6:: with SMTP id f189mr389784wmf.20.1601563319688; Thu, 01 Oct 2020 07:41:59 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Laurent Vivier , qemu-devel@nongnu.org Cc: Eduardo Habkost , Michael Tokarev , Richard Henderson , Markus Armbruster , Marcel Apfelbaum , qemu-trivial@nongnu.org, Eric Blake , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 1/3] target/i386/cpu: Trivial code movement Date: Thu, 1 Oct 2020 16:41:50 +0200 Message-Id: <20201001144152.1555659-2-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001144152.1555659-1-philmd@redhat.com> References: <20201001144152.1555659-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Trivial code movement to reduce #ifdef'ry in the next commit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/cpu.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 3ffd877dd5..2eec53ca22 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4643,16 +4643,6 @@ static void x86_cpu_get_feature_words(Object *obj, V= isitor *v, visit_type_X86CPUFeatureWordInfoList(v, "feature-words", &list, errp); } =20 -/* Convert all '_' in a feature string option name to '-', to make feature - * name conform to QOM property naming rule, which uses '-' instead of '_'. - */ -static inline void feat2prop(char *s) -{ - while ((s =3D strchr(s, '_'))) { - *s =3D '-'; - } -} - /* Return the feature property name for a feature flag bit */ static const char *x86_cpu_feature_name(FeatureWord w, int bitnr) { @@ -4677,6 +4667,17 @@ static const char *x86_cpu_feature_name(FeatureWord = w, int bitnr) return name; } =20 +/* + * Convert all '_' in a feature string option name to '-', to make feature + * name conform to QOM property naming rule, which uses '-' instead of '_'. + */ +static inline void feat2prop(char *s) +{ + while ((s =3D strchr(s, '_'))) { + *s =3D '-'; + } +} + /* Compatibily hack to maintain legacy +-feat semantic, * where +-feat overwrites any feature set by * feat=3Don|feat even if the later is parsed after +-feat --=20 2.26.2 From nobody Sun Feb 8 19:43:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601563329; cv=none; d=zohomail.com; s=zohoarc; b=RhAvObyhOjrSmim7gs4xzIlrFoBGdQAGVBEurjdkMbRrFgXn6wY4wbAVkIhjBRbTuWLEK+s+TZ0RwVgnE6YYePJ5iBvwi/pzuWAWJCpd14378+MZ859Na6TSedtj9gZkIqJejD++UzPb0PllAoIr/e+W0tFYlehczovS5lPDMNs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601563329; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=13dFYoU6KvfqYyBOP1RLSUELKZQPOuaHJ8QYH3lau34=; b=VbZUCPVpadWdtkNihWvEzyE4UzE8WFT5UV++t5u96HXAU9L9q4RptzGjd3dyRZ/2NHn4xBUSeeuQ/SuoSjzv8oLEDGsu2hKBo4i/AH+s3VA/j8NU4Vj9nFVJzhrt7a397y+NJBhblT0aCyk/jpMajR3IKoIv0FH4kWzQNU65vWM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1601563329112866.9261440642788; Thu, 1 Oct 2020 07:42:09 -0700 (PDT) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-522-n1r9aVWYOk2btccwDgQJfw-1; Thu, 01 Oct 2020 10:42:06 -0400 Received: by mail-wm1-f72.google.com with SMTP id a7so1268397wmc.2 for ; Thu, 01 Oct 2020 07:42:06 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id o194sm301374wme.24.2020.10.01.07.42.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 07:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601563327; 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=13dFYoU6KvfqYyBOP1RLSUELKZQPOuaHJ8QYH3lau34=; b=K7ykEsaW/2idENbniZyrroDaVKA39z4PYeii3ht+vOX5D0U2ruTzfBnt9eCgZF82l7j9mn AFvu6WC/L5sNVvyep3zYKKPNx3yP9nZTooymWNT2AnnqECvCg1wzJf/DPjOrdGnD7c+IgU cPIgmYX5fSlExujI9aQQ55xa1GMs2dg= X-MC-Unique: n1r9aVWYOk2btccwDgQJfw-1 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=13dFYoU6KvfqYyBOP1RLSUELKZQPOuaHJ8QYH3lau34=; b=JlHqvBWyKzJ7kXf03VWSHxsU/zMQ9Zau4Cf9gptCNdb6nsOLYowjQ6NkPM7dSJMAlb CA7Ua8BPSvP6RdzPcwPhP3P67UKRBb2gEy1hN0g5MN4IbpWYI+VzIXcQ5INFL9UFlCy2 KCCnFYtvzHByqzlFa18wdCUA8ead0wl0gnAGEqCL5L7YXaUTQXBXZSh32QY/P6EwqMJC JPZlfqmOduOIZbRrInI3tL6k6UgKJQuxr0LptXN218dRFjZ2iF3ZyVSaLtMUdH8BwjYE 6iAGADC0gOM+S5/K499xOoJ3n5HHt781cJ36cdkd/gIA7ZCXNfbJRHrKTStXinDdqqhn LGdA== X-Gm-Message-State: AOAM531GTmzUb342Q5Ttfk7ri+8pyPax64DSPSCbpotXWhfMB4To+JMv U6okKwuy86JWPi4UIxgWr7ySXt+k+uMKDeqdZZax4ORGwTmKcbj1EXC+GnTFuxxy1Xd7+RQDHv8 G5n1GLA7XTQBrJg== X-Received: by 2002:a05:6000:151:: with SMTP id r17mr9251130wrx.311.1601563325313; Thu, 01 Oct 2020 07:42:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrzt9S3V7X1vy2AEYQIyqcVrhP7bOQbPWynLiIbO1fC4A1y5IZ7wB2zXD9goNUo4cVKkvc5w== X-Received: by 2002:a05:6000:151:: with SMTP id r17mr9251103wrx.311.1601563325121; Thu, 01 Oct 2020 07:42:05 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Laurent Vivier , qemu-devel@nongnu.org Cc: Eduardo Habkost , Michael Tokarev , Richard Henderson , Markus Armbruster , Marcel Apfelbaum , qemu-trivial@nongnu.org, Eric Blake , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v4 2/3] target/i386/cpu: Restrict some of feature-words uses to system-mode Date: Thu, 1 Oct 2020 16:41:51 +0200 Message-Id: <20201001144152.1555659-3-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001144152.1555659-1-philmd@redhat.com> References: <20201001144152.1555659-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The feature-words properties are not used in user-mode emulation, restrict it to system-mode. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/cpu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 2eec53ca22..9f72342506 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4607,6 +4607,7 @@ static void x86_cpuid_set_tsc_freq(Object *obj, Visit= or *v, const char *name, cpu->env.tsc_khz =3D cpu->env.user_tsc_khz =3D value / 1000; } =20 +#if !defined(CONFIG_USER_ONLY) /* Generic getter for "feature-words" and "filtered-features" properties */ static void x86_cpu_get_feature_words(Object *obj, Visitor *v, const char *name, void *opaque, @@ -4666,6 +4667,7 @@ static const char *x86_cpu_feature_name(FeatureWord w= , int bitnr) assert(bitnr < 32 || !(name && feature_word_info[w].type =3D=3D CPUID_= FEATURE_WORD)); return name; } +#endif /* CONFIG_USER_ONLY */ =20 /* * Convert all '_' in a feature string option name to '-', to make feature @@ -4783,6 +4785,7 @@ static void x86_cpu_parse_featurestr(const char *type= name, char *features, static void x86_cpu_expand_features(X86CPU *cpu, Error **errp); static void x86_cpu_filter_features(X86CPU *cpu, bool verbose); =20 +#if !defined(CONFIG_USER_ONLY) /* Build a list with the name of all features on a feature word array */ static void x86_cpu_list_feature_names(FeatureWordArray features, strList **feat_names) @@ -4853,6 +4856,7 @@ static void x86_cpu_class_check_missing_features(X86C= PUClass *xcc, =20 object_unref(OBJECT(xc)); } +#endif /* CONFIG_USER_ONLY */ =20 /* Print all cpuid feature names in featureset */ @@ -4987,7 +4991,9 @@ static void x86_cpu_definition_entry(gpointer data, g= pointer user_data) =20 info =3D g_malloc0(sizeof(*info)); info->name =3D x86_cpu_class_get_model_name(cc); +#if !defined(CONFIG_USER_ONLY) x86_cpu_class_check_missing_features(cc, &info->unavailable_features); +#endif info->has_unavailable_features =3D true; info->q_typename =3D g_strdup(object_class_get_name(oc)); info->migration_safe =3D cc->migration_safe; @@ -6941,6 +6947,7 @@ static void x86_cpu_initfn(Object *obj) object_property_add(obj, "tsc-frequency", "int", x86_cpuid_get_tsc_freq, x86_cpuid_set_tsc_freq, NULL, NULL); +#if !defined(CONFIG_USER_ONLY) object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo", x86_cpu_get_feature_words, NULL, NULL, (void *)env->features); @@ -6957,7 +6964,6 @@ static void x86_cpu_initfn(Object *obj) x86_cpu_get_unavailable_features, NULL, NULL, NULL); =20 -#if !defined(CONFIG_USER_ONLY) object_property_add(obj, "crash-information", "GuestPanicInformation", x86_cpu_get_crash_info_qom, NULL, NULL, NULL); #endif --=20 2.26.2 From nobody Sun Feb 8 19:43:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601563335; cv=none; d=zohomail.com; s=zohoarc; b=b3hGYyYYGpoV+/6Hj2XSXJf5IlbfKKS/TnR3+ogfUpmlZ0Oc1q7zgcii3rUSWauqwxMh8Xk7f+ePbOa0rs9wIEe87Rg+C6SocTtpQDJJ9D1/tAe0wDTTvg0dxBIE69AML/YD24222C40AOMaJ96YgaYVWOBkwlJWBiZ8KPM7ur4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601563335; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=LYzXqWXgtonVt/u84ke3FsaTsZ2wUQSqwruvuCAoYPY=; b=WWzQOmv2ibOS7AWz7riE5F1/hdIhUxXWeqo7eKaS8eHt6S1n/2VSqUYcvypeE4YSA8+c7I99KPD6pW7IScck4assrTEnQFyPhXrXOfdR7ugRAbn+nKHjXVZb2Z7eYeTOyg6yWCehV2lpr9iqLuN2w5sLi1q9wdZXnP9CxXDHAf0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1601563335706780.2168761707416; Thu, 1 Oct 2020 07:42:15 -0700 (PDT) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-347-Vcyefni4NtyFHm7SBCIvTg-1; Thu, 01 Oct 2020 10:42:12 -0400 Received: by mail-wr1-f72.google.com with SMTP id a12so2139254wrg.13 for ; Thu, 01 Oct 2020 07:42:11 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id 88sm9710069wrl.76.2020.10.01.07.42.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 07:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601563334; 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=LYzXqWXgtonVt/u84ke3FsaTsZ2wUQSqwruvuCAoYPY=; b=gRPMSfT4TPp9/Oe8pb3nZGSRHbaBhnhqCIlRm2BpXTbrpzRfS33Hq/mWi9//+mwusr0Nll Pt9H7QH1oLcRgrLIKFDJM3wIFBexLKiLcqCpzpEARZ0EXUYp1DWAT1FSDUsWGDH/I5BTbC VcIjyA+EgnVVUvY6+953zjaj4whFV7M= X-MC-Unique: Vcyefni4NtyFHm7SBCIvTg-1 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=LYzXqWXgtonVt/u84ke3FsaTsZ2wUQSqwruvuCAoYPY=; b=R2Pr2xKQ2TjT9OzfpTg1PzQzYMPYCMfxGyy/Cy371dUvQDNMG8+tfqMkkKqmdIu33F trHZIgcabYmwfkJPA9veu+Tam7tsuY4oC8K77kC/8PSwD88yCBga2Url4hMZy++FbAxL an23ufQz80wfxzlZYFRSy4ECiidasXLrThBQCa6wFjhSJ0/+2uhhufmHWQzefUPFsnID /LDlXnxYGFa191hAh1iTW94w+I6OQdaQE8DuN3SOX4xvJQBSbVllpdEKbF3kNHlaIfyi h6BhD4E0eWer8g8/igTU6m8fKRnixBMRJJYQ3kMLO1sH3UGzIYGXgrFl4nq4SLLwFCef nMVA== X-Gm-Message-State: AOAM531UgPyfedTWhsp/1vvbzQW2ZZBUjs64JVCAZyMCsq3aSekB6fsk 3vvpIQY04LDk9NA6EhkrL/Siqn7upIWeozl6adE8OBQR1vV/TFGoaz+odfqO5gj6bV3FPLYJOoy 3K622nVnT45w3qA== X-Received: by 2002:a7b:c111:: with SMTP id w17mr396985wmi.28.1601563330799; Thu, 01 Oct 2020 07:42:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfZsOqeK8ZHFNvsrASWtTpI7huwLdL1ZQpRYSjqV4DvIReW346xR/JUEwh2tzoJnIHjL20OQ== X-Received: by 2002:a7b:c111:: with SMTP id w17mr396947wmi.28.1601563330571; Thu, 01 Oct 2020 07:42:10 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Laurent Vivier , qemu-devel@nongnu.org Cc: Eduardo Habkost , Michael Tokarev , Richard Henderson , Markus Armbruster , Marcel Apfelbaum , qemu-trivial@nongnu.org, Eric Blake , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v4 3/3] target/i386: Restrict X86CPUFeatureWord to X86 targets Date: Thu, 1 Oct 2020 16:41:52 +0200 Message-Id: <20201001144152.1555659-4-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001144152.1555659-1-philmd@redhat.com> References: <20201001144152.1555659-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Only qemu-system-FOO and qemu-storage-daemon provide QMP monitors, therefore such declarations and definitions are irrelevant for user-mode emulation. Restricting the x86-specific commands to machine-target.json pulls less QAPI-generated code into user-mode. Acked-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/machine-target.json | 45 ++++++++++++++++++++++++++++++++++++++++ qapi/machine.json | 42 ------------------------------------- target/i386/cpu.c | 2 +- 3 files changed, 46 insertions(+), 43 deletions(-) diff --git a/qapi/machine-target.json b/qapi/machine-target.json index 698850cc78..b4d769a53b 100644 --- a/qapi/machine-target.json +++ b/qapi/machine-target.json @@ -4,6 +4,51 @@ # This work is licensed under the terms of the GNU GPL, version 2 or later. # See the COPYING file in the top-level directory. =20 +## +# @X86CPURegister32: +# +# A X86 32-bit register +# +# Since: 1.5 +## +{ 'enum': 'X86CPURegister32', + 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ], + 'if': 'defined(TARGET_I386)' } + +## +# @X86CPUFeatureWordInfo: +# +# Information about a X86 CPU feature word +# +# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature= word +# +# @cpuid-input-ecx: Input ECX value for CPUID instruction for that +# feature word +# +# @cpuid-register: Output register containing the feature bits +# +# @features: value of output register, containing the feature bits +# +# Since: 1.5 +## +{ 'struct': 'X86CPUFeatureWordInfo', + 'data': { 'cpuid-input-eax': 'int', + '*cpuid-input-ecx': 'int', + 'cpuid-register': 'X86CPURegister32', + 'features': 'int' }, + 'if': 'defined(TARGET_I386)' } + +## +# @DummyForceArrays: +# +# Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally +# +# Since: 2.5 +## +{ 'struct': 'DummyForceArrays', + 'data': { 'unused': ['X86CPUFeatureWordInfo'] }, + 'if': 'defined(TARGET_I386)' } + ## # @CpuModelInfo: # diff --git a/qapi/machine.json b/qapi/machine.json index 756dacb06f..995e972858 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -574,48 +574,6 @@ 'dst': 'uint16', 'val': 'uint8' }} =20 -## -# @X86CPURegister32: -# -# A X86 32-bit register -# -# Since: 1.5 -## -{ 'enum': 'X86CPURegister32', - 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] } - -## -# @X86CPUFeatureWordInfo: -# -# Information about a X86 CPU feature word -# -# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature= word -# -# @cpuid-input-ecx: Input ECX value for CPUID instruction for that -# feature word -# -# @cpuid-register: Output register containing the feature bits -# -# @features: value of output register, containing the feature bits -# -# Since: 1.5 -## -{ 'struct': 'X86CPUFeatureWordInfo', - 'data': { 'cpuid-input-eax': 'int', - '*cpuid-input-ecx': 'int', - 'cpuid-register': 'X86CPURegister32', - 'features': 'int' } } - -## -# @DummyForceArrays: -# -# Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally -# -# Since: 2.5 -## -{ 'struct': 'DummyForceArrays', - 'data': { 'unused': ['X86CPUFeatureWordInfo'] } } - ## # @NumaCpuOptions: # diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 9f72342506..848a65ded2 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -38,7 +38,7 @@ #include "qemu/option.h" #include "qemu/config-file.h" #include "qapi/error.h" -#include "qapi/qapi-visit-machine.h" +#include "qapi/qapi-visit-machine-target.h" #include "qapi/qapi-visit-run-state.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qerror.h" --=20 2.26.2