mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
vfio-ccw: Add support for the schib region
The schib region can be used to obtain the latest SCHIB from the host passthrough subchannel. Since the guest SCHIB is virtualized, we currently only update the path related information so that the guest is aware of any path related changes when it issues the 'stsch' instruction. Signed-off-by: Farhan Ali <alifm@linux.ibm.com> Signed-off-by: Eric Farman <farman@linux.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Message-Id: <20200505125757.98209-4-farman@linux.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
This commit is contained in:
parent
2a3b9cbaa7
commit
46ea3841ed
6 changed files with 99 additions and 5 deletions
|
@ -1335,11 +1335,20 @@ static void copy_schib_to_guest(SCHIB *dest, const SCHIB *src)
|
|||
}
|
||||
}
|
||||
|
||||
int css_do_stsch(SubchDev *sch, SCHIB *schib)
|
||||
IOInstEnding css_do_stsch(SubchDev *sch, SCHIB *schib)
|
||||
{
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* For some subchannels, we may want to update parts of
|
||||
* the schib (e.g., update path masks from the host device
|
||||
* for passthrough subchannels).
|
||||
*/
|
||||
ret = s390_ccw_store(sch);
|
||||
|
||||
/* Use current status. */
|
||||
copy_schib_to_guest(schib, &sch->curr_status);
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void copy_pmcw_from_guest(PMCW *dest, const PMCW *src)
|
||||
|
|
|
@ -51,6 +51,27 @@ int s390_ccw_clear(SubchDev *sch)
|
|||
return cdc->handle_clear(sch);
|
||||
}
|
||||
|
||||
IOInstEnding s390_ccw_store(SubchDev *sch)
|
||||
{
|
||||
S390CCWDeviceClass *cdc = NULL;
|
||||
int ret = IOINST_CC_EXPECTED;
|
||||
|
||||
/*
|
||||
* This code is called for both virtual and passthrough devices,
|
||||
* but only applies to to the latter. This ugly check makes that
|
||||
* distinction for us.
|
||||
*/
|
||||
if (object_dynamic_cast(OBJECT(sch->driver_data), TYPE_S390_CCW)) {
|
||||
cdc = S390_CCW_DEVICE_GET_CLASS(sch->driver_data);
|
||||
}
|
||||
|
||||
if (cdc && cdc->handle_store) {
|
||||
ret = cdc->handle_store(sch);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void s390_ccw_get_dev_info(S390CCWDevice *cdev,
|
||||
char *sysfsdev,
|
||||
Error **errp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue