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 C2B1B174EDB for ; Wed, 20 Nov 2024 14:22:53 +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=1732112575; cv=none; b=pR0lPHAqcFd/qTvrXWlHFq8rhhbrpnOdxAlOwgLMbr89XukenV35iu4j8KrFGjE+YaKHGuTAvKT+0khJn+x+LWLpymA1xcIMBP/CokCZy9piHcwvWfC+O1eNItOxBGqIuRVX9Q8aJjPxulYXgxUVE1EaW3HPLvgxcNG4vxWNyEU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732112575; c=relaxed/simple; bh=MGmw32eEGq+7TLv6QFL3xCj0QrlYRMg4JAm/geqNPvM=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Sb6zlFV4esu57GDtLTOt3Gau8Cus2QzPlppykE+fuRnls4EnUl9urE0V1nojC4B2i1tQOeuopkNZTpc+Ct71vkCV1gzRbrLETQ7xEog+2lBgIIkwpnNBOJmylm31LAhorJaSGwGA9idhrF9M8PqvBPc4gh03GWKAy4iZ7DYZcFA= 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.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Xtk6V4ktMz6GD2T; Wed, 20 Nov 2024 22:20:34 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id D0E2A140AB8; Wed, 20 Nov 2024 22:22:51 +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:51 +0100 Date: Wed, 20 Nov 2024 14:22:50 +0000 From: Jonathan Cameron To: Mauro Carvalho Chehab CC: Igor Mammedov , Shiju Jose , "Michael S. Tsirkin" , Ani Sinha , Dongjiu Geng , , , Subject: Re: [PATCH v3 10/15] acpi/ghes: don't crash QEMU if ghes GED is not found Message-ID: <20241120142250.00006ae2@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: linux-kernel@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:54 +0100 Mauro Carvalho Chehab wrote: > Make error handling within ghes_record_cper_errors() consistent, > i.e. instead abort just print a error in case ghes GED is not found. > > Signed-off-by: Mauro Carvalho Chehab Fair enough. Reviewed-by: Jonathan Cameron > --- > hw/acpi/ghes.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c > index 1dbcbefbc2ee..e15a411b47e1 100644 > --- a/hw/acpi/ghes.c > +++ b/hw/acpi/ghes.c > @@ -377,7 +377,10 @@ void ghes_record_cper_errors(const void *cper, size_t len, > > acpi_ged_state = ACPI_GED(object_resolve_path_type("", TYPE_ACPI_GED, > NULL)); > - g_assert(acpi_ged_state); > + if (!acpi_ged_state) { > + error_setg(errp, "Can't find ACPI_GED object"); > + return; > + } > ags = &acpi_ged_state->ghes_state; > > start_addr = le64_to_cpu(ags->ghes_addr_le);