New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch: use __get_cpuid instead of do_cpuid #14857

Merged
merged 1 commit into from May 2, 2017

Conversation

Projects
None yet
4 participants
@joscollin
Member

joscollin commented Apr 28, 2017

Use __get_cpuid() instead of implementing do_cpuid().
Fixes: http://tracker.ceph.com/issues/7869

Signed-off-by: Jos Collin jcollin@redhat.com

@tchaikov tchaikov added the cleanup label Apr 28, 2017

Show outdated Hide outdated src/arch/intel.c
@@ -57,8 +40,9 @@ static void do_cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx,
int ceph_arch_intel_probe(void)
{
/* i know how to check this on x86_64... */
unsigned int eax = 1, ebx, ecx, edx;
do_cpuid(&eax, &ebx, &ecx, &edx);
unsigned int eax, ebx, ecx=0, edx=0;

This comment has been minimized.

@tchaikov

tchaikov Apr 28, 2017

Contributor

please add spaces around =.

@tchaikov

tchaikov Apr 28, 2017

Contributor

please add spaces around =.

This comment has been minimized.

@tchaikov

tchaikov Apr 28, 2017

Contributor

and i don't understand why we need to assign 0 to ecx and edx. but not to eax, ebx. they are always assigned if __get_cpuid() returns 1

@tchaikov

tchaikov Apr 28, 2017

Contributor

and i don't understand why we need to assign 0 to ecx and edx. but not to eax, ebx. they are always assigned if __get_cpuid() returns 1

This comment has been minimized.

@joscollin

joscollin Apr 28, 2017

Member

@tchaikov Fixed the review comments. The reason is only ecx and edx are used below and they shows warnings "Not initialized". But I'm open to your suggestions that will improve the code.

@joscollin

joscollin Apr 28, 2017

Member

@tchaikov Fixed the review comments. The reason is only ecx and edx are used below and they shows warnings "Not initialized". But I'm open to your suggestions that will improve the code.

Show outdated Hide outdated src/arch/intel.c
do_cpuid(&eax, &ebx, &ecx, &edx);
unsigned int eax, ebx, ecx=0, edx=0;
__get_cpuid(1, &eax, &ebx, &ecx, &edx);

This comment has been minimized.

@tchaikov

tchaikov Apr 28, 2017

Contributor

no need to add this extra empty line.

@tchaikov

tchaikov Apr 28, 2017

Contributor

no need to add this extra empty line.

Show outdated Hide outdated src/arch/intel.c
@@ -40,9 +40,8 @@ int ceph_arch_intel_aesni = 0;
int ceph_arch_intel_probe(void)
{
/* i know how to check this on x86_64... */
unsigned int eax, ebx, ecx=0, edx=0;
unsigned int eax, ebx, ecx = 0, edx = 0;

This comment has been minimized.

@tchaikov

tchaikov Apr 28, 2017

Contributor

might want to return right away if __get_cpuid() returns 0.

@tchaikov

tchaikov Apr 28, 2017

Contributor

might want to return right away if __get_cpuid() returns 0.

This comment has been minimized.

@joscollin
@joscollin
arch: use __get_cpuid instead of do_cpuid
Use __get_cpuid() instead of implementing do_cpuid(). Fixed the review comments too.

Fixes: http://tracker.ceph.com/issues/7869
Signed-off-by: Jos Collin <jcollin@redhat.com>

@tchaikov tchaikov added the needs-qa label Apr 28, 2017

@yuriw yuriw merged commit 0807f38 into ceph:master May 2, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@joscollin joscollin deleted the joscollin:wip-arch-cpuid branch May 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment