From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752952AbbKZQZv (ORCPT ); Thu, 26 Nov 2015 11:25:51 -0500 Received: from cmta9.telus.net ([209.171.16.82]:52321 "EHLO cmta9.telus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751165AbbKZQZs (ORCPT ); Thu, 26 Nov 2015 11:25:48 -0500 X-Authority-Analysis: v=2.1 cv=I4yYP4Ug c=1 sm=2 tr=0 a=zJWegnE7BH9C0Gl4FFgQyA==:117 a=zJWegnE7BH9C0Gl4FFgQyA==:17 a=aatUQebYAAAA:8 a=Pyq9K9CWowscuQLKlpiwfMBGOR0=:19 a=kj9zAlcOel0A:10 a=ZeLvzcRZMMq15wiv9KcA:9 a=CjuIK1q_8ugA:10 X-Telus-Outbound-IP: 173.180.45.4 From: "Doug Smythies" To: "'Borislav Petkov'" Cc: "Doug Smythies" , "'Borislav Petkov'" , Subject: As of kernel 4.4-rc1 segmentation fault if msr module not loaded. [REGRESSION][BISECTED] Date: Thu, 26 Nov 2015 08:25:43 -0800 Message-ID: <000301d12867$19ba3030$4d2e9090$@net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdEoZxjvhaOZAnLYRsCoZ6LQIt91rg== Content-Language: en-ca Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This might be considered a minor issue, but I submit my findings anyhow. In some distros, the msr module is not loaded by default. (I guess not built in by default, would be more correct.) I often forget to load it before using "rdmsr" or "wrmsr". It was never an issue before, but as of Kernel 4.4-rc1 it causes a segmentation fault crash. Example: # rdmsr -a 0x19a Segmentation fault (core dumped) It could be argued that the msr-tools commands should check if the module is loaded and abort with some error message if not (or, and as turbostat now does, just load the module). However, what I do not know is if there might be other effected use cases. The kernel was bisected, and this is the result: 9a2bc335f100a0f6ee6392b9f97ac4188d84db1d is the first bad commit commit 9a2bc335f100a0f6ee6392b9f97ac4188d84db1d Author: Borislav Petkov Date: Tue Oct 20 11:54:44 2015 +0200 x86/microcode: Unmodularize the microcode driver Make CONFIG_MICROCODE a bool. It was practically a bool already anyway, since early loader was forcing it to =y. ... Since I sometimes mess up using git bisect, and end up at some random result, the above was double checked manually: 9a2bc335f100a0f6ee6392b9f97ac4188d84db1d has the issue 81ffdcdd97d94110627caa81c23d5d780083731d (the previous commit) does not have the issue. As a potentially interesting side note, the segmentation fault does not occur if I use sudo instead. Example: $ sudo rdmsr -a 0x19a $ Of course, if I load the module then things work as expected: # modprobe msr # rdmsr -a 0x19a 0 0 0 0 0 0 0 0