[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/20] target-i386: add x86cpu_vendor_words2str(
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH 09/20] target-i386: add x86cpu_vendor_words2str() |
Date: |
Thu, 27 Dec 2012 16:56:04 -0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Dec 27, 2012 at 03:59:25PM +0100, Igor Mammedov wrote:
> Make for() cycle reusable for the next patch
>
> Signed-off-by: Igor Mammedov <address@hidden>
> Reviewed-by: Eduardo Habkost <address@hidden>
To confirm that this specific submission looks OK to me:
Reviewed-by: Eduardo Habkost <address@hidden>
> ---
> target-i386/cpu.c | 21 ++++++++++++++-------
> 1 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index d93bf5a..935bc42 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -847,6 +847,18 @@ static x86_def_t builtin_x86_defs[] = {
> },
> };
>
> +static void x86cpu_vendor_words2str(char *dst, uint32_t ebx, uint32_t ecx,
> + uint32_t edx)
> +{
> + int i;
> + for (i = 0; i < 4; i++) {
> + dst[i] = ebx >> (8 * i);
> + dst[i + 4] = edx >> (8 * i);
> + dst[i + 8] = ecx >> (8 * i);
> + }
> + dst[CPUID_VENDOR_SZ] = '\0';
> +}
> +
> #ifdef CONFIG_KVM
> static int cpu_x86_fill_model_id(char *str)
> {
> @@ -1130,15 +1142,10 @@ static char *x86_cpuid_get_vendor(Object *obj, Error
> **errp)
> X86CPU *cpu = X86_CPU(obj);
> CPUX86State *env = &cpu->env;
> char *value;
> - int i;
>
> value = (char *)g_malloc(CPUID_VENDOR_SZ + 1);
> - for (i = 0; i < 4; i++) {
> - value[i ] = env->cpuid_vendor1 >> (8 * i);
> - value[i + 4] = env->cpuid_vendor2 >> (8 * i);
> - value[i + 8] = env->cpuid_vendor3 >> (8 * i);
> - }
> - value[CPUID_VENDOR_SZ] = '\0';
> + x86cpu_vendor_words2str(value, env->cpuid_vendor1, env->cpuid_vendor2,
> + env->cpuid_vendor3);
> return value;
> }
>
> --
> 1.7.1
>
--
Eduardo
- Re: [Qemu-devel] [PATCH 01/20] target-i386: filter out not TCG features if running without kvm at realize time, (continued)
[Qemu-devel] [PATCH 04/20] target-i386: setting default 'vendor' is obsolete, remove it, Igor Mammedov, 2012/12/27
[Qemu-devel] [PATCH 05/20] target-i386: move setting defaults out of cpu_x86_parse_featurestr(), Igor Mammedov, 2012/12/27
[Qemu-devel] [PATCH 07/20] target-i386: cpu_x86_register() consolidate freeing resources, Igor Mammedov, 2012/12/27
[Qemu-devel] [PATCH 09/20] target-i386: add x86cpu_vendor_words2str(), Igor Mammedov, 2012/12/27
- Re: [Qemu-devel] [PATCH 09/20] target-i386: add x86cpu_vendor_words2str(),
Eduardo Habkost <=
[Qemu-devel] [PATCH 10/20] target-i386: replace uint32_t vendor fields by vendor string in x86_def_t, Igor Mammedov, 2012/12/27
[Qemu-devel] [PATCH 11/20] target-i386: remove vendor_override field from CPUX86State, Igor Mammedov, 2012/12/27
[Qemu-devel] [PATCH 06/20] target-i386: move out CPU features initialization in separate func, Igor Mammedov, 2012/12/27
[Qemu-devel] [PATCH 08/20] target-i386: move kvm_check_features_against_host() check to realize time, Igor Mammedov, 2012/12/27