From owner-svn-src-head@freebsd.org Fri Feb 26 16:00:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F32E3AB5168; Fri, 26 Feb 2016 16:00:17 +0000 (UTC) (envelope-from marcel@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 mx1.freebsd.org (Postfix) with ESMTPS id C2F6F1844; Fri, 26 Feb 2016 16:00:17 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1QG0Git020079; Fri, 26 Feb 2016 16:00:16 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1QG0GNR020078; Fri, 26 Feb 2016 16:00:16 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201602261600.u1QG0GNR020078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 26 Feb 2016 16:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296099 - head/sys/boot/userboot X-SVN-Group: head 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.20 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, 26 Feb 2016 16:00:18 -0000 Author: marcel Date: Fri Feb 26 16:00:16 2016 New Revision: 296099 URL: https://svnweb.freebsd.org/changeset/base/296099 Log: Add vm_set_register() and vm_set_desc() callbacks. These callbacks translate directly into calls to their namesake API functions in libvmmapi. It is an improvement over the existing setreg(), setmsr(), setcr() setgdt() and exec() callbacks in that the new additions give full control and don't assume we're booting FreeBSD, like exec() and don't assume one only wants to set the value of RSP, like setreg(). Modified: head/sys/boot/userboot/userboot.h Modified: head/sys/boot/userboot/userboot.h ============================================================================== --- head/sys/boot/userboot/userboot.h Fri Feb 26 15:54:34 2016 (r296098) +++ head/sys/boot/userboot/userboot.h Fri Feb 26 16:00:16 2016 (r296099) @@ -34,6 +34,14 @@ #define USERBOOT_VERSION_3 3 /* + * Version 4 added more generic callbacks for setting up + * registers and descriptors. The callback structure is + * backward compatible (new callbacks have been added at + * the tail end). + */ +#define USERBOOT_VERSION_4 4 + +/* * Exit codes from the loader */ #define USERBOOT_EXIT_QUIT 1 @@ -195,4 +203,11 @@ struct loader_callbacks { * each invocation will add 1 to the previous value of 'num'. */ const char * (*getenv)(void *arg, int num); + + /* + * Version 4 additions. + */ + int (*vm_set_register)(void *arg, int vcpu, int reg, uint64_t val); + int (*vm_set_desc)(void *arg, int vcpu, int reg, uint64_t base, + u_int limit, u_int access); };