From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: Re: [PATCH 1/3] vfio-ccw: add capabilities chain Date: Wed, 28 Nov 2018 10:05:34 +0100 Message-ID: <20181128100534.7350639c.cohuck@redhat.com> References: <20181122165432.4437-1-cohuck@redhat.com> <20181122165432.4437-2-cohuck@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel2=m.gmane.org@nongnu.org Sender: "Qemu-devel" List-Archive: List-Post: To: Farhan Ali Cc: linux-s390@vger.kernel.org, Eric Farman , Alex Williamson , Pierre Morel , kvm@vger.kernel.org, qemu-devel@nongnu.org, Halil Pasic , qemu-s390x@nongnu.org List-ID: On Tue, 27 Nov 2018 14:04:49 -0500 Farhan Ali wrote: > On 11/22/2018 11:54 AM, Cornelia Huck wrote: > > diff --git a/drivers/s390/cio/vfio_ccw_private.h b/drivers/s390/cio/vfio_ccw_private.h > > index 078e46f9623d..a6f9f84526e2 100644 > > --- a/drivers/s390/cio/vfio_ccw_private.h > > +++ b/drivers/s390/cio/vfio_ccw_private.h > > @@ -3,9 +3,11 @@ > > * Private stuff for vfio_ccw driver > > * > > * Copyright IBM Corp. 2017 > > + * Copyright Red Hat, Inc. 2018 > > * > > * Author(s): Dong Jia Shi > > * Xiao Feng Ren > > + * Cornelia Huck > > */ > > > > #ifndef_VFIO_CCW_PRIVATE_H_ > > @@ -19,6 +21,38 @@ > > #include "css.h" > > #include "vfio_ccw_cp.h" > > > > +#define VFIO_CCW_OFFSET_SHIFT 40 > > +#define VFIO_CCW_OFFSET_TO_INDEX(off) (off >> VFIO_CCW_OFFSET_SHIFT) > > +#define VFIO_CCW_INDEX_TO_OFFSET(index) ((u64)(index) << VFIO_CCW_OFFSET_SHIFT) > > +#define VFIO_CCW_OFFSET_MASK (((u64)(1) << VFIO_CCW_OFFSET_SHIFT) - 1) > > + > > Why is the offset shift 40? I know vfio-pci is also using the same > offset shift, but I am curious about the reasoning behind why we are > using this? :) > My entire reasoning was "hey, vfio-pci is using this, so it should not be bad" 8)