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 uint64_t netboot_start_addr
;
20 uint8_t reserved0
[77];
30 typedef struct IplBlockCcw IplBlockCcw
;
33 uint8_t reserved1
[305 - 1];
42 uint8_t reserved5
[12];
44 uint32_t scp_data_len
;
45 uint8_t reserved6
[260];
48 typedef struct IplBlockFcp IplBlockFcp
;
50 struct IplBlockQemuScsi
{
54 uint8_t reserved0
[77];
58 typedef struct IplBlockQemuScsi IplBlockQemuScsi
;
60 union IplParameterBlock
{
73 IplBlockQemuScsi scsi
;
77 uint8_t reserved1
[110];
79 uint8_t reserved2
[88];
80 uint8_t reserved_ext
[4096 - 200];
83 typedef union IplParameterBlock IplParameterBlock
;
85 void s390_ipl_update_diag308(IplParameterBlock
*iplb
);
86 void s390_ipl_prepare_cpu(S390CPU
*cpu
);
87 IplParameterBlock
*s390_ipl_get_iplb(void);
88 void s390_reipl_request(void);
90 #define TYPE_S390_IPL "s390-ipl"
91 #define S390_IPL(obj) OBJECT_CHECK(S390IPLState, (obj), TYPE_S390_IPL)
95 DeviceState parent_obj
;
97 uint64_t compat_start_addr
;
98 uint64_t bios_start_addr
;
99 uint64_t compat_bios_start_addr
;
101 IplParameterBlock iplb
;
103 bool reipl_requested
;
115 bool iplbext_migration
;
117 typedef struct S390IPLState S390IPLState
;
119 #define S390_IPL_TYPE_FCP 0x00
120 #define S390_IPL_TYPE_CCW 0x02
121 #define S390_IPL_TYPE_QEMU_SCSI 0xff
123 #define S390_IPLB_HEADER_LEN 8
124 #define S390_IPLB_MIN_CCW_LEN 200
125 #define S390_IPLB_MIN_FCP_LEN 384
126 #define S390_IPLB_MIN_QEMU_SCSI_LEN 200
128 static inline bool iplb_valid_len(IplParameterBlock
*iplb
)
130 return be32_to_cpu(iplb
->len
) <= sizeof(IplParameterBlock
);
133 static inline bool iplb_valid_ccw(IplParameterBlock
*iplb
)
135 return be32_to_cpu(iplb
->len
) >= S390_IPLB_MIN_CCW_LEN
&&
136 iplb
->pbt
== S390_IPL_TYPE_CCW
;
139 static inline bool iplb_valid_fcp(IplParameterBlock
*iplb
)
141 return be32_to_cpu(iplb
->len
) >= S390_IPLB_MIN_FCP_LEN
&&
142 iplb
->pbt
== S390_IPL_TYPE_FCP
;