aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/sysctl.c
Commit message (Collapse)AuthorAgeFilesLines
* hypervisor/xen/tools: Remove the XENMEM_get_oustanding_pages and provide the ↵Konrad Rzeszutek Wilk2013-05-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | data via xc_phys_info During the review of the patches it was noticed that there exists a race wherein the 'free_memory' value consists of information from two hypercalls. That is the XEN_SYSCTL_physinfo and XENMEM_get_outstanding_pages. The free memory the host has available for guest is the difference between the 'free_pages' (from XEN_SYSCTL_physinfo) and 'outstanding_pages'. As they are two hypercalls many things can happen in between the execution of them. This patch resolves this by eliminating the XENMEM_get_outstanding_pages hypercall and providing the free_pages and outstanding_pages information via the xc_phys_info structure. It also removes the XSM hooks and adds locking as needed. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Reviewed-by: Tim Deegan <tim@xen.org> Acked-by: Keir Fraser <keir.xen@gmail.com>
* gcov: Implement code to read coverage informationsFrediano Ziglio2013-02-211-0/+6
| | | | | | | | | | | | | | | | | | Operations are handled by a sysctl specific operation. Implement 4 operations - check if coverage is compiled in - read size of coverage information - read coverage information - reset coverage counters Information are stored in a single blob in a format specific to Xen designed to make code that generate coverage as small as possible. This patch add a public header with the structure of blob exported by Xen. This avoid problems distributing header which is GPL2. Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
* Fix emacs local variable block to use correct C style variable.David Vrabel2013-02-211-1/+1
| | | | | | | The emacs variable to set the C style from a local variable block is c-file-style, not c-set-style. Signed-off-by: David Vrabel <david.vrabel@citrix.com
* xen: move XEN_SYSCTL_physinfo, XEN_SYSCTL_numainfo and ↵Stefano Stabellini2013-02-151-0/+109
| | | | | | | | | | | | | | | | | | | | | XEN_SYSCTL_topologyinfo to common code Move XEN_SYSCTL_physinfo, XEN_SYSCTL_numainfo and XEN_SYSCTL_topologyinfo from x86/sysctl.c to common/sysctl.c. The implementation of XEN_SYSCTL_physinfo is mostly generic but needs to fill in few arch specific details: introduce arch_do_physinfo to do that. The implementation of XEN_SYSCTL_physinfo relies on two global variables: total_pages and cpu_khz. Make them available on ARM. Implement node_spanned_pages and __node_distance on ARM, assuming 1 numa node for now. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen/xsm: Add xsm_default parameter to XSM hooksDaniel De Graaf2013-01-111-4/+4
| | | | | | | | | | | | | | Include the default XSM hook action as the first argument of the hook to facilitate quick understanding of how the call site is expected to be used (dom0-only, arbitrary guest, or device model). This argument does not solely define how a given hook is interpreted, since any changes to the hook's default action need to be made identically to all callers of a hook (if there are multiple callers; most hooks only have one), and may also require changing the arguments of the hook. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Keir Fraser <keir@xen.org>
* xen: sysctl XSM hook removalDaniel De Graaf2013-01-111-44/+0
| | | | | | | | | A number of the sysctl XSM hooks have no parameters or only pass the operation ID, making them redundant with the xsm_sysctl hook. Remove these redundant hooks. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
* xen: convert do_sysctl to use XSMDaniel De Graaf2013-01-111-3/+4
| | | | | | | | The xsm_sysctl hook now covers every sysctl, in addition to the more fine-grained XSM hooks in most sub-functions. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
* streamline guest copy operationsJan Beulich2012-12-101-69/+22
| | | | | | | | | | | | - use the variants not validating the VA range when writing back structures/fields to the same space that they were previously read from - when only a single field of a structure actually changed, copy back just that field where possible - consolidate copying back results in a few places Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* xen: replace XEN_GUEST_HANDLE with XEN_GUEST_HANDLE_PARAM when appropriateStefano Stabellini2012-10-171-1/+1
| | | | | | | | | | | | Note: these changes don't make any difference on x86. Replace XEN_GUEST_HANDLE with XEN_GUEST_HANDLE_PARAM when it is used as an hypercall argument. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* fix build error when enabling lock profileYang Zhang2012-04-171-1/+0
| | | | | Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com> Committed-by: Keir Fraser <keir@xen.org>
* replace bogus gdprintk() uses with {,d}printk()Jan Beulich2012-02-161-2/+0
| | | | | | | | | | | When the subject domain is not the current one (e.g. during domctl or HVM save/restore handling), use of gdprintk() is questionable at best, as it won't give the intended information on what domain is affected. Use plain printk() or dprintk() instead, but keep things (mostly) as guest messages by using XENLOG_G_*. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* PM: only include XEN_SYSCTL_{get_pmstat,pm_op} if HAVE_ACPIIan Campbell2012-02-151-0/+2
| | | | | | | | | These hypercalls are currently ACPI specific and implemented in xen/drivers/acpi which is not implemented on ARM. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: keir@xen.org Committed-by: Ian Campbell <Ian.Campbell@citrix.com>
* xsm: Add missing access checksDaniel De Graaf2011-12-181-0/+17
| | | | | | | | | Actions requiring IS_PRIV should also require some XSM access control in order for XSM to be useful in confining multiple privileged domains. Add XSM hooks for new hypercalls and sub-commands that are under IS_PRIV but not currently under any access checks. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
* introduce and use nr_cpu_ids and nr_cpumask_bitsJan Beulich2011-10-211-1/+1
| | | | | | | | | | | | | | | The former is the runtime equivalent of NR_CPUS (and users of NR_CPUS, where necessary, get adjusted accordingly), while the latter is for the sole use of determining the allocation size when dynamically allocating CPU masks (done later in this series). Adjust accessors to use either of the two to bound their bitmap operations - which one gets used depends on whether accessing the bits in the gap between nr_cpu_ids and nr_cpumask_bits is benign but more efficient. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* xen: remove extern function declarations from C files.Tim Deegan2011-05-261-6/+0
| | | | | | | | Move all extern declarations into appropriate header files. This also fixes up a few places where the caller and the definition had different signatures. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* scheduler: Add a global parameter adjustment to the switchable scheduler ↵Keir Fraser2010-05-041-0/+8
| | | | | | | | | | | | interface ...along with a new sysctl to call it directly. This is in order to support DornerWorks' new ARINC653 scheduler. Based on code from Josh Holtrop and Kathy Hadley at DornerWorks, Ltd Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
* cpupool: Control interface should be a sysctl rather than a domctl.Keir Fraser2010-05-041-0/+8
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Update comments around spin_trylock() usage for sysctl and xenpf locks.Keir Fraser2010-04-151-1/+5
| | | | | | | | | | Since the execution of stop_machine_run() via cpu_down() is now always deferred to a hypercall continuation context, the above locks are not held at that time. Hence the trylock is not specifically to avoid deadlock with stop_machine_run(), but rather a more general paranoia about deadlocks in general. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* sysctl: Fix XEN_SYSCTL_debug_keys error path.Keir Fraser2010-04-131-1/+3
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Do not spin on locks that may be held by stop_machine_run() callers.Keir Fraser2010-03-221-1/+5
| | | | | | | | | | | | | | | | | | Currently stop_machine_run() will try to bring all CPUs to softirq context, with some locks held, like xenpf_lock or cpu_add_remove_lock etc. However, if another CPU is trying to get these locks, it may cause deadlock. This patch replace all such spin_lock with spin_trylock. For xenpf_lock and sysctl_lock, we try to use hypercall_continuation, so that we will not cause trouble to user space tools. For cpu_hot_remove_lock, we simply return EBUSY if failure, since it will only impact small number of user space tools. In the end, we should try to make the stop_machine_run as spinlock free. Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
* Spinlock profiling (enable in build with lock_profile=y)Keir Fraser2009-10-141-0/+12
| | | | | | | Adds new tool xenlockprof to run from dom0. From: Juergen Gross <juergen.gross@ts.fujitsu.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Scattered code arrangement cleanups.Keir Fraser2009-10-071-3/+2
| | | | | | | | - remove redundant declarations - add/move prototypes to headers - move things where they belong to Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* xenpm: Set scheduler vcpu_migration_delay by xenpmKeir Fraser2009-04-061-0/+8
| | | | | Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>
* Revert debugging patch c/s 19344.Keir Fraser2009-03-171-2/+0
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* xenpm: Add CPU topology info (thread/core/socket)Keir Fraser2009-03-131-6/+5
| | | | | | | | | | | | CPU topology info is necessary for power management analysis. For example, to analysis the effect of Px state coordination, Cx package/core coordination, the thread/core/socket topology information is needed. This patch add new command "get-cpu-topology" in xenpm to print the CPU topology info: Signed-off-by: Yu Ke <ke.yu@intel.com>
* Add debug code to catch count_info errors in page_alloc.cKeir Fraser2009-03-121-0/+2
| | | | | | This patch is temporary. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Code cleanups after page offline patch.Keir Fraser2009-03-121-4/+6
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Page offline support in Xen sideKeir Fraser2009-03-061-0/+55
| | | | | | | | | | | | This patch add support to offline a page. The basical idea is, when a page is assigned, it will be marked offline pending and be moved out of buddy when freed, when a page is free, it will be moved out of buddy directly. One notice after this change is, now the page->count_info is not always 0, especially for shadow page, since the PGC_offlining bit may be set. Signed-off-by: Wang, Shane <shane.wang@intel.com> Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
* Avoid negative runstate pieces.Keir Fraser2008-12-101-8/+1
| | | | | | | Also consolidate all places to get cpu idle time. Signed-off-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Add user PM control interfaceKeir Fraser2008-12-101-0/+16
| | | | Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
* xsm: refactor IO hooks/sysctl hooksKeir Fraser2008-09-041-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The patch refactors the IO resource checks into the rangeset add/del code. This produces a much more architecture friendly implementation and ensures that HVM and paravirtualized guests are checked consistently. - The patch removes the following hooks in support of the refactoring of the IO resource checks: - xsm_irq_permission - xsm_iomem_permission - xsm_ioport_permission - The patch adds the following hooks in support of the refactoring of the IO resource checks: - xsm_add_range - xsm_remove_range - These IO refactoring changes are transparent to any pre-existing Flask policies. - The patch adds also adds hooks for sysctl functionality that was added since the last major XSM patch. The following hooks were added: - xsm_set_target - xsm_debug_keys - xsm_getcpuinfo - xsm_availheap - xsm_firmware_info - xsm_acpi_sleep - xsm_change_freq - xsm_getidletime - xsm_sendtrigger - xsm_test_assign_device - xsm_assign_device - xsm_deassign_device - xsm_bind_pt_irq - xsm_pin_mem_cacheattr - xsm_ext_vcpucontext Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
* Provide Px statistic data to user through libxcKeir Fraser2008-05-161-0/+16
| | | | | | | | Sampling and collecting dynamic Px statistic data, including Px state value, Px count, Px residency time, Px transition matrix, etc. Provide Px statistic data to user through libxc. Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
* Allow incremental access to hypervisor console log.Keir Fraser2007-10-291-4/+1
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Clean up and fix XEN_SYSCTL_getcpuinfo error path.Keir Fraser2007-10-021-8/+4
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Xen Security Modules: XSMkfraser@localhost.localdomain2007-08-311-0/+21
| | | | Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
* Add new domctl hypercall to expose current heap values. Thiskfraser@localhost.localdomain2007-07-111-0/+14
| | | | | | | | functionality is needed for probing how much memory is available in a given node prior to VM creation. Signed-off-by: Ryan Harper <ryanh@us.ibm.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* More getcpuinfo sysctl cleanup.Keir Fraser2007-06-271-7/+7
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Small sysctl cleanups.Keir Fraser2007-06-271-8/+9
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Add new sysctl to return runtime information about physical CPU utilization.Steven Hand2007-06-271-0/+32
| | | | Signed-off-by: Steven Hadn <steven@xensource.com>
* xm: New command 'debug-keys' to inject debug-key events into Xen.kfraser@localhost.localdomain2007-03-091-0/+15
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* xen: Cleanups and bug fixes after the rcu_lock_domain patch.kfraser@localhost.localdomain2007-03-011-7/+0
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Use RCU for domain_list and domain_hash.kfraser@localhost.localdomain2007-02-211-2/+2
| | | | | Signed-off-by: Jose Renato Santos <jsantos@hpl.hp.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* Make domctl/sysctl interfaces 32-/64-bit invariant.kfraser@localhost.localdomain2007-01-241-10/+5
| | | | | | | This kills off a fair amount of unpleasant CONFIG_COMPAT shimming and avoids needing to keep the compat paths in sync as these interfaces continue to develop. Signed-off-by: Keir Fraser <keir@xensource.com>
* Enable compatibility mode operation for HYPERVISOR_sysctl.Emmanuel Ackaouy2007-01-051-8/+10
| | | | Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Fix hypervisor build with performance counters after -unstableSteven Hand2006-08-281-3/+3
| | | | | | cset 11257:86d26e6ec89b Signed-off-by: Steve Dobbelstein <steved@us.ibm.com>
* Replace dom0_ops hypercall with three new hypercalls:kfraser@localhost.localdomain2006-08-251-0/+152
1. platform_op -- used by dom0 kernel to perform actions on the hardware platform (e.g., MTRR access, microcode update, platform quirks, ...) 2. domctl -- used by management tools to control a specified domain 3. sysctl -- used by management tools for system-wide actions Benefits include more sensible factoring of actions to hypercalls. Also allows tool compatibility to be tracked separately from the dom0 kernel. The assumption is that it will be easier to replace libxenctrl, libxenguest and Xen as a matched set if the dom0 kernel does not need to be replaced too (e.g., because that would require vendor revalidation). From here on we hope to maintain dom0 kernel compatibility. This promise is not extended to tool compatibility beyond the existing guarantee that compatibility will not be broken within a three-level stable release [3.0.2, 3.0.3, etc.]. Signed-off-by: Keir Fraser <keir@xensource.com>