lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 19 May 2009 22:18:33 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Borislav Petkov <borislav.petkov@....com>
CC:	akpm@...ux-foundation.org, greg@...ah.com, mingo@...e.hu,
	norsk5@...oo.com, tglx@...utronix.de, mchehab@...hat.com,
	aris@...hat.com, edt@....ca, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/22] x86: add methods for writing of an MSR on	several
 CPUs

Borislav Petkov wrote:
> +
> +/* rdmsr on a bunch of CPUs
> + *
> + * @mask:	which CPUs
> + * @msr_no:	which MSR
> + * @msrs:	array of MSR values
> + *
> + * Returns:
> + * 0 - success
> + * <0 - read failed on at least one CPU (latter in the mask)
> + */
> +int rdmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs)
> +{
> +	struct msr *reg;
> +	int cpu, tmp, err = 0;
> +	int off = cpumask_first(mask);
> +
> +	for_each_cpu(cpu, mask) {
> +		reg = &msrs[cpu - off];
> +
> +		tmp = rdmsr_on_cpu(cpu, msr_no, &reg->l, &reg->h);
> +		if (tmp)
> +			err = tmp;
> +	}
> +	return err;
> +}
> +EXPORT_SYMBOL(rdmsr_on_cpus);
> +
> +/*
> + * wrmsr of a bunch of CPUs
> + *
> + * @mask:	which CPUs
> + * @msr_no:	which MSR
> + * @msrs:	array of MSR values
> +  *
> + * Returns:
> + * 0 - success
> + * <0 - write failed on at least one CPU (latter in the mask)
> + */
> +int wrmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs)
> +{
> +	struct msr reg;
> +	int cpu, tmp, err = 0;
> +	int off = cpumask_first(mask);
> +
> +	for_each_cpu(cpu, mask) {
> +		reg = msrs[cpu - off];
> +
> +		tmp = wrmsr_on_cpu(cpu, msr_no, reg.l, reg.h);
> +		if (tmp)
> +			err = tmp;
> +	}
> +	return err;
> +}
> +EXPORT_SYMBOL(wrmsr_on_cpus);
> +

Okay, now I'm *really* confused.

I thought the whole point of these functions was to allow these MSR
references to take place in parallel, as opposed to doing outcalls to
each CPU in order... but that's exactly what these functions do.

So what was the point of them again?

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ