public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v4 0/6] Fix PciBus to accept Spec values as BarIndex and Alignment
@ 2017-02-08  9:42 Ruiyu Ni
  2017-02-08  9:42 ` [PATCH v4 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros Ruiyu Ni
  0 siblings, 1 reply; 7+ messages in thread
From: Ruiyu Ni @ 2017-02-08  9:42 UTC (permalink / raw)
  To: edk2-devel

If a platform developer follows the PI spec to write an
IncompatiblePciDeviceSupport driver, due to a spec complaince
bug in PciBus driver, the IncompatiblePciDeviceSupport driver
may not work as expected. The patches fix PciBus to follow Spec
to accept Spec defined values.

v2: Use DISABLE_NEW_DEPRECATED_INTERFACES to deprecate macros.
v3: Use MAX_UINT64/MAX_UINTN to replace (UINT64)-1 and (UINTN)-1.
v4: Deprecate PCI_ACPI_UNUSED and PCI_BAR_NOCHANGE.

Ruiyu Ni (6):
  MdeModulePkg/PciSioSerialDxe: Use MAX_UINT8 instead of PCI_BAR_ALL
  MdeModulePkg/PciBus: Accept Spec values as BarIndex and Alignment
  MdeModulePkg/IncompatiblePciDevice: Do not use deprecated macros
  MdeModulePkg/IncompatiblePci: Use MAX_UINTN to match any IDs
  OvmfPkg/IncompatiblePci: Do not use deprecated macros
  MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros

 .../IncompatiblePciDeviceSupport.c                 | 108 ++++++++++-----------
 .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c       |  36 ++++---
 MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c      |   2 +-
 MdePkg/Include/IndustryStandard/Pci22.h            |  24 +++--
 .../IncompatiblePciDeviceSupport.c                 |  13 +--
 5 files changed, 100 insertions(+), 83 deletions(-)

-- 
2.9.0.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v4 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros
  2017-02-08  9:42 [PATCH v4 0/6] Fix PciBus to accept Spec values as BarIndex and Alignment Ruiyu Ni
@ 2017-02-08  9:42 ` Ruiyu Ni
  2017-02-08 10:44   ` Laszlo Ersek
  2017-02-09  2:06   ` Ruiyu Ni
  0 siblings, 2 replies; 7+ messages in thread
From: Ruiyu Ni @ 2017-02-08  9:42 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao, Jeff Fan

DEVICE_ID_NOCARE is defined as 0xFFFF but Spec says (UINT64) -1
should be used to match any VendorId/DeviceId/RevisionId/
SubsystemVendorId/SubsystemDeviceId.

PCI_BAR_OLD_ALIGN/PCI_BAR_EVEN_ALIGN/PCI_BAR_SQUAD_ALIGN/
PCI_BAR_DQUAD_ALIGN are defined but Spec doesn't have such
definitions.

PCI_BAR_ALL is defined as 0xFF but Spec says (UINT64)-1 should be
used to match all BARs.

PCI_ACPI_UNUSED and PCI_BAR_NOCHANGE are defined as 0 which
compliant with Spec but the name is too general and causes confusing.
IncompatiblePciDeviceSupport could directly use 0.

All of the above macros are marked as deprecated.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
---
 MdePkg/Include/IndustryStandard/Pci22.h | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/Pci22.h b/MdePkg/Include/IndustryStandard/Pci22.h
index 4cf8389..5dec65d 100644
--- a/MdePkg/Include/IndustryStandard/Pci22.h
+++ b/MdePkg/Include/IndustryStandard/Pci22.h
@@ -7,7 +7,7 @@
     PC Card Standard, 8.0
     PCI Power Management Interface Specifiction, Revision 1.2
 
-  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
   Copyright (c) 2014 - 2015, Hewlett-Packard Development Company, L.P.<BR>
   This program and the accompanying materials                          
   are licensed and made available under the terms and conditions of the BSD License         
@@ -780,14 +780,25 @@ typedef struct {
   ///
 } EFI_PCI_CAPABILITY_HOTPLUG;
 
-#define DEVICE_ID_NOCARE    0xFFFF
+///
+/// Below macros (till PCI_BAR_NOCHANGE) were used by EfiIncompatiblePciDeviceSupport Protocol.
+///
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
+///
+/// [ATTENTION] These macros are deprecated because they don't match Spec or not defined in Spec.
+///
+#define DEVICE_ID_NOCARE    0xFFFF                 ///< Deprecated. Value doesn't match Spec.
+#define PCI_BAR_OLD_ALIGN   0xFFFFFFFFFFFFFFFFULL  ///< Deprecated. Value isn't defined in Spec.
+#define PCI_BAR_EVEN_ALIGN  0xFFFFFFFFFFFFFFFEULL  ///< Deprecated. Value isn't defined in Spec.
+#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL  ///< Deprecated. Value isn't defined in Spec.
+#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL  ///< Deprecated. Value isn't defined in Spec.
+#define PCI_BAR_ALL         0xFF                   ///< Deprecated. Value doesn't match Spec.
+
+#endif
 
 #define PCI_ACPI_UNUSED     0
 #define PCI_BAR_NOCHANGE    0
-#define PCI_BAR_OLD_ALIGN   0xFFFFFFFFFFFFFFFFULL
-#define PCI_BAR_EVEN_ALIGN  0xFFFFFFFFFFFFFFFEULL
-#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL
-#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL
 
 #define PCI_BAR_IDX0        0x00
 #define PCI_BAR_IDX1        0x01
@@ -795,7 +806,6 @@ typedef struct {
 #define PCI_BAR_IDX3        0x03
 #define PCI_BAR_IDX4        0x04
 #define PCI_BAR_IDX5        0x05
-#define PCI_BAR_ALL         0xFF
 
 ///
 /// EFI PCI Option ROM definitions
-- 
2.9.0.windows.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v4 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros
  2017-02-08  9:42 ` [PATCH v4 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros Ruiyu Ni
@ 2017-02-08 10:44   ` Laszlo Ersek
  2017-02-09  2:10     ` Ni, Ruiyu
  2017-02-09  2:06   ` Ruiyu Ni
  1 sibling, 1 reply; 7+ messages in thread
From: Laszlo Ersek @ 2017-02-08 10:44 UTC (permalink / raw)
  To: Ruiyu Ni, edk2-devel; +Cc: Jeff Fan, Liming Gao

On 02/08/17 10:42, Ruiyu Ni wrote:
> DEVICE_ID_NOCARE is defined as 0xFFFF but Spec says (UINT64) -1
> should be used to match any VendorId/DeviceId/RevisionId/
> SubsystemVendorId/SubsystemDeviceId.
> 
> PCI_BAR_OLD_ALIGN/PCI_BAR_EVEN_ALIGN/PCI_BAR_SQUAD_ALIGN/
> PCI_BAR_DQUAD_ALIGN are defined but Spec doesn't have such
> definitions.
> 
> PCI_BAR_ALL is defined as 0xFF but Spec says (UINT64)-1 should be
> used to match all BARs.
> 
> PCI_ACPI_UNUSED and PCI_BAR_NOCHANGE are defined as 0 which
> compliant with Spec but the name is too general and causes confusing.
> IncompatiblePciDeviceSupport could directly use 0.
> 
> All of the above macros are marked as deprecated.

I agree with the commit message update (thanks for that!), but
PCI_ACPI_UNUSED and PCI_BAR_NOCHANGE aren't actually moved into the
(!DISABLE_NEW_DEPRECATED_INTERFACES) section, apparently.

Did you perhaps forget "git add" before "git commit --amend"? That would
explain why the commit message was updated, but the patch wasn't.

Thanks
Laszlo

> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Jeff Fan <jeff.fan@intel.com>
> ---
>  MdePkg/Include/IndustryStandard/Pci22.h | 24 +++++++++++++++++-------
>  1 file changed, 17 insertions(+), 7 deletions(-)
> 
> diff --git a/MdePkg/Include/IndustryStandard/Pci22.h b/MdePkg/Include/IndustryStandard/Pci22.h
> index 4cf8389..5dec65d 100644
> --- a/MdePkg/Include/IndustryStandard/Pci22.h
> +++ b/MdePkg/Include/IndustryStandard/Pci22.h
> @@ -7,7 +7,7 @@
>      PC Card Standard, 8.0
>      PCI Power Management Interface Specifiction, Revision 1.2
>  
> -  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
>    Copyright (c) 2014 - 2015, Hewlett-Packard Development Company, L.P.<BR>
>    This program and the accompanying materials                          
>    are licensed and made available under the terms and conditions of the BSD License         
> @@ -780,14 +780,25 @@ typedef struct {
>    ///
>  } EFI_PCI_CAPABILITY_HOTPLUG;
>  
> -#define DEVICE_ID_NOCARE    0xFFFF
> +///
> +/// Below macros (till PCI_BAR_NOCHANGE) were used by EfiIncompatiblePciDeviceSupport Protocol.
> +///
> +#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
> +
> +///
> +/// [ATTENTION] These macros are deprecated because they don't match Spec or not defined in Spec.
> +///
> +#define DEVICE_ID_NOCARE    0xFFFF                 ///< Deprecated. Value doesn't match Spec.
> +#define PCI_BAR_OLD_ALIGN   0xFFFFFFFFFFFFFFFFULL  ///< Deprecated. Value isn't defined in Spec.
> +#define PCI_BAR_EVEN_ALIGN  0xFFFFFFFFFFFFFFFEULL  ///< Deprecated. Value isn't defined in Spec.
> +#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL  ///< Deprecated. Value isn't defined in Spec.
> +#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL  ///< Deprecated. Value isn't defined in Spec.
> +#define PCI_BAR_ALL         0xFF                   ///< Deprecated. Value doesn't match Spec.
> +
> +#endif
>  
>  #define PCI_ACPI_UNUSED     0
>  #define PCI_BAR_NOCHANGE    0
> -#define PCI_BAR_OLD_ALIGN   0xFFFFFFFFFFFFFFFFULL
> -#define PCI_BAR_EVEN_ALIGN  0xFFFFFFFFFFFFFFFEULL
> -#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL
> -#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL
>  
>  #define PCI_BAR_IDX0        0x00
>  #define PCI_BAR_IDX1        0x01
> @@ -795,7 +806,6 @@ typedef struct {
>  #define PCI_BAR_IDX3        0x03
>  #define PCI_BAR_IDX4        0x04
>  #define PCI_BAR_IDX5        0x05
> -#define PCI_BAR_ALL         0xFF
>  
>  ///
>  /// EFI PCI Option ROM definitions
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v4 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros
  2017-02-08  9:42 ` [PATCH v4 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros Ruiyu Ni
  2017-02-08 10:44   ` Laszlo Ersek
@ 2017-02-09  2:06   ` Ruiyu Ni
  2017-02-09 19:47     ` Laszlo Ersek
  2017-02-10  3:13     ` Gao, Liming
  1 sibling, 2 replies; 7+ messages in thread
From: Ruiyu Ni @ 2017-02-09  2:06 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao, Jeff Fan

DEVICE_ID_NOCARE is defined as 0xFFFF but Spec says (UINT64) -1
should be used to match any VendorId/DeviceId/RevisionId/
SubsystemVendorId/SubsystemDeviceId.

PCI_BAR_OLD_ALIGN/PCI_BAR_EVEN_ALIGN/PCI_BAR_SQUAD_ALIGN/
PCI_BAR_DQUAD_ALIGN are defined but Spec doesn't have such
definitions.

PCI_BAR_ALL is defined as 0xFF but Spec says (UINT64)-1 should be
used to match all BARs.

PCI_ACPI_UNUSED and PCI_BAR_NOCHANGE are defined as 0 which
compliant with Spec but the name is too general and causes confusing.
IncompatiblePciDeviceSupport could directly use 0.

All of the above macros are marked as deprecated.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
---
 MdePkg/Include/IndustryStandard/Pci22.h | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/Pci22.h b/MdePkg/Include/IndustryStandard/Pci22.h
index 4cf8389..07718dc 100644
--- a/MdePkg/Include/IndustryStandard/Pci22.h
+++ b/MdePkg/Include/IndustryStandard/Pci22.h
@@ -7,7 +7,7 @@
     PC Card Standard, 8.0
     PCI Power Management Interface Specifiction, Revision 1.2
 
-  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
   Copyright (c) 2014 - 2015, Hewlett-Packard Development Company, L.P.<BR>
   This program and the accompanying materials                          
   are licensed and made available under the terms and conditions of the BSD License         
@@ -780,14 +780,24 @@ typedef struct {
   ///
 } EFI_PCI_CAPABILITY_HOTPLUG;
 
-#define DEVICE_ID_NOCARE    0xFFFF
+///
+/// Below macros (till PCI_BAR_NOCHANGE) were used by EfiIncompatiblePciDeviceSupport Protocol.
+///
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
+///
+/// [ATTENTION] These macros are deprecated because they don't match Spec or not defined in Spec.
+///
+#define DEVICE_ID_NOCARE    0xFFFF                 ///< Deprecated. Value doesn't match Spec.
+#define PCI_BAR_OLD_ALIGN   0xFFFFFFFFFFFFFFFFULL  ///< Deprecated. Value isn't defined in Spec.
+#define PCI_BAR_EVEN_ALIGN  0xFFFFFFFFFFFFFFFEULL  ///< Deprecated. Value isn't defined in Spec.
+#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL  ///< Deprecated. Value isn't defined in Spec.
+#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL  ///< Deprecated. Value isn't defined in Spec.
+#define PCI_BAR_ALL         0xFF                   ///< Deprecated. Value doesn't match Spec.
+#define PCI_ACPI_UNUSED     0                      ///< Deprecated. Macro name is too general.
+#define PCI_BAR_NOCHANGE    0                      ///< Deprecated. Macro name is too general.
 
-#define PCI_ACPI_UNUSED     0
-#define PCI_BAR_NOCHANGE    0
-#define PCI_BAR_OLD_ALIGN   0xFFFFFFFFFFFFFFFFULL
-#define PCI_BAR_EVEN_ALIGN  0xFFFFFFFFFFFFFFFEULL
-#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL
-#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL
+#endif
 
 #define PCI_BAR_IDX0        0x00
 #define PCI_BAR_IDX1        0x01
@@ -795,7 +805,6 @@ typedef struct {
 #define PCI_BAR_IDX3        0x03
 #define PCI_BAR_IDX4        0x04
 #define PCI_BAR_IDX5        0x05
-#define PCI_BAR_ALL         0xFF
 
 ///
 /// EFI PCI Option ROM definitions
-- 
2.9.0.windows.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v4 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros
  2017-02-08 10:44   ` Laszlo Ersek
@ 2017-02-09  2:10     ` Ni, Ruiyu
  0 siblings, 0 replies; 7+ messages in thread
From: Ni, Ruiyu @ 2017-02-09  2:10 UTC (permalink / raw)
  To: Laszlo Ersek, edk2-devel@ml01.01.org; +Cc: Fan, Jeff, Gao, Liming

The reason actually is simple: I remembered to change the commit message
but forgot to change the code. I am using a Windows GUI tool (TortoiseGit) to
change the patch.

I just re-sent the correct patch. Please help to review it.

Thanks/Ray

> -----Original Message-----
> From: Laszlo Ersek [mailto:lersek@redhat.com]
> Sent: Wednesday, February 8, 2017 6:45 PM
> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@ml01.01.org
> Cc: Fan, Jeff <jeff.fan@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: Re: [edk2] [PATCH v4 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec
> IncompatiblePciDevice macros
> 
> On 02/08/17 10:42, Ruiyu Ni wrote:
> > DEVICE_ID_NOCARE is defined as 0xFFFF but Spec says (UINT64) -1 should
> > be used to match any VendorId/DeviceId/RevisionId/
> > SubsystemVendorId/SubsystemDeviceId.
> >
> > PCI_BAR_OLD_ALIGN/PCI_BAR_EVEN_ALIGN/PCI_BAR_SQUAD_ALIGN/
> > PCI_BAR_DQUAD_ALIGN are defined but Spec doesn't have such
> > definitions.
> >
> > PCI_BAR_ALL is defined as 0xFF but Spec says (UINT64)-1 should be used
> > to match all BARs.
> >
> > PCI_ACPI_UNUSED and PCI_BAR_NOCHANGE are defined as 0 which
> compliant
> > with Spec but the name is too general and causes confusing.
> > IncompatiblePciDeviceSupport could directly use 0.
> >
> > All of the above macros are marked as deprecated.
> 
> I agree with the commit message update (thanks for that!), but
> PCI_ACPI_UNUSED and PCI_BAR_NOCHANGE aren't actually moved into the
> (!DISABLE_NEW_DEPRECATED_INTERFACES) section, apparently.
> 
> Did you perhaps forget "git add" before "git commit --amend"? That would
> explain why the commit message was updated, but the patch wasn't.
> 
> Thanks
> Laszlo
> 
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> > Cc: Liming Gao <liming.gao@intel.com>
> > Cc: Jeff Fan <jeff.fan@intel.com>
> > ---
> >  MdePkg/Include/IndustryStandard/Pci22.h | 24 +++++++++++++++++-----
> --
> >  1 file changed, 17 insertions(+), 7 deletions(-)
> >
> > diff --git a/MdePkg/Include/IndustryStandard/Pci22.h
> > b/MdePkg/Include/IndustryStandard/Pci22.h
> > index 4cf8389..5dec65d 100644
> > --- a/MdePkg/Include/IndustryStandard/Pci22.h
> > +++ b/MdePkg/Include/IndustryStandard/Pci22.h
> > @@ -7,7 +7,7 @@
> >      PC Card Standard, 8.0
> >      PCI Power Management Interface Specifiction, Revision 1.2
> >
> > -  Copyright (c) 2006 - 2016, Intel Corporation. All rights
> > reserved.<BR>
> > +  Copyright (c) 2006 - 2017, Intel Corporation. All rights
> > + reserved.<BR>
> >    Copyright (c) 2014 - 2015, Hewlett-Packard Development Company,
> L.P.<BR>
> >    This program and the accompanying materials
> >    are licensed and made available under the terms and conditions of the
> BSD License
> > @@ -780,14 +780,25 @@ typedef struct {
> >    ///
> >  } EFI_PCI_CAPABILITY_HOTPLUG;
> >
> > -#define DEVICE_ID_NOCARE    0xFFFF
> > +///
> > +/// Below macros (till PCI_BAR_NOCHANGE) were used by
> EfiIncompatiblePciDeviceSupport Protocol.
> > +///
> > +#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
> > +
> > +///
> > +/// [ATTENTION] These macros are deprecated because they don't match
> Spec or not defined in Spec.
> > +///
> > +#define DEVICE_ID_NOCARE    0xFFFF                 ///< Deprecated. Value
> doesn't match Spec.
> > +#define PCI_BAR_OLD_ALIGN   0xFFFFFFFFFFFFFFFFULL  ///< Deprecated.
> Value isn't defined in Spec.
> > +#define PCI_BAR_EVEN_ALIGN  0xFFFFFFFFFFFFFFFEULL  ///<
> Deprecated. Value isn't defined in Spec.
> > +#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL  ///<
> Deprecated. Value isn't defined in Spec.
> > +#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL  ///<
> Deprecated. Value isn't defined in Spec.
> > +#define PCI_BAR_ALL         0xFF                   ///< Deprecated. Value doesn't
> match Spec.
> > +
> > +#endif
> >
> >  #define PCI_ACPI_UNUSED     0
> >  #define PCI_BAR_NOCHANGE    0
> > -#define PCI_BAR_OLD_ALIGN   0xFFFFFFFFFFFFFFFFULL
> > -#define PCI_BAR_EVEN_ALIGN  0xFFFFFFFFFFFFFFFEULL -#define
> > PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL -#define
> PCI_BAR_DQUAD_ALIGN
> > 0xFFFFFFFFFFFFFFFCULL
> >
> >  #define PCI_BAR_IDX0        0x00
> >  #define PCI_BAR_IDX1        0x01
> > @@ -795,7 +806,6 @@ typedef struct {
> >  #define PCI_BAR_IDX3        0x03
> >  #define PCI_BAR_IDX4        0x04
> >  #define PCI_BAR_IDX5        0x05
> > -#define PCI_BAR_ALL         0xFF
> >
> >  ///
> >  /// EFI PCI Option ROM definitions
> >



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v4 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros
  2017-02-09  2:06   ` Ruiyu Ni
@ 2017-02-09 19:47     ` Laszlo Ersek
  2017-02-10  3:13     ` Gao, Liming
  1 sibling, 0 replies; 7+ messages in thread
From: Laszlo Ersek @ 2017-02-09 19:47 UTC (permalink / raw)
  To: Ruiyu Ni, edk2-devel; +Cc: Jeff Fan, Liming Gao

On 02/09/17 03:06, Ruiyu Ni wrote:
> DEVICE_ID_NOCARE is defined as 0xFFFF but Spec says (UINT64) -1
> should be used to match any VendorId/DeviceId/RevisionId/
> SubsystemVendorId/SubsystemDeviceId.
> 
> PCI_BAR_OLD_ALIGN/PCI_BAR_EVEN_ALIGN/PCI_BAR_SQUAD_ALIGN/
> PCI_BAR_DQUAD_ALIGN are defined but Spec doesn't have such
> definitions.
> 
> PCI_BAR_ALL is defined as 0xFF but Spec says (UINT64)-1 should be
> used to match all BARs.
> 
> PCI_ACPI_UNUSED and PCI_BAR_NOCHANGE are defined as 0 which
> compliant with Spec but the name is too general and causes confusing.
> IncompatiblePciDeviceSupport could directly use 0.
> 
> All of the above macros are marked as deprecated.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Jeff Fan <jeff.fan@intel.com>
> ---
>  MdePkg/Include/IndustryStandard/Pci22.h | 27 ++++++++++++++++++---------
>  1 file changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/MdePkg/Include/IndustryStandard/Pci22.h b/MdePkg/Include/IndustryStandard/Pci22.h
> index 4cf8389..07718dc 100644
> --- a/MdePkg/Include/IndustryStandard/Pci22.h
> +++ b/MdePkg/Include/IndustryStandard/Pci22.h
> @@ -7,7 +7,7 @@
>      PC Card Standard, 8.0
>      PCI Power Management Interface Specifiction, Revision 1.2
>  
> -  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
>    Copyright (c) 2014 - 2015, Hewlett-Packard Development Company, L.P.<BR>
>    This program and the accompanying materials                          
>    are licensed and made available under the terms and conditions of the BSD License         
> @@ -780,14 +780,24 @@ typedef struct {
>    ///
>  } EFI_PCI_CAPABILITY_HOTPLUG;
>  
> -#define DEVICE_ID_NOCARE    0xFFFF
> +///
> +/// Below macros (till PCI_BAR_NOCHANGE) were used by EfiIncompatiblePciDeviceSupport Protocol.
> +///
> +#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
> +
> +///
> +/// [ATTENTION] These macros are deprecated because they don't match Spec or not defined in Spec.
> +///
> +#define DEVICE_ID_NOCARE    0xFFFF                 ///< Deprecated. Value doesn't match Spec.
> +#define PCI_BAR_OLD_ALIGN   0xFFFFFFFFFFFFFFFFULL  ///< Deprecated. Value isn't defined in Spec.
> +#define PCI_BAR_EVEN_ALIGN  0xFFFFFFFFFFFFFFFEULL  ///< Deprecated. Value isn't defined in Spec.
> +#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL  ///< Deprecated. Value isn't defined in Spec.
> +#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL  ///< Deprecated. Value isn't defined in Spec.
> +#define PCI_BAR_ALL         0xFF                   ///< Deprecated. Value doesn't match Spec.
> +#define PCI_ACPI_UNUSED     0                      ///< Deprecated. Macro name is too general.
> +#define PCI_BAR_NOCHANGE    0                      ///< Deprecated. Macro name is too general.
>  
> -#define PCI_ACPI_UNUSED     0
> -#define PCI_BAR_NOCHANGE    0
> -#define PCI_BAR_OLD_ALIGN   0xFFFFFFFFFFFFFFFFULL
> -#define PCI_BAR_EVEN_ALIGN  0xFFFFFFFFFFFFFFFEULL
> -#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL
> -#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL
> +#endif
>  
>  #define PCI_BAR_IDX0        0x00
>  #define PCI_BAR_IDX1        0x01
> @@ -795,7 +805,6 @@ typedef struct {
>  #define PCI_BAR_IDX3        0x03
>  #define PCI_BAR_IDX4        0x04
>  #define PCI_BAR_IDX5        0x05
> -#define PCI_BAR_ALL         0xFF
>  
>  ///
>  /// EFI PCI Option ROM definitions
> 

I didn't try to verify the macros one by one, but I agree that relative
to the previous version (*), the patch is now complete (PCI_ACPI_UNUSED
and PCI_BAR_NOCHANGE are covered).

Acked-by: Laszlo Ersek <lersek@redhat.com>

(*) It's not easy to identify the previous version, because both that
one and this one are marked as "[PATCH v4 6/6]".

Thanks
Laszlo


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v4 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros
  2017-02-09  2:06   ` Ruiyu Ni
  2017-02-09 19:47     ` Laszlo Ersek
@ 2017-02-10  3:13     ` Gao, Liming
  1 sibling, 0 replies; 7+ messages in thread
From: Gao, Liming @ 2017-02-10  3:13 UTC (permalink / raw)
  To: Ni, Ruiyu, edk2-devel@lists.01.org; +Cc: Fan, Jeff

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Ni, Ruiyu
>Sent: Thursday, February 09, 2017 10:07 AM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>; Fan, Jeff <jeff.fan@intel.com>
>Subject: [PATCH v4 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec
>IncompatiblePciDevice macros
>
>DEVICE_ID_NOCARE is defined as 0xFFFF but Spec says (UINT64) -1
>should be used to match any VendorId/DeviceId/RevisionId/
>SubsystemVendorId/SubsystemDeviceId.
>
>PCI_BAR_OLD_ALIGN/PCI_BAR_EVEN_ALIGN/PCI_BAR_SQUAD_ALIGN/
>PCI_BAR_DQUAD_ALIGN are defined but Spec doesn't have such
>definitions.
>
>PCI_BAR_ALL is defined as 0xFF but Spec says (UINT64)-1 should be
>used to match all BARs.
>
>PCI_ACPI_UNUSED and PCI_BAR_NOCHANGE are defined as 0 which
>compliant with Spec but the name is too general and causes confusing.
>IncompatiblePciDeviceSupport could directly use 0.
>
>All of the above macros are marked as deprecated.
>
>Contributed-under: TianoCore Contribution Agreement 1.0
>Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
>Cc: Liming Gao <liming.gao@intel.com>
>Cc: Jeff Fan <jeff.fan@intel.com>
>---
> MdePkg/Include/IndustryStandard/Pci22.h | 27 ++++++++++++++++++-------
>--
> 1 file changed, 18 insertions(+), 9 deletions(-)
>
>diff --git a/MdePkg/Include/IndustryStandard/Pci22.h
>b/MdePkg/Include/IndustryStandard/Pci22.h
>index 4cf8389..07718dc 100644
>--- a/MdePkg/Include/IndustryStandard/Pci22.h
>+++ b/MdePkg/Include/IndustryStandard/Pci22.h
>@@ -7,7 +7,7 @@
>     PC Card Standard, 8.0
>     PCI Power Management Interface Specifiction, Revision 1.2
>
>-  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
>+  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
>   Copyright (c) 2014 - 2015, Hewlett-Packard Development Company, L.P.<BR>
>   This program and the accompanying materials
>   are licensed and made available under the terms and conditions of the BSD
>License
>@@ -780,14 +780,24 @@ typedef struct {
>   ///
> } EFI_PCI_CAPABILITY_HOTPLUG;
>
>-#define DEVICE_ID_NOCARE    0xFFFF
>+///
>+/// Below macros (till PCI_BAR_NOCHANGE) were used by
>EfiIncompatiblePciDeviceSupport Protocol.
>+///
>+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
>+
>+///
>+/// [ATTENTION] These macros are deprecated because they don't match
>Spec or not defined in Spec.
>+///
>+#define DEVICE_ID_NOCARE    0xFFFF                 ///< Deprecated. Value
>doesn't match Spec.
>+#define PCI_BAR_OLD_ALIGN   0xFFFFFFFFFFFFFFFFULL  ///< Deprecated.
>Value isn't defined in Spec.
>+#define PCI_BAR_EVEN_ALIGN  0xFFFFFFFFFFFFFFFEULL  ///< Deprecated.
>Value isn't defined in Spec.
>+#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL  ///< Deprecated.
>Value isn't defined in Spec.
>+#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL  ///< Deprecated.
>Value isn't defined in Spec.
>+#define PCI_BAR_ALL         0xFF                   ///< Deprecated. Value doesn't
>match Spec.
>+#define PCI_ACPI_UNUSED     0                      ///< Deprecated. Macro name is
>too general.
>+#define PCI_BAR_NOCHANGE    0                      ///< Deprecated. Macro name is
>too general.
>
>-#define PCI_ACPI_UNUSED     0
>-#define PCI_BAR_NOCHANGE    0
>-#define PCI_BAR_OLD_ALIGN   0xFFFFFFFFFFFFFFFFULL
>-#define PCI_BAR_EVEN_ALIGN  0xFFFFFFFFFFFFFFFEULL
>-#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL
>-#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL
>+#endif
>
> #define PCI_BAR_IDX0        0x00
> #define PCI_BAR_IDX1        0x01
>@@ -795,7 +805,6 @@ typedef struct {
> #define PCI_BAR_IDX3        0x03
> #define PCI_BAR_IDX4        0x04
> #define PCI_BAR_IDX5        0x05
>-#define PCI_BAR_ALL         0xFF
>
> ///
> /// EFI PCI Option ROM definitions
>--
>2.9.0.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-02-10  3:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-08  9:42 [PATCH v4 0/6] Fix PciBus to accept Spec values as BarIndex and Alignment Ruiyu Ni
2017-02-08  9:42 ` [PATCH v4 6/6] MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macros Ruiyu Ni
2017-02-08 10:44   ` Laszlo Ersek
2017-02-09  2:10     ` Ni, Ruiyu
2017-02-09  2:06   ` Ruiyu Ni
2017-02-09 19:47     ` Laszlo Ersek
2017-02-10  3:13     ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox