--- old/usr/src/cmd/boot/bootadm/bootadm.c	Wed Mar  7 18:38:19 2018
+++ new/usr/src/cmd/boot/bootadm/bootadm.c	Wed Mar  7 18:38:19 2018
@@ -289,8 +289,6 @@
 	"update_temp",		OPT_OPTIONAL,	update_temp, 0,	/* reboot */
 	"upgrade",		OPT_ABSENT,	upgrade_menu, 0, /* menu */
 	"list_setting",		OPT_OPTIONAL,	list_setting, 1, /* menu */
-	"disable_hypervisor",	OPT_ABSENT,	cvt_to_metal, 0, /* menu */
-	"enable_hypervisor",	OPT_ABSENT,	cvt_to_hyper, 0, /* menu */
 	NULL,			0,		NULL, 0	/* must be last */
 };
 
@@ -552,7 +550,7 @@
 	}
 
 	if (ret != BAM_SUCCESS)
-		bam_exit((ret == BAM_NOCHANGE) ? 2 : 1);
+		bam_exit(1);
 
 	bam_unlock();
 	return (0);
@@ -624,8 +622,6 @@
  *	-m list_entry			-- list-menu
  *	-m update_temp			-- (reboot -- [boot-args])
  *	-m delete_all_entries		-- (called from install)
- *	-m enable_hypervisor [args]	-- cvt_to_hyper
- *	-m disable_hypervisor		-- cvt_to_metal
  *	-m list_setting [entry] [value]	-- list_setting
  *
  * A set of private flags is there too:
@@ -762,7 +758,7 @@
 			}
 			break;
 		case 'X':
-			bam_is_hv = BAM_HV_PRESENT;
+			/* obsolete */
 			break;
 		case 'Z':
 			bam_zfs = 1;
@@ -868,11 +864,11 @@
 		}
 		if (bam_argc == 1)
 			sync_menu = 0;
-	} else if (((strcmp(subcmd, "enable_hypervisor") != 0) &&
-	    (strcmp(subcmd, "list_setting") != 0)) && (bam_argc || bam_argv)) {
+	} else if (strcmp(subcmd, "list_setting") != 0 &&
+	    (bam_argc || bam_argv)) {
 		/*
-		 * Of the remaining subcommands, only "enable_hypervisor" and
-		 * "list_setting" take trailing arguments.
+		 * Of the remaining subcommands, only "list_setting" takes
+		 * trailing arguments.
 		 */
 		bam_error(_("invalid trailing arguments\n"));
 		usage();
@@ -1431,8 +1427,7 @@
 	if (strcmp(subcmd, "set_option") == 0) {
 		assert(largc == 1 && largv[0] && largv[1] == NULL);
 		opt = largv[0];
-	} else if ((strcmp(subcmd, "enable_hypervisor") != 0) &&
-	    (strcmp(subcmd, "list_setting") != 0)) {
+	} else if (strcmp(subcmd, "list_setting") != 0) {
 		assert(largc == 0 && largv == NULL);
 	}
 
@@ -1455,60 +1450,6 @@
 	} else if (strcmp(subcmd, "list_setting") == 0) {
 		ret = f(menu, ((largc > 0) ? largv[0] : ""),
 		    ((largc > 1) ? largv[1] : ""));
-	} else if (strcmp(subcmd, "disable_hypervisor") == 0) {
-		if (is_sparc()) {
-			bam_error(_("%s operation unsupported on SPARC "
-			    "machines\n"), subcmd);
-			ret = BAM_ERROR;
-		} else {
-			ret = f(menu, bam_root, NULL);
-		}
-	} else if (strcmp(subcmd, "enable_hypervisor") == 0) {
-		if (is_sparc()) {
-			bam_error(_("%s operation unsupported on SPARC "
-			    "machines\n"), subcmd);
-			ret = BAM_ERROR;
-		} else {
-			char *extra_args = NULL;
-
-			/*
-			 * Compress all arguments passed in the largv[] array
-			 * into one string that can then be appended to the
-			 * end of the kernel$ string the routine to enable the
-			 * hypervisor will build.
-			 *
-			 * This allows the caller to supply arbitrary unparsed
-			 * arguments, such as dom0 memory settings or APIC
-			 * options.
-			 *
-			 * This concatenation will be done without ANY syntax
-			 * checking whatsoever, so it's the responsibility of
-			 * the caller to make sure the arguments are valid and
-			 * do not duplicate arguments the conversion routines
-			 * may create.
-			 */
-			if (largc > 0) {
-				int extra_len, i;
-
-				for (extra_len = 0, i = 0; i < largc; i++)
-					extra_len += strlen(largv[i]);
-
-				/*
-				 * Allocate space for argument strings,
-				 * intervening spaces and terminating NULL.
-				 */
-				extra_args = alloca(extra_len + largc);
-
-				(void) strcpy(extra_args, largv[0]);
-
-				for (i = 1; i < largc; i++) {
-					(void) strcat(extra_args, " ");
-					(void) strcat(extra_args, largv[i]);
-				}
-			}
-
-			ret = f(menu, bam_root, extra_args);
-		}
 	} else
 		ret = f(menu, NULL, opt);
 
@@ -4629,9 +4570,6 @@
 		BAM_DPRINTF(("%s: setting MULTIBOOT|MULTIBOOT_FAILSAFE "
 		    "flag: %s\n", fcn, arg));
 		entry->flags |= BAM_ENTRY_MULTIBOOT | BAM_ENTRY_FAILSAFE;
-	} else if (strstr(arg, XEN_KERNEL_SUBSTR)) {
-		BAM_DPRINTF(("%s: setting XEN HV flag: %s\n", fcn, arg));
-		entry->flags |= BAM_ENTRY_HV;
 	} else if (!(entry->flags & (BAM_ENTRY_BOOTADM|BAM_ENTRY_LU))) {
 		BAM_DPRINTF(("%s: is HAND kernel flag: %s\n", fcn, arg));
 		return (BAM_ERROR);
@@ -4672,9 +4610,7 @@
 	    strcmp(arg, MULTIBOOT_ARCHIVE) == 0 ||
 	    strcmp(arg, FAILSAFE_ARCHIVE) == 0 ||
 	    strcmp(arg, FAILSAFE_ARCHIVE_32) == 0 ||
-	    strcmp(arg, FAILSAFE_ARCHIVE_64) == 0 ||
-	    strcmp(arg, XEN_KERNEL_MODULE_LINE) == 0 ||
-	    strcmp(arg, XEN_KERNEL_MODULE_LINE_ZFS) == 0) {
+	    strcmp(arg, FAILSAFE_ARCHIVE_64) == 0) {
 		BAM_DPRINTF(("%s: bootadm or LU module cmd: %s\n", fcn, arg));
 		return (BAM_SUCCESS);
 	} else if (!(entry->flags & BAM_ENTRY_BOOTADM) &&
@@ -8253,13 +8189,9 @@
 		/*
 		 * Check for matching module entry (failsafe or normal).
 		 * If it fails to match, we go around the loop again.
-		 * For xpv entries, there are two module lines, so we
-		 * do the check twice.
 		 */
 		lp = lp->next;	/* advance to module line */
-		if (check_cmd(lp->cmd, MODULE_CMD, lp->arg, module) ||
-		    (((lp = lp->next) != NULL) &&
-		    check_cmd(lp->cmd, MODULE_CMD, lp->arg, module))) {
+		if (check_cmd(lp->cmd, MODULE_CMD, lp->arg, module)) {
 			/* match found */
 			BAM_DPRINTF(("%s: module match: %s, %s\n", fcn,
 			    module, lp->arg));
@@ -8588,20 +8520,10 @@
 		    root_optional(osroot, menu_root));
 		BAM_DPRINTF(("%s: updated boot entry bam_zfs=%d, "
 		    "grubsign = %s\n", fcn, bam_zfs, grubsign));
-		if ((entry != BAM_ERROR) && (bam_is_hv == BAM_HV_PRESENT)) {
-			(void) update_boot_entry(mp, NEW_HV_ENTRY, grubsign,
-			    grubroot, XEN_MENU, bam_zfs ?
-			    XEN_KERNEL_MODULE_LINE_ZFS : XEN_KERNEL_MODULE_LINE,
-			    DIRECT_BOOT_ARCHIVE,
-			    root_optional(osroot, menu_root));
-			BAM_DPRINTF(("%s: updated HV entry bam_zfs=%d, "
-			    "grubsign = %s\n", fcn, bam_zfs, grubsign));
-		}
 	} else {
 		entry = update_boot_entry(mp, title, grubsign, grubroot,
 		    MULTI_BOOT, NULL, MULTIBOOT_ARCHIVE,
 		    root_optional(osroot, menu_root));
-
 		BAM_DPRINTF(("%s: updated MULTIBOOT entry grubsign = %s\n",
 		    fcn, grubsign));
 	}
