From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756277Ab2DQPxK (ORCPT ); Tue, 17 Apr 2012 11:53:10 -0400 Received: from mail.wdtv.com ([66.118.69.84]:49177 "EHLO mail.wdtv.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756098Ab2DQPxH (ORCPT ); Tue, 17 Apr 2012 11:53:07 -0400 From: Gene Heskett To: Borislav Petkov Subject: Re: [PATCH 2/2] x86, microcode: Ensure that module is only loaded for Date: Tue, 17 Apr 2012 11:53:04 -0400 User-Agent: KMail/1.13.7 (Linux/3.2.14-pclos7-gene-pae-bfs; KDE/4.6.5; i686; ; ) Cc: "Srivatsa S. Bhat" , "Greg Kroah-Hartman" , Andreas Herrmann , Kay Sievers , Dave Jones , linux-kernel@vger.kernel.org, Ingo Molnar , Thomas Gleixner , tigran@aivazian.fsnet.co.uk, hpa@zytor.com, x86@kernel.org References: <20120411163849.GE4794@alberich.amd.com> <4F8D7A0A.4080404@linux.vnet.ibm.com> <20120417145002.GA11221@aftab> In-Reply-To: <20120417145002.GA11221@aftab> MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1256" Content-Transfer-Encoding: 7bit Message-Id: <201204171153.04489.gene.heskett@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, April 17, 2012, Borislav Petkov wrote: >On Tue, Apr 17, 2012 at 07:41:22PM +0530, Srivatsa S. Bhat wrote: >> On 04/16/2012 07:13 PM, Borislav Petkov wrote: >> > On Mon, Apr 16, 2012 at 02:12:00PM +0530, Srivatsa S. Bhat wrote: >> >> I guess a similar change in intel microcode driver would also be >> > >> >> worthwhile, right? If so, then the below patch might be useful: >> > AFAICT, you'd need to test this on a box which is not supported >> > (family check below). Or you can tweak the family check so that it >> > doesn't apply and run it on a test box of yours to see whether the >> > module still unloads properly in the error case (and doesn't remain >> > loaded as in our case due to something in sysfs remaining registered >> > although it shouldn't). >> >> Judging by the nature of the code itself, its evident that this problem >> is not restricted to AMD alone. In any case, I went ahead and did the >> (tweaked) test that you suggested and here is the result: >> >> 1. dmesg logs : >> [ 21.912451] microcode: CPU0 not a capable Intel processor >> [ 21.916028] microcode: CPU1 not a capable Intel processor >> [ 21.934624] microcode: CPU2 not a capable Intel processor >> [ 21.940276] microcode: CPU3 not a capable Intel processor >> [ 21.946023] microcode: CPU4 not a capable Intel processor >> [ 21.951678] microcode: CPU5 not a capable Intel processor >> [ 21.957326] microcode: CPU6 not a capable Intel processor >> [ 21.962935] microcode: CPU7 not a capable Intel processor >> [ 21.968611] microcode: CPU8 not a capable Intel processor >> [ 21.974212] microcode: CPU9 not a capable Intel processor >> [ 21.979842] microcode: CPU10 not a capable Intel processor >> [ 21.985577] microcode: CPU11 not a capable Intel processor >> [ 21.991323] microcode: CPU12 not a capable Intel processor >> [ 21.997055] microcode: CPU13 not a capable Intel processor >> [ 22.002774] microcode: CPU14 not a capable Intel processor >> [ 22.008460] microcode: CPU15 not a capable Intel processor >> [ 22.014600] microcode: Microcode Update Driver: v2.00 >> , Peter Oruba >> >> 2. lsmod | grep microcode >> microcode 117749 0 >> >> 3. rmmod microcode >> >> 4. dmesg logs: >> [ 64.297638] ------------[ cut here ]------------ >> [ 64.302332] WARNING: at fs/sysfs/group.c:142 >> sysfs_remove_group+0xd9/0xe0() [ 64.309446] Hardware name: IBM >> System x -[7870C4Q]- >> [ 64.309449] sysfs group ffffffffa03a5110 not found for kobject >> 'cpu0' [ 64.309451] Modules linked in: ipv6 cpufreq_conservative >> cpufreq_userspace cpufreq_powersave acpi_cpufreq mperf fuse loop >> dm_mod coretemp crc32c_intel shpchp microcode(-) cdc_ether usbnet >> ioatdma bnx2 mii serio_raw pcspkr pci_hotplug i2c_i801 i7core_edac >> i2c_core dca edac_core iTCO_wdt iTCO_vendor_support tpm_tis tpm sg >> tpm_bios rtc_cmos button uhci_hcd ehci_hcd usbcore usb_common sd_mod >> crc_t10dif edd ext3 mbcache jbd fan processor mptsas mptscsih mptbase >> scsi_transport_sas scsi_mod thermal thermal_sys hwmon [ 64.309499] >> Pid: 6529, comm: rmmod Not tainted >> 3.4.0-rc3-intelucodebroken-0.0.0.28.36b5ec9-default #2 [ 64.309501] >> Call Trace: >> [ 64.309506] [] ? sysfs_remove_group+0xd9/0xe0 >> [ 64.309510] [] ? sysfs_remove_group+0xd9/0xe0 >> [ 64.309516] [] warn_slowpath_common+0x7a/0xb0 >> [ 64.309522] [] warn_slowpath_fmt+0x41/0x50 >> [ 64.309526] [] ? sysfs_get_dirent+0x56/0x80 >> [ 64.309531] [] sysfs_remove_group+0xd9/0xe0 >> [ 64.309538] [] mc_device_remove+0x78/0xa0 >> [microcode] [ 64.309545] [] >> subsys_interface_unregister+0x89/0xd0 [ 64.309553] >> [] microcode_exit+0x5a/0xa4 [microcode] [ >> 64.309559] [] sys_delete_module+0x16a/0x2b0 [ >> 64.309565] [] ? >> trace_hardirqs_on_caller+0x12d/0x1b0 [ 64.309573] >> [] system_call_fastpath+0x16/0x1b [ 64.309576] >> ---[ end trace 748ddf8b4218f820 ]--- >> >> >> The above warning was repeated for each cpu, of course. > >Right, this is the warning we're seeing too. Applying your patch fixes >it, I s'pose? If so, maybe x86 people would pick it up. I do not think the above has anything to do with the current version shipping in some distro's, which is trying to find the intel code on kernels >2.6.39 when running on AMD stuff, so that script in /etc/init.d needs attention too. I have nuked about half of that script in my local copy so that it does install AMD code on AMD processors. The errors I was seeing were only the lack of its ability to find the Intel code and does not generate any output resembling the above. That test in that script for a minimum minor kernel version to determine which microcode to apply seems totally bogus to me anyway, but I am not privy to enough cpu info to write the correct test. Cheers, Gene -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) My web page: "Most of us, when all is said and done, like what we like and make up reasons for it afterwards." -- Soren F. Petersen