From owner-svn-src-head@freebsd.org Fri Apr 17 15:19:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A0652BD1E1; Fri, 17 Apr 2020 15:19:43 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 493fsC2dv1z44tw; Fri, 17 Apr 2020 15:19:43 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5543C246B9; Fri, 17 Apr 2020 15:19:43 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03HFJhtT009978; Fri, 17 Apr 2020 15:19:43 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03HFJhb5009977; Fri, 17 Apr 2020 15:19:43 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202004171519.03HFJhb5009977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 17 Apr 2020 15:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360044 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 360044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2020 15:19:43 -0000 Author: cem Date: Fri Apr 17 15:19:42 2020 New Revision: 360044 URL: https://svnweb.freebsd.org/changeset/base/360044 Log: vmm.h: Add ABI assertions and mark implicit holes The static assertions were added (with size and offsets from gdb) and verified with a build prior to marking the holes explicitly. This is in preparation for a subsequent revision, pending in phabricator, that makes use of some of these unused bits without impacting the ABI. Reviewed by: grehan Differential Revision: https://reviews.freebsd.org/D24461 Modified: head/sys/amd64/include/vmm.h Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Fri Apr 17 14:57:15 2020 (r360043) +++ head/sys/amd64/include/vmm.h Fri Apr 17 15:19:42 2020 (r360044) @@ -515,6 +515,8 @@ struct vie_op { uint8_t op_type; /* type of operation (e.g. MOV) */ uint16_t op_flags; }; +_Static_assert(sizeof(struct vie_op) == 4, "ABI"); +_Static_assert(_Alignof(struct vie_op) == 2, "ABI"); #define VIE_INST_SIZE 15 struct vie { @@ -539,13 +541,17 @@ struct vie { rm:4; uint8_t ss:2, /* SIB byte */ - index:4, - base:4; + _sparebits:2, + index:4, /* SIB byte */ + base:4; /* SIB byte */ uint8_t disp_bytes; uint8_t imm_bytes; uint8_t scale; + + uint8_t _sparebytes[3]; + int base_register; /* VM_REG_GUEST_xyz */ int index_register; /* VM_REG_GUEST_xyz */ int segment_register; /* VM_REG_GUEST_xyz */ @@ -555,8 +561,14 @@ struct vie { uint8_t decoded; /* set to 1 if successfully decoded */ + uint8_t _sparebyte; + struct vie_op op; /* opcode description */ }; +_Static_assert(sizeof(struct vie) == 64, "ABI"); +_Static_assert(__offsetof(struct vie, disp_bytes) == 22, "ABI"); +_Static_assert(__offsetof(struct vie, scale) == 24, "ABI"); +_Static_assert(__offsetof(struct vie, base_register) == 28, "ABI"); enum vm_exitcode { VM_EXITCODE_INOUT,