From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH v6 13/18] ACPI / APEI: Don't update struct ghes' flags in read/clear estatus Date: Fri, 12 Oct 2018 19:14:39 +0200 Message-ID: <20181012171439.GF580@zn.tnic> References: <20180921221705.6478-1-james.morse@arm.com> <20180921221705.6478-14-james.morse@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20180921221705.6478-14-james.morse@arm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu To: James Morse Cc: jonathan.zhang@cavium.com, Rafael Wysocki , Tony Luck , linux-mm@kvack.org, Marc Zyngier , Catalin Marinas , Tyler Baicar , Will Deacon , Dongjiu Geng , linux-acpi@vger.kernel.org, Punit Agrawal , Naoya Horiguchi , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Len Brown List-Id: linux-acpi@vger.kernel.org On Fri, Sep 21, 2018 at 11:17:00PM +0100, James Morse wrote: > ghes_read_estatus() sets a flag in struct ghes if the buffer of > CPER records needs to be cleared once the records have been > processed. This global flags value is a problem if a struct ghes > can be processed concurrently, as happens at probe time if an > NMI arrives for the same error source. > > The GHES_TO_CLEAR flags was only set at the same time as > buffer_paddr, which is now owned by the caller and passed to > ghes_clear_estatus(). Use this as the flag. > > A non-zero buf_paddr returned by ghes_read_estatus() means > ghes_clear_estatus() will clear this address. ghes_read_estatus() > already checks for a read of error_status_address being zero, > so we can never get CPER records written at zero. > > After this ghes_clear_estatus() no longer needs the struct ghes. > > Signed-off-by: James Morse > --- > drivers/acpi/apei/ghes.c | 26 ++++++++++++-------------- > include/acpi/ghes.h | 1 - > 2 files changed, 12 insertions(+), 15 deletions(-) Nice. Reviewed-by: Borislav Petkov -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by kanga.kvack.org (Postfix) with ESMTP id 9F9326B0007 for ; Fri, 12 Oct 2018 13:14:46 -0400 (EDT) Received: by mail-wr1-f70.google.com with SMTP id j17-v6so6030847wrm.11 for ; Fri, 12 Oct 2018 10:14:46 -0700 (PDT) Received: from mail.skyhub.de (mail.skyhub.de. [5.9.137.197]) by mx.google.com with ESMTPS id j138-v6si1695570wmf.195.2018.10.12.10.14.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Oct 2018 10:14:45 -0700 (PDT) Date: Fri, 12 Oct 2018 19:14:39 +0200 From: Borislav Petkov Subject: Re: [PATCH v6 13/18] ACPI / APEI: Don't update struct ghes' flags in read/clear estatus Message-ID: <20181012171439.GF580@zn.tnic> References: <20180921221705.6478-1-james.morse@arm.com> <20180921221705.6478-14-james.morse@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180921221705.6478-14-james.morse@arm.com> Sender: owner-linux-mm@kvack.org List-ID: To: James Morse Cc: linux-acpi@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, Marc Zyngier , Christoffer Dall , Will Deacon , Catalin Marinas , Naoya Horiguchi , Rafael Wysocki , Len Brown , Tony Luck , Tyler Baicar , Dongjiu Geng , Xie XiuQi , Punit Agrawal , jonathan.zhang@cavium.com On Fri, Sep 21, 2018 at 11:17:00PM +0100, James Morse wrote: > ghes_read_estatus() sets a flag in struct ghes if the buffer of > CPER records needs to be cleared once the records have been > processed. This global flags value is a problem if a struct ghes > can be processed concurrently, as happens at probe time if an > NMI arrives for the same error source. > > The GHES_TO_CLEAR flags was only set at the same time as > buffer_paddr, which is now owned by the caller and passed to > ghes_clear_estatus(). Use this as the flag. > > A non-zero buf_paddr returned by ghes_read_estatus() means > ghes_clear_estatus() will clear this address. ghes_read_estatus() > already checks for a read of error_status_address being zero, > so we can never get CPER records written at zero. > > After this ghes_clear_estatus() no longer needs the struct ghes. > > Signed-off-by: James Morse > --- > drivers/acpi/apei/ghes.c | 26 ++++++++++++-------------- > include/acpi/ghes.h | 1 - > 2 files changed, 12 insertions(+), 15 deletions(-) Nice. Reviewed-by: Borislav Petkov -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply. From mboxrd@z Thu Jan 1 00:00:00 1970 From: bp@alien8.de (Borislav Petkov) Date: Fri, 12 Oct 2018 19:14:39 +0200 Subject: [PATCH v6 13/18] ACPI / APEI: Don't update struct ghes' flags in read/clear estatus In-Reply-To: <20180921221705.6478-14-james.morse@arm.com> References: <20180921221705.6478-1-james.morse@arm.com> <20180921221705.6478-14-james.morse@arm.com> Message-ID: <20181012171439.GF580@zn.tnic> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, Sep 21, 2018 at 11:17:00PM +0100, James Morse wrote: > ghes_read_estatus() sets a flag in struct ghes if the buffer of > CPER records needs to be cleared once the records have been > processed. This global flags value is a problem if a struct ghes > can be processed concurrently, as happens at probe time if an > NMI arrives for the same error source. > > The GHES_TO_CLEAR flags was only set at the same time as > buffer_paddr, which is now owned by the caller and passed to > ghes_clear_estatus(). Use this as the flag. > > A non-zero buf_paddr returned by ghes_read_estatus() means > ghes_clear_estatus() will clear this address. ghes_read_estatus() > already checks for a read of error_status_address being zero, > so we can never get CPER records written at zero. > > After this ghes_clear_estatus() no longer needs the struct ghes. > > Signed-off-by: James Morse > --- > drivers/acpi/apei/ghes.c | 26 ++++++++++++-------------- > include/acpi/ghes.h | 1 - > 2 files changed, 12 insertions(+), 15 deletions(-) Nice. Reviewed-by: Borislav Petkov -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.