summaryrefslogtreecommitdiffstats
path: root/drivers/edac/mce_amd_inj.c
Commit message (Collapse)AuthorAgeFilesLines
* x86/ras: Move AMD MCE injector to arch/x86/ras/Borislav Petkov2015-08-131-375/+0
| | | | | | | | | | | | | | This is an x86-specific module and would benefit from being closer to the arch code. Move it there. Update copyright while at it. Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Luck <tony.luck@intel.com> Link: http://lkml.kernel.org/r/1439396985-12812-14-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
* EDAC, mce_amd_inj: Set MISCV on injectionBorislav Petkov2015-06-241-0/+3
| | | | | | | | When during injection we populate MCi_MISC by writing into misc, we need to set the MiscV bit in the corresponding MCi_STATUS register which denotes that there's valid info in the MCi_MISC register. Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC, mce_amd_inj: Move bit preparations before the injectionBorislav Petkov2015-06-241-4/+4
| | | | | | | We do get_online_cpus() and then start noodling with the bits. Do that *before* we grab the hotplug lock. Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC, mce_amd_inj: Cleanup and simplify READMEBorislav Petkov2015-06-241-31/+35
| | | | | | | | Save us an indentation level, widen to 80 cols, make the text more succinct and slender. Use i as the bank variable, same as what the documentation uses. Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC, mce_amd_inj: Make inj_type statickbuild test robot2015-06-241-1/+1
| | | | | | | | | | | | It is used there only anyway. Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Cc: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com> Cc: Mauro Carvalho Chehab <m.chehab@samsung.com> Cc: kbuild-all@01.org Cc: linux-edac <linux-edac@vger.kernel.org> Link: http://lkml.kernel.org/r/20150605112426.GA97073@lkp-sb04 Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC, mce_amd_inj: Add README fileAravind Gopalakrishnan2015-06-241-0/+46
| | | | | | | | | | | | | Provide information about each injection file and its usage for ease of use and in-band documentation. This is a good idea adapted from ftrace. Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com> Cc: linux-edac <linux-edac@vger.kernel.org> Cc: mchehab@osg.samsung.com Cc: Steven Rostedt <rostedt@goodmis.org> Cc: x86-ml <x86@kernel.org> Link: http://lkml.kernel.org/r/1433277362-10911-7-git-send-email-Aravind.Gopalakrishnan@amd.com Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC, mce_amd_inj: Add individual permissions field to dfs_nodeAravind Gopalakrishnan2015-06-241-7/+8
| | | | | | | | | | | | | | Add per-file permissions to the dfs_fls[] array. In a later patch, we will add a README file that needs different permissions. Hence the move here to add a perm field. Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com> Cc: linux-edac <linux-edac@vger.kernel.org> Cc: mchehab@osg.samsung.com Cc: x86-ml <x86@kernel.org> Link: http://lkml.kernel.org/r/1433277362-10911-6-git-send-email-Aravind.Gopalakrishnan@amd.com Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC, mce_amd_inj: Modify flags attribute to use string argumentsAravind Gopalakrishnan2015-06-031-10/+71
| | | | | | | | | | | | | | | | | | | | | | | | Use strings such as "hw" or "sw" to indicate the type of error injection to be performed. Current flags attribute derives the meanings of values that can be programmed into it from asm/mce.h. Moving to defined strings for the attribute allows this module to be self-sufficient and removes the dependency. Also, we can introduce new flags as and when needed without having to worry about conflicting with the flags already defined in asm/mce.h. Also, modify do_inject() to use the newly defined injection_type enum to figure out the injection mechanism we need to use Suggested-by: Borislav Petkov <bp@suse.de> Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com> Cc: linux-edac <linux-edac@vger.kernel.org> Cc: mchehab@osg.samsung.com Cc: x86-ml <x86@kernel.org> Link: http://lkml.kernel.org/r/1433277362-10911-4-git-send-email-Aravind.Gopalakrishnan@amd.com [ Use strstrip() return value. ] Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC, mce_amd_inj: Read out number of MCE banks from the hardwareAravind Gopalakrishnan2015-06-031-5/+9
| | | | | | | | | | | | The number of banks for a given processor is encoded in MSR_IA32_MCG_CAP[7:0]. So obtain the value from that MSR and use it for sanity checking in inj_bank_set() instead of doing a family/model check. Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com> Cc: linux-edac <linux-edac@vger.kernel.org> Cc: mchehab@osg.samsung.com Link: http://lkml.kernel.org/r/1432753418-2985-3-git-send-email-Aravind.Gopalakrishnan@amd.com Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC, mce_amd_inj: Use MCE_INJECT_GET macro for bank node tooAravind Gopalakrishnan2015-06-031-7/+1
| | | | | | | | | | | | | | inj_bank_get() is generic enough that we can use the MCE_INJECT_GET macro instead. No functionality change. Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com> Cc: linux-edac <linux-edac@vger.kernel.org> Cc: mchehab@osg.samsung.com Cc: x86-ml <x86@kernel.org> Link: http://lkml.kernel.org/r/1433277362-10911-2-git-send-email-Aravind.Gopalakrishnan@amd.com Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC, mce_amd_inj: Fix sparse non static symbol warningWei Yongjun2014-12-211-1/+1
| | | | | | | | | | | Fixes the following sparse warnings: drivers/edac/mce_amd_inj.c:204:3: warning: symbol 'dfs_fls' was not declared. Should it be static? Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Link: http://lkml.kernel.org/r/1418087095-14174-1-git-send-email-weiyj_lk@163.com Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC, mce_amd_inj: Add an injector functionBorislav Petkov2014-11-251-2/+51
| | | | | | | | | Selectively inject either a real MCE or a sw-only version which exercises the decoding path only. The hardware-injected MCE triggers a machine check exception (#MC) so that the MCE handler can be bothered to do something too. Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC, mce_amd_inj: Add hw-injection attributesBorislav Petkov2014-11-251-0/+40
| | | | | | Expose struct mce->inject_flags. Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC, mce_amd_inj: Enable direct writes to MCE MSRsBorislav Petkov2014-11-251-0/+24
| | | | | | | Normally, writing those causes a #GP but HWCR[McStatusWrEn] controls that. Provide a knob. Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC, mce_amd_inj: Convert mce_amd_inj module to debugfsBorislav Petkov2014-11-251-102/+78
| | | | | | This module's interface belongs in debugfs, not in sysfs. Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC: Replace strict_strtoul() with kstrtoul()Jingoo Han2013-06-081-2/+2
| | | | | | | | The usage of strict_strtoul() is not preferred, because strict_strtoul() is obsolete. Thus, kstrtoul() should be used. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Borislav Petkov <bp@suse.de>
* EDAC: Change Boris' email addressBorislav Petkov2012-10-301-2/+2
| | | | | | | | | My @amd.com address will be invalid soon so move to private email address. Signed-off-by: Borislav Petkov <bp@alien8.de> Link: http://lkml.kernel.org/r/1351532410-4887-2-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
* device.h: cleanup users outside of linux/include (C files)Paul Gortmaker2012-03-111-0/+1
| | | | | | | | | | | | | | For files that are actively using linux/device.h, make sure that they call it out. This will allow us to clean up some of the implicit uses of linux/device.h within include/* without introducing build regressions. Yes, this was created by "cheating" -- i.e. the headers were cleaned up, and then the fallout was found and fixed, and then the two commits were reordered. This ensures we don't introduce build regressions into the git history. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
* edac: convert sysdev_class to a regular subsystemKay Sievers2011-12-141-7/+6
| | | | | | | | | | | | After all sysdev classes are ported to regular driver core entities, the sysdev implementation will be entirely removed from the kernel. Cc: Doug Thompson <dougthompson@xmission.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi> Cc: Borislav Petkov <borislav.petkov@amd.com> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* drivers/edac: Add module.h to mce_amd_inj.cPaul Gortmaker2011-10-311-0/+1
| | | | | | | | This file really needs the full module.h header file present, but was just getting it implicitly before. Fix it up in advance so we avoid build failures once the cleanup commit is present. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
* Fix common misspellingsLucas De Marchi2011-03-311-1/+1
| | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* EDAC, MCE: Allow F15h bank 6 MCE injectionBorislav Petkov2011-01-071-4/+5
| | | | | | | F15h adds a sixth MCE bank: adjust bank number check in the injection code. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
* EDAC, MCE: Fix edac_init_mce_inject error handlingAxel Lin2010-11-221-1/+1
| | | | | | | | Otherwise, variable i will be -1 inside the latest iteration of the while loop. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
* EDAC, MCE: Rename filesBorislav Petkov2010-10-211-1/+1
| | | | | | | Drop "edac_" string from the filenames since they're prefixed with edac/ in their pathname anyway. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
* EDAC, MCE: Rework MCE injectionBorislav Petkov2010-10-211-0/+171
Add sysfs injection facilities for testing of the MCE decoding code. Remove large parts of amd64_edac_dbg.c, as a result, which did only NB MCE injection anyway and the new injection code supports that functionality already. Add an injection module so that MCE decoding code in production kernels like those in RHEL and SLES can be tested. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
OpenPOWER on IntegriCloud