All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>
To: Nicholas Piggin <npiggin@gmail.com>
Cc: linuxppc-dev <linuxppc-dev@ozlabs.org>,
	stable@vger.kernel.org,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Laurent Dufour <ldufour@linux.vnet.ibm.com>
Subject: Re: [v3 PATCH 1/5] powerpc/pseries: convert rtas_log_buf to linear allocation.
Date: Fri, 8 Jun 2018 11:46:15 +0530	[thread overview]
Message-ID: <81380cda-66d1-0d16-ab38-09f86ef767cf@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180608113137.7d409c6c@roar.ozlabs.ibm.com>

On 06/08/2018 07:01 AM, Nicholas Piggin wrote:
> On Thu, 07 Jun 2018 22:58:11 +0530
> Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com> wrote:
> 
>> From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
>>
>> 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 <aneesh.kumar@linux.vnet.ibm.com>
>> Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
>> ---
>>  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?

Nope not required. It never gets accessed with relocation off.

> 
> A comment about it being accessed with relocation off might be helpful
> too.

Sure.

Thanks,
-Mahesh.

  reply	other threads:[~2018-06-08  6:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07 17:27 [v3 PATCH 0/5] powerpc/pseries: Machien check handler improvements Mahesh J Salgaonkar
2018-06-07 17:28 ` [v3 PATCH 1/5] powerpc/pseries: convert rtas_log_buf to linear allocation Mahesh J Salgaonkar
2018-06-08  1:31   ` Nicholas Piggin
2018-06-08  6:16     ` Mahesh Jagannath Salgaonkar [this message]
2018-06-07 17:28 ` [v3 PATCH 2/5] powerpc/pseries: Fix endainness while restoring of r3 in MCE handler Mahesh J Salgaonkar
2018-06-08  1:33   ` Nicholas Piggin
2018-06-08  6:50   ` Michael Ellerman
2018-06-08 10:31     ` Mahesh Jagannath Salgaonkar
2018-06-07 17:28 ` [v3 PATCH 3/5] powerpc/pseries: Define MCE error event section Mahesh J Salgaonkar
2018-06-07 17:28 ` [v3 PATCH 4/5] powerpc/pseries: Dump and flush SLB contents on SLB MCE errors Mahesh J Salgaonkar
2018-06-08  1:48   ` Nicholas Piggin
2018-06-08  6:19     ` Mahesh Jagannath Salgaonkar
2018-06-12 13:47   ` Michael Ellerman
2018-06-13  2:38     ` Aneesh Kumar K.V
2018-06-13  4:06       ` Michael Ellerman
2018-06-13  4:06         ` Aneesh Kumar K.V
2018-06-13  3:45     ` Mahesh Jagannath Salgaonkar
2018-06-07 17:29 ` [v3 PATCH 5/5] powerpc/pseries: Display machine check error details Mahesh J Salgaonkar
2018-06-08  1:51   ` Nicholas Piggin
2018-06-08  6:28     ` Mahesh Jagannath Salgaonkar
2018-07-02 18:01     ` Michal Suchánek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81380cda-66d1-0d16-ab38-09f86ef767cf@linux.vnet.ibm.com \
    --to=mahesh@linux.vnet.ibm.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=ldufour@linux.vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.