From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH V3 1/2] kvm/x86 : add coalesced pio support Date: Wed, 29 Aug 2018 17:14:33 +0200 Message-ID: <20180829151432.GA19487@flask> References: <1535109632-59745-1-git-send-email-peng.hao2@zte.com.cn> <1535109632-59745-2-git-send-email-peng.hao2@zte.com.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn, wanpeng.li@hotmail.com To: Peng Hao Return-path: Content-Disposition: inline In-Reply-To: <1535109632-59745-2-git-send-email-peng.hao2@zte.com.cn> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2018-08-24 19:20+0800, Peng Hao: > Signed-off-by: Peng Hao > --- > include/uapi/linux/kvm.h | 5 +++-- > virt/kvm/coalesced_mmio.c | 8 +++++--- > virt/kvm/kvm_main.c | 2 ++ > 3 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h > index b6270a3..9cc56d3 100644 > --- a/include/uapi/linux/kvm.h > +++ b/include/uapi/linux/kvm.h > @@ -420,13 +420,13 @@ struct kvm_run { > struct kvm_coalesced_mmio_zone { > __u64 addr; > __u32 size; > - __u32 pad; > + __u32 pio; I would prefer to have this as a slightly more compatible union { __u32 pad; __u32 pio; }; > }; > > struct kvm_coalesced_mmio { > __u64 phys_addr; > __u32 len; > - __u32 pad; > + __u32 pio; Also, please add a check that "pio <= 1". This would catch most cases where userspace passed garbage in that field and we'd also make the remaining bits available for future features. Thanks.