From ca5e000a30eae58e84c98fef9c511ef61ec00fbe Mon Sep 17 00:00:00 2001
From: Chuan Zheng <zhengchuan@huawei.com>
Date: Mon, 26 Apr 2021 14:48:34 +0800
Subject: [PATCH] gensrc: skip vector instruction in str_do_gotpcrel

We might have "move (%rip) %0xmm0" in qemu hotpatch, which causes
gensrc failure in str_do_gotpcrel.
Fix it by skipping it because we do not need anything for vector command.
---
 src/kpatch_gensrc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/kpatch_gensrc.c b/src/kpatch_gensrc.c
index a16b652..4f978f8 100644
--- a/src/kpatch_gensrc.c
+++ b/src/kpatch_gensrc.c
@@ -291,6 +291,11 @@ void str_do_gotpcrel(struct kp_file *f, char *dst, char *src)
 			goto out;
 		}
 
+                if (strstr(movdst.s, "%xmm") != NULL) {
+                        /* Is SSE (%xmm0, etc), bail out */
+                        goto out;
+                }
+
 		/* Use full 64-bit counterpart of the destination register
 		 * as the auxiliary register */
 		get_full_reg(&movdst, auxreg);
-- 
2.27.0

