From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f196.google.com ([209.85.192.196]:46418 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752139AbeFHBbr (ORCPT ); Thu, 7 Jun 2018 21:31:47 -0400 Received: by mail-pf0-f196.google.com with SMTP id q1-v6so5774817pff.13 for ; Thu, 07 Jun 2018 18:31:47 -0700 (PDT) Date: Fri, 8 Jun 2018 11:31:37 +1000 From: Nicholas Piggin To: Mahesh J Salgaonkar Cc: linuxppc-dev , stable@vger.kernel.org, "Aneesh Kumar K.V" , Michael Ellerman , Laurent Dufour Subject: Re: [v3 PATCH 1/5] powerpc/pseries: convert rtas_log_buf to linear allocation. Message-ID: <20180608113137.7d409c6c@roar.ozlabs.ibm.com> In-Reply-To: <152839248387.25118.579137029955034015.stgit@jupiter.in.ibm.com> References: <152839244928.25118.15100234720683911223.stgit@jupiter.in.ibm.com> <152839248387.25118.579137029955034015.stgit@jupiter.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On Thu, 07 Jun 2018 22:58:11 +0530 Mahesh J Salgaonkar wrote: > From: Mahesh Salgaonkar > > rtas_log_buf is a buffer to hold RTAS event data that are communicated > to kernel by hypervisor. This buffer is then used to pass RTAS event > data to user through proc fs. This buffer is allocated from vmalloc > (non-linear mapping) area. > > On Machine check interrupt, register r3 points to RTAS extended event > log passed by hypervisor that contains the MCE event. The pseries > machine check handler then logs this error into rtas_log_buf. The > rtas_log_buf is a vmalloc-ed (non-linear) buffer we end up taking up a > page fault (vector 0x300) while accessing it. Since machine check > interrupt handler runs in NMI context we can not afford to take any > page fault. Page faults are not honored in NMI context and causes > kernel panic. This patch fixes this issue by allocating rtas_log_buf > using kmalloc. > > Fixes: b96672dd840f ("powerpc: Machine check interrupt is a non-maskable interrupt") > Cc: stable@vger.kernel.org > Suggested-by: Aneesh Kumar K.V > Signed-off-by: Mahesh Salgaonkar > --- > arch/powerpc/kernel/rtasd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c > index f915db93cd42..3957d4ae2ba2 100644 > --- a/arch/powerpc/kernel/rtasd.c > +++ b/arch/powerpc/kernel/rtasd.c > @@ -559,7 +559,7 @@ static int __init rtas_event_scan_init(void) > rtas_error_log_max = rtas_get_error_log_max(); > rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int); > > - rtas_log_buf = vmalloc(rtas_error_log_buffer_max*LOG_NUMBER); > + rtas_log_buf = kmalloc(rtas_error_log_buffer_max*LOG_NUMBER, GFP_KERNEL); Does this have to be in the RMA region if it's to be accessed with relocation off in the guest? A comment about it being accessed with relocation off might be helpful too. Thanks, Nick