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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <4F5F11A00200007800077DD4@nat28.tlf.novell.com>
Date:	Tue, 13 Mar 2012 08:21:36 +0000
From:	"Jan Beulich" <JBeulich@...e.com>
To:	"Konrad Rzeszutek Wilk" <konrad.wilk@...cle.com>
Cc:	<mike.mcclurg@...rix.com>, <ke.yu@...el.com>,
	<kevin.tian@...el.com>, <xen-devel@...ts.xensource.com>,
	<davej@...hat.com>, <cpufreq@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] xen/acpi-processor: C and P-state driver that
 uploads said data to hypervisor.

>>> On 13.03.12 at 04:35, Konrad Rzeszutek Wilk <konrad.wilk@...cle.com> wrote:
> +static unsigned int __init get_max_acpi_id(void)
> +{
> +	struct xenpf_pcpuinfo *info;
> +	struct xen_platform_op op = {
> +		.cmd = XENPF_get_cpuinfo,
> +		.interface_version = XENPF_INTERFACE_VERSION,
> +	};
> +	int ret = 0;
> +	unsigned int i, max_apic_id, max_acpi_id = 0;
> +
> +	info = &op.u.pcpu_info;
> +	info->xen_cpuid = 0;
> +
> +	ret = HYPERVISOR_dom0_op(&op);
> +	if (ret)
> +		return max_acpi_id;
> +
> +	/* The max_present is the same irregardless of the xen_cpuid */
> +	max_apic_id = op.u.pcpu_info.max_present;

The 'apic' in the name here is confusing, as this isn't an APIC ID, but
(Xen) ID of the last present CPU (i.e. one less than the maximum
count).

> +	for (i = 0; i <= max_apic_id; i++) {
> +		info->xen_cpuid = i;
> +		ret = HYPERVISOR_dom0_op(&op);
> +		if (ret)
> +			continue;
> +		max_acpi_id = max(info->acpi_id, max_acpi_id);
> +	}
> +	pr_debug(DRV_NAME "Max ACPI ID: %u\n", max_acpi_id);
> +	return max_acpi_id;

Iirc hotplug CPUs may not be represented in MADT, and hence I'd
suggest adding some slack here (e.g. doubling the value).

> +}

Now, if the whole thing could become a true extension to processor.ko,
the fishy (and too weak in the 'm' case, as you noted yourself) Kconfig
dependency on the cpufreq drivers could go away, since both
acpi-cpufreq and powernow-k8 depend on ACPI_PROCESSOR. Which
would at once put it on par with the XenoLinux placement (in terms of
the point in time when it gets executed) of the code.

Jan

--
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