[zlib][intel] Implement QAT hardware acceleration code path

QAT is a hardware accelerator developed by Intel to speed up compression and cryptographic algorithms and this patch adds support to leverage hardware acceleration in zlib for
compression operations.

It adds a new path for deflate_fast and deflate_slow to perform compression with QAT using a helper library called qatzpp (included in the patch).
We added a new member in the struct deflate_state to keep a context for QAT operations (i.e. qat_s) that is initialized when deflateInit() is called.

When a valid QAT context exists (i. e. qat_s is not NULL) all deflate_fast and deflate_slow calls are deferred to qat_deflate_step in contrib/qat/deflate_qat.cpp
This overrides the usage of pending_buf and window buffers from deflate_state, which will remain empty for as long as QAT is being used.

The average performance gain was 5.9x (i.e. +500%) for the snappy data corpus (plus linux kernel tarball and javascript corpus), with up to 4x for HTML4, 12x for linux kernel sources and 14x for Javascript corpus.
The average compression ratio loss is of ~0.6% for the same data corpus.

The system environment requirements are:

* A kernel with the QAT 4XXX module (we performed tests with kernels >=6.1.0)
* the packages qatlib and qatlib-devel installed in the system. (CentOS 9)
* The system configuration file /etc/sysconfig/qat with ServicesEnabled=dc [1]
* The systemd service qat.service active and running.
* A 'qat' group and users in that group [2] (these users will have permissions to run QAT)
* The system configuration file /etc/security/limits.conf with a memlock for the user(s) that will run QAT [3]
   e. g. gustavoa   -   memlock   500000

To enable the QAT hardware-accelerated fast path, simply build chromium-zlib with the CMake option ENABLE_INTEL_QAT_COMPRESSION.

[1] https://github.com/intel/qatlib/blob/main/INSTALL#L409
[2] https://github.com/intel/qatlib/blob/main/INSTALL#L273
[3] https://github.com/intel/qatlib/blob/main/INSTALL#L284

Bug: 40267458

Signed-off-by: Gustavo A Espinoza <gustavo.adolfo.espinoza.quintero@intel.com>
Change-Id: Idb0c380d39ca72669b1bccb7a6d993894b62b592
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5419776
Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1325829}
NOKEYCHECK=True
GitOrigin-RevId: ecb289f4169b502fb84c2205343857b1ce385b31
20 files changed