mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
vfio-ccw: support async command subregion
A vfio-ccw device may provide an async command subregion for issuing halt/clear subchannel requests. If it is present, use it for sending halt/clear request to the device; if not, fall back to emulation (as done today). Reviewed-by: Farhan Ali <alifm@linux.ibm.com> Message-Id: <20190613092542.2834-1-cohuck@redhat.com> Reviewed-by: Eric Farman <farman@linux.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
This commit is contained in:
parent
b5e89f044d
commit
8fadea24de
5 changed files with 159 additions and 6 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "trace.h"
|
||||
#include "hw/s390x/s390_flic.h"
|
||||
#include "hw/s390x/s390-virtio-ccw.h"
|
||||
#include "hw/s390x/s390-ccw.h"
|
||||
|
||||
typedef struct CrwContainer {
|
||||
CRW crw;
|
||||
|
@ -1205,6 +1206,26 @@ static void sch_handle_start_func_virtual(SubchDev *sch)
|
|||
|
||||
}
|
||||
|
||||
static void sch_handle_halt_func_passthrough(SubchDev *sch)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = s390_ccw_halt(sch);
|
||||
if (ret == -ENOSYS) {
|
||||
sch_handle_halt_func(sch);
|
||||
}
|
||||
}
|
||||
|
||||
static void sch_handle_clear_func_passthrough(SubchDev *sch)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = s390_ccw_clear(sch);
|
||||
if (ret == -ENOSYS) {
|
||||
sch_handle_clear_func(sch);
|
||||
}
|
||||
}
|
||||
|
||||
static IOInstEnding sch_handle_start_func_passthrough(SubchDev *sch)
|
||||
{
|
||||
SCHIB *schib = &sch->curr_status;
|
||||
|
@ -1244,11 +1265,9 @@ IOInstEnding do_subchannel_work_passthrough(SubchDev *sch)
|
|||
SCHIB *schib = &sch->curr_status;
|
||||
|
||||
if (schib->scsw.ctrl & SCSW_FCTL_CLEAR_FUNC) {
|
||||
/* TODO: Clear handling */
|
||||
sch_handle_clear_func(sch);
|
||||
sch_handle_clear_func_passthrough(sch);
|
||||
} else if (schib->scsw.ctrl & SCSW_FCTL_HALT_FUNC) {
|
||||
/* TODO: Halt handling */
|
||||
sch_handle_halt_func(sch);
|
||||
sch_handle_halt_func_passthrough(sch);
|
||||
} else if (schib->scsw.ctrl & SCSW_FCTL_START_FUNC) {
|
||||
return sch_handle_start_func_passthrough(sch);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue