1*63e158a0SMatt Evans /* 2*63e158a0SMatt Evans * PPC64 architecture-specific definitions 3*63e158a0SMatt Evans * 4*63e158a0SMatt Evans * Copyright 2011 Matt Evans <matt@ozlabs.org>, IBM Corporation. 5*63e158a0SMatt Evans * 6*63e158a0SMatt Evans * This program is free software; you can redistribute it and/or modify it 7*63e158a0SMatt Evans * under the terms of the GNU General Public License version 2 as published 8*63e158a0SMatt Evans * by the Free Software Foundation. 9*63e158a0SMatt Evans */ 10*63e158a0SMatt Evans 11*63e158a0SMatt Evans #ifndef KVM__KVM_ARCH_H 12*63e158a0SMatt Evans #define KVM__KVM_ARCH_H 13*63e158a0SMatt Evans 14*63e158a0SMatt Evans #include <stdbool.h> 15*63e158a0SMatt Evans #include <linux/types.h> 16*63e158a0SMatt Evans #include <time.h> 17*63e158a0SMatt Evans 18*63e158a0SMatt Evans #define KVM_NR_CPUS (255) 19*63e158a0SMatt Evans 20*63e158a0SMatt Evans /* 21*63e158a0SMatt Evans * MMIO lives after RAM, but it'd be nice if it didn't constantly move. 22*63e158a0SMatt Evans * Choose a suitably high address, e.g. 63T... This limits RAM size. 23*63e158a0SMatt Evans */ 24*63e158a0SMatt Evans #define PPC_MMIO_START 0x3F0000000000UL 25*63e158a0SMatt Evans #define PPC_MMIO_SIZE 0x010000000000UL 26*63e158a0SMatt Evans 27*63e158a0SMatt Evans #define KERNEL_LOAD_ADDR 0x0000000000000000 28*63e158a0SMatt Evans #define KERNEL_START_ADDR 0x0000000000000000 29*63e158a0SMatt Evans #define KERNEL_SECONDARY_START_ADDR 0x0000000000000060 30*63e158a0SMatt Evans #define INITRD_LOAD_ADDR 0x0000000002800000 31*63e158a0SMatt Evans 32*63e158a0SMatt Evans #define FDT_MAX_SIZE 0x10000 33*63e158a0SMatt Evans #define RTAS_MAX_SIZE 0x10000 34*63e158a0SMatt Evans 35*63e158a0SMatt Evans #define TIMEBASE_FREQ 512000000ULL 36*63e158a0SMatt Evans 37*63e158a0SMatt Evans #define KVM_MMIO_START PPC_MMIO_START 38*63e158a0SMatt Evans 39*63e158a0SMatt Evans /* 40*63e158a0SMatt Evans * This is the address that pci_get_io_space_block() starts allocating 41*63e158a0SMatt Evans * from. Note that this is a PCI bus address. 42*63e158a0SMatt Evans */ 43*63e158a0SMatt Evans #define KVM_PCI_MMIO_AREA 0x1000000 44*63e158a0SMatt Evans 45*63e158a0SMatt Evans struct kvm { 46*63e158a0SMatt Evans int sys_fd; /* For system ioctls(), i.e. /dev/kvm */ 47*63e158a0SMatt Evans int vm_fd; /* For VM ioctls() */ 48*63e158a0SMatt Evans timer_t timerid; /* Posix timer for interrupts */ 49*63e158a0SMatt Evans 50*63e158a0SMatt Evans int nrcpus; /* Number of cpus to run */ 51*63e158a0SMatt Evans 52*63e158a0SMatt Evans u32 mem_slots; /* for KVM_SET_USER_MEMORY_REGION */ 53*63e158a0SMatt Evans 54*63e158a0SMatt Evans u64 ram_size; 55*63e158a0SMatt Evans void *ram_start; 56*63e158a0SMatt Evans 57*63e158a0SMatt Evans bool nmi_disabled; 58*63e158a0SMatt Evans 59*63e158a0SMatt Evans bool single_step; 60*63e158a0SMatt Evans 61*63e158a0SMatt Evans const char *vmlinux; 62*63e158a0SMatt Evans struct disk_image **disks; 63*63e158a0SMatt Evans int nr_disks; 64*63e158a0SMatt Evans unsigned long rtas_gra; 65*63e158a0SMatt Evans unsigned long rtas_size; 66*63e158a0SMatt Evans unsigned long fdt_gra; 67*63e158a0SMatt Evans unsigned long initrd_gra; 68*63e158a0SMatt Evans unsigned long initrd_size; 69*63e158a0SMatt Evans const char *name; 70*63e158a0SMatt Evans }; 71*63e158a0SMatt Evans 72*63e158a0SMatt Evans #endif /* KVM__KVM_ARCH_H */ 73