From: "Andreas Färber" <afaerber@suse.de>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/3] target-i386: replace cpuid_*features fields with a feature word array
Date: Fri, 14 Dec 2012 18:20:41 +0100 [thread overview]
Message-ID: <50CB5FE9.3050703@suse.de> (raw)
In-Reply-To: <20121214165235.GB3236@otherpad.lan.raisama.net>
Am 14.12.2012 17:52, schrieb Eduardo Habkost:
> On Fri, Dec 14, 2012 at 04:14:32PM +0100, Andreas Färber wrote:
>> Am 12.12.2012 23:22, schrieb Eduardo Habkost:
>>> This replaces the feature-bit fields on both X86CPU and x86_def_t
>>> structs with an array.
>>>
>>> With this, we will be able to simplify code that simply does the same
>>> operation on all feature words (e.g. kvm_check_features_against_host(),
>>> filter_features_for_kvm(), add_flagname_to_bitmaps(), and CPU
>>> feature-bit property lookup/registration).
>>>
>>> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
>>> ---
>>> This patch was created solely using a sed script and no manual changes,
>>> to try to avoid mistakes while converting the code, and make it easier
>>> to rebase if necessary. The sed script can be seen at:
>>> https://gist.github.com/4271991
>>> ---
>>> hw/kvm/clock.c | 2 +-
>>> linux-user/elfload.c | 2 +-
>>> linux-user/main.c | 4 +-
>>> target-i386/cpu.c | 578 +++++++++++++++++++++++-----------------------
>>> target-i386/cpu.h | 30 +--
>>> target-i386/helper.c | 4 +-
>>> target-i386/kvm.c | 5 +-
>>> target-i386/misc_helper.c | 14 +-
>>> target-i386/translate.c | 10 +-
>>> 9 files changed, 331 insertions(+), 318 deletions(-)
>>
>> I wonder, if we're touching all these lines anyway, can't we place the
>> new feature array directly into X86CPU? As far as I see the features are
>> never changed at runtime, so the only reason to have them in the
>> instance is the command-line-supplied overrides.
>
> You mean directly into X86CPUClass? [...]
No, I literally meant X86CPU rather than CPUX86State (i.e., the place
within the instance).
>> The clock code using first_cpu looks solvable; what about CR4 and MSR
>> helpers, how performance-sensitive are they? (if they're not yet using
>> X86CPU for something else)
>
> I guess any CPU-state code inside QEMU is not performance-sensitive, as
> it woud already require switching between KVM kernelspace and QEMU
> userspace.
I mean target-i386/[misc_]helper.c and thus TCG, IIUC. :)
> On the other hand, this cleanup will allow us to easily convert some
> code to deal with the feature array only (not requiring the full X86CPU
> or x86_def_t struct), making it easier to have only one feature array,
> in only one place, in the future.
The alternative line of thought is whether to group KVM stuff together.
Tying it into an array makes that harder. But personally I'm not opposed
to this array proposal.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-12-14 17:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-12 22:22 [Qemu-devel] [PATCH 0/3] replace cpuid_*features fields with a featue word array (v2) Eduardo Habkost
2012-12-12 22:22 ` [Qemu-devel] [PATCH 1/3] target-i386: add EXT2_PPRO_FEATURES #define Eduardo Habkost
2012-12-14 9:44 ` Igor Mammedov
2012-12-14 11:44 ` Andreas Färber
2012-12-14 12:15 ` Eduardo Habkost
2012-12-12 22:22 ` [Qemu-devel] [PATCH 2/3] target-i386/cpu.c: coding style fix Eduardo Habkost
2012-12-12 23:36 ` Igor Mammedov
2012-12-13 13:16 ` Eduardo Habkost
2012-12-12 22:22 ` [Qemu-devel] [PATCH 3/3] target-i386: replace cpuid_*features fields with a feature word array Eduardo Habkost
2012-12-14 9:38 ` Igor Mammedov
2012-12-14 12:27 ` Eduardo Habkost
2012-12-14 13:52 ` Igor Mammedov
2012-12-14 14:02 ` Eduardo Habkost
2012-12-14 14:53 ` Andreas Färber
2012-12-14 17:16 ` Eduardo Habkost
2012-12-14 15:14 ` Andreas Färber
2012-12-14 16:52 ` Eduardo Habkost
2012-12-14 17:20 ` Andreas Färber [this message]
2012-12-14 17:36 ` Eduardo Habkost
2012-12-14 17:47 ` Igor Mammedov
2012-12-14 18:32 ` Eduardo Habkost
-- strict thread matches above, loose matches on Subject: below --
2012-12-18 16:29 [Qemu-devel] [PATCH 0/3] replace cpuid_*features fields with a featue word array (v3) Eduardo Habkost
2012-12-18 16:29 ` [Qemu-devel] [PATCH 3/3] target-i386: replace cpuid_*features fields with a feature word array Eduardo Habkost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50CB5FE9.3050703@suse.de \
--to=afaerber@suse.de \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).