I have modified the patch again, and the new patch does not need to modify the upstream xz.
The link of the new patch:
 openembedded-core@lists.openembedded.org | [meta-oe][PATCH V2] xz: add ptest support

Du