• Boqun Feng's avatar
    Drivers: hv: vmbus: Introduce types of GPADL · c1135c7f
    Boqun Feng authored
    This patch introduces two types of GPADL: HV_GPADL_{BUFFER, RING}. The
    types of GPADL are purely the concept in the guest, IOW the hypervisor
    treat them as the same.
    
    The reason of introducing the types for GPADL is to support guests whose
    page size is not 4k (the page size of Hyper-V hypervisor). In these
    guests, both the headers and the data parts of the ringbuffers need to
    be aligned to the PAGE_SIZE, because 1) some of the ringbuffers will be
    mapped into userspace and 2) we use "double mapping" mechanism to
    support fast wrap-around, and "double mapping" relies on ringbuffers
    being page-aligned. However, the Hyper-V hypervisor only uses 4k
    (HV_HYP_PAGE_SIZE) headers. Our solution to this is that we always make
    the headers of ringbuffers take one guest page and when GPADL is
    established between the guest and hypervisor, the only first 4k of
    header is used. To handle this special case, we need the types of GPADL
    to differ different guest memory usage for GPADL.
    
    Type enum is introduced along with several general interfaces to
    describe the differences between normal buffer GPADL and ringbuffer
    GPADL.
    Signed-off-by: default avatarBoqun Feng <boqun.feng@gmail.com>
    Reviewed-by: default avatarMichael Kelley <mikelley@microsoft.com>
    Link: https://lore.kernel.org/r/20200916034817.30282-4-boqun.feng@gmail.comSigned-off-by: default avatarWei Liu <wei.liu@kernel.org>
    c1135c7f
channel.c 30 KB