From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web12.12626.1634039417743086430 for ; Tue, 12 Oct 2021 04:50:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PKPXoHaC; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634039416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qz1NKJnN9qD8uSbOu/URmNHZUX6FZpoC2IXf1SH3cY0=; b=PKPXoHaCLoHXvtrm41Tax3y+4pta6vMWF1ug0404fCdnjtJmrNsegHmo7spuy780djv5Bj HpKfNn+QUoAMz5WG7IGCtP/GAYOG70Vv08XD8Md6WGVbLxsXgexDv2XkUOg4rSW89elgqM w4lokYnbbkoEw6H9qE8am9eKvJ/xdz0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-312-aySkJldNMWGa22rXfyTt7A-1; Tue, 12 Oct 2021 07:50:13 -0400 X-MC-Unique: aySkJldNMWGa22rXfyTt7A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D130618125C0; Tue, 12 Oct 2021 11:50:11 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 83EE97092E; Tue, 12 Oct 2021 11:50:11 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C3DCC180060E; Tue, 12 Oct 2021 13:50:09 +0200 (CEST) Date: Tue, 12 Oct 2021 13:50:09 +0200 From: "Gerd Hoffmann" To: devel@edk2.groups.io, min.m.xu@intel.com Cc: Ard Biesheuvel , Jordan Justen , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky Subject: Re: [edk2-devel] [PATCH V2 24/28] OvmfPkg: Add TdxDxe driver Message-ID: <20211012115009.bde5etudkkbzmfqm@sirius.home.kraxel.org> References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, > Besides above features, TdxDxe driver will update the ACPI MADT > Mutiprocessor Wakeup Table. > + ACPI_MADT_MPWK_STRUCT *MadtMpWk; > + NewBufferSize = 1 * sizeof (*Madt) + > + CpuCount * sizeof (*LocalApic) + > + 1 * sizeof (*IoApic) + > + NUM_8259_IRQS * sizeof (*Iso) + > + 1 * sizeof (*LocalApicNmi); + sizeof(MadtMpWk) > + CopyMem (&(Madt->Header), AcpiTableBuffer, sizeof (EFI_ACPI_DESCRIPTION_HEADER)); > + Madt->Header.Length = (UINT32) NewBufferSize; > + Madt->LocalApicAddress = PcdGet32 (PcdCpuLocalApicBaseAddress); > + Madt->Flags = EFI_ACPI_1_0_PCAT_COMPAT; > + Ptr = Madt + 1; [ ... ] You are not updating the MADT. You create a new one from scratch. Not a good plan. I think you should simply get the installed table, copy it to a larger buffer and append the ACPI_MADT_MPWK_STRUCT to that. take care, Gerd