From a2ad4f71086661cc760fc31373d4c3e2514a4d36 Mon Sep 17 00:00:00 2001 From: mlarkin Date: Thu, 6 Jul 2017 06:19:15 +0000 Subject: [PATCH] vmd: increase the max number of disks from 2 to 4. Requires kernel rebuild as a struct passed to vmm has changed size. ok deraadt, pd --- sys/arch/amd64/include/vmmvar.h | 4 ++-- sys/arch/i386/include/vmmvar.h | 4 ++-- usr.sbin/vmd/pci.c | 5 +++-- usr.sbin/vmd/pci.h | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/sys/arch/amd64/include/vmmvar.h b/sys/arch/amd64/include/vmmvar.h index db758e9d02c..add9f9a7dbe 100644 --- a/sys/arch/amd64/include/vmmvar.h +++ b/sys/arch/amd64/include/vmmvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmmvar.h,v 1.41 2017/05/30 20:31:24 mlarkin Exp $ */ +/* $OpenBSD: vmmvar.h,v 1.42 2017/07/06 06:19:15 mlarkin Exp $ */ /* * Copyright (c) 2014 Mike Larkin * @@ -24,7 +24,7 @@ #define VMM_HV_SIGNATURE "OpenBSDVMM58" #define VMM_MAX_MEM_RANGES 16 -#define VMM_MAX_DISKS_PER_VM 2 +#define VMM_MAX_DISKS_PER_VM 4 #define VMM_MAX_PATH_DISK 128 #define VMM_MAX_NAME_LEN 32 #define VMM_MAX_KERNEL_PATH 128 diff --git a/sys/arch/i386/include/vmmvar.h b/sys/arch/i386/include/vmmvar.h index 7e62b319c71..351d896230a 100644 --- a/sys/arch/i386/include/vmmvar.h +++ b/sys/arch/i386/include/vmmvar.h @@ -23,13 +23,13 @@ #define VMM_HV_SIGNATURE "OpenBSDVMM58" #define VMM_MAX_MEM_RANGES 16 -#define VMM_MAX_DISKS_PER_VM 2 +#define VMM_MAX_DISKS_PER_VM 4 #define VMM_MAX_PATH_DISK 128 #define VMM_MAX_NAME_LEN 32 #define VMM_MAX_KERNEL_PATH 128 #define VMM_MAX_VCPUS_PER_VM 64 #define VMM_MAX_VM_MEM_SIZE 2048 -#define VMM_MAX_NICS_PER_VM 2 +#define VMM_MAX_NICS_PER_VM 4 #define VMM_PCI_MMIO_BAR_BASE 0xF0000000 #define VMM_PCI_MMIO_BAR_END 0xF0FFFFFF diff --git a/usr.sbin/vmd/pci.c b/usr.sbin/vmd/pci.c index 41f5878cc8b..ffcab0df158 100644 --- a/usr.sbin/vmd/pci.c +++ b/usr.sbin/vmd/pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci.c,v 1.17 2017/04/21 04:18:47 mlarkin Exp $ */ +/* $OpenBSD: pci.c,v 1.18 2017/07/06 06:19:15 mlarkin Exp $ */ /* * Copyright (c) 2015 Mike Larkin @@ -33,7 +33,8 @@ struct pci pci; extern char *__progname; /* PIC IRQs, assigned to devices in order */ -const uint8_t pci_pic_irqs[PCI_MAX_PIC_IRQS] = {3, 5, 7, 9, 10, 11, 14, 15}; +const uint8_t pci_pic_irqs[PCI_MAX_PIC_IRQS] = {3, 5, 6, 7, 9, 10, 11, 12, + 14, 15}; /* * pci_add_bar diff --git a/usr.sbin/vmd/pci.h b/usr.sbin/vmd/pci.h index 360b5012942..3c4afd46ec5 100644 --- a/usr.sbin/vmd/pci.h +++ b/usr.sbin/vmd/pci.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci.h,v 1.5 2017/03/25 15:47:37 mlarkin Exp $ */ +/* $OpenBSD: pci.h,v 1.6 2017/07/06 06:19:15 mlarkin Exp $ */ /* * Copyright (c) 2015 Mike Larkin @@ -25,7 +25,7 @@ #define PCI_BAR_TYPE_IO 0x0 #define PCI_BAR_TYPE_MMIO 0x1 -#define PCI_MAX_PIC_IRQS 8 +#define PCI_MAX_PIC_IRQS 10 typedef int (*pci_cs_fn_t)(int dir, uint8_t reg, uint32_t *data); typedef int (*pci_iobar_fn_t)(int dir, uint16_t reg, uint32_t *data, uint8_t *, -- 2.20.1