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 2F52216F851 for ; Mon, 25 Nov 2024 12:00:08 +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=1732536012; cv=none; b=Cut/vF7wPZNpfV+Cmpd9qP1eLgBiM1PhVdJjm/Mi0pcByrDMCgoZrrc81Grlv1JmN+BGeZJojOqo65BMbjLepdKVYIneqkGdCb5MDva9CIKTtY5ua7T4HgQtbN++zmmC5ssiXnsywp7j6i7vj0RZO57STBvirHkCKn9cGqNZBec= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732536012; c=relaxed/simple; bh=IHleToAA6rnb5X+NVVZOmm4xFO5hSRXp4UtRpALfFuQ=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TuGykmoXfaU3fYazP9tm8ATJftowjMCPeycbmmU1LdobldfzCU4HmSgb/t4Wzfhesj09l+GJTQQ22dQo5BtSUKEA6awSV7SwplxvodgsphLbGkKcfe7R4gVkCwPcKf0c3OxpwRcvo0HF4w/7fklrC7JClSD9rBDfFjDLyHIQwpM= 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.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Xxkgl27fpz6J72Z; Mon, 25 Nov 2024 19:56:19 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id F2D561400D9; Mon, 25 Nov 2024 20:00:05 +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; Mon, 25 Nov 2024 13:00:05 +0100 Date: Mon, 25 Nov 2024 12:00:04 +0000 From: Jonathan Cameron To: Mauro Carvalho Chehab CC: Shiju Jose , "Michael S. Tsirkin" , Ani Sinha , Dongjiu Geng , Igor Mammedov , , , Subject: Re: [PATCH v2 3/5] acpi/ghes: Use HEST table offsets when preparing GHES records Message-ID: <20241125120004.000041f1@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: lhrpeml100010.china.huawei.com (7.191.174.197) To frapeml500008.china.huawei.com (7.182.85.71) On Fri, 22 Nov 2024 14:14:13 +0100 Mauro Carvalho Chehab wrote: > There are two pointers that are needed during error injection: > > 1. The start address of the CPER block to be stored; > 2. The address of the ack, which needs a reset before next error. > > It is preferable to calculate them from the HEST table. This allows > checking the source ID, the size of the table and the type of the > HEST error block structures. > > Yet, keep the old code, as this is needed for migration purposes. > > Signed-off-by: Mauro Carvalho Chehab > --- Just repeat of the comment I failed to explain properly on previous version about comment style. Reviewed-by: Jonathan Cameron > hw/acpi/ghes.c | 98 ++++++++++++++++++++++++++++++++++++++++++++------ > 1 file changed, 88 insertions(+), 10 deletions(-) > > diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c > index 680cada0e487..b5e3e2891445 100644 > --- a/hw/acpi/ghes.c > +++ b/hw/acpi/ghes.c > @@ -61,6 +61,23 @@ > */ > #define ACPI_GHES_GESB_SIZE 20 > > +/* > + * Offsets with regards to the start of the HEST table stored at > + * ags->hest_addr_le, according with the memory layout map at > + * docs/specs/acpi_hest_ghes.rst. > + */ > + This was the bit I failed to explain in previous review. I think for consistency it should be. /* * ACPI 6.2: 18.3.2.8 Generic Hardware Error Source version 2 * Table 18-382 Generic Hardware Error Source version 2 (GHESv2) Structure */ > +/* ACPI 6.2: 18.3.2.8 Generic Hardware Error Source version 2 > + * Table 18-382 Generic Hardware Error Source version 2 (GHESv2) Structure > + */ > +#define HEST_GHES_V2_TABLE_SIZE 92 > +#define GHES_ACK_OFFSET (64 + GAS_ADDR_OFFSET) > + > +/* ACPI 6.2: 18.3.2.7: Generic Hardware Error Source Similar here. > + * Table 18-380: 'Error Status Address' field > + */ > +#define GHES_ERR_ST_ADDR_OFFSET (20 + GAS_ADDR_OFFSET) > +