Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp277039pxb; Wed, 4 Nov 2020 22:45:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtfnqr0Az/e4ICM3lb0zib+1X/s4K0U2MSHZupq59lrEgospyHFdLO3bWr/tQEFmjFsojc X-Received: by 2002:a17:906:3a8d:: with SMTP id y13mr943522ejd.460.1604558716781; Wed, 04 Nov 2020 22:45:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604558716; cv=none; d=google.com; s=arc-20160816; b=hcYwKbjJWLwNUXrpwfFmtD1SzStG5WXv/BLz5LBAdRxJuOnP4egLv4am9mnsSoPAJq oe1t25zcUBChgk5G4HwVncLTJSu9mxRntRxJoyeLOxa8CRWBXanrjZXxeUXpUHg7haWK ELt314XI29BeY6DF3SiUu9Cj1wZg6LkdgdCOYQDR4SRN8rE9HR7lAc8ZG2NN/mXPejmQ /vvtovWa+gn7ZH9gksRjp5WOnfyjcdRKEfK8LkNee3o+ROCsZVX59+fYRNGLPU6JbkwB Sfz4a5vc2XpGygtbZOkqbe3dVzOhN6eXPOyo64nn5Zn53N6P4lsDn6W5bc7o7yX2o/iV He5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WN6boHSV4PGUHZ0+2EQphUvjvT0c5V6yJZaawNyCB+Y=; b=YHvb64yqsULMYRSNmXSy1yJGmVUfofOGQxAX65NcN/xrQVNAVqdio++8WRHRgnDR4w O0IJyZcTqXZ0iT6L/FI97kbmAGYbcgbVsfV3RVhBog15tDrxJkzJfmUukEX5zS/xhsRg Q7fd6HueTIhw+cTK6/MS3pp6Skx0YW+rIru9eMeDQS0vQ/J7nC6+HsfABiww8bC1L/on P1R2HoHgxX7eVgA8LMXFtWXSxR5q+L/vYfSBAl1NOpsVPFaXgkEM4nx+A7A5Yx8nljs1 xyg3E4iftyaBn1tSe0rsOizynAKe1x79l7NH/AphwsIAalq7lOzDzkxiUsJquCK6zGK0 Ynog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="uB4J/ovF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si509170ejs.577.2020.11.04.22.44.54; Wed, 04 Nov 2020 22:45:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="uB4J/ovF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729369AbgKEG3Z (ORCPT + 99 others); Thu, 5 Nov 2020 01:29:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:52892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728966AbgKEG3N (ORCPT ); Thu, 5 Nov 2020 01:29:13 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8F3BB2071A; Thu, 5 Nov 2020 06:29:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604557751; bh=vCmoc8vxQM+VgnPBpDMozp8+JRj5jr+dIEAwtCGJzgs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uB4J/ovFYj/4NbogG5hGA6Q1mu+Dhn2XLKhDqw3mn+Xt4a2jktWaAULQcurI7lIoy AUeHxcXowcBTDiCPuLrK64VIJ58rdWM2UR0/0L7IOVXuusRZJa9Ky36WyNzuSINfSV 3s3jkT+qXEe14a5SDr9smnazYoXU5JdVKio5H/CY= Date: Thu, 5 Nov 2020 07:29:07 +0100 From: Greg Kroah-Hartman To: Shuo A Liu Cc: linux-kernel@vger.kernel.org, x86@kernel.org, "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Sean Christopherson , Yu Wang , Reinette Chatre , Zhi Wang , Zhenyu Wang Subject: Re: [PATCH v5 06/17] virt: acrn: Introduce VM management interfaces Message-ID: <20201105062907.GA693781@kroah.com> References: <20201019061803.13298-1-shuo.a.liu@intel.com> <20201019061803.13298-7-shuo.a.liu@intel.com> <20201104190235.GA2855400@kroah.com> <20201105031029.GB17702@shuo-intel.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201105031029.GB17702@shuo-intel.sh.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 05, 2020 at 11:10:29AM +0800, Shuo A Liu wrote: > On Wed 4.Nov'20 at 20:02:35 +0100, Greg Kroah-Hartman wrote: > > On Mon, Oct 19, 2020 at 02:17:52PM +0800, shuo.a.liu@intel.com wrote: > > > --- /dev/null > > > +++ b/include/uapi/linux/acrn.h > > > @@ -0,0 +1,56 @@ > > > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ > > > +/* > > > + * Userspace interface for /dev/acrn_hsm - ACRN Hypervisor Service Module > > > + * > > > + * This file can be used by applications that need to communicate with the HSM > > > + * via the ioctl interface. > > > + */ > > > + > > > +#ifndef _UAPI_ACRN_H > > > +#define _UAPI_ACRN_H > > > + > > > +#include > > > + > > > +/** > > > + * struct acrn_vm_creation - Info to create a User VM > > > + * @vmid: User VM ID returned from the hypervisor > > > + * @reserved0: Reserved > > > + * @vcpu_num: Number of vCPU in the VM. Return from hypervisor. > > > + * @reserved1: Reserved > > > + * @uuid: UUID of the VM. Pass to hypervisor directly. > > > + * @vm_flag: Flag of the VM creating. Pass to hypervisor directly. > > > + * @ioreq_buf: Service VM GPA of I/O request buffer. Pass to > > > + * hypervisor directly. > > > + * @cpu_affinity: CPU affinity of the VM. Pass to hypervisor directly. > > > + * @reserved2: Reserved > > > > Reserved and must be 0? > > Not a must. That's guaranteed to come back and bite you in the end. You all have read the "how to write a good api" document, right? > > What are they reserved for? > > > > Same for all of the reserved fields, why? > > Some reserved fields are to map layout in the hypervisor side, others > are for future use. ioctls should not have these, again, please read the documentation. If you need something new in the future, just make a new ioctl. > > > + */ > > > +struct acrn_vm_creation { > > > + __u16 vmid; > > > + __u16 reserved0; > > > + __u16 vcpu_num; > > > + __u16 reserved1; > > > + __u8 uuid[16]; > > > > We have a userspace-visable uid structure in include/uapi/uuid.h, why > > not use that? > > we just pass the uuid data from user space to hypervisor. So, we can > remove a header dependeny with using raw data format. I do not understand this, please use the built-in kernel types we have. thanks, greg k-h