AIX HIPER APAR(IJ47907 Potential undetected data loss by using zlibNX ) の対応

#### はじめに

AIX HIPER APAR "Potential undetected data loss by using zlibNX" の確認、ifix の適用ログです。



対象のAPAR:

* AIX7.3

https://www.ibm.com/support/pages/apar/IJ47907

* AIX7.2

https://www.ibm.com/support/pages/apar/IJ48340


* ifix 適用の参考：

https://www.ibm.com/support/pages/node/1137298



---

#### zlibNX について

zlibNX は Power9, Power10 のハードウェア加速データ圧縮/圧縮解除を行うライブラリーです。

https://www.ibm.com/docs/ja/aix/7.2?topic=management-data-compression-by-using-zlibnx-library

> zlibNX ライブラリーは zlib 圧縮ライブラリーの拡張バージョンで、IBM® POWER9™ プロセッサー・ベース・サーバー上のネスト・アクセラレーター (NX) と呼ばれるコプロセッサーを使用して、ハードウェア加速データ圧縮/圧縮解除をサポートします。 zlibNX ライブラリーは、IBM AIX® 7.2 (テクノロジー・レベル 4 適用) Expansion Pack 以降に用意されています。



Db2, MQ 等でも使用している場合があります。


* Db2

https://www.ibm.com/docs/ja/db2/11.5?topic=considerations-hardware-accelerated-backup-log-file-compression

> ネスト・アクセラレーターを使用して、バックアップ・イメージおよびログ・アーカイブ・ファイルのハードウェア圧縮を行うことができます。 サポートされるオプションには、 POWER7+ 以上のプロセッサーの NX842 、 POWER9 以上のプロセッサーの NXZLIB、および Linux® on IBM z Systems ® 15 以降のバージョンの NXU が含まれます。



* MQ

https://www.ibm.com/docs/ja/ibm-mq/9.2?topic=keywords-compmsg-data-compression

> AIX IBM® MQ 9.2.1以降、ZLIBFAST および ZLIBHIGH 技法では、 IBM MQ for AIX® 上のハードウェア加速 zlibNX ライブラリーを使用できます (インストールされている場合)。 zlibNX ライブラリーは zlib 圧縮ライブラリーの拡張バージョンで、IBM POWER9 プロセッサー・ベース・サーバー上のネスト・アクセラレーター (NX) と呼ばれるコプロセッサーを使用することによって、ハードウェア・アクセラレーションされたデータの圧縮および圧縮解除をサポートします。 zlibNX ライブラリーは、 IBM AIX 7.2 (Technology Level 4 Expansion Pack 適用) 以降で使用可能です。 zlibNX ライブラリーの使用を選択することにより CPU 使用率が削減されることから益を得る可能性が最も高いのは、高率での圧縮が可能な 2KB を超えるサイズのメッセージです。 メッセージング・チャネル・エージェント (MCA) で zlibNX ライブラリーを使用できるようにするためには、環境変数 AMQ_USE_ZLIBNX を設定します。


* Java Semeru Runtime

なお、Java 11 Semeru Runtime を使用する場合などでは zlibNX ライブラリーが自動的に使用されるとありました。 アプリケーションによっては気づかないところで zlibNX ライブラリーが使用される可能性がある点は注意が必要です。

・IBM Semeru Runtimes migration guide

https://www.ibm.com/support/pages/node/6366719

> Support for the following data compression devices will change to use the OpenJDK method of using system zlib for data compression.Field Programmable Gate Array (FPGA) Accelerator Adapter (AIX and Linux on IBM Power systems). On AIX systems that contain the Nest accelerator (NX) co-processor, the zlibNX library is automatically used instead of zlib, if it is installed. )



少し古いバージョンの AIX では zlibNX.rte がデフォルトでは導入されていませんので、その場合は今回のAPAR は適用対象外となります。

```
# lslpp -l zlibNX.rte
lslpp: Fileset zlibNX.rte not installed.
#
```
---

#### 環境

AIX 7.2TL5SP6


```
# oslevel -s
7200-05-06-2320
#
```

zlibNX.rte が導入されていることを確認します。

```
# lslpp -l zlibNX.rte
  Fileset                      Level  State      Description
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  zlibNX.rte                 7.2.4.9  COMMITTED  NX accelerated zlib
                                                 compression library

Path: /etc/objrepos
  zlibNX.rte                 7.2.4.9  COMMITTED  NX accelerated zlib
                                                 compression library
```



####  適用前確認

```
# emgr -l
There is no efix data on this system.
```



zlibNX.rte に依存するファイルセットは存在していません(lslpp -d オプション)

```
# lslpp -d zlibNX.rte
  Fileset               Dependents
  ----------------------------------------------------------------------------
<Fileset> is a requisite of <Dependents>
Path: /usr/lib/objrepos
  zlibNX.rte 7.2.4.9    NONE

Path: /etc/objrepos
  zlibNX.rte 7.2.4.9    NONE
#
```

#### モジュール・ダウンロード

次のサイトから ifix をダウンロードし、対象サーバーに配置します。

->  [ifix](https://aix.software.ibm.com/aix/ifixes/ij47907/?_gl=1*1l10sa2*_ga*MTAxNjQ1OTU1Ni4xNjk0NzU2ODc5*_ga_FYECCCS21D*MTY5NTU5OTczOS4zMi4xLjE2OTU2MDQ1MTUuMC4wLjA.)


```
# ls -l
total 1864
-rw-r--r--    1 root     system       953170 Sep 24 19:47 IJ48340s6a.230907.AIX72TL05SP06.epkg.Z
```

---

#### ifix適用プレビューの実行


```
# emgr -e IJ48340s6a.230907.AIX72TL05SP06.epkg.Z -p
*******************************************************************************
EFIX MANAGER PREVIEW START
*******************************************************************************

+-----------------------------------------------------------------------------+
Efix Manager Initialization
+-----------------------------------------------------------------------------+
Initializing log /var/adm/ras/emgr.log ...
emgr: 0645-009 Unable to locate or access file IJ48340s6a.230907.AIX72TL05SP06.epkg.Z
emgr: 0645-035 Efix package did not pass all preview checks.

*******************************************************************************
EFIX MANAGER PREVIEW END
*******************************************************************************

+-----------------------------------------------------------------------------+
Operation Summary
+-----------------------------------------------------------------------------+
Log file is /var/adm/ras/emgr.log

EPKG NUMBER       LABEL               OPERATION              RESULT
===========       ==============      =================      ==============
1                 Unknown             INSTALL PREVIEW        FAILURE

Return Status: FAILURE
# pwd
/
# cd work/ifix
# ls
IJ48340s6a.230907.AIX72TL05SP06.epkg.Z
# emgr -e IJ48340s6a.230907.AIX72TL05SP06.epkg.Z -p
*******************************************************************************
EFIX MANAGER PREVIEW START
*******************************************************************************

+-----------------------------------------------------------------------------+
Efix Manager Initialization
+-----------------------------------------------------------------------------+
Initializing log /var/adm/ras/emgr.log ...
Efix package file is: /work/ifix/IJ48340s6a.230907.AIX72TL05SP06.epkg.Z
MD5 generating command is /usr/bin/csum
MD5 checksum is 06458274671c3285de19deb9fe1a4ccd
Accessing efix metadata ...
Processing efix label "IJ48340s6a" ...
Verifying efix control file ...

+-----------------------------------------------------------------------------+
Installp Prerequisite Verification
+-----------------------------------------------------------------------------+
Verifying prerequisite file ...
Checking prerequisites ...

Prerequisite Number: 1
   Fileset: zlibNX.rte
   Minimal Level: 7.2.4.9
   Maximum Level: 7.2.4.9
   Actual Level: 7.2.4.9
   Type: PREREQ
   Requisite Met: yes

All prerequisites have been met.

+-----------------------------------------------------------------------------+
Processing APAR reference file
+-----------------------------------------------------------------------------+
ATTENTION: Interim fix is enabled for automatic removal by installp.

+-----------------------------------------------------------------------------+
Efix Attributes
+-----------------------------------------------------------------------------+
LABEL:            IJ48340s6a
PACKAGING DATE:   Thu Sep  7 00:50:55 CDT 2023
ABSTRACT:         Ifix for APAR IJ48340
PACKAGER VERSION: 7
VUID:             00F7CD554C00090700095523
REBOOT REQUIRED:  no
BUILD BOOT IMAGE: no
LU CAPABLE:       yes
PRE-REQUISITES:   yes
SUPERSEDE:        no
PACKAGE LOCKS:    no
E2E PREREQS:      no
FIX TESTED:       no
ALTERNATE PATH:   None
EFIX FILES:       2

Install Scripts:
   PRE_INSTALL:   no
   POST_INSTALL:  no
   PRE_REMOVE:    no
   POST_REMOVE:   no

File Number:      1
   LOCATION:      /usr/opt/zlibNX/lib/libz.a
   FILE TYPE:     Standard (file or executable)
   INSTALLER:     installp
   SIZE:          1696
   ACL:           DEFAULT
   CKSUM:         05647
   PACKAGE:       zlibNX.rte
   MOUNT INST:    no

File Number:      2
   LOCATION:      /usr/opt/zlibNX/static/lib/libz.a
   FILE TYPE:     Standard (file or executable)
   INSTALLER:     installp
   SIZE:          1152
   ACL:           DEFAULT
   CKSUM:         11906
   PACKAGE:       zlibNX.rte
   MOUNT INST:    no

+-----------------------------------------------------------------------------+
Efix Description
+-----------------------------------------------------------------------------+
IJ48340 - ZLIBNX MAY GENERATE UNCOMPRESSABLE COMPRESSED FILES

+-----------------------------------------------------------------------------+
Efix Lock Management
+-----------------------------------------------------------------------------+
Checking locks for file /usr/opt/zlibNX/lib/libz.a ...
Checking locks for file /usr/opt/zlibNX/static/lib/libz.a ...

All files have passed lock checks.

+-----------------------------------------------------------------------------+
Space Requirements
+-----------------------------------------------------------------------------+
Checking space requirements ...

Space statistics (in 512 byte-blocks):
File system: /usr, Free: 1622544, Required: 4517, Deficit: 0.
File system: /tmp, Free: 516600, Required: 5793, Deficit: 0.

+-----------------------------------------------------------------------------+
Reboot Processing
+-----------------------------------------------------------------------------+
Reboot is not required by this efix package.

*******************************************************************************
EFIX MANAGER PREVIEW END
*******************************************************************************

+-----------------------------------------------------------------------------+
Operation Summary
+-----------------------------------------------------------------------------+
Log file is /var/adm/ras/emgr.log

EPKG NUMBER       LABEL               OPERATION              RESULT
===========       ==============      =================      ==============
1                 IJ48340s6a          INSTALL PREVIEW        SUCCESS

Return Status = SUCCESS
#
```

リブートは不要です。



#### ifix適用

```
# time emgr -e IJ48340s6a.230907.AIX72TL05SP06.epkg.Z
+-----------------------------------------------------------------------------+
Efix Manager Initialization
+-----------------------------------------------------------------------------+
Initializing log /var/adm/ras/emgr.log ...
Efix package file is: /work/ifix/IJ48340s6a.230907.AIX72TL05SP06.epkg.Z
MD5 generating command is /usr/bin/csum
MD5 checksum is 06458274671c3285de19deb9fe1a4ccd
Accessing efix metadata ...
Processing efix label "IJ48340s6a" ...
Verifying efix control file ...

+-----------------------------------------------------------------------------+
Installp Prerequisite Verification
+-----------------------------------------------------------------------------+
Verifying prerequisite file ...
Checking prerequisites ...

Prerequisite Number: 1
   Fileset: zlibNX.rte
   Minimal Level: 7.2.4.9
   Maximum Level: 7.2.4.9
   Actual Level: 7.2.4.9
   Type: PREREQ
   Requisite Met: yes

All prerequisites have been met.

+-----------------------------------------------------------------------------+
Processing APAR reference file
+-----------------------------------------------------------------------------+
ATTENTION: Interim fix is enabled for automatic removal by installp.

+-----------------------------------------------------------------------------+
Efix Attributes
+-----------------------------------------------------------------------------+
LABEL:            IJ48340s6a
PACKAGING DATE:   Thu Sep  7 00:50:55 CDT 2023
ABSTRACT:         Ifix for APAR IJ48340
PACKAGER VERSION: 7
VUID:             00F7CD554C00090700095523
REBOOT REQUIRED:  no
BUILD BOOT IMAGE: no
LU CAPABLE:       yes
PRE-REQUISITES:   yes
SUPERSEDE:        no
PACKAGE LOCKS:    no
E2E PREREQS:      no
FIX TESTED:       no
ALTERNATE PATH:   None
EFIX FILES:       2

Install Scripts:
   PRE_INSTALL:   no
   POST_INSTALL:  no
   PRE_REMOVE:    no
   POST_REMOVE:   no

File Number:      1
   LOCATION:      /usr/opt/zlibNX/lib/libz.a
   FILE TYPE:     Standard (file or executable)
   INSTALLER:     installp
   SIZE:          1696
   ACL:           DEFAULT
   CKSUM:         05647
   PACKAGE:       zlibNX.rte
   MOUNT INST:    no

File Number:      2
   LOCATION:      /usr/opt/zlibNX/static/lib/libz.a
   FILE TYPE:     Standard (file or executable)
   INSTALLER:     installp
   SIZE:          1152
   ACL:           DEFAULT
   CKSUM:         11906
   PACKAGE:       zlibNX.rte
   MOUNT INST:    no

+-----------------------------------------------------------------------------+
Efix Description
+-----------------------------------------------------------------------------+
IJ48340 - ZLIBNX MAY GENERATE UNCOMPRESSABLE COMPRESSED FILES

+-----------------------------------------------------------------------------+
Efix Lock Management
+-----------------------------------------------------------------------------+
Checking locks for file /usr/opt/zlibNX/lib/libz.a ...
Checking locks for file /usr/opt/zlibNX/static/lib/libz.a ...

All files have passed lock checks.

+-----------------------------------------------------------------------------+
Space Requirements
+-----------------------------------------------------------------------------+
Checking space requirements ...

Space statistics (in 512 byte-blocks):
File system: /usr, Free: 1622544, Required: 4517, Deficit: 0.
File system: /tmp, Free: 516600, Required: 5793, Deficit: 0.

+-----------------------------------------------------------------------------+
Efix Installation Setup
+-----------------------------------------------------------------------------+
Unpacking efix package file ...
Initializing efix installation ...

+-----------------------------------------------------------------------------+
Efix State
+-----------------------------------------------------------------------------+
Setting efix state to: INSTALLING

+-----------------------------------------------------------------------------+
File Archiving
+-----------------------------------------------------------------------------+
Saving all files that will be replaced ...
Save directory is: /usr/emgrdata/efixdata/IJ48340s6a/save
File 1: Saving /usr/opt/zlibNX/lib/libz.a as EFSAVE1 ...
File 2: Saving /usr/opt/zlibNX/static/lib/libz.a as EFSAVE2 ...

+-----------------------------------------------------------------------------+
Efix File Installation
+-----------------------------------------------------------------------------+
Installing all efix files:
Installing efix file #1 (File: /usr/opt/zlibNX/lib/libz.a) ...
Installing efix file #2 (File: /usr/opt/zlibNX/static/lib/libz.a) ...

Total number of efix files installed is 2.
All efix files installed successfully.

+-----------------------------------------------------------------------------+
Package Locking
+-----------------------------------------------------------------------------+
Processing package locking for all files.
File 1: locking installp fileset zlibNX.rte.
File 2: installp fileset zlibNX.rte is already locked by emgr.

All package locks processed successfully.

+-----------------------------------------------------------------------------+
Reboot Processing
+-----------------------------------------------------------------------------+
Reboot is not required by this efix package.

+-----------------------------------------------------------------------------+
Efix State
+-----------------------------------------------------------------------------+
Setting efix state to: STABLE

+-----------------------------------------------------------------------------+
Operation Summary
+-----------------------------------------------------------------------------+
Log file is /var/adm/ras/emgr.log

EPKG NUMBER       LABEL               OPERATION              RESULT
===========       ==============      =================      ==============
1                 IJ48340s6a          INSTALL                SUCCESS

Return Status = SUCCESS

real    0m12.20s
user    0m1.33s
sys     0m0.71s
# echo $?
0
```

適用時間は 12 秒程度です。


```
# emgr -l

ID  STATE LABEL      INSTALL TIME      UPDATED BY ABSTRACT
=== ===== ========== ================= ========== ======================================
1    S    IJ48340s6a 09/24/23 20:18:13            Ifix for APAR IJ48340

STATE codes:
 S = STABLE
 M = MOUNTED
 U = UNMOUNTED
 Q = REBOOT REQUIRED
 B = BROKEN
 I = INSTALLING
 R = REMOVING
 T = TESTED
 P = PATCHED
 N = NOT PATCHED
 SP = STABLE + PATCHED
 SN = STABLE + NOT PATCHED
 QP = BOOT IMAGE MODIFIED + PATCHED
 QN = BOOT IMAGE MODIFIED + NOT PATCHED
 RQ = REMOVING + REBOOT REQUIRED
```

EFIXLOCKED の表示があり、ifix が適用されていることが確認できます。


```
# lslpp -l zlibNX.rte
  Fileset                      Level  State      Description
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  zlibNX.rte                 7.2.4.9  COMMITTED  NX accelerated zlib
                                                 compression library
                                      EFIXLOCKED

Path: /etc/objrepos
  zlibNX.rte                 7.2.4.9  COMMITTED  NX accelerated zlib
                                                 compression library
                                      EFIXLOCKED
```


以上です。

[HIPER APAR Information](https://esupport.ibm.com/customercare/flrt/doc?page=hiper)



* こちらは一個人による参考ログです。正確な情報は製品サポートへご確認ください。