Message ID | 20221116092254.66234-1-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp44827wru; Wed, 16 Nov 2022 01:31:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf7iKxb0AZTslMNd96NS9fPij8Uy5R0AkxFKEeeBWqf154SLCpKV5wg7I7UyY6Q4VwA2yKiT X-Received: by 2002:a17:906:1e51:b0:7b2:7b45:2bf6 with SMTP id i17-20020a1709061e5100b007b27b452bf6mr3808261ejj.467.1668591118727; Wed, 16 Nov 2022 01:31:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668591118; cv=none; d=google.com; s=arc-20160816; b=hYu14uzfGmCD3LALJ19wEkG6ECaQF8Z5O5zdBqcS8oYvm2A96Yi+BIhSNWyPRP1cv7 jlcRVGywjFy0kgU3wMWDtiCnib1uMp97Cye5E0yFTA/Ra8wDGfZ71H3edk7ZQNN9HnIL nlwI/CCgJN0jEvP/WRLLYeUbWkHjjGvpP1qG6SlToznkIbcFWwe/D5+mRgtikGCBiAaE cR2qcPNAr5ibqBvsDYiDjdl5Zfz8I/c9FGBB4BxEbIA6ElDYRfCnnKcU3g5GtLr9hX9K FsYUfH8Gp1pa8fW/2XgwKqkntJHp1NtMRRDWycKE0TkeK0CjeKPFlPKkqRaVtoWousL3 xpTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Rb2X/hPLEsnsRjwLHhCOXJBAEZkeMFj1MSy2EhSKLaA=; b=kFQQhJxKb2EJ9xxmsoPhbzco/6fVm7K9j4hpL0AJdLBPK6JyFMVDDOTDDkqA7j9pLy IxmjflW9eTBfFRXOrdkeMC2l9kwZkOzY4IsGyLp5I73nDU0O9JJFpoaZqP1eYFQEa97O jGyyGaTptGQNa7/LcSS/SQE9PPpsGe4PnKn438tlO0q1R+WViM3sSvrgOUFpZJdIDz5I JkwzbE199n/9l0T9YtMwCNFvShDfqne+XoEAK+zpkkjqGjgCDblFRDf3IGSP3J2qqhmL FKmKYa8zmytiBjKZNttVcZA14gjYryJadrIwFOsKx/oJkrp02mtd5kL2MccOn8DjbfTp 4mNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=c13AzyHP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw7-20020a1709066a0700b007aeec2bf18fsi9336867ejc.543.2022.11.16.01.31.34; Wed, 16 Nov 2022 01:31:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=c13AzyHP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231829AbiKPJXF (ORCPT <rfc822;just.gull.subs@gmail.com> + 99 others); Wed, 16 Nov 2022 04:23:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233546AbiKPJWo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 16 Nov 2022 04:22:44 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1859D29C89 for <linux-kernel@vger.kernel.org>; Wed, 16 Nov 2022 01:22:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668590560; x=1700126560; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=GTSmWM4/773jpiMFtu9dyGEa5/KxzthxxjZk9qHNbF0=; b=c13AzyHPAXzFm4TqW504kPfXGLTzDuNzj0QKXveMWxPasMAdvlSP3vkf fUcJdWCXlIfdkSMaE46jmjyy87IWpbs35U3Q/I9o3Hl3W+zSLgQnl4dvh +qYpLNqrni8JPD6FKgd2pNSrENdyUaQfqr4wgV23bTF2wrNhaWyeq9Odi dtwodWcMwATEqiR/ej1WzblNUO6Ke7IocmEdrEYTbDyhst853MEKZGiHY YuHsSL9y+8/j5nwx2Bc/FhITSHoBMjqQOolu3V5A/LGuK9Q9U8PHBnBz2 16fmQSrWTcSM/AsGpUDh5VFiz1TDVi1oFMUGUw8cN0UU3aNPXWNUfW7f4 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10532"; a="314310528" X-IronPort-AV: E=Sophos;i="5.96,167,1665471600"; d="scan'208";a="314310528" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2022 01:22:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10532"; a="728297924" X-IronPort-AV: E=Sophos;i="5.96,167,1665471600"; d="scan'208";a="728297924" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 16 Nov 2022 01:22:38 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id B3BD92F3; Wed, 16 Nov 2022 11:23:02 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, linux-kernel@vger.kernel.org Cc: Fei Li <fei1.li@intel.com>, "Rafael J. Wysocki" <rafael@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Subject: [PATCH v4 1/1] virt: acrn: Mark the uuid field as unused Date: Wed, 16 Nov 2022 11:22:54 +0200 Message-Id: <20221116092254.66234-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749644600779259184?= X-GMAIL-MSGID: =?utf-8?q?1749644600779259184?= |
Series |
[v4,1/1] virt: acrn: Mark the uuid field as unused
|
|
Commit Message
Andy Shevchenko
Nov. 16, 2022, 9:22 a.m. UTC
After the commits for userspace (see Link tags below) the uuid field is not being used in the ACRN code. Update kernel to reflect these changes. I.e. we do the following: - adding a comment explaining that it's not used anymore - replacing the specific type by a raw buffer - updating the example code accordingly The advertised field confused users and actually never been used. So the wrong part here is that kernel puts something which userspace never used and hence this may confuse a reader of this code. Link: https://github.com/projectacrn/acrn-hypervisor/commit/da0d24326ed6 Link: https://github.com/projectacrn/acrn-hypervisor/commit/bb0327e70097 Fixes: 5b06931d7f8b ("sample/acrn: Introduce a sample of HSM ioctl interface usage") Fixes: 9c5137aedd11 ("virt: acrn: Introduce VM management interfaces") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Rafael J. Wysocki <rafael@kernel.org> --- v4: added tag (Rafael), Cc'ed to Greg (missing in the previous version by some reason) v3: converted to Link tags (Rafael), explained what was wrong (Rafael) v2: added tag (Fei) include/uapi/linux/acrn.h | 5 ++--- samples/acrn/vm-sample.c | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-)
Comments
On Wed, Nov 16, 2022 at 11:22:54AM +0200, Andy Shevchenko wrote: > After the commits for userspace (see Link tags below) the uuid field is > not being used in the ACRN code. Update kernel to reflect these changes. > I.e. we do the following: > - adding a comment explaining that it's not used anymore > - replacing the specific type by a raw buffer > - updating the example code accordingly > > The advertised field confused users and actually never been used. So > the wrong part here is that kernel puts something which userspace never > used and hence this may confuse a reader of this code. > > Link: https://github.com/projectacrn/acrn-hypervisor/commit/da0d24326ed6 > Link: https://github.com/projectacrn/acrn-hypervisor/commit/bb0327e70097 > Fixes: 5b06931d7f8b ("sample/acrn: Introduce a sample of HSM ioctl interface usage") > Fixes: 9c5137aedd11 ("virt: acrn: Introduce VM management interfaces") > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Acked-by: Rafael J. Wysocki <rafael@kernel.org> > --- > v4: added tag (Rafael), Cc'ed to Greg (missing in the previous version > by some reason) > v3: converted to Link tags (Rafael), explained what was wrong (Rafael) > v2: added tag (Fei) > > include/uapi/linux/acrn.h | 5 ++--- > samples/acrn/vm-sample.c | 3 --- > 2 files changed, 2 insertions(+), 6 deletions(-) > > diff --git a/include/uapi/linux/acrn.h b/include/uapi/linux/acrn.h > index ccf47ed92500..04fa83647ae5 100644 > --- a/include/uapi/linux/acrn.h > +++ b/include/uapi/linux/acrn.h > @@ -12,7 +12,6 @@ > #define _UAPI_ACRN_H > > #include <linux/types.h> > -#include <linux/uuid.h> > > #define ACRN_IO_REQUEST_MAX 16 > > @@ -186,7 +185,7 @@ struct acrn_ioreq_notify { > * @reserved0: Reserved and must be 0 > * @vcpu_num: Number of vCPU in the VM. Return from hypervisor. > * @reserved1: Reserved and must be 0 > - * @uuid: UUID of the VM. Pass to hypervisor directly. > + * @uuid: Reserved (used to be UUID of the VM) If it's reserved, then don't you need to check for 0? > * @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. > @@ -198,7 +197,7 @@ struct acrn_vm_creation { > __u16 reserved0; > __u16 vcpu_num; > __u16 reserved1; > - guid_t uuid; > + __u8 uuid[16]; You just changed the type here, so what is that going to break in userspace that depended on this being of a structure type and now it's an array? And no other kernel changes needed? Shouldn't you warn if this field is set? thanks, greg k-h
On Wed, Nov 16, 2022 at 12:42:16PM +0100, Greg Kroah-Hartman wrote: > On Wed, Nov 16, 2022 at 11:22:54AM +0200, Andy Shevchenko wrote: > > After the commits for userspace (see Link tags below) the uuid field is > > not being used in the ACRN code. Update kernel to reflect these changes. > > I.e. we do the following: > > - adding a comment explaining that it's not used anymore > > - replacing the specific type by a raw buffer > > - updating the example code accordingly > > > > The advertised field confused users and actually never been used. So > > the wrong part here is that kernel puts something which userspace never > > used and hence this may confuse a reader of this code. > > - * @uuid: UUID of the VM. Pass to hypervisor directly. > > + * @uuid: Reserved (used to be UUID of the VM) > > If it's reserved, then don't you need to check for 0? Reserved in a way that it may content something we just don't care about. ... > > + __u8 uuid[16]; > > You just changed the type here, so what is that going to break in > userspace that depended on this being of a structure type and now it's > an array? It's the same. The previous was hidden behind additional type level. > And no other kernel changes needed? Shouldn't you warn if this field is > set? No, as pointed out in the commit message kernel never ever used this.
On Wed, Nov 16, 2022 at 03:29:31PM +0200, Andy Shevchenko wrote: > On Wed, Nov 16, 2022 at 12:42:16PM +0100, Greg Kroah-Hartman wrote: > > On Wed, Nov 16, 2022 at 11:22:54AM +0200, Andy Shevchenko wrote: > > > After the commits for userspace (see Link tags below) the uuid field is > > > not being used in the ACRN code. Update kernel to reflect these changes. > > > I.e. we do the following: > > > - adding a comment explaining that it's not used anymore > > > - replacing the specific type by a raw buffer > > > - updating the example code accordingly > > > > > > The advertised field confused users and actually never been used. So > > > the wrong part here is that kernel puts something which userspace never > > > used and hence this may confuse a reader of this code. > > > > - * @uuid: UUID of the VM. Pass to hypervisor directly. > > > + * @uuid: Reserved (used to be UUID of the VM) > > > > If it's reserved, then don't you need to check for 0? > > Reserved in a way that it may content something we just don't care about. "reserved" in the kernel ioctls mean "must be 0 and we will test for it, otherwise this is an empty/useless field that can never be touched again in the future. Please spell it out in detail as to if you can ever use this later on, and what the kernel will do (if anything) if it is set. And if "the kernel ignores it" then that means these bytes are now "empty space never to be used again", right? > ... > > > > + __u8 uuid[16]; > > > > You just changed the type here, so what is that going to break in > > userspace that depended on this being of a structure type and now it's > > an array? > > It's the same. The previous was hidden behind additional type level. Same size, yes. Same C structure definition, no. > > And no other kernel changes needed? Shouldn't you warn if this field is > > set? > > No, as pointed out in the commit message kernel never ever used this. That does not mean that userspace tools never did, right? You are changing the structure definition, what tool just broke? thanks, greg k-h
On Wed, Nov 16, 2022 at 04:20:08PM +0100, Greg Kroah-Hartman wrote: > On Wed, Nov 16, 2022 at 03:29:31PM +0200, Andy Shevchenko wrote: > > On Wed, Nov 16, 2022 at 12:42:16PM +0100, Greg Kroah-Hartman wrote: > > > On Wed, Nov 16, 2022 at 11:22:54AM +0200, Andy Shevchenko wrote: ... > > > > - * @uuid: UUID of the VM. Pass to hypervisor directly. > > > > + * @uuid: Reserved (used to be UUID of the VM) > > > > > > If it's reserved, then don't you need to check for 0? > > > > Reserved in a way that it may content something we just don't care about. > > "reserved" in the kernel ioctls mean "must be 0 and we will test for it, > otherwise this is an empty/useless field that can never be touched again > in the future. > > Please spell it out in detail as to if you can ever use this later on, > and what the kernel will do (if anything) if it is set. > > And if "the kernel ignores it" then that means these bytes are now > "empty space never to be used again", right? Right, I will fix this in v5. ... > > > > + __u8 uuid[16]; > > > > > > You just changed the type here, so what is that going to break in > > > userspace that depended on this being of a structure type and now it's > > > an array? > > > > It's the same. The previous was hidden behind additional type level. > > Same size, yes. Same C structure definition, no. It doesn't matter, see below. > > > And no other kernel changes needed? Shouldn't you warn if this field is > > > set? > > > > No, as pointed out in the commit message kernel never ever used this. > > That does not mean that userspace tools never did, right? You are > changing the structure definition, what tool just broke? The only tool has been amended like a year ago, so the answer is none. The commit message has links to the commits in question that made that amendment. Maybe I should remove Fixes tags? In such case we will very much know that no old tools will be run on the new kernel.
On Wed, Nov 16, 2022 at 06:04:37PM +0200, Andy Shevchenko wrote: > On Wed, Nov 16, 2022 at 04:20:08PM +0100, Greg Kroah-Hartman wrote: > > On Wed, Nov 16, 2022 at 03:29:31PM +0200, Andy Shevchenko wrote: > > > On Wed, Nov 16, 2022 at 12:42:16PM +0100, Greg Kroah-Hartman wrote: > > > > On Wed, Nov 16, 2022 at 11:22:54AM +0200, Andy Shevchenko wrote: > > ... > > > > > > - * @uuid: UUID of the VM. Pass to hypervisor directly. > > > > > + * @uuid: Reserved (used to be UUID of the VM) > > > > > > > > If it's reserved, then don't you need to check for 0? > > > > > > Reserved in a way that it may content something we just don't care about. > > > > "reserved" in the kernel ioctls mean "must be 0 and we will test for it, > > otherwise this is an empty/useless field that can never be touched again > > in the future. > > > > Please spell it out in detail as to if you can ever use this later on, > > and what the kernel will do (if anything) if it is set. > > > > And if "the kernel ignores it" then that means these bytes are now > > "empty space never to be used again", right? > > Right, I will fix this in v5. > > ... > > > > > > + __u8 uuid[16]; > > > > > > > > You just changed the type here, so what is that going to break in > > > > userspace that depended on this being of a structure type and now it's > > > > an array? > > > > > > It's the same. The previous was hidden behind additional type level. > > > > Same size, yes. Same C structure definition, no. > > It doesn't matter, see below. > > > > > And no other kernel changes needed? Shouldn't you warn if this field is > > > > set? > > > > > > No, as pointed out in the commit message kernel never ever used this. > > > > That does not mean that userspace tools never did, right? You are > > changing the structure definition, what tool just broke? > > The only tool has been amended like a year ago, so the answer is none. > The commit message has links to the commits in question that made that > amendment. > > Maybe I should remove Fixes tags? In such case we will very much know > that no old tools will be run on the new kernel. Please remove "fixes" as this doesn't "fix" anything. thanks, greg k-h
On Wed, Nov 16, 2022 at 05:16:20PM +0100, Greg Kroah-Hartman wrote: > On Wed, Nov 16, 2022 at 06:04:37PM +0200, Andy Shevchenko wrote: > > On Wed, Nov 16, 2022 at 04:20:08PM +0100, Greg Kroah-Hartman wrote: > > > On Wed, Nov 16, 2022 at 03:29:31PM +0200, Andy Shevchenko wrote: > > > > On Wed, Nov 16, 2022 at 12:42:16PM +0100, Greg Kroah-Hartman wrote: > > > > > On Wed, Nov 16, 2022 at 11:22:54AM +0200, Andy Shevchenko wrote: > > > > ... > > > > > > > > - * @uuid: UUID of the VM. Pass to hypervisor directly. > > > > > > + * @uuid: Reserved (used to be UUID of the VM) > > > > > > > > > > If it's reserved, then don't you need to check for 0? > > > > > > > > Reserved in a way that it may content something we just don't care about. > > > > > > "reserved" in the kernel ioctls mean "must be 0 and we will test for it, > > > otherwise this is an empty/useless field that can never be touched again > > > in the future. > > > > > > Please spell it out in detail as to if you can ever use this later on, > > > and what the kernel will do (if anything) if it is set. > > > > > > And if "the kernel ignores it" then that means these bytes are now > > > "empty space never to be used again", right? > > > > Right, I will fix this in v5. > > > > ... > > > > > > > > + __u8 uuid[16]; > > > > > > > > > > You just changed the type here, so what is that going to break in > > > > > userspace that depended on this being of a structure type and now it's > > > > > an array? > > > > > > > > It's the same. The previous was hidden behind additional type level. > > > > > > Same size, yes. Same C structure definition, no. > > > > It doesn't matter, see below. > > > > > > > And no other kernel changes needed? Shouldn't you warn if this field is > > > > > set? > > > > > > > > No, as pointed out in the commit message kernel never ever used this. > > > > > > That does not mean that userspace tools never did, right? You are > > > changing the structure definition, what tool just broke? > > > > The only tool has been amended like a year ago, so the answer is none. > > The commit message has links to the commits in question that made that > > amendment. > > > > Maybe I should remove Fixes tags? In such case we will very much know > > that no old tools will be run on the new kernel. > > Please remove "fixes" as this doesn't "fix" anything. Done in v5. Thank you for the thorough review!
On 2022-11-16 at 18:04:37 +0200, Andy Shevchenko wrote: > On Wed, Nov 16, 2022 at 04:20:08PM +0100, Greg Kroah-Hartman wrote: > > On Wed, Nov 16, 2022 at 03:29:31PM +0200, Andy Shevchenko wrote: > > > On Wed, Nov 16, 2022 at 12:42:16PM +0100, Greg Kroah-Hartman wrote: > > > > On Wed, Nov 16, 2022 at 11:22:54AM +0200, Andy Shevchenko wrote: > > ... > > > > > > - * @uuid: UUID of the VM. Pass to hypervisor directly. > > > > > + * @uuid: Reserved (used to be UUID of the VM) > > > > > > > > If it's reserved, then don't you need to check for 0? > > > > > > Reserved in a way that it may content something we just don't care about. > > > > "reserved" in the kernel ioctls mean "must be 0 and we will test for it, > > otherwise this is an empty/useless field that can never be touched again > > in the future. > > > > Please spell it out in detail as to if you can ever use this later on, > > and what the kernel will do (if anything) if it is set. > > > > And if "the kernel ignores it" then that means these bytes are now > > "empty space never to be used again", right? > > Right, I will fix this in v5. Hi Andy ACRN does not use uuid recently. But before that, the old ACRN still uses it. So could we just change the uuid data structure definition here ? Thanks. > > ... > > > > > > + __u8 uuid[16]; > > > > > > > > You just changed the type here, so what is that going to break in > > > > userspace that depended on this being of a structure type and now it's > > > > an array? > > > > > > It's the same. The previous was hidden behind additional type level. > > > > Same size, yes. Same C structure definition, no. > > It doesn't matter, see below. > > > > > And no other kernel changes needed? Shouldn't you warn if this field is > > > > set? > > > > > > No, as pointed out in the commit message kernel never ever used this. > > > > That does not mean that userspace tools never did, right? You are > > changing the structure definition, what tool just broke? > > The only tool has been amended like a year ago, so the answer is none. > The commit message has links to the commits in question that made that > amendment. > > Maybe I should remove Fixes tags? In such case we will very much know > that no old tools will be run on the new kernel. > > -- > With Best Regards, > Andy Shevchenko > >
On Thu, Nov 17, 2022 at 09:03:48AM +0800, Fei Li wrote: > On 2022-11-16 at 18:04:37 +0200, Andy Shevchenko wrote: ... > ACRN does not use uuid recently. But before that, the old ACRN still uses it. > So could we just change the uuid data structure definition here ? That's what is meant by removing the Fixes tags.
On Thu, Nov 17, 2022 at 08:47:10AM +0200, Andy Shevchenko wrote: > On Thu, Nov 17, 2022 at 09:03:48AM +0800, Fei Li wrote: > > On 2022-11-16 at 18:04:37 +0200, Andy Shevchenko wrote: ... > > ACRN does not use uuid recently. But before that, the old ACRN still uses it. > > So could we just change the uuid data structure definition here ? > > That's what is meant by removing the Fixes tags. Note, this change also removes the link to non-existing file.
diff --git a/include/uapi/linux/acrn.h b/include/uapi/linux/acrn.h index ccf47ed92500..04fa83647ae5 100644 --- a/include/uapi/linux/acrn.h +++ b/include/uapi/linux/acrn.h @@ -12,7 +12,6 @@ #define _UAPI_ACRN_H #include <linux/types.h> -#include <linux/uuid.h> #define ACRN_IO_REQUEST_MAX 16 @@ -186,7 +185,7 @@ struct acrn_ioreq_notify { * @reserved0: Reserved and must be 0 * @vcpu_num: Number of vCPU in the VM. Return from hypervisor. * @reserved1: Reserved and must be 0 - * @uuid: UUID of the VM. Pass to hypervisor directly. + * @uuid: Reserved (used to be UUID of the VM) * @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. @@ -198,7 +197,7 @@ struct acrn_vm_creation { __u16 reserved0; __u16 vcpu_num; __u16 reserved1; - guid_t uuid; + __u8 uuid[16]; __u64 vm_flag; __u64 ioreq_buf; __u64 cpu_affinity; diff --git a/samples/acrn/vm-sample.c b/samples/acrn/vm-sample.c index b2dad47a77a0..7abd68b20153 100644 --- a/samples/acrn/vm-sample.c +++ b/samples/acrn/vm-sample.c @@ -29,8 +29,6 @@ static struct acrn_io_request *io_req_buf = (struct acrn_io_request *)io_request __u16 vcpu_num; __u16 vmid; -/* POST_STANDARD_VM_UUID1, refer to https://github.com/projectacrn/acrn-hypervisor/blob/master/hypervisor/include/common/vm_uuids.h */ -guid_t vm_uuid = GUID_INIT(0x385479d2, 0xd625, 0xe811, 0x86, 0x4e, 0xcb, 0x7a, 0x18, 0xb3, 0x46, 0x43); int hsm_fd; int is_running = 1; @@ -63,7 +61,6 @@ int main(int argc, char **argv) } hsm_fd = open("/dev/acrn_hsm", O_RDWR|O_CLOEXEC); - memcpy(&create_vm.uuid, &vm_uuid, 16); create_vm.ioreq_buf = (__u64)io_req_buf; ret = ioctl(hsm_fd, ACRN_IOCTL_CREATE_VM, &create_vm); printf("Created VM! [%d]\n", ret);