Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 583673

Summary: set-cpu_llc_id-on-amd-cpus patch: undefined variable 'cpu' in in amd_detect_cmp()
Product: Red Hat Enterprise Linux 5 Reporter: Igor Zhbanov <izh1979>
Component: kernelAssignee: Prarit Bhargava <prarit>
Status: CLOSED ERRATA QA Contact: Mike Gahagan <mgahagan>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: anton, izh1979, jwilson
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-13 21:28:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
RHEL5 fix for this issue none

Description Igor Zhbanov 2010-04-19 11:30:04 UTC
Description of problem:
Hello!

I have kernel-2.6.18-194.el5.src.rpm and cannot compile it.
The problem is because variable 'cpu' is undefined in arch/x86_64/kernel/setup.c
in function amd_detect_cmp():

static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
{
...
#ifdef CONFIG_NUMA
        int cpu = smp_processor_id();
...
#endif
...
        /* use socket ID also for last level cache */
        cpu_llc_id[cpu] = c->phys_proc_id;
...
#ifdef CONFIG_NUMA
...
#endif
...
}

As you can see, variable 'cpu' is defined only when CONFIG_NUMA is set.
But this variable unconditionally used few lines below.

I suppose that it should be defined unconditionally or it's usage should be moved inside CONFIG_NUMA ifdef.

That lines are added in linux-2.6-x86-set-cpu_llc_id-on-amd-cpus.patch.

Version-Release number of selected component (if applicable):
kernel-2.6.18-194.el5.src.rpm

How reproducible:
Always

Steps to Reproduce:
Build kernel.

Comment 1 Prarit Bhargava 2010-04-29 18:55:07 UTC
Red Hat does not support the building of custom kernels, however, we should be able to make this simple change.

P.

Comment 2 Prarit Bhargava 2010-08-19 12:48:29 UTC
Created attachment 439674 [details]
RHEL5 fix for this issue

int cpu is defined w/o CONFIG_NUMA upstream.  Even though a straight backport isn't viable, let's do the same in RHEL5.

P.

Comment 3 RHEL Program Management 2010-08-27 18:29:40 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 5 Jarod Wilson 2010-09-10 21:39:40 UTC
in kernel-2.6.18-219.el5
You can download this test kernel from http://people.redhat.com/jwilson/el5

Detailed testing feedback is always welcomed.

Comment 7 Mike Gahagan 2010-12-09 18:50:49 UTC
I was able to rebuild the -236 kernel with the numa config options turned off so this one can be verified.

Comment 9 errata-xmlrpc 2011-01-13 21:28:29 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0017.html