Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp539125pxb; Fri, 13 Aug 2021 00:13:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfjV+OTRovB1QCOMB/+mib0Kq0MnxWD2OWZo8XmFlKbswlfD1YbHIicfbAM5gw8kvQCyQ8 X-Received: by 2002:a02:908a:: with SMTP id x10mr945047jaf.30.1628838815766; Fri, 13 Aug 2021 00:13:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628838815; cv=none; d=google.com; s=arc-20160816; b=lG0yMUDJWe/ATF3xLu5tsQGi8r2jCT3uVBu/Jujxt2/iW2WfDfeqyuX0Opzn9Y6uQt ukj1AfTkT+ypB6CNOaIy6EK8UNDPJuKyvpN9gTZVfGQVvm9zqR65woaNgPWYlRxPWzOW cGCgYy7mtm8tQWbks976awXwdcYFY1qSgPnTTF2r1eV4WQiQ6QGj04LkJ3sPafd5gb9e vJa6J9aRlK1Co+p40F/+D2xIe6+LHbwaQeDpA3CP1JeIcuGh805aLPj+/TDml+angrt1 Pn0ypF+MLJwFsVQbpYgd9UW2VormC6e1AVfIdwLmsSbB18GV8vOoIoVFC4r3XXjsY70s YpzQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RbMnv4xLzFK3cGlV7gRVytCFaeSSy0i9w4B4VQKbuGo=; b=tzPdN4e6pIGtQQ2GosPS6dHdEzLPrZKwcXVx7SbesP1bBTppr+CU80AYNQWtyZqayD BoC4R+HQ4d56GH8VRu9zPswAvKSmLn8Uq9rH2hvdp2hHU4M+imVLpWFSg1/B2oKrt0TE I8CBr1ruk7oX8HugRNvjPq52uhJaWoy+pbYXro3aVQQvnU1wPo9/3hE2sk8T+PWoARTR BO8YSFC95FQHO/QV3aZn2MJuFEiN1NluhVqJU1cpigKqgZmYuSMOI0vF2vMuVYuLyfK3 lq2ojrQQ+Iu0ySib1itdkogBYiVlSf5TeB759reFJo+nNKJi6rvW1BXWXvaDnLpeORjM k+Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=i2Nhshx1; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b7si694927ilr.75.2021.08.13.00.13.25; Fri, 13 Aug 2021 00:13:35 -0700 (PDT) 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=@messagingengine.com header.s=fm3 header.b=i2Nhshx1; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239289AbhHMHMz (ORCPT + 99 others); Fri, 13 Aug 2021 03:12:55 -0400 Received: from forward2-smtp.messagingengine.com ([66.111.4.226]:44005 "EHLO forward2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239262AbhHMHMr (ORCPT ); Fri, 13 Aug 2021 03:12:47 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailforward.nyi.internal (Postfix) with ESMTP id BCCC2194084B; Fri, 13 Aug 2021 03:12:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 13 Aug 2021 03:12:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=RbMnv4xLzFK3cGlV7gRVytCFaeSSy0i9w4B4VQKbuGo=; b=i2Nhshx1 YyuBZUIqZTtqty0SzN8RhyotAFSA4vUoT0goeLq/D7gepI1BLKbGPeTCToZWOU7o rDnF9+N5P75fXlS8Sb2bo4/NEr0nDPSXTcwSE9mfj/iPcA+hUQkTJAcK0imJeVzJ arIXgU+czuMgvY/Gid/PXYQJaNnc7A67q4sdXXaaj1B62XoiMXHb5set4kYoFbVa e7Y+kptdYOSDducLXqcN2BMhsk2thDWY9lFa9e8Hka5K+GDT8Rxj+EZSEsVu5JJF NM143KDg0oTNLbbiT0/HeMOZUIDt+PBOfEx8na1VWNe/75ltYF0EvHgdfM9tzJr+ GzEvqWpsP3t1wg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrkeeggdduudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghvihgu ucfgughmohhnughsohhnuceouggrvhhiugdrvggumhhonhgushhonhesohhrrggtlhgvrd gtohhmqeenucggtffrrghtthgvrhhnpedufeetjefgfefhtdejhfehtdfftefhteekhefg leehfffhiefhgeelgfejtdehkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegurghvihgurdgvughmohhnughsohhnsehorhgrtghlvgdrtgho mh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Aug 2021 03:12:15 -0400 (EDT) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 418eb6c0; Fri, 13 Aug 2021 07:12:12 +0000 (UTC) From: David Edmondson To: linux-kernel@vger.kernel.org Cc: Jim Mattson , Borislav Petkov , Paolo Bonzini , Vitaly Kuznetsov , "H. Peter Anvin" , Thomas Gleixner , Wanpeng Li , Ingo Molnar , Sean Christopherson , Joerg Roedel , David Matlack , x86@kernel.org, kvm@vger.kernel.org, David Edmondson Subject: [PATCH v4 1/4] KVM: x86: Clarify the kvm_run.emulation_failure structure layout Date: Fri, 13 Aug 2021 08:12:08 +0100 Message-Id: <20210813071211.1635310-2-david.edmondson@oracle.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210813071211.1635310-1-david.edmondson@oracle.com> References: <20210813071211.1635310-1-david.edmondson@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Until more flags for kvm_run.emulation_failure flags are defined, it is undetermined whether new payload elements corresponding to those flags will be additive or alternative. As a hint to userspace that an alternative is possible, wrap the current payload elements in a union. Suggested-by: Sean Christopherson Signed-off-by: David Edmondson --- include/uapi/linux/kvm.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index d9e4aabcb31a..6c79c1ce3703 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -402,8 +402,12 @@ struct kvm_run { __u32 suberror; __u32 ndata; __u64 flags; - __u8 insn_size; - __u8 insn_bytes[15]; + union { + struct { + __u8 insn_size; + __u8 insn_bytes[15]; + }; + }; } emulation_failure; /* KVM_EXIT_OSI */ struct { -- 2.30.2