@@ -219,6 +219,20 @@ static inline unsigned short stap(void)
return cpu_address;
}
+#define MACHINE_Z15A 0x8561
+#define MACHINE_Z15B 0x8562
+
+static inline uint16_t get_machine_id(void)
+{
+ uint64_t cpuid;
+
+ asm volatile("stidp %0" : "=Q" (cpuid));
+ cpuid = cpuid >> 16;
+ cpuid &= 0xffff;
+
+ return cpuid;
+}
+
static inline int tprot(unsigned long addr)
{
int cc;
@@ -111,6 +111,7 @@ static void test_config_destroy(void)
static void test_cpu_destroy(void)
{
int rc;
+ uint16_t machineid = get_machine_id();
struct uv_cb_nodata uvcb = {
.header.len = sizeof(uvcb),
.header.cmd = UVC_CMD_DESTROY_SEC_CPU,
@@ -125,10 +126,12 @@ static void test_cpu_destroy(void)
"hdr invalid length");
uvcb.header.len += 8;
- uvcb.handle += 1;
- rc = uv_call(0, (uint64_t)&uvcb);
- report(rc == 1 && uvcb.header.rc == UVC_RC_INV_CHANDLE, "invalid handle");
- uvcb.handle -= 1;
+ if (machineid != MACHINE_Z15A && machineid != MACHINE_Z15B) {
+ uvcb.handle += 1;
+ rc = uv_call(0, (uint64_t)&uvcb);
+ report(rc == 1 && uvcb.header.rc == UVC_RC_INV_CHANDLE, "invalid handle");
+ uvcb.handle -= 1;
+ }
rc = uv_call(0, (uint64_t)&uvcb);
report(rc == 0 && uvcb.header.rc == UVC_RC_EXECUTED, "success");