From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web09.886.1610694735600416306 for ; Thu, 14 Jan 2021 23:12:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hSETwjem; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610694734; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6/95yGn7q+g1Z7He/hCfm9GoRm8/b54g66tgSCpwSo8=; b=hSETwjemV0s3LIZi6JsQviNoCwgpZ4VSJolH+bS1KJXF/N2MtcUNpFhtcs8TfLdMkGjZQ2 X+NgB1K8m6et5cgkSvU+9sLyCT1n9nJWYtM3oHSJkmzHBIcxQzOYLEYNoyu/CxhP5n0NS/ xmWjzzzZMthM4q4MUR5Rua2cWZa28+E= 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-562-RPFhclZsNl-bP2ExDldsyQ-1; Fri, 15 Jan 2021 02:12:12 -0500 X-MC-Unique: RPFhclZsNl-bP2ExDldsyQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B722780A5C1; Fri, 15 Jan 2021 07:12:11 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-223.ams2.redhat.com [10.36.112.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 825EF6F7E5; Fri, 15 Jan 2021 07:12:10 +0000 (UTC) Subject: Re: [PATCH v3 16/18] UefiCpuPkg: CpuIo2Smm: Move CpuIo2Smm driver to consume gMmst To: Kun Qin , devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar References: <20210114223637.2737-1-kun.q@outlook.com> From: "Laszlo Ersek" Message-ID: Date: Fri, 15 Jan 2021 08:12:09 +0100 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 01/14/21 23:36, Kun Qin wrote: > This change replaced gSmst with gMmst to support broader compatibility > under MM environment for CpuIo2Smm driver. > > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Rahul Kumar > > Signed-off-by: Kun Qin > --- > > Notes: > v3: > - Break gMmst replacement into separate PR [Laszlo] > > v2: > - Removed "EFIAPI" for internal functions. > > UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c | 6 +++--- > UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h | 2 +- > UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf | 2 +- > UefiCpuPkg/UefiCpuPkg.dsc | 1 + > 4 files changed, 6 insertions(+), 5 deletions(-) > > diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c > index b840d3e10cae..c0a2baecee03 100644 > --- a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c > +++ b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c > @@ -390,12 +390,12 @@ SmmCpuIo2Initialize ( > // > // Copy the SMM CPU I/O Protocol instance into the System Management System Table > // > - CopyMem (&gSmst->SmmIo, &mSmmCpuIo2, sizeof (mSmmCpuIo2)); > + CopyMem (&gMmst->MmIo, &mSmmCpuIo2, sizeof (mSmmCpuIo2)); > > // > - // Install the SMM CPU I/O Protocol into the SMM protocol database > + // Install the SMM CPU I/O Protocol into the MM protocol database > // > - Status = gSmst->SmmInstallProtocolInterface ( > + Status = gMmst->MmInstallProtocolInterface ( > &mHandle, > &gEfiSmmCpuIo2ProtocolGuid, > EFI_NATIVE_INTERFACE, > diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h > index 4c133b58c9f4..c80261945f71 100644 > --- a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h > +++ b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h > @@ -16,7 +16,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > #include > #include > #include > -#include > +#include > #include > > #define MAX_IO_PORT_ADDRESS 0xFFFF > diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf > index bc78fa4e42d2..b743a5e0e316 100644 > --- a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf > +++ b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf > @@ -34,7 +34,7 @@ [LibraryClasses] > BaseLib > DebugLib > IoLib > - SmmServicesTableLib > + MmServicesTableLib > BaseMemoryLib > > [Protocols] > diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc > index b2b6d78a71b0..9b56bcaabebe 100644 > --- a/UefiCpuPkg/UefiCpuPkg.dsc > +++ b/UefiCpuPkg/UefiCpuPkg.dsc > @@ -89,6 +89,7 @@ [LibraryClasses.common.DXE_DRIVER] > > [LibraryClasses.common.DXE_SMM_DRIVER] > SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf > + MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf > MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf > HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf > Reviewed-by: Laszlo Ersek