4 * Copyright 2015 IBM Corp.
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 #define DIAG308_FLAGS_LP_VALID 0x80
62 union IplParameterBlock {
75 IplBlockQemuScsi scsi;
79 uint8_t reserved1[110];
81 uint8_t reserved2[88];
82 uint8_t reserved_ext[4096 - 200];
85 typedef union IplParameterBlock IplParameterBlock;
87 int s390_ipl_set_loadparm(uint8_t *loadparm);
88 void s390_ipl_update_diag308(IplParameterBlock *iplb);
89 void s390_ipl_prepare_cpu(S390CPU *cpu);
90 IplParameterBlock *s390_ipl_get_iplb(void);
91 void s390_reipl_request(void);
93 #define TYPE_S390_IPL "s390-ipl"
94 #define S390_IPL(obj) OBJECT_CHECK(S390IPLState, (obj), TYPE_S390_IPL)
98 DeviceState parent_obj;
100 uint64_t compat_start_addr;
101 uint64_t bios_start_addr;
102 uint64_t compat_bios_start_addr;
104 IplParameterBlock iplb;
106 bool reipl_requested;
118 bool iplbext_migration;
120 typedef struct S390IPLState S390IPLState;
122 #define S390_IPL_TYPE_FCP 0x00
123 #define S390_IPL_TYPE_CCW 0x02
124 #define S390_IPL_TYPE_QEMU_SCSI 0xff
126 #define S390_IPLB_HEADER_LEN 8
127 #define S390_IPLB_MIN_CCW_LEN 200
128 #define S390_IPLB_MIN_FCP_LEN 384
129 #define S390_IPLB_MIN_QEMU_SCSI_LEN 200
131 static inline bool iplb_valid_len(IplParameterBlock *iplb)
133 return be32_to_cpu(iplb->len) <= sizeof(IplParameterBlock);
136 static inline bool iplb_valid_ccw(IplParameterBlock *iplb)
138 return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_CCW_LEN &&
139 iplb->pbt == S390_IPL_TYPE_CCW;
142 static inline bool iplb_valid_fcp(IplParameterBlock *iplb)
144 return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_FCP_LEN &&
145 iplb->pbt == S390_IPL_TYPE_FCP;