Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-17 Thread Ni, Ray
Marc,
Thanks for your contribution! It's a big step already to have the header files 
in MdePkg.

Thanks,
Ray

> -Original Message-
> From: Ni, Ray
> Sent: Sunday, August 18, 2019 1:20 PM
> To: Chen, Marc W ; Gao, Liming ; 
> devel@edk2.groups.io;
> ler...@redhat.com
> Cc: Kinney, Michael D 
> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl 
> definition.
> 
> I don't have strong preference on removing SmmAccess.h from MdeModulePkg.
> If people except me all agreed to keep that header file for compatibility, I 
> am ok.
> 
> > -Original Message-
> > From: Chen, Marc W
> > Sent: Wednesday, August 14, 2019 5:54 PM
> > To: Gao, Liming ; devel@edk2.groups.io; 
> > ler...@redhat.com; Ni, Ray 
> > Cc: Kinney, Michael D 
> > Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl 
> > definition.
> >
> > Thanks Liming for pushing the code.
> >
> > Can we have a conclusion for the SmmAccess.h removal from MdeModulePkg? Who 
> > can make the decision? Or do we need
> any
> > further discussion?
> >
> > Thanks,
> > Marc
> >
> > > -Original Message-
> > > From: Gao, Liming
> > > Sent: Tuesday, August 13, 2019 5:20 PM
> > > To: devel@edk2.groups.io; Gao, Liming ; Chen, Marc
> > > W ; ler...@redhat.com; Ni, Ray
> > > 
> > > Cc: Kinney, Michael D 
> > > Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> > > definition.
> > >
> > > Push @6f33f7a262314af35e2b99c849e08928ea49aa55
> > >
> > > >-Original Message-
> > > >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > > >Liming Gao
> > > >Sent: Saturday, August 10, 2019 11:34 AM
> > > >To: Chen, Marc W ; devel@edk2.groups.io;
> > > >ler...@redhat.com; Ni, Ray 
> > > >Cc: Kinney, Michael D 
> > > >Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> > > >definition.
> > > >
> > > >I agree. The patch to add them in MdePkg is clear. I will push it next 
> > > >Monday.
> > > >
> > > >Thanks
> > > >Liming
> > > >> -Original Message-
> > > >> From: Chen, Marc W
> > > >> Sent: Saturday, August 10, 2019 11:33 AM
> > > >> To: devel@edk2.groups.io; ler...@redhat.com; Ni, Ray
> > > ;
> > > >Gao, Liming 
> > > >> Cc: Kinney, Michael D 
> > > >> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> > > MmControl
> > > >definition.
> > > >>
> > > >> Hi Liming
> > > >>
> > > >> Since the SmmAccess.h of MdeModulePkg removal is still under 
> > > >> discussion,
> > > >can we push the MmAccess.h and MmControl.h to MdePkg
> > > >> first? I have other tasks pending by this.
> > > >> We can keep discussing the SmmAccess after push the code.
> > > >>
> > > >> Thanks,
> > > >> Marc
> > > >>
> > > >> > -Original Message-
> > > >> > From: devel@edk2.groups.io  On Behalf Of
> > > Laszlo
> > > >> > Ersek
> > > >> > Sent: Thursday, August 8, 2019 12:11 AM
> > > >> > To: Ni, Ray ; Chen, Marc W
> > > ;
> > > >> > devel@edk2.groups.io; Gao, Liming 
> > > >> > Cc: Kinney, Michael D 
> > > >> > Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> > > >MmControl
> > > >> > definition.
> > > >> >
> > > >> > On 08/06/19 12:08, Ni, Ray wrote:
> > > >> > > Laszlo,
> > > >> > > Do you want to avoid touching the OvmfPkg due the file removal in
> > > >> > MdeModulePkg?
> > > >> >
> > > >> > My main problem with this *specific* update proposal is that the
> > > >> > identifiers (type names and such) that would be subject to removal 
> > > >> > were
> > > >> > publicly specified in earlier PI spec releases.
> > > >> >
> > > >> > I don't suggest that we maintain two parallel sets of typedefs and 
> > > >> > such
> > > >> > in edk2. It's fine to keep the new "MM" nomenclature the main one. 
> > > >> > But
> > > >> > we should keep the &quo

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-17 Thread Ni, Ray
I don't have strong preference on removing SmmAccess.h from MdeModulePkg.
If people except me all agreed to keep that header file for compatibility, I am 
ok.

> -Original Message-
> From: Chen, Marc W
> Sent: Wednesday, August 14, 2019 5:54 PM
> To: Gao, Liming ; devel@edk2.groups.io; 
> ler...@redhat.com; Ni, Ray 
> Cc: Kinney, Michael D 
> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl 
> definition.
> 
> Thanks Liming for pushing the code.
> 
> Can we have a conclusion for the SmmAccess.h removal from MdeModulePkg? Who 
> can make the decision? Or do we need any
> further discussion?
> 
> Thanks,
> Marc
> 
> > -Original Message-
> > From: Gao, Liming
> > Sent: Tuesday, August 13, 2019 5:20 PM
> > To: devel@edk2.groups.io; Gao, Liming ; Chen, Marc
> > W ; ler...@redhat.com; Ni, Ray
> > 
> > Cc: Kinney, Michael D 
> > Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> > definition.
> >
> > Push @6f33f7a262314af35e2b99c849e08928ea49aa55
> >
> > >-Original Message-
> > >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > >Liming Gao
> > >Sent: Saturday, August 10, 2019 11:34 AM
> > >To: Chen, Marc W ; devel@edk2.groups.io;
> > >ler...@redhat.com; Ni, Ray 
> > >Cc: Kinney, Michael D 
> > >Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> > >definition.
> > >
> > >I agree. The patch to add them in MdePkg is clear. I will push it next 
> > >Monday.
> > >
> > >Thanks
> > >Liming
> > >> -----Original Message-
> > >> From: Chen, Marc W
> > >> Sent: Saturday, August 10, 2019 11:33 AM
> > >> To: devel@edk2.groups.io; ler...@redhat.com; Ni, Ray
> > ;
> > >Gao, Liming 
> > >> Cc: Kinney, Michael D 
> > >> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> > MmControl
> > >definition.
> > >>
> > >> Hi Liming
> > >>
> > >> Since the SmmAccess.h of MdeModulePkg removal is still under discussion,
> > >can we push the MmAccess.h and MmControl.h to MdePkg
> > >> first? I have other tasks pending by this.
> > >> We can keep discussing the SmmAccess after push the code.
> > >>
> > >> Thanks,
> > >> Marc
> > >>
> > >> > -Original Message-
> > >> > From: devel@edk2.groups.io  On Behalf Of
> > Laszlo
> > >> > Ersek
> > >> > Sent: Thursday, August 8, 2019 12:11 AM
> > >> > To: Ni, Ray ; Chen, Marc W
> > ;
> > >> > devel@edk2.groups.io; Gao, Liming 
> > >> > Cc: Kinney, Michael D 
> > >> > Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> > >MmControl
> > >> > definition.
> > >> >
> > >> > On 08/06/19 12:08, Ni, Ray wrote:
> > >> > > Laszlo,
> > >> > > Do you want to avoid touching the OvmfPkg due the file removal in
> > >> > MdeModulePkg?
> > >> >
> > >> > My main problem with this *specific* update proposal is that the
> > >> > identifiers (type names and such) that would be subject to removal were
> > >> > publicly specified in earlier PI spec releases.
> > >> >
> > >> > I don't suggest that we maintain two parallel sets of typedefs and such
> > >> > in edk2. It's fine to keep the new "MM" nomenclature the main one. But
> > >> > we should keep the "SMM" set of terms too, as a thin wrapper, if that's
> > >> > technically feasible.
> > >> >
> > >> > If we remove "SMM", that will not only affect OvmfPkg unpleasantly, but
> > >> > a bunch of other, out-of-tree code. And the reason I suddenly care
> > about
> > >> > out-of-tree code is that such code was written against a public 
> > >> > industry
> > >> > spec (= earlier versions of the PI spec).
> > >> >
> > >> > I don't think that the simplicity that would come from removing "SMM"
> > >> > altogether, is well-balanced against the pain that it would cause for
> > >> > platforms.
> > >> >
> > >> > Earlier this was solved in the following commits:
> > >> > - 07c6a47e70ba ("MdePkg: Add new definitions for Management
> > Mode.",
> &g

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-14 Thread Marc W Chen
Thanks Liming for pushing the code.

Can we have a conclusion for the SmmAccess.h removal from MdeModulePkg? Who can 
make the decision? Or do we need any further discussion?

Thanks,
Marc

> -Original Message-
> From: Gao, Liming
> Sent: Tuesday, August 13, 2019 5:20 PM
> To: devel@edk2.groups.io; Gao, Liming ; Chen, Marc
> W ; ler...@redhat.com; Ni, Ray
> 
> Cc: Kinney, Michael D 
> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> definition.
> 
> Push @6f33f7a262314af35e2b99c849e08928ea49aa55
> 
> >-Original Message-
> >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> >Liming Gao
> >Sent: Saturday, August 10, 2019 11:34 AM
> >To: Chen, Marc W ; devel@edk2.groups.io;
> >ler...@redhat.com; Ni, Ray 
> >Cc: Kinney, Michael D 
> >Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> >definition.
> >
> >I agree. The patch to add them in MdePkg is clear. I will push it next 
> >Monday.
> >
> >Thanks
> >Liming
> >> -Original Message-
> >> From: Chen, Marc W
> >> Sent: Saturday, August 10, 2019 11:33 AM
> >> To: devel@edk2.groups.io; ler...@redhat.com; Ni, Ray
> ;
> >Gao, Liming 
> >> Cc: Kinney, Michael D 
> >> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> MmControl
> >definition.
> >>
> >> Hi Liming
> >>
> >> Since the SmmAccess.h of MdeModulePkg removal is still under discussion,
> >can we push the MmAccess.h and MmControl.h to MdePkg
> >> first? I have other tasks pending by this.
> >> We can keep discussing the SmmAccess after push the code.
> >>
> >> Thanks,
> >> Marc
> >>
> >> > -Original Message-
> >> > From: devel@edk2.groups.io  On Behalf Of
> Laszlo
> >> > Ersek
> >> > Sent: Thursday, August 8, 2019 12:11 AM
> >> > To: Ni, Ray ; Chen, Marc W
> ;
> >> > devel@edk2.groups.io; Gao, Liming 
> >> > Cc: Kinney, Michael D 
> >> > Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> >MmControl
> >> > definition.
> >> >
> >> > On 08/06/19 12:08, Ni, Ray wrote:
> >> > > Laszlo,
> >> > > Do you want to avoid touching the OvmfPkg due the file removal in
> >> > MdeModulePkg?
> >> >
> >> > My main problem with this *specific* update proposal is that the
> >> > identifiers (type names and such) that would be subject to removal were
> >> > publicly specified in earlier PI spec releases.
> >> >
> >> > I don't suggest that we maintain two parallel sets of typedefs and such
> >> > in edk2. It's fine to keep the new "MM" nomenclature the main one. But
> >> > we should keep the "SMM" set of terms too, as a thin wrapper, if that's
> >> > technically feasible.
> >> >
> >> > If we remove "SMM", that will not only affect OvmfPkg unpleasantly, but
> >> > a bunch of other, out-of-tree code. And the reason I suddenly care
> about
> >> > out-of-tree code is that such code was written against a public industry
> >> > spec (= earlier versions of the PI spec).
> >> >
> >> > I don't think that the simplicity that would come from removing "SMM"
> >> > altogether, is well-balanced against the pain that it would cause for
> >> > platforms.
> >> >
> >> > Earlier this was solved in the following commits:
> >> > - 07c6a47e70ba ("MdePkg: Add new definitions for Management
> Mode.",
> >> > 2017-08-29)
> >> > - 2f208e59e4b9 ("MdePkg: Reference new definitions for Management
> >> > Mode.", 2017-08-29)
> >> >
> >> > Thanks
> >> > Laszlo
> >> >
> >> > > I prefer to remove the files in MdeModulePkg to avoid future
> confusion.
> >> > >
> >> > > Thanks,
> >> > > Ray
> >> > >
> >> > >> -Original Message-
> >> > >> From: Chen, Marc W
> >> > >> Sent: Tuesday, August 6, 2019 4:57 PM
> >> > >> To: devel@edk2.groups.io; ler...@redhat.com; Ni, Ray
> >> > ;
> >> > >> Gao, Liming 
> >> > >> Cc: Kinney, Michael D 
> >> > >> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> >> > MmControl
> >> > >> defini

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-13 Thread Liming Gao
Push @6f33f7a262314af35e2b99c849e08928ea49aa55

>-Original Message-
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>Liming Gao
>Sent: Saturday, August 10, 2019 11:34 AM
>To: Chen, Marc W ; devel@edk2.groups.io;
>ler...@redhat.com; Ni, Ray 
>Cc: Kinney, Michael D 
>Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
>definition.
>
>I agree. The patch to add them in MdePkg is clear. I will push it next Monday.
>
>Thanks
>Liming
>> -Original Message-
>> From: Chen, Marc W
>> Sent: Saturday, August 10, 2019 11:33 AM
>> To: devel@edk2.groups.io; ler...@redhat.com; Ni, Ray ;
>Gao, Liming 
>> Cc: Kinney, Michael D 
>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
>definition.
>>
>> Hi Liming
>>
>> Since the SmmAccess.h of MdeModulePkg removal is still under discussion,
>can we push the MmAccess.h and MmControl.h to MdePkg
>> first? I have other tasks pending by this.
>> We can keep discussing the SmmAccess after push the code.
>>
>> Thanks,
>> Marc
>>
>> > -Original Message-
>> > From: devel@edk2.groups.io  On Behalf Of Laszlo
>> > Ersek
>> > Sent: Thursday, August 8, 2019 12:11 AM
>> > To: Ni, Ray ; Chen, Marc W ;
>> > devel@edk2.groups.io; Gao, Liming 
>> > Cc: Kinney, Michael D 
>> > Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
>MmControl
>> > definition.
>> >
>> > On 08/06/19 12:08, Ni, Ray wrote:
>> > > Laszlo,
>> > > Do you want to avoid touching the OvmfPkg due the file removal in
>> > MdeModulePkg?
>> >
>> > My main problem with this *specific* update proposal is that the
>> > identifiers (type names and such) that would be subject to removal were
>> > publicly specified in earlier PI spec releases.
>> >
>> > I don't suggest that we maintain two parallel sets of typedefs and such
>> > in edk2. It's fine to keep the new "MM" nomenclature the main one. But
>> > we should keep the "SMM" set of terms too, as a thin wrapper, if that's
>> > technically feasible.
>> >
>> > If we remove "SMM", that will not only affect OvmfPkg unpleasantly, but
>> > a bunch of other, out-of-tree code. And the reason I suddenly care about
>> > out-of-tree code is that such code was written against a public industry
>> > spec (= earlier versions of the PI spec).
>> >
>> > I don't think that the simplicity that would come from removing "SMM"
>> > altogether, is well-balanced against the pain that it would cause for
>> > platforms.
>> >
>> > Earlier this was solved in the following commits:
>> > - 07c6a47e70ba ("MdePkg: Add new definitions for Management Mode.",
>> > 2017-08-29)
>> > - 2f208e59e4b9 ("MdePkg: Reference new definitions for Management
>> > Mode.", 2017-08-29)
>> >
>> > Thanks
>> > Laszlo
>> >
>> > > I prefer to remove the files in MdeModulePkg to avoid future confusion.
>> > >
>> > > Thanks,
>> > > Ray
>> > >
>> > >> -Original Message-
>> > >> From: Chen, Marc W
>> > >> Sent: Tuesday, August 6, 2019 4:57 PM
>> > >> To: devel@edk2.groups.io; ler...@redhat.com; Ni, Ray
>> > ;
>> > >> Gao, Liming 
>> > >> Cc: Kinney, Michael D 
>> > >> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
>> > MmControl
>> > >> definition.
>> > >>
>> > >> Hi Liming and Ray
>> > >>
>> > >> Do you also agree?
>> > >>
>> > >> Thanks,
>> > >> Marc
>> > >>
>> > >>> -Original Message-
>> > >>> From: devel@edk2.groups.io  On Behalf Of
>> > Laszlo
>> > >>> Ersek
>> > >>> Sent: Friday, August 2, 2019 10:14 AM
>> > >>> To: devel@edk2.groups.io; Chen, Marc W ;
>Ni,
>> > >>> Ray ; Gao, Liming 
>> > >>> Cc: Kinney, Michael D 
>> > >>> Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
>> > >> MmControl
>> > >>> definition.
>> > >>>
>> > >>> On 08/01/19 12:15, Marc W Chen wrote:
>> > >>>> Yes, my purpose is to avoid platform code update if the package is
>> > >>>> 

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-09 Thread Marc W Chen
Hi Liming

Since the SmmAccess.h of MdeModulePkg removal is still under discussion, can we 
push the MmAccess.h and MmControl.h to MdePkg first? I have other tasks pending 
by this.
We can keep discussing the SmmAccess after push the code.

Thanks,
Marc

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Laszlo
> Ersek
> Sent: Thursday, August 8, 2019 12:11 AM
> To: Ni, Ray ; Chen, Marc W ;
> devel@edk2.groups.io; Gao, Liming 
> Cc: Kinney, Michael D 
> Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> definition.
> 
> On 08/06/19 12:08, Ni, Ray wrote:
> > Laszlo,
> > Do you want to avoid touching the OvmfPkg due the file removal in
> MdeModulePkg?
> 
> My main problem with this *specific* update proposal is that the
> identifiers (type names and such) that would be subject to removal were
> publicly specified in earlier PI spec releases.
> 
> I don't suggest that we maintain two parallel sets of typedefs and such
> in edk2. It's fine to keep the new "MM" nomenclature the main one. But
> we should keep the "SMM" set of terms too, as a thin wrapper, if that's
> technically feasible.
> 
> If we remove "SMM", that will not only affect OvmfPkg unpleasantly, but
> a bunch of other, out-of-tree code. And the reason I suddenly care about
> out-of-tree code is that such code was written against a public industry
> spec (= earlier versions of the PI spec).
> 
> I don't think that the simplicity that would come from removing "SMM"
> altogether, is well-balanced against the pain that it would cause for
> platforms.
> 
> Earlier this was solved in the following commits:
> - 07c6a47e70ba ("MdePkg: Add new definitions for Management Mode.",
> 2017-08-29)
> - 2f208e59e4b9 ("MdePkg: Reference new definitions for Management
> Mode.", 2017-08-29)
> 
> Thanks
> Laszlo
> 
> > I prefer to remove the files in MdeModulePkg to avoid future confusion.
> >
> > Thanks,
> > Ray
> >
> >> -----Original Message-
> >> From: Chen, Marc W
> >> Sent: Tuesday, August 6, 2019 4:57 PM
> >> To: devel@edk2.groups.io; ler...@redhat.com; Ni, Ray
> ;
> >> Gao, Liming 
> >> Cc: Kinney, Michael D 
> >> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> MmControl
> >> definition.
> >>
> >> Hi Liming and Ray
> >>
> >> Do you also agree?
> >>
> >> Thanks,
> >> Marc
> >>
> >>> -Original Message-
> >>> From: devel@edk2.groups.io  On Behalf Of
> Laszlo
> >>> Ersek
> >>> Sent: Friday, August 2, 2019 10:14 AM
> >>> To: devel@edk2.groups.io; Chen, Marc W ; Ni,
> >>> Ray ; Gao, Liming 
> >>> Cc: Kinney, Michael D 
> >>> Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> >> MmControl
> >>> definition.
> >>>
> >>> On 08/01/19 12:15, Marc W Chen wrote:
> >>>> Yes, my purpose is to avoid platform code update if the package is
> >>>> allowed
> >>> to use MdeModulePkg like OvmfPkg.
> >>>> For those packages that cannot depend on MdeModulePkg must
> change
> >> to
> >>> use new definition.
> >>>
> >>> Agreed.
> >>>
> >>> Thanks!
> >>> Laszlo
> >>>
> >>>>> -Original Message-
> >>>>> From: Ni, Ray
> >>>>> Sent: Thursday, August 1, 2019 6:04 PM
> >>>>> To: Chen, Marc W ; Gao, Liming
> >>>>> ; devel@edk2.groups.io
> >>>>> Cc: Kinney, Michael D 
> >>>>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> >>> MmControl
> >>>>> definition.
> >>>>>
> >>>>> Marc,
> >>>>> Is the purpose to avoid platform code update with the wrapper
> >>>>> header
> >>> file in
> >>>>> MdeModulePkg?
> >>>>> Certain platforms they may require to not depend on MdeModulePkg
> >>>>> but just depend on MdePkg.
> >>>>> Having SmmAccess.h in MdeModulePkg doesn't help.
> >>>>>
> >>>>> It also bring confusing.
> >>>>>
> >>>>> Thanks,
> >>>>> Ray
> >>>>>
> >>>>>> -Original Message-
> >>>>>> From: Chen, Marc W
> >>>>>> Sent: Thursday, August 1, 2019 4:53 PM
> >>>&g

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-07 Thread Laszlo Ersek
On 08/06/19 12:08, Ni, Ray wrote:
> Laszlo,
> Do you want to avoid touching the OvmfPkg due the file removal in 
> MdeModulePkg?

My main problem with this *specific* update proposal is that the
identifiers (type names and such) that would be subject to removal were
publicly specified in earlier PI spec releases.

I don't suggest that we maintain two parallel sets of typedefs and such
in edk2. It's fine to keep the new "MM" nomenclature the main one. But
we should keep the "SMM" set of terms too, as a thin wrapper, if that's
technically feasible.

If we remove "SMM", that will not only affect OvmfPkg unpleasantly, but
a bunch of other, out-of-tree code. And the reason I suddenly care about
out-of-tree code is that such code was written against a public industry
spec (= earlier versions of the PI spec).

I don't think that the simplicity that would come from removing "SMM"
altogether, is well-balanced against the pain that it would cause for
platforms.

Earlier this was solved in the following commits:
- 07c6a47e70ba ("MdePkg: Add new definitions for Management Mode.",
2017-08-29)
- 2f208e59e4b9 ("MdePkg: Reference new definitions for Management
Mode.", 2017-08-29)

Thanks
Laszlo

> I prefer to remove the files in MdeModulePkg to avoid future confusion.
> 
> Thanks,
> Ray
> 
>> -Original Message-
>> From: Chen, Marc W
>> Sent: Tuesday, August 6, 2019 4:57 PM
>> To: devel@edk2.groups.io; ler...@redhat.com; Ni, Ray ;
>> Gao, Liming 
>> Cc: Kinney, Michael D 
>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
>> definition.
>>
>> Hi Liming and Ray
>>
>> Do you also agree?
>>
>> Thanks,
>> Marc
>>
>>> -Original Message-
>>> From: devel@edk2.groups.io  On Behalf Of Laszlo
>>> Ersek
>>> Sent: Friday, August 2, 2019 10:14 AM
>>> To: devel@edk2.groups.io; Chen, Marc W ; Ni,
>>> Ray ; Gao, Liming 
>>> Cc: Kinney, Michael D 
>>> Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
>> MmControl
>>> definition.
>>>
>>> On 08/01/19 12:15, Marc W Chen wrote:
>>>> Yes, my purpose is to avoid platform code update if the package is
>>>> allowed
>>> to use MdeModulePkg like OvmfPkg.
>>>> For those packages that cannot depend on MdeModulePkg must change
>> to
>>> use new definition.
>>>
>>> Agreed.
>>>
>>> Thanks!
>>> Laszlo
>>>
>>>>> -Original Message-
>>>>> From: Ni, Ray
>>>>> Sent: Thursday, August 1, 2019 6:04 PM
>>>>> To: Chen, Marc W ; Gao, Liming
>>>>> ; devel@edk2.groups.io
>>>>> Cc: Kinney, Michael D 
>>>>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
>>> MmControl
>>>>> definition.
>>>>>
>>>>> Marc,
>>>>> Is the purpose to avoid platform code update with the wrapper
>>>>> header
>>> file in
>>>>> MdeModulePkg?
>>>>> Certain platforms they may require to not depend on MdeModulePkg
>>>>> but just depend on MdePkg.
>>>>> Having SmmAccess.h in MdeModulePkg doesn't help.
>>>>>
>>>>> It also bring confusing.
>>>>>
>>>>> Thanks,
>>>>> Ray
>>>>>
>>>>>> -Original Message-
>>>>>> From: Chen, Marc W
>>>>>> Sent: Thursday, August 1, 2019 4:53 PM
>>>>>> To: Gao, Liming ; devel@edk2.groups.io
>>>>>> Cc: Kinney, Michael D ; Ni, Ray
>>>>>> 
>>>>>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
>>> MmControl
>>>>>> definition.
>>>>>>
>>>>>> Hi Liming
>>>>>>
>>>>>> Another thought, do you think it is ok to keep SmmAccess.h in
>>>>>> MdeModulePkg? We can use #define and typedef to convert
>> MmAccess
>>> to
>>>>>> SmmAccess, just like current SmmAccess Protocol in MdePkg.
>>>>>>
>>>>>> Thanks,
>>>>>> Marc
>>>>>>
>>>>>>> -Original Message-----
>>>>>>> From: Chen, Marc W
>>>>>>> Sent: Thursday, August 1, 2019 4:48 PM
>>>>>>> To: Gao, Liming ; devel@edk2.groups.io
>>>>>>> Cc: Kinney, Michael D ; Ni, Ray
>>>>>>> 
>>>>>>> Subject: 

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-06 Thread Liming Gao
Ray:
  I agree Marc option to keep SMM definition and keep SmmAccess.h in 
MdeModulePkg. 
  And, this header file can be updated to refer the definition in MmAccess.h 
from MdePkg. 
  This way aligns to current SMM definition in MdePkg. 

Thanks
Liming
>-Original Message-
>From: Ni, Ray
>Sent: Tuesday, August 06, 2019 6:09 PM
>To: Chen, Marc W ; devel@edk2.groups.io;
>ler...@redhat.com; Gao, Liming 
>Cc: Kinney, Michael D 
>Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
>definition.
>
>Laszlo,
>Do you want to avoid touching the OvmfPkg due the file removal in
>MdeModulePkg?
>
>I prefer to remove the files in MdeModulePkg to avoid future confusion.
>
>Thanks,
>Ray
>
>> -Original Message-
>> From: Chen, Marc W
>> Sent: Tuesday, August 6, 2019 4:57 PM
>> To: devel@edk2.groups.io; ler...@redhat.com; Ni, Ray ;
>> Gao, Liming 
>> Cc: Kinney, Michael D 
>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
>> definition.
>>
>> Hi Liming and Ray
>>
>> Do you also agree?
>>
>> Thanks,
>> Marc
>>
>> > -Original Message-
>> > From: devel@edk2.groups.io  On Behalf Of Laszlo
>> > Ersek
>> > Sent: Friday, August 2, 2019 10:14 AM
>> > To: devel@edk2.groups.io; Chen, Marc W ; Ni,
>> > Ray ; Gao, Liming 
>> > Cc: Kinney, Michael D 
>> > Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
>> MmControl
>> > definition.
>> >
>> > On 08/01/19 12:15, Marc W Chen wrote:
>> > > Yes, my purpose is to avoid platform code update if the package is
>> > > allowed
>> > to use MdeModulePkg like OvmfPkg.
>> > > For those packages that cannot depend on MdeModulePkg must change
>> to
>> > use new definition.
>> >
>> > Agreed.
>> >
>> > Thanks!
>> > Laszlo
>> >
>> > >> -Original Message-
>> > >> From: Ni, Ray
>> > >> Sent: Thursday, August 1, 2019 6:04 PM
>> > >> To: Chen, Marc W ; Gao, Liming
>> > >> ; devel@edk2.groups.io
>> > >> Cc: Kinney, Michael D 
>> > >> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
>> > MmControl
>> > >> definition.
>> > >>
>> > >> Marc,
>> > >> Is the purpose to avoid platform code update with the wrapper
>> > >> header
>> > file in
>> > >> MdeModulePkg?
>> > >> Certain platforms they may require to not depend on MdeModulePkg
>> > >> but just depend on MdePkg.
>> > >> Having SmmAccess.h in MdeModulePkg doesn't help.
>> > >>
>> > >> It also bring confusing.
>> > >>
>> > >> Thanks,
>> > >> Ray
>> > >>
>> > >>> -Original Message-
>> > >>> From: Chen, Marc W
>> > >>> Sent: Thursday, August 1, 2019 4:53 PM
>> > >>> To: Gao, Liming ; devel@edk2.groups.io
>> > >>> Cc: Kinney, Michael D ; Ni, Ray
>> > >>> 
>> > >>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
>> > MmControl
>> > >>> definition.
>> > >>>
>> > >>> Hi Liming
>> > >>>
>> > >>> Another thought, do you think it is ok to keep SmmAccess.h in
>> > >>> MdeModulePkg? We can use #define and typedef to convert
>> MmAccess
>> > to
>> > >>> SmmAccess, just like current SmmAccess Protocol in MdePkg.
>> > >>>
>> > >>> Thanks,
>> > >>> Marc
>> > >>>
>> > >>>> -Original Message-
>> > >>>> From: Chen, Marc W
>> > >>>> Sent: Thursday, August 1, 2019 4:48 PM
>> > >>>> To: Gao, Liming ; devel@edk2.groups.io
>> > >>>> Cc: Kinney, Michael D ; Ni, Ray
>> > >>>> 
>> > >>>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
>> > >>> MmControl
>> > >>>> definition.
>> > >>>>
>> > >>>> Hi Liming
>> > >>>>
>> > >>>> Since there are multiple packages are still using SmmAccess.h, we
>> > >>>> need to change all packages to use MmAccess.h instead of
>> > >>>> SmmAccess.h first, then clean up SmmAccess.h from

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-06 Thread Ni, Ray
Laszlo,
Do you want to avoid touching the OvmfPkg due the file removal in MdeModulePkg?

I prefer to remove the files in MdeModulePkg to avoid future confusion.

Thanks,
Ray

> -Original Message-
> From: Chen, Marc W
> Sent: Tuesday, August 6, 2019 4:57 PM
> To: devel@edk2.groups.io; ler...@redhat.com; Ni, Ray ;
> Gao, Liming 
> Cc: Kinney, Michael D 
> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> definition.
> 
> Hi Liming and Ray
> 
> Do you also agree?
> 
> Thanks,
> Marc
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Laszlo
> > Ersek
> > Sent: Friday, August 2, 2019 10:14 AM
> > To: devel@edk2.groups.io; Chen, Marc W ; Ni,
> > Ray ; Gao, Liming 
> > Cc: Kinney, Michael D 
> > Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> MmControl
> > definition.
> >
> > On 08/01/19 12:15, Marc W Chen wrote:
> > > Yes, my purpose is to avoid platform code update if the package is
> > > allowed
> > to use MdeModulePkg like OvmfPkg.
> > > For those packages that cannot depend on MdeModulePkg must change
> to
> > use new definition.
> >
> > Agreed.
> >
> > Thanks!
> > Laszlo
> >
> > >> -----Original Message-----
> > >> From: Ni, Ray
> > >> Sent: Thursday, August 1, 2019 6:04 PM
> > >> To: Chen, Marc W ; Gao, Liming
> > >> ; devel@edk2.groups.io
> > >> Cc: Kinney, Michael D 
> > >> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> > MmControl
> > >> definition.
> > >>
> > >> Marc,
> > >> Is the purpose to avoid platform code update with the wrapper
> > >> header
> > file in
> > >> MdeModulePkg?
> > >> Certain platforms they may require to not depend on MdeModulePkg
> > >> but just depend on MdePkg.
> > >> Having SmmAccess.h in MdeModulePkg doesn't help.
> > >>
> > >> It also bring confusing.
> > >>
> > >> Thanks,
> > >> Ray
> > >>
> > >>> -Original Message-
> > >>> From: Chen, Marc W
> > >>> Sent: Thursday, August 1, 2019 4:53 PM
> > >>> To: Gao, Liming ; devel@edk2.groups.io
> > >>> Cc: Kinney, Michael D ; Ni, Ray
> > >>> 
> > >>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> > MmControl
> > >>> definition.
> > >>>
> > >>> Hi Liming
> > >>>
> > >>> Another thought, do you think it is ok to keep SmmAccess.h in
> > >>> MdeModulePkg? We can use #define and typedef to convert
> MmAccess
> > to
> > >>> SmmAccess, just like current SmmAccess Protocol in MdePkg.
> > >>>
> > >>> Thanks,
> > >>> Marc
> > >>>
> > >>>> -Original Message-
> > >>>> From: Chen, Marc W
> > >>>> Sent: Thursday, August 1, 2019 4:48 PM
> > >>>> To: Gao, Liming ; devel@edk2.groups.io
> > >>>> Cc: Kinney, Michael D ; Ni, Ray
> > >>>> 
> > >>>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> > >>> MmControl
> > >>>> definition.
> > >>>>
> > >>>> Hi Liming
> > >>>>
> > >>>> Since there are multiple packages are still using SmmAccess.h, we
> > >>>> need to change all packages to use MmAccess.h instead of
> > >>>> SmmAccess.h first, then clean up SmmAccess.h from MdeModulePkg
> will be the last step.
> > >>>> Below are the packages that has "include " for
> > >>>> your reference.
> > >>>> *  Edk2 repo:
> > >>>> o  MdeModulePkg
> > >>>> o  OvmfPkg
> > >>>> o  UefiCpuPkg
> > >>>> *  Edk2Platform repo:
> > >>>> o  MinPlatformPkg
> > >>>> o  QuarkSocPkg
> > >>>>
> > >>>> Thanks,
> > >>>> Marc
> > >>>>
> > >>>>> -Original Message-
> > >>>>> From: Gao, Liming
> > >>>>> Sent: Thursday, August 1, 2019 4:42 PM
> > >>>>> To: devel@edk2.groups.io; Chen, Marc W 
> > >>>>> Cc: Kinney, Michael D ; Ni, Ray
> > >>>>> 
> > >>&

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-06 Thread Marc W Chen
Hi Liming and Ray

Do you also agree?

Thanks,
Marc

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Laszlo
> Ersek
> Sent: Friday, August 2, 2019 10:14 AM
> To: devel@edk2.groups.io; Chen, Marc W ; Ni, Ray
> ; Gao, Liming 
> Cc: Kinney, Michael D 
> Subject: Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> definition.
> 
> On 08/01/19 12:15, Marc W Chen wrote:
> > Yes, my purpose is to avoid platform code update if the package is allowed
> to use MdeModulePkg like OvmfPkg.
> > For those packages that cannot depend on MdeModulePkg must change to
> use new definition.
> 
> Agreed.
> 
> Thanks!
> Laszlo
> 
> >> -Original Message-
> >> From: Ni, Ray
> >> Sent: Thursday, August 1, 2019 6:04 PM
> >> To: Chen, Marc W ; Gao, Liming
> >> ; devel@edk2.groups.io
> >> Cc: Kinney, Michael D 
> >> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> MmControl
> >> definition.
> >>
> >> Marc,
> >> Is the purpose to avoid platform code update with the wrapper header
> file in
> >> MdeModulePkg?
> >> Certain platforms they may require to not depend on MdeModulePkg but
> >> just depend on MdePkg.
> >> Having SmmAccess.h in MdeModulePkg doesn't help.
> >>
> >> It also bring confusing.
> >>
> >> Thanks,
> >> Ray
> >>
> >>> -Original Message-
> >>> From: Chen, Marc W
> >>> Sent: Thursday, August 1, 2019 4:53 PM
> >>> To: Gao, Liming ; devel@edk2.groups.io
> >>> Cc: Kinney, Michael D ; Ni, Ray
> >>> 
> >>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> MmControl
> >>> definition.
> >>>
> >>> Hi Liming
> >>>
> >>> Another thought, do you think it is ok to keep SmmAccess.h in
> >>> MdeModulePkg? We can use #define and typedef to convert MmAccess
> to
> >>> SmmAccess, just like current SmmAccess Protocol in MdePkg.
> >>>
> >>> Thanks,
> >>> Marc
> >>>
> >>>> -Original Message-
> >>>> From: Chen, Marc W
> >>>> Sent: Thursday, August 1, 2019 4:48 PM
> >>>> To: Gao, Liming ; devel@edk2.groups.io
> >>>> Cc: Kinney, Michael D ; Ni, Ray
> >>>> 
> >>>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> >>> MmControl
> >>>> definition.
> >>>>
> >>>> Hi Liming
> >>>>
> >>>> Since there are multiple packages are still using SmmAccess.h, we need
> >>>> to change all packages to use MmAccess.h instead of SmmAccess.h first,
> >>>> then clean up SmmAccess.h from MdeModulePkg will be the last step.
> >>>> Below are the packages that has "include " for your
> >>>> reference.
> >>>> *Edk2 repo:
> >>>> oMdeModulePkg
> >>>> oOvmfPkg
> >>>> oUefiCpuPkg
> >>>> *Edk2Platform repo:
> >>>> oMinPlatformPkg
> >>>> oQuarkSocPkg
> >>>>
> >>>> Thanks,
> >>>> Marc
> >>>>
> >>>>> -Original Message-
> >>>>> From: Gao, Liming
> >>>>> Sent: Thursday, August 1, 2019 4:42 PM
> >>>>> To: devel@edk2.groups.io; Chen, Marc W 
> >>>>> Cc: Kinney, Michael D ; Ni, Ray
> >>>>> 
> >>>>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> >>> MmControl
> >>>>> definition.
> >>>>>
> >>>>> Marc:
> >>>>>   The change is good. Reviewed-by: Liming Gao
> 
> >>>>>
> >>>>>   Besides, I see BZ also mention to remove the one in MdeModulePkg.
> >>>>> Have you the following patches for the change in MdeModulePkg?
> >>>>>
> >>>>> Thanks
> >>>>> Liming
> >>>>>> -Original Message-
> >>>>>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On
> >> Behalf
> >>>>>> Of Marc W Chen
> >>>>>> Sent: Monday, July 29, 2019 12:26 PM
> >>>>>> To: devel@edk2.groups.io
> >>>>>> Cc: Kinney, Michael D ; Gao, Liming
> >>>>>> ; Ni, Ray 
> >&

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-01 Thread Laszlo Ersek
On 08/01/19 12:15, Marc W Chen wrote:
> Yes, my purpose is to avoid platform code update if the package is allowed to 
> use MdeModulePkg like OvmfPkg.
> For those packages that cannot depend on MdeModulePkg must change to use new 
> definition.

Agreed.

Thanks!
Laszlo

>> -Original Message-
>> From: Ni, Ray
>> Sent: Thursday, August 1, 2019 6:04 PM
>> To: Chen, Marc W ; Gao, Liming
>> ; devel@edk2.groups.io
>> Cc: Kinney, Michael D 
>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
>> definition.
>>
>> Marc,
>> Is the purpose to avoid platform code update with the wrapper header file in
>> MdeModulePkg?
>> Certain platforms they may require to not depend on MdeModulePkg but
>> just depend on MdePkg.
>> Having SmmAccess.h in MdeModulePkg doesn't help.
>>
>> It also bring confusing.
>>
>> Thanks,
>> Ray
>>
>>> -Original Message-
>>> From: Chen, Marc W
>>> Sent: Thursday, August 1, 2019 4:53 PM
>>> To: Gao, Liming ; devel@edk2.groups.io
>>> Cc: Kinney, Michael D ; Ni, Ray
>>> 
>>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
>>> definition.
>>>
>>> Hi Liming
>>>
>>> Another thought, do you think it is ok to keep SmmAccess.h in
>>> MdeModulePkg? We can use #define and typedef to convert MmAccess to
>>> SmmAccess, just like current SmmAccess Protocol in MdePkg.
>>>
>>> Thanks,
>>> Marc
>>>
>>>> -Original Message-
>>>> From: Chen, Marc W
>>>> Sent: Thursday, August 1, 2019 4:48 PM
>>>> To: Gao, Liming ; devel@edk2.groups.io
>>>> Cc: Kinney, Michael D ; Ni, Ray
>>>> 
>>>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
>>> MmControl
>>>> definition.
>>>>
>>>> Hi Liming
>>>>
>>>> Since there are multiple packages are still using SmmAccess.h, we need
>>>> to change all packages to use MmAccess.h instead of SmmAccess.h first,
>>>> then clean up SmmAccess.h from MdeModulePkg will be the last step.
>>>> Below are the packages that has "include " for your
>>>> reference.
>>>> *  Edk2 repo:
>>>> o  MdeModulePkg
>>>> o  OvmfPkg
>>>> o  UefiCpuPkg
>>>> *  Edk2Platform repo:
>>>> o  MinPlatformPkg
>>>> o  QuarkSocPkg
>>>>
>>>> Thanks,
>>>> Marc
>>>>
>>>>> -Original Message-
>>>>> From: Gao, Liming
>>>>> Sent: Thursday, August 1, 2019 4:42 PM
>>>>> To: devel@edk2.groups.io; Chen, Marc W 
>>>>> Cc: Kinney, Michael D ; Ni, Ray
>>>>> 
>>>>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
>>> MmControl
>>>>> definition.
>>>>>
>>>>> Marc:
>>>>>   The change is good. Reviewed-by: Liming Gao 
>>>>>
>>>>>   Besides, I see BZ also mention to remove the one in MdeModulePkg.
>>>>> Have you the following patches for the change in MdeModulePkg?
>>>>>
>>>>> Thanks
>>>>> Liming
>>>>>> -Original Message-
>>>>>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On
>> Behalf
>>>>>> Of Marc W Chen
>>>>>> Sent: Monday, July 29, 2019 12:26 PM
>>>>>> To: devel@edk2.groups.io
>>>>>> Cc: Kinney, Michael D ; Gao, Liming
>>>>>> ; Ni, Ray 
>>>>>> Subject: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
>> MmControl
>>>>>> definition.
>>>>>>
>>>>>> EFI MmAccess and MmControl PPIs are defined in the PI 1.5
>>> specification.
>>>>>>
>>>>>> Cc: Michael D Kinney 
>>>>>> Cc: Liming Gao 
>>>>>> Cc: Ray Ni 
>>>>>> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2023
>>>>>> Signed-off-by: Marc W Chen 
>>>>>> ---
>>>>>> MdePkg/Include/Ppi/MmAccess.h  | 155
>>>>>> +
>>>>>> MdePkg/Include/Ppi/MmControl.h |  90
>>> 
>>>>>> MdePkg/MdePkg.dec  |   6 ++
>>>>>> 3 files changed, 251 insertions(+) create mode 100644
>>>>>> MdePkg/

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-01 Thread Laszlo Ersek
On 08/01/19 10:48, Marc W Chen wrote:
> Hi Liming
> 
> Since there are multiple packages are still using SmmAccess.h, we need to 
> change all packages to use MmAccess.h instead of SmmAccess.h first, then 
> clean up SmmAccess.h from MdeModulePkg will be the last step.
> Below are the packages that has "include " for your 
> reference.
> * Edk2 repo:
> o MdeModulePkg
> o OvmfPkg
> o UefiCpuPkg
> * Edk2Platform repo:
> o MinPlatformPkg
> o QuarkSocPkg

We discussed this in the past. I agree with introducing the new PI
names, and also expecting new platforms / new code in general to use the
new name.

I don't understand why existent code has to be updated. Not just the
#include directives, or the INF files -- that's not too bad. But
replacing a bunch of type names, in structures, local variables,
function declarations, and so on -- that's quite a bit of risk for
regressions, without any actual benefit.

In fact, where do you stop? Assume some static function uses "Smm" in
the name, in a driver. Will you want to rename that to "Mm" too? If so,
that's *really* bad (way to risky). And if not, then the resultant code
will be inconsistent, because type names will be the modern "MM" kind,
but local function and variable names will be the old "Smm" kind.

Please keep the old "SMM" identifiers in MdeModulePkg. They can be
redefined as macros / typedefs on top of the new "MM" ones in MdePkg.

Thanks
Laszlo


>> -Original Message-
>> From: Gao, Liming
>> Sent: Thursday, August 1, 2019 4:42 PM
>> To: devel@edk2.groups.io; Chen, Marc W 
>> Cc: Kinney, Michael D ; Ni, Ray
>> 
>> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
>> definition.
>>
>> Marc:
>>   The change is good. Reviewed-by: Liming Gao 
>>
>>   Besides, I see BZ also mention to remove the one in MdeModulePkg. Have
>> you the following patches for the change in MdeModulePkg?
>>
>> Thanks
>> Liming
>>> -Original Message-
>>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>>> Marc W Chen
>>> Sent: Monday, July 29, 2019 12:26 PM
>>> To: devel@edk2.groups.io
>>> Cc: Kinney, Michael D ; Gao, Liming
>>> ; Ni, Ray 
>>> Subject: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
>>> definition.
>>>
>>> EFI MmAccess and MmControl PPIs are defined in the PI 1.5 specification.
>>>
>>> Cc: Michael D Kinney 
>>> Cc: Liming Gao 
>>> Cc: Ray Ni 
>>> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2023
>>> Signed-off-by: Marc W Chen 
>>> ---
>>> MdePkg/Include/Ppi/MmAccess.h  | 155
>>> +
>>> MdePkg/Include/Ppi/MmControl.h |  90 
>>> MdePkg/MdePkg.dec  |   6 ++
>>> 3 files changed, 251 insertions(+)
>>> create mode 100644 MdePkg/Include/Ppi/MmAccess.h
>>> create mode 100644 MdePkg/Include/Ppi/MmControl.h
>>>
>>> diff --git a/MdePkg/Include/Ppi/MmAccess.h
>>> b/MdePkg/Include/Ppi/MmAccess.h
>>> new file mode 100644
>>> index 00..636e7288a0
>>> --- /dev/null
>>> +++ b/MdePkg/Include/Ppi/MmAccess.h
>>> @@ -0,0 +1,155 @@
>>> +/** @file
>>> +  EFI MM Access PPI definition.
>>> +
>>> +  This PPI is used to control the visibility of the MMRAM on the platform.
>>> +  The EFI_PEI_MM_ACCESS_PPI abstracts the location and characteristics of
>>> MMRAM. The
>>> +  principal functionality found in the memory controller includes the
>> following:
>>> +  - Exposing the MMRAM to all non-MM agents, or the "open" state
>>> +  - Shrouding the MMRAM to all but the MM agents, or the "closed" state
>>> +  - Preserving the system integrity, or "locking" the MMRAM, such that the
>>> settings cannot be
>>> +perturbed by either boot service or runtime agents
>>> +
>>> +  Copyright (c) 2019, Intel Corporation. All rights reserved.
>>> +  SPDX-License-Identifier: BSD-2-Clause-Patent
>>> +
>>> +  @par Revision Reference:
>>> +  This PPI is introduced in PI Version 1.5.
>>> +
>>> +**/
>>> +
>>> +#ifndef _MM_ACCESS_PPI_H_
>>> +#define _MM_ACCESS_PPI_H_
>>> +
>>> +#define EFI_PEI_MM_ACCESS_PPI_GUID \
>>> +  { 0x268f33a9, 0xcccd, 0x48be, { 0x88, 0x17, 0x86, 0x5, 0x3a, 0xc3, 0x2e,
>>> 0xd6 }}
>>> +
>>> +typedef struct _EFI_PEI_MM_AC

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-01 Thread Marc W Chen
Yes, my purpose is to avoid platform code update if the package is allowed to 
use MdeModulePkg like OvmfPkg.
For those packages that cannot depend on MdeModulePkg must change to use new 
definition.

Thanks,
Marc

> -Original Message-
> From: Ni, Ray
> Sent: Thursday, August 1, 2019 6:04 PM
> To: Chen, Marc W ; Gao, Liming
> ; devel@edk2.groups.io
> Cc: Kinney, Michael D 
> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> definition.
> 
> Marc,
> Is the purpose to avoid platform code update with the wrapper header file in
> MdeModulePkg?
> Certain platforms they may require to not depend on MdeModulePkg but
> just depend on MdePkg.
> Having SmmAccess.h in MdeModulePkg doesn't help.
> 
> It also bring confusing.
> 
> Thanks,
> Ray
> 
> > -Original Message-
> > From: Chen, Marc W
> > Sent: Thursday, August 1, 2019 4:53 PM
> > To: Gao, Liming ; devel@edk2.groups.io
> > Cc: Kinney, Michael D ; Ni, Ray
> > 
> > Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> > definition.
> >
> > Hi Liming
> >
> > Another thought, do you think it is ok to keep SmmAccess.h in
> > MdeModulePkg? We can use #define and typedef to convert MmAccess to
> > SmmAccess, just like current SmmAccess Protocol in MdePkg.
> >
> > Thanks,
> > Marc
> >
> > > -Original Message-----
> > > From: Chen, Marc W
> > > Sent: Thursday, August 1, 2019 4:48 PM
> > > To: Gao, Liming ; devel@edk2.groups.io
> > > Cc: Kinney, Michael D ; Ni, Ray
> > > 
> > > Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> > MmControl
> > > definition.
> > >
> > > Hi Liming
> > >
> > > Since there are multiple packages are still using SmmAccess.h, we need
> > > to change all packages to use MmAccess.h instead of SmmAccess.h first,
> > > then clean up SmmAccess.h from MdeModulePkg will be the last step.
> > > Below are the packages that has "include " for your
> > > reference.
> > > * Edk2 repo:
> > > o MdeModulePkg
> > > o OvmfPkg
> > > o UefiCpuPkg
> > > * Edk2Platform repo:
> > > o MinPlatformPkg
> > > o QuarkSocPkg
> > >
> > > Thanks,
> > > Marc
> > >
> > > > -Original Message-
> > > > From: Gao, Liming
> > > > Sent: Thursday, August 1, 2019 4:42 PM
> > > > To: devel@edk2.groups.io; Chen, Marc W 
> > > > Cc: Kinney, Michael D ; Ni, Ray
> > > > 
> > > > Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> > MmControl
> > > > definition.
> > > >
> > > > Marc:
> > > >   The change is good. Reviewed-by: Liming Gao 
> > > >
> > > >   Besides, I see BZ also mention to remove the one in MdeModulePkg.
> > > > Have you the following patches for the change in MdeModulePkg?
> > > >
> > > > Thanks
> > > > Liming
> > > > >-Original Message-
> > > > >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On
> Behalf
> > > > >Of Marc W Chen
> > > > >Sent: Monday, July 29, 2019 12:26 PM
> > > > >To: devel@edk2.groups.io
> > > > >Cc: Kinney, Michael D ; Gao, Liming
> > > > >; Ni, Ray 
> > > > >Subject: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> MmControl
> > > > >definition.
> > > > >
> > > > >EFI MmAccess and MmControl PPIs are defined in the PI 1.5
> > specification.
> > > > >
> > > > >Cc: Michael D Kinney 
> > > > >Cc: Liming Gao 
> > > > >Cc: Ray Ni 
> > > > >Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2023
> > > > >Signed-off-by: Marc W Chen 
> > > > >---
> > > > > MdePkg/Include/Ppi/MmAccess.h  | 155
> > > > >+
> > > > > MdePkg/Include/Ppi/MmControl.h |  90
> > 
> > > > > MdePkg/MdePkg.dec  |   6 ++
> > > > > 3 files changed, 251 insertions(+) create mode 100644
> > > > > MdePkg/Include/Ppi/MmAccess.h create mode 100644
> > > > > MdePkg/Include/Ppi/MmControl.h
> > > > >
> > > > >diff --git a/MdePkg/Include/Ppi/MmAccess.h
> > > > >b/MdePkg/Include/Ppi/MmAccess.h new file mode 100644 index
> > > > >00..636e7288a

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-01 Thread Ni, Ray
Marc,
Is the purpose to avoid platform code update with the wrapper header file in 
MdeModulePkg?
Certain platforms they may require to not depend on MdeModulePkg but just 
depend on MdePkg.
Having SmmAccess.h in MdeModulePkg doesn't help.

It also bring confusing.

Thanks,
Ray

> -Original Message-
> From: Chen, Marc W
> Sent: Thursday, August 1, 2019 4:53 PM
> To: Gao, Liming ; devel@edk2.groups.io
> Cc: Kinney, Michael D ; Ni, Ray
> 
> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> definition.
> 
> Hi Liming
> 
> Another thought, do you think it is ok to keep SmmAccess.h in
> MdeModulePkg? We can use #define and typedef to convert MmAccess to
> SmmAccess, just like current SmmAccess Protocol in MdePkg.
> 
> Thanks,
> Marc
> 
> > -Original Message-
> > From: Chen, Marc W
> > Sent: Thursday, August 1, 2019 4:48 PM
> > To: Gao, Liming ; devel@edk2.groups.io
> > Cc: Kinney, Michael D ; Ni, Ray
> > 
> > Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> MmControl
> > definition.
> >
> > Hi Liming
> >
> > Since there are multiple packages are still using SmmAccess.h, we need
> > to change all packages to use MmAccess.h instead of SmmAccess.h first,
> > then clean up SmmAccess.h from MdeModulePkg will be the last step.
> > Below are the packages that has "include " for your
> > reference.
> > *   Edk2 repo:
> > o   MdeModulePkg
> > o   OvmfPkg
> > o   UefiCpuPkg
> > *   Edk2Platform repo:
> > o   MinPlatformPkg
> > o   QuarkSocPkg
> >
> > Thanks,
> > Marc
> >
> > > -Original Message-
> > > From: Gao, Liming
> > > Sent: Thursday, August 1, 2019 4:42 PM
> > > To: devel@edk2.groups.io; Chen, Marc W 
> > > Cc: Kinney, Michael D ; Ni, Ray
> > > 
> > > Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and
> MmControl
> > > definition.
> > >
> > > Marc:
> > >   The change is good. Reviewed-by: Liming Gao 
> > >
> > >   Besides, I see BZ also mention to remove the one in MdeModulePkg.
> > > Have you the following patches for the change in MdeModulePkg?
> > >
> > > Thanks
> > > Liming
> > > >-Original Message-
> > > >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf
> > > >Of Marc W Chen
> > > >Sent: Monday, July 29, 2019 12:26 PM
> > > >To: devel@edk2.groups.io
> > > >Cc: Kinney, Michael D ; Gao, Liming
> > > >; Ni, Ray 
> > > >Subject: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> > > >definition.
> > > >
> > > >EFI MmAccess and MmControl PPIs are defined in the PI 1.5
> specification.
> > > >
> > > >Cc: Michael D Kinney 
> > > >Cc: Liming Gao 
> > > >Cc: Ray Ni 
> > > >Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2023
> > > >Signed-off-by: Marc W Chen 
> > > >---
> > > > MdePkg/Include/Ppi/MmAccess.h  | 155
> > > >+
> > > > MdePkg/Include/Ppi/MmControl.h |  90
> 
> > > > MdePkg/MdePkg.dec  |   6 ++
> > > > 3 files changed, 251 insertions(+) create mode 100644
> > > > MdePkg/Include/Ppi/MmAccess.h create mode 100644
> > > > MdePkg/Include/Ppi/MmControl.h
> > > >
> > > >diff --git a/MdePkg/Include/Ppi/MmAccess.h
> > > >b/MdePkg/Include/Ppi/MmAccess.h new file mode 100644 index
> > > >00..636e7288a0
> > > >--- /dev/null
> > > >+++ b/MdePkg/Include/Ppi/MmAccess.h
> > > >@@ -0,0 +1,155 @@
> > > >+/** @file
> > > >+  EFI MM Access PPI definition.
> > > >+
> > > >+  This PPI is used to control the visibility of the MMRAM on the
> platform.
> > > >+  The EFI_PEI_MM_ACCESS_PPI abstracts the location and
> > > >+ characteristics
> > of
> > > >MMRAM. The
> > > >+  principal functionality found in the memory controller includes
> > > >+ the
> > > following:
> > > >+  - Exposing the MMRAM to all non-MM agents, or the "open" state
> > > >+  - Shrouding the MMRAM to all but the MM agents, or the "closed"
> > > >+ state
> > > >+  - Preserving the system integrity, or "locking" the MMRAM, such
> > > >+ that
> > the
> > > >settings cannot be
> > >

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-01 Thread Marc W Chen
Hi Liming

Another thought, do you think it is ok to keep SmmAccess.h in MdeModulePkg? We 
can use #define and typedef to convert MmAccess to SmmAccess, just like current 
SmmAccess Protocol in MdePkg. 

Thanks,
Marc

> -Original Message-
> From: Chen, Marc W
> Sent: Thursday, August 1, 2019 4:48 PM
> To: Gao, Liming ; devel@edk2.groups.io
> Cc: Kinney, Michael D ; Ni, Ray
> 
> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> definition.
> 
> Hi Liming
> 
> Since there are multiple packages are still using SmmAccess.h, we need to
> change all packages to use MmAccess.h instead of SmmAccess.h first, then
> clean up SmmAccess.h from MdeModulePkg will be the last step.
> Below are the packages that has "include " for your
> reference.
> * Edk2 repo:
> o MdeModulePkg
> o OvmfPkg
> o UefiCpuPkg
> * Edk2Platform repo:
> o MinPlatformPkg
> o QuarkSocPkg
> 
> Thanks,
> Marc
> 
> > -Original Message-
> > From: Gao, Liming
> > Sent: Thursday, August 1, 2019 4:42 PM
> > To: devel@edk2.groups.io; Chen, Marc W 
> > Cc: Kinney, Michael D ; Ni, Ray
> > 
> > Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> > definition.
> >
> > Marc:
> >   The change is good. Reviewed-by: Liming Gao 
> >
> >   Besides, I see BZ also mention to remove the one in MdeModulePkg. Have
> > you the following patches for the change in MdeModulePkg?
> >
> > Thanks
> > Liming
> > >-Original Message-
> > >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > >Marc W Chen
> > >Sent: Monday, July 29, 2019 12:26 PM
> > >To: devel@edk2.groups.io
> > >Cc: Kinney, Michael D ; Gao, Liming
> > >; Ni, Ray 
> > >Subject: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> > >definition.
> > >
> > >EFI MmAccess and MmControl PPIs are defined in the PI 1.5 specification.
> > >
> > >Cc: Michael D Kinney 
> > >Cc: Liming Gao 
> > >Cc: Ray Ni 
> > >Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2023
> > >Signed-off-by: Marc W Chen 
> > >---
> > > MdePkg/Include/Ppi/MmAccess.h  | 155
> > >+
> > > MdePkg/Include/Ppi/MmControl.h |  90 
> > > MdePkg/MdePkg.dec  |   6 ++
> > > 3 files changed, 251 insertions(+)
> > > create mode 100644 MdePkg/Include/Ppi/MmAccess.h
> > > create mode 100644 MdePkg/Include/Ppi/MmControl.h
> > >
> > >diff --git a/MdePkg/Include/Ppi/MmAccess.h
> > >b/MdePkg/Include/Ppi/MmAccess.h
> > >new file mode 100644
> > >index 00..636e7288a0
> > >--- /dev/null
> > >+++ b/MdePkg/Include/Ppi/MmAccess.h
> > >@@ -0,0 +1,155 @@
> > >+/** @file
> > >+  EFI MM Access PPI definition.
> > >+
> > >+  This PPI is used to control the visibility of the MMRAM on the platform.
> > >+  The EFI_PEI_MM_ACCESS_PPI abstracts the location and characteristics
> of
> > >MMRAM. The
> > >+  principal functionality found in the memory controller includes the
> > following:
> > >+  - Exposing the MMRAM to all non-MM agents, or the "open" state
> > >+  - Shrouding the MMRAM to all but the MM agents, or the "closed" state
> > >+  - Preserving the system integrity, or "locking" the MMRAM, such that
> the
> > >settings cannot be
> > >+perturbed by either boot service or runtime agents
> > >+
> > >+  Copyright (c) 2019, Intel Corporation. All rights reserved.
> > >+  SPDX-License-Identifier: BSD-2-Clause-Patent
> > >+
> > >+  @par Revision Reference:
> > >+  This PPI is introduced in PI Version 1.5.
> > >+
> > >+**/
> > >+
> > >+#ifndef _MM_ACCESS_PPI_H_
> > >+#define _MM_ACCESS_PPI_H_
> > >+
> > >+#define EFI_PEI_MM_ACCESS_PPI_GUID \
> > >+  { 0x268f33a9, 0xcccd, 0x48be, { 0x88, 0x17, 0x86, 0x5, 0x3a, 0xc3, 0x2e,
> > >0xd6 }}
> > >+
> > >+typedef struct _EFI_PEI_MM_ACCESS_PPI  EFI_PEI_MM_ACCESS_PPI;
> > >+
> > >+/**
> > >+  Opens the MMRAM area to be accessible by a PEIM.
> > >+
> > >+  This function "opens" MMRAM so that it is visible while not inside of
> MM.
> > >The function should
> > >+  return EFI_UNSUPPORTED if the hardware does not support hiding of
> > >MMRAM. The function
> 

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-01 Thread Marc W Chen
Hi Liming

Since there are multiple packages are still using SmmAccess.h, we need to 
change all packages to use MmAccess.h instead of SmmAccess.h first, then clean 
up SmmAccess.h from MdeModulePkg will be the last step.
Below are the packages that has "include " for your reference.
*   Edk2 repo:
o   MdeModulePkg
o   OvmfPkg
o   UefiCpuPkg
*   Edk2Platform repo:
o   MinPlatformPkg
o   QuarkSocPkg

Thanks,
Marc

> -Original Message-
> From: Gao, Liming
> Sent: Thursday, August 1, 2019 4:42 PM
> To: devel@edk2.groups.io; Chen, Marc W 
> Cc: Kinney, Michael D ; Ni, Ray
> 
> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> definition.
> 
> Marc:
>   The change is good. Reviewed-by: Liming Gao 
> 
>   Besides, I see BZ also mention to remove the one in MdeModulePkg. Have
> you the following patches for the change in MdeModulePkg?
> 
> Thanks
> Liming
> >-Original Message-
> >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> >Marc W Chen
> >Sent: Monday, July 29, 2019 12:26 PM
> >To: devel@edk2.groups.io
> >Cc: Kinney, Michael D ; Gao, Liming
> >; Ni, Ray 
> >Subject: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
> >definition.
> >
> >EFI MmAccess and MmControl PPIs are defined in the PI 1.5 specification.
> >
> >Cc: Michael D Kinney 
> >Cc: Liming Gao 
> >Cc: Ray Ni 
> >Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2023
> >Signed-off-by: Marc W Chen 
> >---
> > MdePkg/Include/Ppi/MmAccess.h  | 155
> >+
> > MdePkg/Include/Ppi/MmControl.h |  90 
> > MdePkg/MdePkg.dec  |   6 ++
> > 3 files changed, 251 insertions(+)
> > create mode 100644 MdePkg/Include/Ppi/MmAccess.h
> > create mode 100644 MdePkg/Include/Ppi/MmControl.h
> >
> >diff --git a/MdePkg/Include/Ppi/MmAccess.h
> >b/MdePkg/Include/Ppi/MmAccess.h
> >new file mode 100644
> >index 00..636e7288a0
> >--- /dev/null
> >+++ b/MdePkg/Include/Ppi/MmAccess.h
> >@@ -0,0 +1,155 @@
> >+/** @file
> >+  EFI MM Access PPI definition.
> >+
> >+  This PPI is used to control the visibility of the MMRAM on the platform.
> >+  The EFI_PEI_MM_ACCESS_PPI abstracts the location and characteristics of
> >MMRAM. The
> >+  principal functionality found in the memory controller includes the
> following:
> >+  - Exposing the MMRAM to all non-MM agents, or the "open" state
> >+  - Shrouding the MMRAM to all but the MM agents, or the "closed" state
> >+  - Preserving the system integrity, or "locking" the MMRAM, such that the
> >settings cannot be
> >+perturbed by either boot service or runtime agents
> >+
> >+  Copyright (c) 2019, Intel Corporation. All rights reserved.
> >+  SPDX-License-Identifier: BSD-2-Clause-Patent
> >+
> >+  @par Revision Reference:
> >+  This PPI is introduced in PI Version 1.5.
> >+
> >+**/
> >+
> >+#ifndef _MM_ACCESS_PPI_H_
> >+#define _MM_ACCESS_PPI_H_
> >+
> >+#define EFI_PEI_MM_ACCESS_PPI_GUID \
> >+  { 0x268f33a9, 0xcccd, 0x48be, { 0x88, 0x17, 0x86, 0x5, 0x3a, 0xc3, 0x2e,
> >0xd6 }}
> >+
> >+typedef struct _EFI_PEI_MM_ACCESS_PPI  EFI_PEI_MM_ACCESS_PPI;
> >+
> >+/**
> >+  Opens the MMRAM area to be accessible by a PEIM.
> >+
> >+  This function "opens" MMRAM so that it is visible while not inside of MM.
> >The function should
> >+  return EFI_UNSUPPORTED if the hardware does not support hiding of
> >MMRAM. The function
> >+  should return EFI_DEVICE_ERROR if the MMRAM configuration is locked.
> >+
> >+  @param  PeiServicesAn indirect pointer to the PEI Services 
> >Table
> >published by the PEI Foundation.
> >+  @param  This   The EFI_PEI_MM_ACCESS_PPI instance.
> >+  @param  DescriptorIndexThe region of MMRAM to Open.
> >+
> >+  @retval EFI_SUCCESSThe operation was successful.
> >+  @retval EFI_UNSUPPORTEDThe system does not support opening
> and
> >closing of MMRAM.
> >+  @retval EFI_DEVICE_ERROR   MMRAM cannot be opened, perhaps
> >because it is locked.
> >+
> >+**/
> >+typedef
> >+EFI_STATUS
> >+(EFIAPI *EFI_PEI_MM_OPEN)(
> >+  IN EFI_PEI_SERVICES**PeiServices,
> >+  IN EFI_PEI_MM_ACCESS_PPI   *This,
> >+  IN UINTN   DescriptorIndex
> >+  );
> >+
> >+/**
> >+  Inhibits access to the MMRAM.

Re: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl definition.

2019-08-01 Thread Liming Gao
Marc:
  The change is good. Reviewed-by: Liming Gao 

  Besides, I see BZ also mention to remove the one in MdeModulePkg. Have you 
the following patches for the change in MdeModulePkg?

Thanks
Liming
>-Original Message-
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>Marc W Chen
>Sent: Monday, July 29, 2019 12:26 PM
>To: devel@edk2.groups.io
>Cc: Kinney, Michael D ; Gao, Liming
>; Ni, Ray 
>Subject: [edk2-devel] [PATCH] MdePkg: Add MmAccess and MmControl
>definition.
>
>EFI MmAccess and MmControl PPIs are defined in the PI 1.5 specification.
>
>Cc: Michael D Kinney 
>Cc: Liming Gao 
>Cc: Ray Ni 
>Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2023
>Signed-off-by: Marc W Chen 
>---
> MdePkg/Include/Ppi/MmAccess.h  | 155
>+
> MdePkg/Include/Ppi/MmControl.h |  90 
> MdePkg/MdePkg.dec  |   6 ++
> 3 files changed, 251 insertions(+)
> create mode 100644 MdePkg/Include/Ppi/MmAccess.h
> create mode 100644 MdePkg/Include/Ppi/MmControl.h
>
>diff --git a/MdePkg/Include/Ppi/MmAccess.h
>b/MdePkg/Include/Ppi/MmAccess.h
>new file mode 100644
>index 00..636e7288a0
>--- /dev/null
>+++ b/MdePkg/Include/Ppi/MmAccess.h
>@@ -0,0 +1,155 @@
>+/** @file
>+  EFI MM Access PPI definition.
>+
>+  This PPI is used to control the visibility of the MMRAM on the platform.
>+  The EFI_PEI_MM_ACCESS_PPI abstracts the location and characteristics of
>MMRAM. The
>+  principal functionality found in the memory controller includes the 
>following:
>+  - Exposing the MMRAM to all non-MM agents, or the "open" state
>+  - Shrouding the MMRAM to all but the MM agents, or the "closed" state
>+  - Preserving the system integrity, or "locking" the MMRAM, such that the
>settings cannot be
>+perturbed by either boot service or runtime agents
>+
>+  Copyright (c) 2019, Intel Corporation. All rights reserved.
>+  SPDX-License-Identifier: BSD-2-Clause-Patent
>+
>+  @par Revision Reference:
>+  This PPI is introduced in PI Version 1.5.
>+
>+**/
>+
>+#ifndef _MM_ACCESS_PPI_H_
>+#define _MM_ACCESS_PPI_H_
>+
>+#define EFI_PEI_MM_ACCESS_PPI_GUID \
>+  { 0x268f33a9, 0xcccd, 0x48be, { 0x88, 0x17, 0x86, 0x5, 0x3a, 0xc3, 0x2e,
>0xd6 }}
>+
>+typedef struct _EFI_PEI_MM_ACCESS_PPI  EFI_PEI_MM_ACCESS_PPI;
>+
>+/**
>+  Opens the MMRAM area to be accessible by a PEIM.
>+
>+  This function "opens" MMRAM so that it is visible while not inside of MM.
>The function should
>+  return EFI_UNSUPPORTED if the hardware does not support hiding of
>MMRAM. The function
>+  should return EFI_DEVICE_ERROR if the MMRAM configuration is locked.
>+
>+  @param  PeiServicesAn indirect pointer to the PEI Services Table
>published by the PEI Foundation.
>+  @param  This   The EFI_PEI_MM_ACCESS_PPI instance.
>+  @param  DescriptorIndexThe region of MMRAM to Open.
>+
>+  @retval EFI_SUCCESSThe operation was successful.
>+  @retval EFI_UNSUPPORTEDThe system does not support opening and
>closing of MMRAM.
>+  @retval EFI_DEVICE_ERROR   MMRAM cannot be opened, perhaps
>because it is locked.
>+
>+**/
>+typedef
>+EFI_STATUS
>+(EFIAPI *EFI_PEI_MM_OPEN)(
>+  IN EFI_PEI_SERVICES**PeiServices,
>+  IN EFI_PEI_MM_ACCESS_PPI   *This,
>+  IN UINTN   DescriptorIndex
>+  );
>+
>+/**
>+  Inhibits access to the MMRAM.
>+
>+  This function "closes" MMRAM so that it is not visible while outside of MM.
>The function should
>+  return EFI_UNSUPPORTED if the hardware does not support hiding of
>MMRAM.
>+
>+  @param  PeiServicesAn indirect pointer to the PEI Services Table
>published by the PEI Foundation.
>+  @param  This   The EFI_PEI_MM_ACCESS_PPI instance.
>+  @param  DescriptorIndexThe region of MMRAM to Close.
>+
>+  @retval EFI_SUCCESSThe operation was successful.
>+  @retval EFI_UNSUPPORTEDThe system does not support opening and
>closing of MMRAM.
>+  @retval EFI_DEVICE_ERROR   MMRAM cannot be closed.
>+
>+**/
>+typedef
>+EFI_STATUS
>+(EFIAPI *EFI_PEI_MM_CLOSE)(
>+  IN EFI_PEI_SERVICES**PeiServices,
>+  IN EFI_PEI_MM_ACCESS_PPI   *This,
>+  IN UINTN   DescriptorIndex
>+  );
>+
>+/**
>+  This function prohibits access to the MMRAM region. This function is usually
>implemented such
>+  that it is a write-once operation.
>+
>+  @param  PeiServicesAn indirect pointer to the PEI Services Table
>published by the PEI Foundation.
>+  @param  This   The EFI_PEI_MM_ACCESS_PPI instance.
>+  @param  DescriptorIndexThe region of MMRAM to Lock.
>+
>+  @retval EFI_SUCCESSThe operation was successful.
>+  @retval EFI_UNSUPPORTEDThe system does not support opening and
>closing of MMRAM.
>+
>+**/
>+typedef
>+EFI_STATUS
>+(EFIAPI *EFI_PEI_MM_LOCK)(
>+  IN EFI_PEI_SERVICES**PeiServices,
>+  IN EFI_PEI_MM_ACCESS_PPI