public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: dimm <dmitry.adamushko@gmail.com>
Cc: Andreas Mohr <andi@lisas.de>,
	linux-kernel@vger.kernel.org, Mike Travis <travis@sgi.com>,
	Borislav Petkov <borislav.petkov@amd.com>
Subject: Re: [PATCH - 2/2] tip, x86-microcode: refactor microcode output messages
Date: Thu, 26 Nov 2009 10:31:23 +0100	[thread overview]
Message-ID: <20091126093123.GA32275@elte.hu> (raw)
In-Reply-To: <1259189772.7940.48.camel@dimm>


* dimm <dmitry.adamushko@gmail.com> wrote:

> +static int summarize_cpu_range(struct cpumask *range, struct cpu_signature *csig)
> +{
> +	char *cpu_str, *ver_str;
> +	int ret = -1;
> +
> +	cpu_str = kmalloc(128, GFP_KERNEL);
> +	ver_str = kmalloc(128, GFP_KERNEL);
> +	if (!cpu_str || !ver_str)
> +		goto out;
> +
> +	cpulist_scnprintf(cpu_str, 128, range);
> +	microcode_ops->version_snprintf(ver_str, 128, csig);
> +
> +        printk(KERN_INFO "microcode: CPU%s: %s\n", cpu_str, ver_str);
> +	ret = 0;
> +out:
> +	if (cpu_str)
> +		kfree(cpu_str);
> +	if (ver_str)
> +		kfree(ver_str);
> +
> +	return ret;
> +}
> +
> +static void summarize_cpu_info(void)
> +{
> +	struct cpu_info_array_ctx *ctx_array;
> +	cpumask_var_t cpulist;
> +	int base, cpu, ret;
> +
> +	if (!zalloc_cpumask_var(&cpulist, GFP_KERNEL))
> +		return;
> +
> +	ctx_array = kmalloc(nr_cpu_ids * sizeof(*ctx_array), GFP_KERNEL);
> +	if (!ctx_array)
> +		goto out;
> +
> +	ret = on_each_cpu(collect_cpu_info_array, ctx_array, 1);
> +	if (ret)
> +		goto out;
> +
> +	base = cpumask_first(cpu_online_mask);
> +	cpu  = base;
> +	cpumask_set_cpu(cpu, cpulist);
> +
> +	while ((cpu = cpumask_next(cpu, cpu_online_mask)) < nr_cpu_ids) {
> +		if (memcmp(&ctx_array[base].cpu_sig, &ctx_array[cpu].cpu_sig,
> +				sizeof(ctx_array[base].cpu_sig)) != 0) {
> +			summarize_cpu_range(cpulist, &ctx_array[base].cpu_sig);
> +			cpumask_clear(cpulist);
> +			base = cpu;
> +		}
> +		cpumask_set_cpu(cpu, cpulist);
> +	}
> +	summarize_cpu_range(cpulist, &ctx_array[base].cpu_sig);
> +out:
> +	free_cpumask_var(cpulist);
> +	if (ctx_array)
> +		kfree(ctx_array);
> +}

Could we please leave out this summarizing logic (it's bloaty and 
unnecessary), and just print a single line message when applying the 
microcode?

Thanks,

	Ingo

      reply	other threads:[~2009-11-26  9:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25 22:56 [PATCH - 2/2] tip, x86-microcode: refactor microcode output messages dimm
2009-11-26  9:31 ` Ingo Molnar [this message]

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=20091126093123.GA32275@elte.hu \
    --to=mingo@elte.hu \
    --cc=andi@lisas.de \
    --cc=borislav.petkov@amd.com \
    --cc=dmitry.adamushko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=travis@sgi.com \
    /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