Mail Archives: cygwin/2015/08/17/05:03:27
--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Aug 17 08:27, Achim Gratz wrote:
> Achim Gratz <Stromeko <at> nexgo.de> writes:
> > The output is correct now for a SandyBridge dual-core CPU with
> > logical processors (aka HT) and an IvyBridge dual-core CPU w/o HT.
>=20
> Another IvyBridge dual-core w/ HT looks also correct.
>=20
> However, for the Piledriver Opteron 6328 in the 2012R2 server, Cygwin
> reports 8 cores. Linux on the other hand would report 8 processors on 4
> cores (SMT, like HT on Intel). I don't know where you get the topology
> information from,
The code is loosly based on what the Linux kernel does, combined with
the information given in
http://wiki.osdev.org/Detecting_CPU_Topology_%2880x86%29
So on AMD the topo is taken from cpuids 0x80000008 and 0x00000001,
but I may have made a mistake there.
[...digging...]
Oh, ok. It seems I accidentally dropped a piece of code there. Can you
do me a favor and run the following test application? I just need the
value your Piledrive CPU returns in ecx returned by cpuid 0x80000008:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#include <stdio.h>
#include <stdint.h>
static inline void __attribute ((always_inline))
cpuid (uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d,
uint32_t ain, uint32_t cin)
{
asm volatile ("cpuid"
: "=3Da" (*a), "=3Db" (*b), "=3Dc" (*c), "=3Dd" (*d)
: "a" (ain), "c" (cin));
}
int
main ()
{
uint32_t eax, ebx, ecx, edx;
cpuid (&eax, &ebx, &ecx, &edx, 0x80000008, 0);
printf ("0x80000008 %08x %08x %08x %08x\n", eax, ebx, ecx, edx);
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Thanks,
Corinna
--=20
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
--sm4nu43k4a2Rpi4c
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJV0aNLAAoJEPU2Bp2uRE+gJMcP/1XjRzV/xOTNPUzR4KDzuSE+
XkCSB5F0ajx+6LYLHqc1dGbFAYsI8LJ/2YNaUed57XlfKJeo6/yu5IDGCABp45g4
HFVpenHs4NYReqXY9lf/IcLQkoxh1anIHGt6OWBhMOvZWn+yztKgKBeZC2APS405
qu6jdn+V7xmvThRFkB7wJsNCaE/IPoZRwRdNMiIDPd7bFY67CfzVYyzhbgNRKqHr
go3iDblR1+mRgHZgIFan8jJOdt76orhfiHJwOqa8Kevd8z6XFk7VbMHP25A0sS0s
I1nihpNzakVGzcVI9t+bUTRLbuhYgLtntWvZUerXSgBO5bycxirm4NBgFm1yMWCd
4WQI1fz6MtdWjR6WxovtpzHBVsvjL9Feox9QltSHeP5rTkHwppwrJLdYcg7koTRc
NOoKI6S88ytmXfztIDCZTnnjuZ+t5feuvqU0HDSh02nPg7lhPJv9JZ6l21Uapl3u
rrUdW6Id5HoeCV6bSbRXBBE7R0VaIyA9eSj1w0eowOL21qvDT9DsP9oQ8eroffCp
Cq5qbyByP94kTTSCqY60GDyF+jDZel6jq9/LEehFfqPUHFU0rlaB+0dgWv9m3LUZ
/r/GEu3f4uuAZ8WAYxKVbrdyHsv/173tF86t99U+6WobmhBeljeA2dVEAPDiBV5f
DHCkHYgoclX5dMQL8AHZ
=pf0a
-----END PGP SIGNATURE-----
--sm4nu43k4a2Rpi4c--
- Raw text -