]> xenbits.xensource.com Git - people/andrewcoop/hwloc.git/commitdiff
x86: check hwloc_have_cpuid() in the backend instantiate instead of late in the discovery
authorBrice Goglin <Brice.Goglin@inria.fr>
Tue, 11 Feb 2014 10:30:53 +0000 (11:30 +0100)
committerBrice Goglin <Brice.Goglin@inria.fr>
Tue, 11 Feb 2014 12:01:36 +0000 (13:01 +0100)
src/topology-x86.c

index e470eda5268484239aae41064a9f673b9083df50..d451a059034f9c3f15f18e571beef82b9f52a8e3 100644 (file)
@@ -804,9 +804,6 @@ int hwloc_look_x86(struct hwloc_topology *topology, unsigned nbprocs, int fulldi
    && !(hooks.get_thisthread_cpubind && hooks.set_thisthread_cpubind))
     goto out;
 
-  if (!hwloc_have_cpuid())
-    goto out;
-
   infos = calloc(nbprocs, sizeof(struct procinfo));
   if (NULL == infos)
     goto out;
@@ -953,6 +950,10 @@ hwloc_x86_component_instantiate(struct hwloc_disc_component *component,
                                const void *_data3 __hwloc_attribute_unused)
 {
   struct hwloc_backend *backend;
+
+  if (!hwloc_have_cpuid())
+    return NULL;
+
   backend = hwloc_backend_alloc(component);
   if (!backend)
     return NULL;