Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp628595imm; Wed, 29 Aug 2018 08:16:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaAZws2PK4ZuTbHiUY6QpLc9ONhaJpeMgs+euOhhTnRpX0+gqBMokuE/2D1QtSWtMtT7nNQ X-Received: by 2002:a63:e516:: with SMTP id r22-v6mr6200376pgh.170.1535555761984; Wed, 29 Aug 2018 08:16:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535555761; cv=none; d=google.com; s=arc-20160816; b=hOfpVW02LvnDg4wZBf1UbqjWInVXc26pRbsL76v9aAJHhKfQPlOZXzhc+mtrWurGK5 7v9H/dTkn3wB0rxNfSFJPuMo0I6XGGHRMj05nqf41GuvmxV+7kPaR5j2GHmatNAAigTK GWf3gkUC5Fh8C4UjszcwOe1+W0+B3rHv441JyfufoBM8swgTBOMxCcnXC6efdYaqQUvH CNqDNSqXeyrb0p2J23HuSmD8Zi8amTRIKXKUeJIvAoEY8z4GTkABeXV7S5Dm+9m7OLo9 npNI3l9/N5FuKEBxNBvr+aCU636fRaNqoAbb653Vu3CO3zD3v69aTLimTBrNGbLu4d+u QImg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=1+KTpAczh++9lQ8Bo/aHBK2nBaBw/56NnEnYFN7ujK4=; b=NZMesAo/g9TLb3indDw2Jf63hU/OcQ/F+a/Sj1PSDCUdnBzENY8qR2iarefi1I1jJ6 naE9ToLe8Vc2ImCm2NonUg0TeqzEHrveLatcEMCUTcRRvtSi2aIZksWBTqJ0ncdIOaa8 vOm0KpuiPCTgtUfP8r71WyQdTlyIbsqkZvpjsPAV9SVFFxMr3y253c7Fec3VSwpHovvt 5WAWyV/RUvNHAaq/TVkFzgoVdgaXYHPUoI3DnZF9CPvBsaH2GOcgMpueBaS53n+SFopx fLYnyuNdnoz2BxUZasJ5SJ2eTF917oHd+yBzJ0zOAAAW4LAjmy3YmpzFwiZbslsrmCxO nXpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2-v6si4256117pgn.464.2018.08.29.08.15.46; Wed, 29 Aug 2018 08:16:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728994AbeH2TMD (ORCPT + 99 others); Wed, 29 Aug 2018 15:12:03 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42366 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728442AbeH2TMD (ORCPT ); Wed, 29 Aug 2018 15:12:03 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A142B5CB; Wed, 29 Aug 2018 15:14:39 +0000 (UTC) Received: from flask (unknown [10.40.205.185]) by smtp.corp.redhat.com (Postfix) with SMTP id 9543210EE838; Wed, 29 Aug 2018 15:14:34 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Wed, 29 Aug 2018 17:14:33 +0200 Date: Wed, 29 Aug 2018 17:14:33 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Peng Hao Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn, wanpeng.li@hotmail.com Subject: Re: [PATCH V3 1/2] kvm/x86 : add coalesced pio support 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 Content-Disposition: inline In-Reply-To: <1535109632-59745-2-git-send-email-peng.hao2@zte.com.cn> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 29 Aug 2018 15:14:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 29 Aug 2018 15:14:39 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'rkrcmar@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.