mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-25 02:52:06 -06:00
s390x/ipl: we always have an ipl device
Both s390 machines unconditionally create an ipl device, so no need to handle the missing case. Now we can also change s390_ipl_update_diag308() to return void. Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
This commit is contained in:
parent
09c7f58ca9
commit
feacc6c2c8
3 changed files with 15 additions and 20 deletions
|
@ -95,6 +95,11 @@ static const VMStateDescription vmstate_ipl = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static S390IPLState *get_ipl_device(void)
|
||||||
|
{
|
||||||
|
return S390_IPL(object_resolve_path_type("", TYPE_S390_IPL, NULL));
|
||||||
|
}
|
||||||
|
|
||||||
static uint64_t bios_translate_addr(void *opaque, uint64_t srcaddr)
|
static uint64_t bios_translate_addr(void *opaque, uint64_t srcaddr)
|
||||||
{
|
{
|
||||||
uint64_t dstaddr = *(uint64_t *) opaque;
|
uint64_t dstaddr = *(uint64_t *) opaque;
|
||||||
|
@ -251,25 +256,19 @@ out:
|
||||||
return (uint32_t) (ipl->cssid << 24 | ipl->ssid << 16 | ipl->devno);
|
return (uint32_t) (ipl->cssid << 24 | ipl->ssid << 16 | ipl->devno);
|
||||||
}
|
}
|
||||||
|
|
||||||
int s390_ipl_update_diag308(IplParameterBlock *iplb)
|
void s390_ipl_update_diag308(IplParameterBlock *iplb)
|
||||||
{
|
{
|
||||||
S390IPLState *ipl;
|
S390IPLState *ipl = get_ipl_device();
|
||||||
|
|
||||||
ipl = S390_IPL(object_resolve_path(TYPE_S390_IPL, NULL));
|
ipl->iplb = *iplb;
|
||||||
if (ipl) {
|
ipl->iplb_valid = true;
|
||||||
ipl->iplb = *iplb;
|
|
||||||
ipl->iplb_valid = true;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IplParameterBlock *s390_ipl_get_iplb(void)
|
IplParameterBlock *s390_ipl_get_iplb(void)
|
||||||
{
|
{
|
||||||
S390IPLState *ipl;
|
S390IPLState *ipl = get_ipl_device();
|
||||||
|
|
||||||
ipl = S390_IPL(object_resolve_path(TYPE_S390_IPL, NULL));
|
if (!ipl->iplb_valid) {
|
||||||
if (!ipl || !ipl->iplb_valid) {
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return &ipl->iplb;
|
return &ipl->iplb;
|
||||||
|
@ -277,9 +276,8 @@ IplParameterBlock *s390_ipl_get_iplb(void)
|
||||||
|
|
||||||
void s390_reipl_request(void)
|
void s390_reipl_request(void)
|
||||||
{
|
{
|
||||||
S390IPLState *ipl;
|
S390IPLState *ipl = get_ipl_device();
|
||||||
|
|
||||||
ipl = S390_IPL(object_resolve_path(TYPE_S390_IPL, NULL));
|
|
||||||
ipl->reipl_requested = true;
|
ipl->reipl_requested = true;
|
||||||
qemu_system_reset_request();
|
qemu_system_reset_request();
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ typedef struct IplParameterBlock {
|
||||||
uint8_t reserved2[88];
|
uint8_t reserved2[88];
|
||||||
} IplParameterBlock;
|
} IplParameterBlock;
|
||||||
|
|
||||||
int s390_ipl_update_diag308(IplParameterBlock *iplb);
|
void s390_ipl_update_diag308(IplParameterBlock *iplb);
|
||||||
IplParameterBlock *s390_ipl_get_iplb(void);
|
IplParameterBlock *s390_ipl_get_iplb(void);
|
||||||
void s390_reipl_request(void);
|
void s390_reipl_request(void);
|
||||||
|
|
||||||
|
|
|
@ -233,11 +233,8 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3)
|
||||||
}
|
}
|
||||||
iplb = g_malloc0(sizeof(struct IplParameterBlock));
|
iplb = g_malloc0(sizeof(struct IplParameterBlock));
|
||||||
cpu_physical_memory_read(addr, iplb, sizeof(struct IplParameterBlock));
|
cpu_physical_memory_read(addr, iplb, sizeof(struct IplParameterBlock));
|
||||||
if (!s390_ipl_update_diag308(iplb)) {
|
s390_ipl_update_diag308(iplb);
|
||||||
env->regs[r1 + 1] = DIAG_308_RC_OK;
|
env->regs[r1 + 1] = DIAG_308_RC_OK;
|
||||||
} else {
|
|
||||||
env->regs[r1 + 1] = DIAG_308_RC_INVALID;
|
|
||||||
}
|
|
||||||
g_free(iplb);
|
g_free(iplb);
|
||||||
return;
|
return;
|
||||||
case 6:
|
case 6:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue