Commit Graph

13 Commits

Author SHA1 Message Date
Роман Донченко 69e1aa860b Fix many spelling errors 2020-10-11 08:35:55 +00:00
Darius Davis 5c2eade45d Tweak ws_cpuid so that Valgrind is happy.
Valgrind considers the "cpuid" instruction to always depend on inputs from eax
and ecx, even though it's only a subset of values of eax for which ecx is
relevant.  If ecx is undefined when cpuid is executed, the outputs of cpuid
will be considered undefined.

Instead of suppressing the resulting uninitialised-value warning (the
suppression for which is now out-of-date anyway, now that
register_all_protocols is moved to a worker thread), let's simply set ecx to
zero in ws_cpuid.

Testing done: Built Wireshark on Linux amd64.  Before this change, running
   "tools/valgrind-wireshark.sh ./test/captures/dhcp.pcap" with
   valgrind-3.12.0.SVN on Debian 9.4 amd64 would yield the following Valgrind
   error:

   ==2416== Thread 2:
   ==2416== Conditional jump or move depends on uninitialised value(s)
   ==2416==    at 0xACB8B22: ws_mempbrk_sse42_compile (ws_mempbrk_sse42.c:58)
   ==2416==    by 0x74F4960: register_all_protocols_worker (register.c:37)
   ==2416==    by 0xB1403D4: g_thread_proxy (gthread.c:784)
   ==2416==    by 0xD438493: start_thread (pthread_create.c:333)
   ==2416==    by 0xB4CAACE: clone (clone.S:97)

   With the change, the above message is gone.  Inspected the disassembly of
   function ws_cpuid, and it looks sane -- just an added "xor ecx, ecx" at the
   top.

Change-Id: I2fb382309cac234c400286a6e9fac7d922912c63
Reviewed-on: https://code.wireshark.org/review/26733
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-05 07:34:01 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
The first is deprecated, as per https://spdx.org/licenses/.

Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed
Reviewed-on: https://code.wireshark.org/review/25661
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 14:57:36 +00:00
Michael Mann 3d673da88c Convert to using use SPDX identifier on wsutil directory
Change-Id: Id73e641499e75bc1afc1dea29682418156f461fe
Reviewed-on: https://code.wireshark.org/review/24751
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-10 04:36:29 +00:00
Uli Heilmeier 26a5cd2d78 ws_cpuid: include ws_attributes
Otherwise _U_ is not defined.

Change-Id: I221f64c7d89c221e5a63a573e06457699d0a177e
Reviewed-on: https://code.wireshark.org/review/23440
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-09-09 12:57:56 +00:00
Guy Harris 93efc20115 "#else", not "#elif", for the last part of a chain of conditionals.
Also give more details, for future reference, on how to determine
whether the processor supports CPUID.

Change-Id: I01e7173e45b0079f02338e51248238c05302dbd2
Reviewed-on: https://code.wireshark.org/review/6189
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31 21:26:10 +00:00
Guy Harris d5d2c0e651 ws_cpuid() returns a success/failure indication; make it gboolean.
Change-Id: I03403ce29c4ac343d56fc2cf33aa8da90a082cbb
Reviewed-on: https://code.wireshark.org/review/6185
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31 19:51:59 +00:00
Guy Harris 35cf7c6b3c Distinguish between IA-32 and non-x86.
In case we make ws_cpuid() work on IA-32 processors, add a separate
"always returns no" version of ws_cpuid() for non-x86 processors.

Change-Id: Id6fbd3e5c7d4f04063bc9bcd8f1644cd617b297e
Reviewed-on: https://code.wireshark.org/review/6184
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-31 19:46:33 +00:00
Stephen Fisher d77c5a5106 Update the URL for the CPUID instruction documentation.
Change-Id: I9729b3aa11027783a3557468743e91e180a6de8d
Reviewed-on: https://code.wireshark.org/review/5509
Reviewed-by: Stephen Fisher <sfisher@sdf.org>
2014-11-26 17:30:58 +00:00
Alexis La Goutte 5d7b59aec4 Fix Buildbot Mac OS: /wsutil/ws_cpuid.h:56: warning: unused parameter 'CPUInfo'
Change-Id: Ic0b0d5392ff049cc51f05b79fc5feae190064ce8
Reviewed-on: https://code.wireshark.org/review/2097
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-10 09:00:41 +00:00
AndersBroman e1f0ee412f Mark an unused parameter as such.
Change-Id: Ia319d7b8523ab9b9e9d8ec8533ebdcf4a506a69e
Reviewed-on: https://code.wireshark.org/review/2096
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-10 08:58:42 +00:00
Jakub Zawadzki 4571283379 CPUID improvements
- Make ws_cpuid() return boolean when CPUID is support or no, this way
it's easier for caller to determinate if it works (and can use cpuinfo[X] or no).

- Add function ws_cpuid_sse42(), use it in ws_mempbrk() [cached] &
  version information.

Change-Id: I4e77699f9f3d11bb9b2e8ea599e48d3c5ad84ed7
Reviewed-on: https://code.wireshark.org/review/2088
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-10 08:12:43 +00:00
Jakub Zawadzki 531541660b Move cpuid to seperate header file.
It'll be later used also for detecting sse4.2

Change-Id: I1930abb29026b455d453a79b5f301cdf37585160
Reviewed-on: https://code.wireshark.org/review/1803
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-31 13:01:08 +00:00