Date: Wed, 9 Oct 2013 07:55:21 +0000 (UTC) From: Mark Murray <markm@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r256180 - in projects/random_number_generator: . lib/libvmmapi share/examples/bhyve sys/amd64/amd64 sys/cam/ctl sys/conf sys/dev/nvme sys/mips/atheros sys/mips/conf sys/mips/include sys... Message-ID: <201310090755.r997tLxH009963@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markm Date: Wed Oct 9 07:55:21 2013 New Revision: 256180 URL: http://svnweb.freebsd.org/changeset/base/256180 Log: MFC - tracking commit Modified: projects/random_number_generator/UPDATING projects/random_number_generator/lib/libvmmapi/vmmapi.c projects/random_number_generator/lib/libvmmapi/vmmapi.h projects/random_number_generator/share/examples/bhyve/vmrun.sh projects/random_number_generator/sys/amd64/amd64/pmap.c projects/random_number_generator/sys/cam/ctl/ctl_frontend_iscsi.c projects/random_number_generator/sys/conf/options.mips projects/random_number_generator/sys/dev/nvme/nvme_ns.c projects/random_number_generator/sys/mips/atheros/apb.c projects/random_number_generator/sys/mips/atheros/ar71xxreg.h projects/random_number_generator/sys/mips/atheros/ar934xreg.h projects/random_number_generator/sys/mips/conf/AR934X_BASE projects/random_number_generator/sys/mips/include/asm.h projects/random_number_generator/sys/mips/include/cpuregs.h projects/random_number_generator/sys/mips/mips/elf_trampoline.c projects/random_number_generator/sys/ofed/drivers/infiniband/core/ucm.c projects/random_number_generator/usr.sbin/bhyve/Makefile projects/random_number_generator/usr.sbin/bhyve/bhyverun.c projects/random_number_generator/usr.sbin/bhyve/pci_ahci.c projects/random_number_generator/usr.sbin/bhyvectl/Makefile projects/random_number_generator/usr.sbin/bhyveload/Makefile projects/random_number_generator/usr.sbin/bhyveload/bhyveload.8 projects/random_number_generator/usr.sbin/bhyveload/bhyveload.c Directory Properties: projects/random_number_generator/ (props changed) projects/random_number_generator/lib/libvmmapi/ (props changed) projects/random_number_generator/sys/ (props changed) projects/random_number_generator/sys/conf/ (props changed) projects/random_number_generator/usr.sbin/bhyve/ (props changed) projects/random_number_generator/usr.sbin/bhyvectl/ (props changed) projects/random_number_generator/usr.sbin/bhyveload/ (props changed) Modified: projects/random_number_generator/UPDATING ============================================================================== --- projects/random_number_generator/UPDATING Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/UPDATING Wed Oct 9 07:55:21 2013 (r256180) @@ -77,19 +77,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 has been updated to use this support. A new gcc is required to build the aesni module on both i386 and amd64. -20130827: - Thomas Dickey (vendor author thereof) reports that dialog(1) since - 2011/10/18 has a bug in handling --hline. Testers and I noticed the - --hline is not ignored but displayed as a NULL string, regardless of - value. This will cause confusion in some bsdconfig dialogs where the - --hline is used to inform users which keybindings to use. This will - likewise affect any other persons relying on --hline. It also looks - rather strange seeing "[]" at the bottom of dialog(1) widgets when - passing --hline "anything". Thomas said he will have a look in a few - weeks. NOTE: The "[]" brackets appear with the left-edge where it - would normally appear given the width of text to display, but the - displayed text is not there (part of the bug). - 20130821: The PADLOCK_RNG and RDRAND_RNG kernel options are now devices. Thus "device padlock_rng" and "device rdrand_rng" should be Modified: projects/random_number_generator/lib/libvmmapi/vmmapi.c ============================================================================== --- projects/random_number_generator/lib/libvmmapi/vmmapi.c Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/lib/libvmmapi/vmmapi.c Wed Oct 9 07:55:21 2013 (r256180) @@ -43,11 +43,14 @@ __FBSDID("$FreeBSD$"); #include <fcntl.h> #include <unistd.h> +#include <libutil.h> + #include <machine/vmm.h> #include <machine/vmm_dev.h> #include "vmmapi.h" +#define MB (1024 * 1024UL) #define GB (1024 * 1024 * 1024UL) struct vmctx { @@ -124,6 +127,30 @@ vm_destroy(struct vmctx *vm) } int +vm_parse_memsize(const char *optarg, size_t *ret_memsize) +{ + char *endptr; + size_t optval; + int error; + + optval = strtoul(optarg, &endptr, 0); + if (*optarg != '\0' && *endptr == '\0') { + /* + * For the sake of backward compatibility if the memory size + * specified on the command line is less than a megabyte then + * it is interpreted as being in units of MB. + */ + if (optval < MB) + optval *= MB; + *ret_memsize = optval; + error = 0; + } else + error = expand_number(optarg, ret_memsize); + + return (error); +} + +int vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len, int *wired) { Modified: projects/random_number_generator/lib/libvmmapi/vmmapi.h ============================================================================== --- projects/random_number_generator/lib/libvmmapi/vmmapi.h Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/lib/libvmmapi/vmmapi.h Wed Oct 9 07:55:21 2013 (r256180) @@ -45,6 +45,7 @@ enum vm_mmap_style { int vm_create(const char *name); struct vmctx *vm_open(const char *name); void vm_destroy(struct vmctx *ctx); +int vm_parse_memsize(const char *optarg, size_t *memsize); int vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len, int *wired); int vm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s); Modified: projects/random_number_generator/share/examples/bhyve/vmrun.sh ============================================================================== --- projects/random_number_generator/share/examples/bhyve/vmrun.sh Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/share/examples/bhyve/vmrun.sh Wed Oct 9 07:55:21 2013 (r256180) @@ -31,7 +31,7 @@ LOADER=/usr/sbin/bhyveload BHYVECTL=/usr/sbin/bhyvectl FBSDRUN=/usr/sbin/bhyve -DEFAULT_MEMSIZE=512 +DEFAULT_MEMSIZE=512M DEFAULT_CPUS=2 DEFAULT_TAPDEV=tap0 @@ -47,7 +47,7 @@ usage() { echo " -g: listen for connection from kgdb at <gdbport>" echo " -i: force boot of the Installation CDROM image" echo " -I: Installation CDROM image location (default is ${DEFAULT_ISOFILE})" - echo " -m: memory size in MB (default is ${DEFAULT_MEMSIZE}MB)" + echo " -m: memory size (default is ${DEFAULT_MEMSIZE})" echo " -t: tap device for virtio-net (default is $DEFAULT_TAPDEV)" echo "" echo " This script needs to be executed with superuser privileges" Modified: projects/random_number_generator/sys/amd64/amd64/pmap.c ============================================================================== --- projects/random_number_generator/sys/amd64/amd64/pmap.c Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/sys/amd64/amd64/pmap.c Wed Oct 9 07:55:21 2013 (r256180) @@ -2705,6 +2705,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, str KASSERT(lockp != NULL, ("reclaim_pv_chunk: lockp is NULL")); pmap = NULL; m_pc = NULL; + PG_G = PG_A = PG_M = PG_RW = 0; SLIST_INIT(&free); TAILQ_INIT(&new_tail); mtx_lock(&pv_chunks_mutex); Modified: projects/random_number_generator/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- projects/random_number_generator/sys/cam/ctl/ctl_frontend_iscsi.c Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/sys/cam/ctl/ctl_frontend_iscsi.c Wed Oct 9 07:55:21 2013 (r256180) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include <cam/ctl/ctl_io.h> #include <cam/ctl/ctl.h> #include <cam/ctl/ctl_backend.h> +#include <cam/ctl/ctl_error.h> #include <cam/ctl/ctl_frontend.h> #include <cam/ctl/ctl_frontend_internal.h> #include <cam/ctl/ctl_debug.h> @@ -2301,7 +2302,8 @@ cfiscsi_datamove_in(union ctl_io *io) if (response == NULL) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); - icl_pdu_free(request); + ctl_set_busy(&io->scsiio); + io->scsiio.be_move_done(io); cfiscsi_session_terminate(cs); return; } @@ -2330,8 +2332,9 @@ cfiscsi_datamove_in(union ctl_io *io) if (error != 0) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); - icl_pdu_free(request); icl_pdu_free(response); + ctl_set_busy(&io->scsiio); + io->scsiio.be_move_done(io); cfiscsi_session_terminate(cs); return; } @@ -2428,8 +2431,10 @@ cfiscsi_datamove_out(union ctl_io *io) if (cdw == NULL) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); - icl_pdu_free(request); + ctl_set_busy(&io->scsiio); + io->scsiio.be_move_done(io); cfiscsi_session_terminate(cs); + return; } cdw->cdw_ctl_io = io; cdw->cdw_target_transfer_tag = htonl(target_transfer_tag); @@ -2462,8 +2467,10 @@ cfiscsi_datamove_out(union ctl_io *io) if (response == NULL) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); - icl_pdu_free(request); + ctl_set_busy(&io->scsiio); + io->scsiio.be_move_done(io); cfiscsi_session_terminate(cs); + return; } bhsr2t = (struct iscsi_bhs_r2t *)response->ip_bhs; bhsr2t->bhsr2t_opcode = ISCSI_BHS_OPCODE_R2T; Modified: projects/random_number_generator/sys/conf/options.mips ============================================================================== --- projects/random_number_generator/sys/conf/options.mips Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/sys/conf/options.mips Wed Oct 9 07:55:21 2013 (r256180) @@ -29,6 +29,8 @@ # $FreeBSD$ CPU_MIPS4KC opt_global.h +CPU_MIPS24KC opt_global.h +CPU_MIPS74KC opt_global.h CPU_MIPS32 opt_global.h CPU_MIPS64 opt_global.h CPU_SENTRY5 opt_global.h Modified: projects/random_number_generator/sys/dev/nvme/nvme_ns.c ============================================================================== --- projects/random_number_generator/sys/dev/nvme/nvme_ns.c Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/sys/dev/nvme/nvme_ns.c Wed Oct 9 07:55:21 2013 (r256180) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/module.h> #include <sys/proc.h> +#include <sys/systm.h> #include <dev/pci/pcivar.h> Modified: projects/random_number_generator/sys/mips/atheros/apb.c ============================================================================== --- projects/random_number_generator/sys/mips/atheros/apb.c Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/sys/mips/atheros/apb.c Wed Oct 9 07:55:21 2013 (r256180) @@ -359,6 +359,9 @@ apb_filter(void *arg) case AR71XX_SOC_AR7242: case AR71XX_SOC_AR9330: case AR71XX_SOC_AR9331: + case AR71XX_SOC_AR9341: + case AR71XX_SOC_AR9342: + case AR71XX_SOC_AR9344: /* Ack/clear the irq on status register for AR724x */ ATH_WRITE_REG(AR71XX_MISC_INTR_STATUS, reg & ~(1 << irq)); Modified: projects/random_number_generator/sys/mips/atheros/ar71xxreg.h ============================================================================== --- projects/random_number_generator/sys/mips/atheros/ar71xxreg.h Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/sys/mips/atheros/ar71xxreg.h Wed Oct 9 07:55:21 2013 (r256180) @@ -336,6 +336,7 @@ typedef enum { #define MAC_MII_CFG_SCAN_AUTO_INC (1 << 5) #define MAC_MII_CFG_PREAMBLE_SUP (1 << 4) #define MAC_MII_CFG_CLOCK_SELECT_MASK 0x7 +#define MAC_MII_CFG_CLOCK_SELECT_MASK_AR933X 0xf #define MAC_MII_CFG_CLOCK_DIV_4 0 #define MAC_MII_CFG_CLOCK_DIV_6 2 #define MAC_MII_CFG_CLOCK_DIV_8 3 @@ -343,6 +344,17 @@ typedef enum { #define MAC_MII_CFG_CLOCK_DIV_14 5 #define MAC_MII_CFG_CLOCK_DIV_20 6 #define MAC_MII_CFG_CLOCK_DIV_28 7 + +/* .. and the AR933x/AR934x extensions */ +#define MAC_MII_CFG_CLOCK_DIV_34 8 +#define MAC_MII_CFG_CLOCK_DIV_42 9 +#define MAC_MII_CFG_CLOCK_DIV_50 10 +#define MAC_MII_CFG_CLOCK_DIV_58 11 +#define MAC_MII_CFG_CLOCK_DIV_66 12 +#define MAC_MII_CFG_CLOCK_DIV_74 13 +#define MAC_MII_CFG_CLOCK_DIV_82 14 +#define MAC_MII_CFG_CLOCK_DIV_98 15 + #define AR71XX_MAC_MII_CMD 0x24 #define MAC_MII_CMD_SCAN_CYCLE (1 << 1) #define MAC_MII_CMD_READ 1 Modified: projects/random_number_generator/sys/mips/atheros/ar934xreg.h ============================================================================== --- projects/random_number_generator/sys/mips/atheros/ar934xreg.h Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/sys/mips/atheros/ar934xreg.h Wed Oct 9 07:55:21 2013 (r256180) @@ -29,6 +29,8 @@ #ifndef __AR934X_REG_H__ #define __AR934X_REG_H__ +#define AR934X_GMAC_BASE (AR71XX_APB_BASE + 0x00070000) +#define AR934X_GMAC_SIZE 0x14 #define AR934X_WMAC_BASE (AR71XX_APB_BASE + 0x00100000) #define AR934X_WMAC_SIZE 0x20000 #define AR934X_EHCI_BASE 0x1b000000 @@ -36,6 +38,23 @@ #define AR934X_SRIF_BASE (AR71XX_APB_BASE + 0x00116000) #define AR934X_SRIF_SIZE 0x1000 +/* AR934x GMAC configuration */ +#define AR934X_GMAC_REG_ETH_CFG (AR934X_GMAC_BASE + 0x00) + +#define AR934X_ETH_CFG_RGMII_GMAC0 (1 << 0) +#define AR934X_ETH_CFG_MII_GMAC0 (1 << 1) +#define AR934X_ETH_CFG_GMII_GMAC0 (1 << 2) +#define AR934X_ETH_CFG_MII_GMAC0_MASTER (1 << 3) +#define AR934X_ETH_CFG_MII_GMAC0_SLAVE (1 << 4) +#define AR934X_ETH_CFG_MII_GMAC0_ERR_EN (1 << 5) +#define AR934X_ETH_CFG_SW_ONLY_MODE (1 << 6) +#define AR934X_ETH_CFG_SW_PHY_SWAP (1 << 7) +#define AR934X_ETH_CFG_SW_APB_ACCESS (1 << 9) +#define AR934X_ETH_CFG_RMII_GMAC0 (1 << 10) +#define AR933X_ETH_CFG_MII_CNTL_SPEED (1 << 11) +#define AR934X_ETH_CFG_RMII_GMAC0_MASTER (1 << 12) +#define AR934X_ETH_CFG_SW_ACC_MSB_FIRST (1 << 13) + #define AR934X_DDR_REG_FLUSH_GE0 (AR71XX_APB_BASE + 0x9c) #define AR934X_DDR_REG_FLUSH_GE1 (AR71XX_APB_BASE + 0xa0) #define AR934X_DDR_REG_FLUSH_USB (AR71XX_APB_BASE + 0xa4) @@ -45,6 +64,9 @@ #define AR934X_PLL_CPU_CONFIG_REG (AR71XX_PLL_CPU_BASE + 0x00) #define AR934X_PLL_DDR_CONFIG_REG (AR71XX_PLL_CPU_BASE + 0x04) #define AR934X_PLL_CPU_DDR_CLK_CTRL_REG (AR71XX_PLL_CPU_BASE + 0x08) +#define AR934X_PLL_SWITCH_CLOCK_CONTROL_REG (AR71XX_PLL_CPU_BASE + 0x24) +#define AR934X_PLL_SWITCH_CLOCK_CONTROL_MDIO_CLK_SEL (1 << 6) +#define AR934X_PLL_ETH_XMII_CONTROL_REG (AR71XX_PLL_CPU_BASE + 0x2c) #define AR934X_PLL_CPU_CONFIG_NFRAC_SHIFT 0 #define AR934X_PLL_CPU_CONFIG_NFRAC_MASK 0x3f @@ -81,7 +103,13 @@ #define AR934X_RESET_REG_BOOTSTRAP (AR71XX_RST_BLOCK_BASE + 0xb0) #define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS (AR71XX_RST_BLOCK_BASE + 0xac) +#define AR934X_RESET_GE1_MDIO (1 << 23) +#define AR934X_RESET_GE0_MDIO (1 << 22) +#define AR934X_RESET_GE1_MAC (1 << 13) +#define AR934X_RESET_ETH_SWITCH_ANALOG (1 << 12) #define AR934X_RESET_USB_PHY_ANALOG (1 << 11) +#define AR934X_RESET_GE0_MAC (1 << 9) +#define AR934X_RESET_ETH_SWITCH (1 << 8) #define AR934X_RESET_USB_HOST (1 << 5) #define AR934X_RESET_USB_PHY (1 << 4) #define AR934X_RESET_USBSUS_OVERRIDE (1 << 3) @@ -153,4 +181,9 @@ #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13 #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7 +/* XXX verify! */ +#define AR934X_PLL_VAL_1000 0x16000000 +#define AR934X_PLL_VAL_100 0x00000101 +#define AR934X_PLL_VAL_10 0x00001616 + #endif /* __AR934X_REG_H__ */ Modified: projects/random_number_generator/sys/mips/conf/AR934X_BASE ============================================================================== --- projects/random_number_generator/sys/mips/conf/AR934X_BASE Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/sys/mips/conf/AR934X_BASE Wed Oct 9 07:55:21 2013 (r256180) @@ -12,7 +12,7 @@ machine mips mips ident AR934X_BASE -cpu CPU_MIPS4KC +cpu CPU_MIPS74KC makeoptions KERNLOADADDR=0x80050000 options HZ=1000 Modified: projects/random_number_generator/sys/mips/include/asm.h ============================================================================== --- projects/random_number_generator/sys/mips/include/asm.h Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/sys/mips/include/asm.h Wed Oct 9 07:55:21 2013 (r256180) @@ -725,9 +725,12 @@ _C_LABEL(x): #elif defined(CPU_RMI) #define HAZARD_DELAY #define ITLBNOPFIX +#elif defined(CPU_MIPS74KC) +#define HAZARD_DELAY sll $0,$0,3 +#define ITLBNOPFIX sll $0,$0,3 #else -#define ITLBNOPFIX nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; -#define HAZARD_DELAY nop;nop;nop;nop;nop; +#define ITLBNOPFIX nop;nop;nop;nop;nop;nop;nop;nop;nop;sll $0,$0,3; +#define HAZARD_DELAY nop;nop;nop;nop;sll $0,$0,3; #endif #endif /* !_MACHINE_ASM_H_ */ Modified: projects/random_number_generator/sys/mips/include/cpuregs.h ============================================================================== --- projects/random_number_generator/sys/mips/include/cpuregs.h Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/sys/mips/include/cpuregs.h Wed Oct 9 07:55:21 2013 (r256180) @@ -149,6 +149,11 @@ #define MIPS_CCA_CC 0x05 /* Cacheable Coherent. */ #endif +#if defined(CPU_MIPS74KC) +#define MIPS_CCA_UNCACHED 0x02 +#define MIPS_CCA_CACHED 0x00 +#endif + #ifndef MIPS_CCA_UNCACHED #define MIPS_CCA_UNCACHED MIPS_CCA_UC #endif @@ -204,12 +209,14 @@ #define COP0_SYNC .word 0xc0 /* ehb */ #elif defined(CPU_SB1) #define COP0_SYNC ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop +#elif defined(CPU_MIPS74KC) +#define COP0_SYNC .word 0xc0 /* ehb */ #else /* * Pick a reasonable default based on the "typical" spacing described in the * "CP0 Hazards" chapter of MIPS Architecture Book Vol III. */ -#define COP0_SYNC ssnop; ssnop; ssnop; ssnop; ssnop +#define COP0_SYNC ssnop; ssnop; ssnop; ssnop; .word 0xc0; #endif #define COP0_HAZARD_FPUENABLE nop; nop; nop; nop; Modified: projects/random_number_generator/sys/mips/mips/elf_trampoline.c ============================================================================== --- projects/random_number_generator/sys/mips/mips/elf_trampoline.c Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/sys/mips/mips/elf_trampoline.c Wed Oct 9 07:55:21 2013 (r256180) @@ -32,10 +32,6 @@ __FBSDID("$FreeBSD$"); #else #include <sys/elf32.h> #endif -#include <sys/inflate.h> -#include <machine/elf.h> -#include <machine/cpufunc.h> -#include <machine/stdarg.h> /* * Since we are compiled outside of the normal kernel build process, we @@ -43,6 +39,11 @@ __FBSDID("$FreeBSD$"); */ #include "opt_global.h" +#include <sys/inflate.h> +#include <machine/elf.h> +#include <machine/cpufunc.h> +#include <machine/stdarg.h> + #ifndef KERNNAME #error Kernel name not provided #endif Modified: projects/random_number_generator/sys/ofed/drivers/infiniband/core/ucm.c ============================================================================== --- projects/random_number_generator/sys/ofed/drivers/infiniband/core/ucm.c Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/sys/ofed/drivers/infiniband/core/ucm.c Wed Oct 9 07:55:21 2013 (r256180) @@ -104,9 +104,6 @@ enum { IB_UCM_MAX_DEVICES = 32 }; -/* ib_cm and ib_user_cm modules share /sys/class/infiniband_cm */ -extern struct class cm_class; - #define IB_UCM_BASE_DEV MKDEV(IB_UCM_MAJOR, IB_UCM_BASE_MINOR) static void ib_ucm_add_one(struct ib_device *device); Modified: projects/random_number_generator/usr.sbin/bhyve/Makefile ============================================================================== --- projects/random_number_generator/usr.sbin/bhyve/Makefile Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/usr.sbin/bhyve/Makefile Wed Oct 9 07:55:21 2013 (r256180) @@ -17,8 +17,8 @@ SRCS+= vmm_instruction_emul.c NO_MAN= -DPADD= ${LIBVMMAPI} ${LIBMD} ${LIBPTHREAD} -LDADD= -lvmmapi -lmd -lpthread +DPADD= ${LIBVMMAPI} ${LIBMD} ${LIBUTIL} ${LIBPTHREAD} +LDADD= -lvmmapi -lmd -lutil -lpthread WARNS?= 2 Modified: projects/random_number_generator/usr.sbin/bhyve/bhyverun.c ============================================================================== --- projects/random_number_generator/usr.sbin/bhyve/bhyverun.c Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/usr.sbin/bhyve/bhyverun.c Wed Oct 9 07:55:21 2013 (r256180) @@ -37,12 +37,14 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> #include <stdlib.h> +#include <err.h> #include <libgen.h> #include <unistd.h> #include <assert.h> #include <errno.h> #include <pthread.h> #include <pthread_np.h> +#include <sysexits.h> #include <machine/vmm.h> #include <vmmapi.h> @@ -529,7 +531,9 @@ main(int argc, char *argv[]) else break; case 'm': - memsize = strtoul(optarg, NULL, 0) * MB; + error = vm_parse_memsize(optarg, &memsize); + if (error) + errx(EX_USAGE, "invalid memsize '%s'", optarg); break; case 'H': guest_vmexit_on_hlt = 1; Modified: projects/random_number_generator/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- projects/random_number_generator/usr.sbin/bhyve/pci_ahci.c Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/usr.sbin/bhyve/pci_ahci.c Wed Oct 9 07:55:21 2013 (r256180) @@ -119,8 +119,8 @@ struct ahci_ioreq { struct ahci_port { struct blockif_ctxt *bctx; struct pci_ahci_softc *pr_sc; - uint64_t cmd_lst; - uint64_t rfis; + uint8_t *cmd_lst; + uint8_t *rfis; int atapi; int reset; int mult_sectors; @@ -222,7 +222,7 @@ ahci_write_fis(struct ahci_port *p, enum { int offset, len, irq; - if (p->rfis == 0 || !(p->cmd & AHCI_P_CMD_FRE)) + if (p->rfis == NULL || !(p->cmd & AHCI_P_CMD_FRE)) return; switch (ft) { @@ -396,7 +396,7 @@ ahci_handle_dma(struct ahci_port *p, int sc = p->pr_sc; prdt = (struct ahci_prdt_entry *)(cfis + 0x80); - hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); ncq = 0; readop = 1; @@ -508,7 +508,7 @@ write_prdt(struct ahci_port *p, int slot void *from; int i, len; - hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); len = size; from = buf; prdt = (struct ahci_prdt_entry *)(cfis + 0x80); @@ -528,7 +528,7 @@ handle_identify(struct ahci_port *p, int { struct ahci_cmd_hdr *hdr; - hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); if (p->atapi || hdr->prdtl == 0) { p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; p->is |= AHCI_P_IX_TFE; @@ -869,7 +869,7 @@ atapi_read(struct ahci_port *p, int slot sc = p->pr_sc; acmd = cfis + 0x40; - hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); prdt = (struct ahci_prdt_entry *)(cfis + 0x80); prdt += seek; @@ -1178,7 +1178,7 @@ ahci_handle_cmd(struct ahci_port *p, int } case ATA_SET_MULTI: if (cfis[12] != 0 && - (cfis[12] > 128 || (cfis[12] & cfis[12] - 1))) { + (cfis[12] > 128 || (cfis[12] & (cfis[12] - 1)))) { p->tfd = ATA_S_ERROR | ATA_S_READY; p->tfd |= (ATA_ERROR_ABORT << 8); } else { @@ -1241,7 +1241,7 @@ ahci_handle_slot(struct ahci_port *p, in int cfl; sc = p->pr_sc; - hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); cfl = (hdr->flags & 0x1f) * 4; cfis = paddr_guest2host(ahci_ctx(sc), hdr->ctba, 0x80 + hdr->prdtl * sizeof(struct ahci_prdt_entry)); @@ -1318,7 +1318,7 @@ ata_ioreq_cb(struct blockif_req *br, int slot = aior->slot; pending = aior->prdtl; sc = p->pr_sc; - hdr = p->cmd_lst + slot * AHCI_CL_SIZE; + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE); if (cfis[2] == ATA_WRITE_FPDMA_QUEUED || cfis[2] == ATA_READ_FPDMA_QUEUED) @@ -1380,7 +1380,7 @@ atapi_ioreq_cb(struct blockif_req *br, i slot = aior->slot; pending = aior->prdtl; sc = p->pr_sc; - hdr = p->cmd_lst + aior->slot * AHCI_CL_SIZE; + hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + aior->slot * AHCI_CL_SIZE); pthread_mutex_lock(&sc->mtx); Modified: projects/random_number_generator/usr.sbin/bhyvectl/Makefile ============================================================================== --- projects/random_number_generator/usr.sbin/bhyvectl/Makefile Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/usr.sbin/bhyvectl/Makefile Wed Oct 9 07:55:21 2013 (r256180) @@ -7,8 +7,8 @@ SRCS= bhyvectl.c NO_MAN= -DPADD= ${LIBVMMAPI} -LDADD= -lvmmapi +DPADD= ${LIBVMMAPI} ${LIBUTIL} +LDADD= -lvmmapi -lutil WARNS?= 3 Modified: projects/random_number_generator/usr.sbin/bhyveload/Makefile ============================================================================== --- projects/random_number_generator/usr.sbin/bhyveload/Makefile Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/usr.sbin/bhyveload/Makefile Wed Oct 9 07:55:21 2013 (r256180) @@ -4,8 +4,8 @@ PROG= bhyveload SRCS= bhyveload.c MAN= bhyveload.8 -DPADD+= ${LIBVMMAPI} -LDADD+= -lvmmapi +DPADD+= ${LIBVMMAPI} ${LIBUTIL} +LDADD+= -lvmmapi -lutil WARNS?= 3 Modified: projects/random_number_generator/usr.sbin/bhyveload/bhyveload.8 ============================================================================== --- projects/random_number_generator/usr.sbin/bhyveload/bhyveload.8 Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/usr.sbin/bhyveload/bhyveload.8 Wed Oct 9 07:55:21 2013 (r256180) @@ -1,4 +1,4 @@ -.\" +\" .\" Copyright (c) 2012 NetApp Inc .\" All rights reserved. .\" @@ -60,13 +60,29 @@ and will be created if it does not alrea .Sh OPTIONS The following options are available: .Bl -tag -width indent -.It Fl m Ar mem-size +.It Fl m Ar mem-size Xo +.Sm off +.Op Cm K | k | M | m | G | g | T | t +.Xc +.Sm on +.Ar mem-size +is the amount of memory allocated to the guest. +.Pp +The .Ar mem-size -is the amount of memory allocated to the guest in units of megabytes. +argument may be suffixed with one of +.Cm K , +.Cm M , +.Cm G +or +.Cm T +(either upper or lower case) to indicate a multiple of +Kilobytes, Megabytes, Gigabytes or Terabytes +respectively. .Pp The default value of .Ar mem-size -is 256. +is 256M. .It Fl d Ar disk-path The .Ar disk-path @@ -83,7 +99,7 @@ that boots off the ISO image .Pa /freebsd/release.iso and has 1GB memory allocated to it: .Pp -.Dl "bhyveload -m 1024 -d /freebsd/release.iso freebsd-vm" +.Dl "bhyveload -m 1G -d /freebsd/release.iso freebsd-vm" .Sh SEE ALSO .Xr bhyve 4 , .Xr bhyve 8 , Modified: projects/random_number_generator/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- projects/random_number_generator/usr.sbin/bhyveload/bhyveload.c Wed Oct 9 07:02:03 2013 (r256179) +++ projects/random_number_generator/usr.sbin/bhyveload/bhyveload.c Wed Oct 9 07:55:21 2013 (r256180) @@ -67,12 +67,14 @@ __FBSDID("$FreeBSD$"); #include <dirent.h> #include <dlfcn.h> #include <errno.h> +#include <err.h> #include <fcntl.h> #include <getopt.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <sysexits.h> #include <termios.h> #include <unistd.h> @@ -581,9 +583,10 @@ main(int argc, char** argv) break; case 'm': - mem_size = strtoul(optarg, NULL, 0) * MB; + error = vm_parse_memsize(optarg, &mem_size); + if (error != 0) + errx(EX_USAGE, "Invalid memsize '%s'", optarg); break; - case '?': usage(); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310090755.r997tLxH009963>