@@ -219,9 +219,6 @@ 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;
@@ -13,6 +13,9 @@
#define _S390X_HARDWARE_H_
#include <asm/arch_def.h>
+#define MACHINE_Z15 0x8561
+#define MACHINE_Z15T02 0x8562
+
enum s390_host {
HOST_IS_UNKNOWN,
HOST_IS_LPAR,
@@ -37,4 +40,11 @@ static inline bool host_is_lpar(void)
return detect_host() == HOST_IS_LPAR;
}
+static inline bool machine_is_z15(void)
+{
+ uint16_t machine = get_machine_id();
+
+ return machine == MACHINE_Z15 || machine == MACHINE_Z15T02;
+}
+
#endif /* _S390X_HARDWARE_H_ */
@@ -9,6 +9,7 @@
*/
#include <libcflat.h>
+#include <hardware.h>
#include <alloc.h>
#include <vmalloc.h>
#include <sclp.h>
@@ -111,7 +112,6 @@ 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,
@@ -126,7 +126,7 @@ static void test_cpu_destroy(void)
"hdr invalid length");
uvcb.header.len += 8;
- if (machineid != MACHINE_Z15A && machineid != MACHINE_Z15B) {
+ if (!machine_is_z15()) {
uvcb.handle += 1;
rc = uv_call(0, (uint64_t)&uvcb);
report(rc == 1 && uvcb.header.rc == UVC_RC_INV_CHANDLE, "invalid handle");