From: "Jan Beulich" Subject: Re: [PATCH v5 11/15] x86/altp2m: define and implement alternate p2m HVMOP types. Date: Tue, 14 Jul 2015 15:36:48 +0100 Message-ID: <55A53AA00200007800090CE9@mail.emea.novell.com> References: <1436832903-12639-1-git-send-email-edmund.h.white@intel.com> <1436832903-12639-12-git-send-email-edmund.h.white@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1436832903-12639-12-git-send-email-edmund.h.white@intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ed White Cc: Tim Deegan , Ravi Sahita , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , xen-devel@lists.xen.org, tlengyel@novetta.com, Daniel De Graaf List-Id: xen-devel@lists.xenproject.org >>> On 14.07.15 at 02:14, wrote: > Signed-off-by: Ed White > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -6443,6 +6443,148 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg) > break; > } > > + case HVMOP_altp2m: > + { > + struct xen_hvm_altp2m_op a; > + struct domain *d = NULL; > + > + if ( copy_from_guest(&a, arg, 1) ) > + return -EFAULT; > + > + if ( a.pad[0] || a.pad[1] ) > + return -EINVAL; Why can't the field be uint16_t, making this a single check? Jan