4 * Copyright 2015 IBM Corp.
5 * Author(s): Zhang Fan <bjfanzh@cn.ibm.com>
7 * This work is licensed under the terms of the GNU GPL, version 2 or (at
8 * your option) any later version. See the COPYING file in the top-level
19 uint8_t reserved0
[85];
29 typedef struct IplBlockCcw IplBlockCcw
;
32 uint8_t reserved1
[305 - 1];
41 uint8_t reserved5
[12];
43 uint32_t scp_data_len
;
44 uint8_t reserved6
[260];
47 typedef struct IplBlockFcp IplBlockFcp
;
49 struct IplBlockQemuScsi
{
53 uint8_t reserved0
[77];
57 typedef struct IplBlockQemuScsi IplBlockQemuScsi
;
59 union IplParameterBlock
{
72 IplBlockQemuScsi scsi
;
76 uint8_t reserved1
[110];
78 uint8_t reserved2
[88];
79 uint8_t reserved_ext
[4096 - 200];
82 typedef union IplParameterBlock IplParameterBlock
;
84 void s390_ipl_update_diag308(IplParameterBlock
*iplb
);
85 void s390_ipl_prepare_cpu(S390CPU
*cpu
);
86 IplParameterBlock
*s390_ipl_get_iplb(void);
87 void s390_reipl_request(void);
89 #define TYPE_S390_IPL "s390-ipl"
90 #define S390_IPL(obj) OBJECT_CHECK(S390IPLState, (obj), TYPE_S390_IPL)
94 DeviceState parent_obj
;
96 uint64_t compat_start_addr
;
97 uint64_t bios_start_addr
;
98 uint64_t compat_bios_start_addr
;
100 IplParameterBlock iplb
;
102 bool reipl_requested
;
112 bool iplbext_migration
;
114 typedef struct S390IPLState S390IPLState
;
116 #define S390_IPL_TYPE_FCP 0x00
117 #define S390_IPL_TYPE_CCW 0x02
118 #define S390_IPL_TYPE_QEMU_SCSI 0xff
120 #define S390_IPLB_HEADER_LEN 8
121 #define S390_IPLB_MIN_CCW_LEN 200
122 #define S390_IPLB_MIN_FCP_LEN 384
123 #define S390_IPLB_MIN_QEMU_SCSI_LEN 200
125 static inline bool iplb_valid_len(IplParameterBlock
*iplb
)
127 return be32_to_cpu(iplb
->len
) <= sizeof(IplParameterBlock
);
130 static inline bool iplb_valid_ccw(IplParameterBlock
*iplb
)
132 return be32_to_cpu(iplb
->len
) >= S390_IPLB_MIN_CCW_LEN
&&
133 iplb
->pbt
== S390_IPL_TYPE_CCW
;
136 static inline bool iplb_valid_fcp(IplParameterBlock
*iplb
)
138 return be32_to_cpu(iplb
->len
) >= S390_IPLB_MIN_FCP_LEN
&&
139 iplb
->pbt
== S390_IPL_TYPE_FCP
;