[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XENBUS PATCH 00/13] Use SAL 2.0 annotations



WinPV drivers use old annotations (IN/OUT) that are not checked by the compiler.

This patch series aims to move all Xenbus annotations to SAL 2.0 to increase the
number of checks the compiler can do.

Only Xenbus is converted for now.

The series is split into 3 parts:

Part 1: Conversion and correction of existing annotations; use of string types
to explicitly signify null-terminated pointers
* Replace old annotations with SAL2 equivalents
* Switch from char pointers to null-terminated string types
* Refine function annotations
* Set _Outptr_ on output pointers

Part 2: Suppress new warnings
* Suppress uninitialized *Interface warning in FdoQueryInterface
* registry: Suppress unannotated DriverEntry warning
* registry: Suppress uninitialized memory warnings

Part 3: Various fixes discovered via SAL annotations. These patches can be taken
as-is separately from the above.
* Fix missing return types
* monitor: Fix GetRequestKeyName allocation check
* Check ParametersKey for null in FdoScan
* Check for IoAttachDeviceToDeviceStack failure in FdoCreate
* sync: Save/restore IRQL when disabling interrupts
* Explicitly check HvmGetParam result via BUG_ON

Tu Dinh (13):
  Replace old annotations with SAL2 equivalents
  Switch from char pointers to null-terminated string types
  Refine function annotations
  Set _Outptr_ on output pointers
  Suppress uninitialized *Interface warning in FdoQueryInterface
  registry: Suppress unannotated DriverEntry warning
  registry: Suppress uninitialized memory warnings
  Fix missing return types
  monitor: Fix GetRequestKeyName allocation check
  Check ParametersKey for null in FdoScan
  Check for IoAttachDeviceToDeviceStack failure in FdoCreate
  sync: Save/restore IRQL when disabling interrupts
  Explicitly check HvmGetParam result via BUG_ON

 include/balloon_interface.h     |   68 +-
 include/cache_interface.h       |  130 ++--
 include/console_interface.h     |   30 +-
 include/debug_interface.h       |   88 +--
 include/emulated_interface.h    |   78 +--
 include/evtchn_interface.h      |  136 ++--
 include/gnttab_interface.h      |  148 ++---
 include/range_set_interface.h   |  100 +--
 include/shared_info_interface.h |  106 +--
 include/store_interface.h       |  156 ++---
 include/suspend_interface.h     |   80 +--
 include/unplug_interface.h      |   72 +-
 include/xen.h                   |  330 +++++-----
 src/common/assert.h             |   80 +--
 src/common/dbg_print.h          |   62 +-
 src/common/high.h               |   63 +-
 src/common/mutex.h              |   60 +-
 src/common/names.h              |  118 ++--
 src/common/registry.c           |  269 ++++----
 src/common/registry.h           |  186 +++---
 src/common/util.h               |   73 +-
 src/monitor/monitor.c           |  125 ++--
 src/xen/acpi.c                  |   60 +-
 src/xen/acpi.h                  |   52 +-
 src/xen/bug_check.c             |  175 ++---
 src/xen/config.c                |   46 +-
 src/xen/driver.c                |  138 ++--
 src/xen/driver.h                |    6 +-
 src/xen/event_channel.c         |  116 ++--
 src/xen/filters.c               |   16 +-
 src/xen/grant_table.c           |   90 +--
 src/xen/hvm.c                   |   80 +--
 src/xen/log.c                   |  164 ++---
 src/xen/memory.c                |   78 +--
 src/xen/module.c                |  102 +--
 src/xen/process.c               |   60 +-
 src/xen/process.h               |   50 +-
 src/xen/sched.c                 |   64 +-
 src/xen/system.c                |  125 ++--
 src/xen/unplug.c                |   42 +-
 src/xen/vcpu.c                  |   20 +-
 src/xen/xen_version.c           |   66 +-
 src/xenbus/balloon.c            |  216 +++---
 src/xenbus/balloon.h            |   62 +-
 src/xenbus/bus.c                |  146 ++--
 src/xenbus/bus.h                |   52 +-
 src/xenbus/cache.c              |  220 +++----
 src/xenbus/cache.h              |   62 +-
 src/xenbus/console.c            |  140 ++--
 src/xenbus/console.h            |   16 +-
 src/xenbus/debug.c              |  140 ++--
 src/xenbus/debug.h              |   62 +-
 src/xenbus/dma.c                |  521 +++++++--------
 src/xenbus/dma.h                |   54 +-
 src/xenbus/driver.c             |   97 +--
 src/xenbus/driver.h             |   50 +-
 src/xenbus/evtchn.c             |  244 +++----
 src/xenbus/evtchn.h             |   64 +-
 src/xenbus/evtchn_2l.c          |   96 +--
 src/xenbus/evtchn_2l.h          |   56 +-
 src/xenbus/evtchn_abi.h         |   86 +--
 src/xenbus/evtchn_fifo.c        |  174 ++---
 src/xenbus/evtchn_fifo.h        |   56 +-
 src/xenbus/fdo.c                | 1099 ++++++++++++++++---------------
 src/xenbus/fdo.h                |  180 ++---
 src/xenbus/gnttab.c             |  214 +++---
 src/xenbus/gnttab.h             |   62 +-
 src/xenbus/hash_table.c         |  100 +--
 src/xenbus/hash_table.h         |   68 +-
 src/xenbus/pdo.c                |  392 +++++------
 src/xenbus/pdo.h                |  116 ++--
 src/xenbus/range_set.c          |  162 ++---
 src/xenbus/range_set.h          |   62 +-
 src/xenbus/shared_info.c        |  152 ++---
 src/xenbus/shared_info.h        |   62 +-
 src/xenbus/store.c              |  506 +++++++-------
 src/xenbus/store.h              |   62 +-
 src/xenbus/suspend.c            |  118 ++--
 src/xenbus/suspend.h            |   62 +-
 src/xenbus/sync.c               |  146 ++--
 src/xenbus/sync.h               |   78 +--
 src/xenbus/thread.c             |   74 +--
 src/xenbus/thread.h             |   64 +-
 src/xenbus/unplug.c             |   54 +-
 src/xenbus/unplug.h             |   16 +-
 src/xenfilt/driver.c            |  134 ++--
 src/xenfilt/driver.h            |   72 +-
 src/xenfilt/emulated.c          |  132 ++--
 src/xenfilt/emulated.h          |   74 +--
 src/xenfilt/fdo.c               |  286 ++++----
 src/xenfilt/fdo.h               |   78 +--
 src/xenfilt/pdo.c               |  313 ++++-----
 src/xenfilt/pdo.h               |   80 +--
 src/xenfilt/thread.c            |   78 +--
 src/xenfilt/thread.h            |   64 +-
 95 files changed, 5994 insertions(+), 5888 deletions(-)

-- 
2.50.0.windows.1



Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.