From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99EAA149C42; Wed, 20 Nov 2024 14:22:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732112536; cv=none; b=B4w/TLcK3bdzyYPzrJYwVQ3M+qyWyXSzPhXgSpLqSrwHLOW4uYaAtGjN7fbRRM2PwLMmhbwQ4757C6CVuarIUKKZpU6J25RV5YEsFbzLR3GPxpt519Bdf9zhEXStyyO+xaCrS7M3CbDtOEYlb4abBIeTN5Bg+nEi361A8fYaHjI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732112536; c=relaxed/simple; bh=plJ6EQ3VjvAPbIHz/+2XUa9OXqozHLwx8Q7PHhtFzNM=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FM4kqv9cIVvnz4x1FW3TM0RYp3VMk0eYNcR8KZr7dIx0gt8dRnFvXTnvWkS2ft6uEUrAXlJCghDOB6hIhcgminysEfg6IxEjTEyQc7yQHP5q+amg8KqIHDdT2mM1ALG6QBmRmB/avWy3w2BfaNLa07EGbrJBp5CnGXTSFD0JBS4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Xtk7v3b1bz6LD3m; Wed, 20 Nov 2024 22:21:47 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 19870140114; Wed, 20 Nov 2024 22:22:10 +0800 (CST) Received: from localhost (10.203.177.66) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 20 Nov 2024 15:22:09 +0100 Date: Wed, 20 Nov 2024 14:22:08 +0000 From: Jonathan Cameron To: Mauro Carvalho Chehab CC: Igor Mammedov , Shiju Jose , "Michael S. Tsirkin" , Ani Sinha , Dongjiu Geng , Paolo Bonzini , Peter Maydell , , , , Subject: Re: [PATCH v3 09/15] acpi/ghes: better name GHES memory error function Message-ID: <20241120142208.00005cbe@huawei.com> In-Reply-To: References: X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml100012.china.huawei.com (7.191.174.184) To frapeml500008.china.huawei.com (7.182.85.71) On Tue, 12 Nov 2024 11:14:53 +0100 Mauro Carvalho Chehab wrote: > The current function used to generate GHES data is specific for > memory errors. Give a better name for it, as we now have a generic > function as well. > > Reviewed-by: Igor Mammedov > Signed-off-by: Mauro Carvalho Chehab A couple of unnecessary line breaks I think. Otherwise LGTM Reviewed-by: Jonathan Cameron > --- > hw/acpi/ghes-stub.c | 2 +- > hw/acpi/ghes.c | 2 +- > include/hw/acpi/ghes.h | 5 +++-- > target/arm/kvm.c | 3 ++- > 4 files changed, 7 insertions(+), 5 deletions(-) > > diff --git a/hw/acpi/ghes-stub.c b/hw/acpi/ghes-stub.c > index 2b64cbd2819a..7cec1812dad9 100644 > --- a/hw/acpi/ghes-stub.c > +++ b/hw/acpi/ghes-stub.c > @@ -11,7 +11,7 @@ > #include "qemu/osdep.h" > #include "hw/acpi/ghes.h" > > -int acpi_ghes_record_errors(uint16_t source_id, uint64_t physical_address) > +int acpi_ghes_memory_errors(uint16_t source_id, uint64_t physical_address) > { > return -1; > } > diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c > index 0eb874a11ff7..1dbcbefbc2ee 100644 > --- a/hw/acpi/ghes.c > +++ b/hw/acpi/ghes.c > @@ -421,7 +421,7 @@ void ghes_record_cper_errors(const void *cper, size_t len, > return; > } > > -int acpi_ghes_record_errors(uint16_t source_id, uint64_t physical_address) > +int acpi_ghes_memory_errors(uint16_t source_id, uint64_t physical_address) > { > /* Memory Error Section Type */ > const uint8_t guid[] = > diff --git a/include/hw/acpi/ghes.h b/include/hw/acpi/ghes.h > index 8859346af51a..a35097d5207c 100644 > --- a/include/hw/acpi/ghes.h > +++ b/include/hw/acpi/ghes.h > @@ -74,15 +74,16 @@ void acpi_build_hest(GArray *table_data, GArray *hardware_errors, > const char *oem_id, const char *oem_table_id); > void acpi_ghes_add_fw_cfg(AcpiGhesState *vms, FWCfgState *s, > GArray *hardware_errors); > +int acpi_ghes_memory_errors(uint16_t source_id, > + uint64_t error_physical_addr); No need for line break as under 80 chars anyway. > void ghes_record_cper_errors(const void *cper, size_t len, > uint16_t source_id, Error **errp); > -int acpi_ghes_record_errors(uint16_t source_id, uint64_t error_physical_addr); > > /** > * acpi_ghes_present: Report whether ACPI GHES table is present > * > * Returns: true if the system has an ACPI GHES table and it is > - * safe to call acpi_ghes_record_errors() to record a memory error. > + * safe to call acpi_ghes_memory_errors() to record a memory error. > */ > bool acpi_ghes_present(void); > #endif > diff --git a/target/arm/kvm.c b/target/arm/kvm.c > index 7b6812c0de2e..8e281d920052 100644 > --- a/target/arm/kvm.c > +++ b/target/arm/kvm.c > @@ -2387,7 +2387,8 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, void *addr) > */ > if (code == BUS_MCEERR_AR) { > kvm_cpu_synchronize_state(c); > - if (!acpi_ghes_record_errors(ACPI_HEST_SRC_ID_SEA, paddr)) { > + if (!acpi_ghes_memory_errors(ACPI_HEST_SRC_ID_SEA, > + paddr)) { Why the line break? It will be under 80 chars on one line. > kvm_inject_arm_sea(c); > } else { > error_report("failed to record the error"); From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE0CAD6395B for ; Wed, 20 Nov 2024 14:22:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDlax-0001x5-V9; Wed, 20 Nov 2024 09:22:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tDlaw-0001wm-IP; Wed, 20 Nov 2024 09:22:14 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tDlau-0000EI-TN; Wed, 20 Nov 2024 09:22:14 -0500 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Xtk7v3b1bz6LD3m; Wed, 20 Nov 2024 22:21:47 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 19870140114; Wed, 20 Nov 2024 22:22:10 +0800 (CST) Received: from localhost (10.203.177.66) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 20 Nov 2024 15:22:09 +0100 Date: Wed, 20 Nov 2024 14:22:08 +0000 To: Mauro Carvalho Chehab CC: Igor Mammedov , Shiju Jose , "Michael S. Tsirkin" , Ani Sinha , Dongjiu Geng , Paolo Bonzini , Peter Maydell , , , , Subject: Re: [PATCH v3 09/15] acpi/ghes: better name GHES memory error function Message-ID: <20241120142208.00005cbe@huawei.com> In-Reply-To: References: X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.203.177.66] X-ClientProxiedBy: lhrpeml100012.china.huawei.com (7.191.174.184) To frapeml500008.china.huawei.com (7.182.85.71) Received-SPF: pass client-ip=185.176.79.56; envelope-from=jonathan.cameron@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jonathan Cameron From: Jonathan Cameron via Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Tue, 12 Nov 2024 11:14:53 +0100 Mauro Carvalho Chehab wrote: > The current function used to generate GHES data is specific for > memory errors. Give a better name for it, as we now have a generic > function as well. > > Reviewed-by: Igor Mammedov > Signed-off-by: Mauro Carvalho Chehab A couple of unnecessary line breaks I think. Otherwise LGTM Reviewed-by: Jonathan Cameron > --- > hw/acpi/ghes-stub.c | 2 +- > hw/acpi/ghes.c | 2 +- > include/hw/acpi/ghes.h | 5 +++-- > target/arm/kvm.c | 3 ++- > 4 files changed, 7 insertions(+), 5 deletions(-) > > diff --git a/hw/acpi/ghes-stub.c b/hw/acpi/ghes-stub.c > index 2b64cbd2819a..7cec1812dad9 100644 > --- a/hw/acpi/ghes-stub.c > +++ b/hw/acpi/ghes-stub.c > @@ -11,7 +11,7 @@ > #include "qemu/osdep.h" > #include "hw/acpi/ghes.h" > > -int acpi_ghes_record_errors(uint16_t source_id, uint64_t physical_address) > +int acpi_ghes_memory_errors(uint16_t source_id, uint64_t physical_address) > { > return -1; > } > diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c > index 0eb874a11ff7..1dbcbefbc2ee 100644 > --- a/hw/acpi/ghes.c > +++ b/hw/acpi/ghes.c > @@ -421,7 +421,7 @@ void ghes_record_cper_errors(const void *cper, size_t len, > return; > } > > -int acpi_ghes_record_errors(uint16_t source_id, uint64_t physical_address) > +int acpi_ghes_memory_errors(uint16_t source_id, uint64_t physical_address) > { > /* Memory Error Section Type */ > const uint8_t guid[] = > diff --git a/include/hw/acpi/ghes.h b/include/hw/acpi/ghes.h > index 8859346af51a..a35097d5207c 100644 > --- a/include/hw/acpi/ghes.h > +++ b/include/hw/acpi/ghes.h > @@ -74,15 +74,16 @@ void acpi_build_hest(GArray *table_data, GArray *hardware_errors, > const char *oem_id, const char *oem_table_id); > void acpi_ghes_add_fw_cfg(AcpiGhesState *vms, FWCfgState *s, > GArray *hardware_errors); > +int acpi_ghes_memory_errors(uint16_t source_id, > + uint64_t error_physical_addr); No need for line break as under 80 chars anyway. > void ghes_record_cper_errors(const void *cper, size_t len, > uint16_t source_id, Error **errp); > -int acpi_ghes_record_errors(uint16_t source_id, uint64_t error_physical_addr); > > /** > * acpi_ghes_present: Report whether ACPI GHES table is present > * > * Returns: true if the system has an ACPI GHES table and it is > - * safe to call acpi_ghes_record_errors() to record a memory error. > + * safe to call acpi_ghes_memory_errors() to record a memory error. > */ > bool acpi_ghes_present(void); > #endif > diff --git a/target/arm/kvm.c b/target/arm/kvm.c > index 7b6812c0de2e..8e281d920052 100644 > --- a/target/arm/kvm.c > +++ b/target/arm/kvm.c > @@ -2387,7 +2387,8 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, void *addr) > */ > if (code == BUS_MCEERR_AR) { > kvm_cpu_synchronize_state(c); > - if (!acpi_ghes_record_errors(ACPI_HEST_SRC_ID_SEA, paddr)) { > + if (!acpi_ghes_memory_errors(ACPI_HEST_SRC_ID_SEA, > + paddr)) { Why the line break? It will be under 80 chars on one line. > kvm_inject_arm_sea(c); > } else { > error_report("failed to record the error");