* ========== Copyright Header Begin ==========================================
* Hypervisor Software File: config.h
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* - Do no alter or remove copyright notices
* - Redistribution and use of this software in source and binary forms, with
* or without modification, are permitted provided that the following
* - Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistribution in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of Sun Microsystems, Inc. or the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
* MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
* OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
* FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* You acknowledge that this software is not designed, licensed or
* intended for use in the design, construction, operation or maintenance of
* ========== Copyright Header End ============================================
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
#pragma ident "@(#)config.h 1.39 07/07/18 SMI"
#include <svc_vbsc.h> /* dbgerror */
#include <platform/config.h>
#define NVCPUS NGUESTS /* 1 per guest */
#define DUMPBUF_MINSIZE 8192 /* smallest dump buffer allowed */
#define HVCTL_BUF_SIZE 8 /* HVCTL ibuf and obuf size */
* cpu_pokedelay - the number of ticks between pokes to a target
* cpu that has had a mondo outstanding. The target's cpu queue
* may have been full and it needs a poke to check it again.
#define CPU_POKEDELAY 2000 /* clock ticks */
* memscrub_max default - used as the default if the memscrub_max
* was not specified in the hypervisor description or if the
* setting does not correspond to an 8k-aligned byte count.
#define MEMSCRUB_MAX_DEFAULT ((4LL * 1024LL * 1024LL) >> L2_LINE_SHIFT)
* Dummy TSB to fake up real address space.
#define DUMMYTSB_ENTRIES (DUMMYTSB_SIZE/16)
#define DUMMYTSB_SIZE 0x2000
#define DUMMYTSB_ALIGN DUMMYTSB_SIZE
* Hypervisor MD content-version. We start with 1.0.
* If the property is not present in the MD we assume pre 1.0.
* Pre 1.0 MDs are not supported by this hypervisor.
* The hypervisor will support MDs in the same major version number.
* Minor version numbers less than the version specified below require
* the hypervisor to be backward compatible. Minor versions above can be
* ignored as the version is only incremented on content additions. Removing
* content requires a Major version bump.
#define HV_MDCONT_VER_MAJOR 1
#define HV_MDCONT_VER_MINOR 0
* Extract major and minor numbers. The property is encoded as an uint64_t.
* Top 32 bits = major version number
* Bottom 32 bits = minor version number
#define MDCONT_VER_MAJOR(x) (x >> 32)
#define MDCONT_VER_MINOR(x) ((x << 32) >> 32)
uint64_t hdname_services
;
#endif /* CONFIG_CRYPTO */
uint64_t hdname_uartbase
;
uint64_t hdname_inobitmap
;
uint64_t hdname_todfrequency
;
uint64_t hdname_todoffset
;
uint64_t hdname_strandid
;
uint64_t hdname_memoffset
;
uint64_t hdname_realbase
;
uint64_t hdname_hypervisor
;
uint64_t hdname_perfctraccess
;
uint64_t hdname_perfctrhtaccess
;
uint64_t hdname_rngctlaccessible
;
uint64_t hdname_vpcidevice
;
uint64_t hdname_cfghandle
;
uint64_t hdname_snet_ino
;
uint64_t hdname_diagpriv
;
uint64_t hdname_debugprintflags
;
uint64_t hdname_stickfrequency
;
uint64_t hdname_ceblackoutsec
;
uint64_t hdname_cepollsec
;
uint64_t hdname_memscrubmax
;
uint64_t hdname_erpt_size
;
uint64_t hdname_reset_reason
;
uint64_t hdname_ldc_endpoints
;
uint64_t hdname_sp_ldc_endpoints
;
uint64_t hdname_ldc_endpoint
;
uint64_t hdname_target_type
;
uint64_t hdname_target_guest
;
uint64_t hdname_target_channel
;
uint64_t hdname_svc_vino
;
uint64_t hdname_private_svc
;
uint64_t hdname_ldc_mapinrabase
;
uint64_t hdname_ldc_mapinsize
;
#ifdef CONFIG_SPLIT_SRAM /* { */
uint64_t hdname_sram_ptrs
;
uint64_t hdname_inq_offset
;
uint64_t hdname_inq_data_offset
;
uint64_t hdname_inq_num_pkts
;
uint64_t hdname_outq_offset
;
uint64_t hdname_outq_data_offset
;
uint64_t hdname_outq_num_pkts
;
uint64_t hdname_resource_id
;
uint64_t hdname_consoles
;
uint64_t hdname_virtual_devices
;
uint64_t hdname_channel_devices
;
uint64_t hdname_sys_hwtw_mode
;
uint64_t hdname_pcie_bus
;
uint64_t hdname_allow_bypass
;
#ifdef STANDALONE_NET_DEVICES
uint64_t hdname_network_device
;
uint64_t hdname_l2scrub_interval
;
uint64_t hdname_l2scrub_entries
;
#ifdef PLX_ERRATUM_LINK_HACK
uint64_t hdname_ignore_plx_link_hack
;
uint64_t hdname_content_version
;
typedef struct config config_t
;
uint64_t membase
; /* original membase value */
uint64_t memsize
; /* original memsize value */
/* HV state as reflected by a HV MD */
void *active_hvmd
; /* active hypervisor MD */
void *parse_hvmd
; /* hypervisor MD being parsed */
uint64_t reloc
; /* hv relocation offset */
void *guests
; /* pointer to base of guests array */
void *mblocks
; /* pointer to base of mblocks array */
void *vcpus
; /* pointer to base of vcpus array */
void *strands
; /* pointer to base of strands array */
void *vstate
; /* pointer to base of vstate array */
uint64_t ldcb_pa
; /* Bridge base address */
void *pcie_busses
; /* pcie busses */
#ifdef STANDALONE_NET_DEVICES
void *network_devices
; /* network devices */
void *hv_ldcs
; /* ptr to array of HV LDC endpoints */
void *sp_ldcs
; /* ptr to array of SP LDC endpoints */
void *dummytsbp
; /* pointer to dummy tsb */
* lock to ensure that only one strand executes
uint64_t single_strand_lock
;
uint64_t strand_startset
;
uint64_t strand_present
; /* strand state information */
uint64_t print_spinlock
; /* print output serialization */
uint64_t heartbeat_cpu
; /* physical cpu# of heartbeat handler */
uint64_t error_svch
; /* hypervisor error service handle */
struct dbgerror vbsc_dbgerror
;
uint64_t sys_hwtw_mode
; /* MMU HWTW Mode */
uint64_t erpt_pa
; /* address of erpt buffer */
uint64_t erpt_size
; /* size */
uint64_t sram_erpt_buf_inuse
;
* Cached hypervisor description nodes
void ldcb_dtnode
; /* FIXME: To go away */
* Name to nameindex translation table for hypervisor description
struct nametable hdnametable
;
uint64_t intrtgt
; /* SSI interrupt targets */
* hcall memory scrub and sync limit
* It's a cacheline count, not byte count, and must correspond to
* a byte count multiple of 8k.
/* devinst */ void *devinstancesp
;
uint64_t cyclic_maxd
; /* max delay in ticks */
* HVCTL (hypervisor control) messaging storage
uint16_t hvctl_hv_seq
; /* HV's next seqn */
uint16_t hvctl_zeus_seq
; /* Zeus ' next seqn */
uint16_t hvctl_version_major
;
uint16_t hvctl_version_minor
;
uint64_t hvctl_ibuf
[HVCTL_BUF_SIZE
];
uint64_t hvctl_obuf
[HVCTL_BUF_SIZE
];
uint64_t hvctl_ldc
; /* HV LDC endpoint number */
volatile uint64_t hvctl_ldc_lock
; /* serializes HV LDC sends */
uint64_t ce_blackout
; /* ticks */
uint64_t ce_poll_time
; /* poll time in ticks */
* Error buffers still needed to be sent
uint64_t physmemsize
; /* Total phys memory size */
* Delayed reconfiguration
uint64_t del_reconf_gid
; /* ID of delayed reconfig guest */
volatile uint64_t del_reconf_lock
; /* protects delayed reconfig */
* Scratch used at beginning of time for scrubbing.
* Could be overloaded with other fields.
uint64_t fpga_status_lock
;
* Interval (in seconds) for invoking the L2 Cache Cleanser
uint64_t l2scrub_interval
;
* Number of L2 cache entries to be scrubbed on each invocation
* as a percentage of the total number of entries (64k)
uint64_t l2scrub_entries
;
#endif /* CONFIG_CLEANSER */
#ifdef PLX_ERRATUM_LINK_HACK
* Global setting to ignore the PLX link training reset hack
* in case the system gets in an never-ending reset loop.
uint64_t ignore_plx_link_hack
;
#endif /* PLX_ERRATUM_LINK_HACK */
struct machconfig config_m
;
* The intrtgt property is a byte array of physical cpuids for the SSI
* interrupt targets (INT_MAN devices 1 and 2)
#define INTRTGT_CPUMASK 0xff /* Mask for a single array element */
#define INTRTGT_DEVSHIFT 8 /* #bits for each entry in array */
* The reset-reason property provided by VBSC
#define RESET_REASON_POR 0
#define RESET_REASON_SIR 1
* Watchdog timeout limits
#define MSEC_PER_SEC 1000
#define WATCHDOG_MAX_TIMEOUT (365 * 24 * 60 * 60) /* roughly a year */