mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-04 04:04:19 +00:00
virt: vbox: Rename guest_caps struct members to set_guest_caps
Rename guest_caps[_tracker] struct members to set_guest_caps[_tracker] this is a preparation patch for adding support for the VBGL_IOCTL_GUEST_CAPS_ACQUIRE ioctl. Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20200709120858.63928-4-hdegoede@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2d41d2ab85
commit
fd01cc5903
@ -699,17 +699,17 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
|
|||||||
mutex_lock(&gdev->session_mutex);
|
mutex_lock(&gdev->session_mutex);
|
||||||
|
|
||||||
/* Apply the changes to the session mask. */
|
/* Apply the changes to the session mask. */
|
||||||
previous = session->guest_caps;
|
previous = session->set_guest_caps;
|
||||||
session->guest_caps |= or_mask;
|
session->set_guest_caps |= or_mask;
|
||||||
session->guest_caps &= ~not_mask;
|
session->set_guest_caps &= ~not_mask;
|
||||||
|
|
||||||
/* If anything actually changed, update the global usage counters. */
|
/* If anything actually changed, update the global usage counters. */
|
||||||
changed = previous ^ session->guest_caps;
|
changed = previous ^ session->set_guest_caps;
|
||||||
if (!changed)
|
if (!changed)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
vbg_track_bit_usage(&gdev->guest_caps_tracker, changed, previous);
|
vbg_track_bit_usage(&gdev->set_guest_caps_tracker, changed, previous);
|
||||||
or_mask = gdev->guest_caps_tracker.mask;
|
or_mask = gdev->set_guest_caps_tracker.mask;
|
||||||
|
|
||||||
if (gdev->guest_caps_host == or_mask || !req)
|
if (gdev->guest_caps_host == or_mask || !req)
|
||||||
goto out;
|
goto out;
|
||||||
@ -726,9 +726,9 @@ static int vbg_set_session_capabilities(struct vbg_dev *gdev,
|
|||||||
if (session_termination)
|
if (session_termination)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
vbg_track_bit_usage(&gdev->guest_caps_tracker, changed,
|
vbg_track_bit_usage(&gdev->set_guest_caps_tracker, changed,
|
||||||
session->guest_caps);
|
session->set_guest_caps);
|
||||||
session->guest_caps = previous;
|
session->set_guest_caps = previous;
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
@ -1452,7 +1452,7 @@ static int vbg_ioctl_change_guest_capabilities(struct vbg_dev *gdev,
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
caps->u.out.session_caps = session->guest_caps;
|
caps->u.out.session_caps = session->set_guest_caps;
|
||||||
caps->u.out.global_caps = gdev->guest_caps_host;
|
caps->u.out.global_caps = gdev->guest_caps_host;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -118,11 +118,12 @@ struct vbg_dev {
|
|||||||
u32 event_filter_host;
|
u32 event_filter_host;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Usage counters for guest capabilities. Indexed by capability bit
|
* Usage counters for guest capabilities requested through
|
||||||
|
* vbg_set_session_capabilities(). Indexed by capability bit
|
||||||
* number, one count per session using a capability.
|
* number, one count per session using a capability.
|
||||||
* Protected by session_mutex.
|
* Protected by session_mutex.
|
||||||
*/
|
*/
|
||||||
struct vbg_bit_usage_tracker guest_caps_tracker;
|
struct vbg_bit_usage_tracker set_guest_caps_tracker;
|
||||||
/**
|
/**
|
||||||
* The guest capabilities last reported to the host (or UINT32_MAX).
|
* The guest capabilities last reported to the host (or UINT32_MAX).
|
||||||
* Protected by session_mutex.
|
* Protected by session_mutex.
|
||||||
@ -164,11 +165,11 @@ struct vbg_session {
|
|||||||
*/
|
*/
|
||||||
u32 event_filter;
|
u32 event_filter;
|
||||||
/**
|
/**
|
||||||
* Guest capabilities for this session.
|
* Guest capabilities set through vbg_set_session_capabilities().
|
||||||
* A capability claimed by any guest session will be reported to the
|
* A capability claimed by any guest session will be reported to the
|
||||||
* host. Protected by vbg_gdev.session_mutex.
|
* host. Protected by vbg_gdev.session_mutex.
|
||||||
*/
|
*/
|
||||||
u32 guest_caps;
|
u32 set_guest_caps;
|
||||||
/** VMMDEV_REQUESTOR_* flags */
|
/** VMMDEV_REQUESTOR_* flags */
|
||||||
u32 requestor;
|
u32 requestor;
|
||||||
/** Set on CANCEL_ALL_WAITEVENTS, protected by vbg_devevent_spinlock. */
|
/** Set on CANCEL_ALL_WAITEVENTS, protected by vbg_devevent_spinlock. */
|
||||||
|
Loading…
Reference in New Issue
Block a user