aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/kernel.c
Commit message (Collapse)AuthorAgeFilesLines
* AMD IOMMU: allow command line overrides for broken IVRS tablesJan Beulich2013-08-291-0/+16
| | | | | | | | | | | | | | With there being so many systems with broken ACPI tables, and with it generally being known what's wrong with those tables, give people a handle to overcome the resulting disabling of their IOMMUs. Inspired by Linux side patches providing similar functionality. Suggested-by: Sander Eikelenboom <linux@eikelenboom.it> Signed-off-by: Jan Beulich <jbeulich@suse.com> Tested-By: Sander Eikelenboom <linux@eikelenboom.it> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Suravee Suthikulpanit <suravee.suthikulapanit@amd.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: replace XEN_GUEST_HANDLE with XEN_GUEST_HANDLE_PARAM when appropriateStefano Stabellini2012-10-171-2/+2
| | | | | | | | | | | | 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>
* xen: Fix off-by-one error when parsing command line argumentsAndrew Cooper2012-07-031-1/+1
| | | | | | | | | | | | | As Xen currently stands, it will attempt to interpret the first few bytes of the initcall section as a struct kernel_param. The reason that this not caused problems is because in the overflow case, param->name is actually a function pointer to the first initcall, and intepreting it as string is very unlikely to match an ASCII command line parameter name. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* Fix test for NULL command line in cmdline_parse()David Vrabel2012-03-231-3/+3
| | | | | Signed-off-by: David Vrabel <david.vrabel@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* Allow cmdline_parse() to be used with const stringsDavid Vrabel2012-03-221-1/+1
| | | | | | Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* Introduce system_state variable.Keir Fraser2012-03-221-0/+2
| | | | | | | | | | Use it to replace x86-specific early_boot boolean variable. Also use it to detect suspend/resume case during cpu offline/online to avoid unnecessarily breaking vcpu and cpupool affinities. Signed-off-by: Keir Fraser <keir@xen.org> Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* move declarations of some required per-arch functions into common headersJan Beulich2012-01-121-4/+1
| | | | | | | | ... since it is pointless to have each arch declare them on their own (and now and the - see ia64 - forget to do so). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* add privileged (dom0) kernel feature indicationJan Beulich2011-07-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | With our switching away from supporting 32-bit Dom0 operation, users complained that attempts (perhaps due to lack of knowledge of that change) to boot the no longer privileged kernel in Dom0 resulted in apparently silent failure. To make the mismatch explicit and visible, add dom0 feature flag that the kernel can set to indicate operation as dom0 is supported. Due to the way elf_xen_parse_features() worked up to now (getting fixed here), adding features indications to the old, string based ELF note would make the respective kernel unusable on older hypervisors. For that reason, a new ELF Note is being introduced that allows specifying supported features as a bit array instead (with features unknown to the hypervisor simply ignored, as now also done by elf_xen_parse_features(), whereas here unknown kernel-required features still keep the kernel [and hence VM] from booting). Introduce and use elf_note_numeric_array() to be forward compatible (or else an old hypervisor wouldn't be able to parse kernel specified features occupying more than 64 bits - thanks, Ian!). Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Revert 23664:3e3c0a8be9f9Keir Fraser2011-07-081-2/+1
|
* add privileged/unprivileged kernel feature indicationJan Beulich2011-07-081-1/+2
| | | | | | | | | | | | | With our switching away from supporting 32-bit Dom0 operation, users complained that attempts (perhaps due to lack of knowledge of that change) to boot the no longer privileged kernel in Dom0 resulted in apparently silent failure. To make the mismatch explicit and visible, add feature flags that the kernel can set to indicate operation in what modes it supports. For backward compatibility, absence of both feature flags is taken to indicate a kernel that may be capable of operating in both modes. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* xen: remove extern function declarations from C files.Tim Deegan2011-05-261-1/+1
| | | | | | | | 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>
* Use bool_t for various boolean variablesKeir Fraser2010-12-241-18/+35
| | | | | | | | | | | ... decreasing cache footprint. As a prerequisite this requires making cmdline_parse() a little more flexible. Also remove a few variables altogether, and adjust sections annotations for several others. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir@xen.org>
* Interrupt remapping to PIRQs in HVM guestsKeir Fraser2010-11-191-1/+2
| | | | | | | | | | This patch allows HVM guests to remap interrupts and MSIs into pirqs; once the mapping is in place the guest will receive the interrupt (or the MSI) as an event. The interrupt to be remapped can either be an interrupt of an emulated device or an interrupt of a passthrough device and we keep track of that. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* consolidate custom parameter parsing routines looking for boolean valuesKeir Fraser2010-11-191-5/+21
| | | | | | | Have a single function for this, rather than doing the same in half a dozen places. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86 hvm: implement vector callback for evtchn deliveryKeir Fraser2010-05-251-1/+2
| | | | | | Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: TSC handling cleanups (version 2)Keir Fraser2010-05-221-0/+2
| | | | | | | | | | | | | | | "I am removing the tsc_scaled variable that is never actually used because when tsc needs to be scaled vtsc is 1. I am also making this more explicit in tsc_set_info. I am also removing hvm_domain.gtsc_khz that is a duplicate of d->arch.tsc_khz. I am using scale_delta(delta, &d->arch.ns_to_vtsc) to scale the tsc value before returning it to the guest like in the pv case. I added a feature flag to specify that the pvclock algorithm is safe to be used in an HVM guest so that the guest can now use it without hanging." Version 2 fixes a bug which breaks PV domU time. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* Revert 21339:804304d4e05d "x86: TSC handling cleanups"Keir Fraser2010-05-211-2/+0
| | | | | | It very much breaks PV domU boot. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Implement cpu hotplug notifiers. Use them.Keir Fraser2010-05-141-0/+16
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: TSC handling cleanupsKeir Fraser2010-05-111-0/+2
| | | | | | | | | | | | | "I am removing the tsc_scaled variable that is never actually used because when tsc needs to be scaled vtsc is 1. I am also making this more explicit in tsc_set_info. I am also removing hvm_domain.gtsc_khz that is a duplicate of d->arch.tsc_khz. I am using scale_delta(delta, &d->arch.ns_to_vtsc) to scale the tsc value before returning it to the guest like in the pv case. I added a feature flag to specify that the pvclock algorithm is safe to be used in an HVM guest so that the guest can now use it without hanging." Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* introduce size_param()Keir Fraser2009-08-311-0/+15
| | | | | | | | | | | With there being several instances of custom_param() where the handler is just invoking parse_size_and_unit(), it seems to make sense to introduce a simplifying abstraction. Also fix serial_txbufsz not having been guaranteed to be a power of two. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Allow tools to see the hypervisor command line.Keir Fraser2009-06-181-1/+12
| | | | | | | This is useful from tools in the same way /proc/cmdline is useful for the domain 0 kernel. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* x86: allow grant table originating ptes to have their guest availableKeir Fraser2008-11-041-1/+2
| | | | | | | | | | | bits set. In order to allow 2.6.27's get_user_pages_fast() to correctly detect granted pages (so they would be passed to get_user_pages()), it must be possible to tell the grant table code in Xen to set the three available bits in the pte-s it creates. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86: highmem handling assistance hypercallsKeir Fraser2008-10-271-1/+2
| | | | | | | | | | | | | | | | | While looking at the origin of very frequently executed hypercalls I realized that the high page accessor functions in Linux would be good candidates to handle in the hypervisor - clearing or copying to/from a high page is a pretty frequent operation (provided there's enough memory in the domain). While prior to the first submission I only measured kernel builds (where the results are not hinting at a meaningful improvement), I now found time to do a more specific analysis: page clearing is being improved by about 20%, page copying doesn't seem to significantly benefit (though that may be an effect of the simplistic copy_page() implementation Xen currently uses) - nevertheless I would think that if one function is supported by the hypervisor, then the other should also be. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* amd: fix CPUID mask option handlingKeir Fraser2008-10-151-2/+1
| | | | | | | | | | | c/s 18402 added command line options to AMD-specific code duplicating ones already existing in Intel code. The generic command line parser didn't support this scenario for integer options, however. Additionally, the options added were using the same option string for two different purposes. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86: New feature flag XENFEAT_mmu_pt_update_preserve_ad.Keir Fraser2008-01-161-0/+4
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Allow NMI callback CS to be specified via set_trap_table()Keir Fraser2007-10-221-34/+0
| | | | | | hypercall. Based on a patch by Jan Beulich. Signed-off-by: Keir Fraser <keir@xensource.com>
* Let Xen cmdline boolean options be specified as "=0", "=1", "=false", "=true".kfraser@localhost.localdomain2007-09-141-1/+4
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Skipping image name at start of command line is ankfraser@localhost.localdomain2007-08-291-6/+0
| | | | | | architecture-specific action. Definitely not required on IA64, for now make it just x86 specific. Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] replace shadow_* with paging_* in common codeTim Deegan2007-07-201-2/+2
| | | | Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* Also allow boolean cmdline params to be inverted in two other ways.kfraser@localhost.localdomain2007-07-091-6/+8
| | | | | | | | | | | | | Now, a standard boolean (e.g., watchdog) can be inverted in three ways: 1. no-watchdog 2. watchdog=no 3. watchdog=off Stacked inversions cancel each other: no-watchdog=no turns on the watchdog. Signed-off-by: Keir Fraser <keir@xensource.com>
* Allow inversion of boolean cmdline parameters with 'no-' prefix.kfraser@localhost.localdomain2007-07-091-5/+14
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Enhance guest memory accessor macros so that source operands can bekfraser@localhost.localdomain2007-06-201-5/+5
| | | | | | | | | | | pointers to const or arrays. Only build-tested on ia64, and untested for powerpc (which, however, is almost identical to ia64, except for an apparent bug in the original version of __copy_field_{from,to}_guest in that the field offset was multiplied by the field size). Signed-off-by: Jan Beulich <jbeulich@novell.com>
* xen: Remove {nmi_pending,nmi_masked,paused} vcpu bitflags.kfraser@localhost.localdomain2007-03-291-1/+1
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Fix XENVER_capabilities hypercall.Ian Campbell2007-01-311-2/+2
| | | | | | | | | | | Passing an array to a function turns it into a pointer which confuses safe_strcat. Also fix 54->64 typo in ia64 tree. Thanks to Alex Williamson for pointing out the problem. Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
* Replace sprintf with snprintf and strncpy with strlcpy.kfraser@localhost.localdomain2007-01-291-2/+1
| | | | | | | | There are various cases where no NULL-terminated strings are guaranteed and eventual possible overflows. This patch fixes them. From: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* Handle shared info (having different layout for native and compatibilityEmmanuel Ackaouy2007-01-051-1/+4
| | | | | | mode guests) accesses. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Add logic to generate headers reflecting the compatibility mode layoutEmmanuel Ackaouy2007-01-051-4/+15
| | | | | | | | of hypercall arguments. Provide infrastructure for accessing handles passed from compatibility mode guests. Vector those hypercalls not needing any translation to their native implementations. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Improve consistency of type-attribute usage (volatile/const).kfraser@localhost.localdomain2006-12-211-3/+4
| | | | | From: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* [HVMLOADER] HVM loader initialises hypercall shim and useskfraser@localhost.localdomain2006-08-041-0/+7
| | | | | | | | | it to interrogate Xen version information. Also add support for HVM hypercall execution on 64-bit host. Signed-off-by: Steven Smith <ssmith@xensource.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Hide compile-time information values behind akfraser@localhost.localdomain2006-08-011-8/+8
| | | | | | | functional interface, so that the values are contained within a single object file. Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Fix my change to XENVER_pagesize hypercall --kfraser@dhcp93.uk.xensource.com2006-06-271-1/+1
| | | | | | arg check wrong way round. Signed-off-by: Keir Fraser <keir@xensource.com>
* Add XENVER_pagesize hypercall.kaf24@firebug.cl.cam.ac.uk2006-06-271-0/+5
| | | | | | Make xen pagesize available through xm info and sysfs. Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
* [XEN] Add a warning banner when 'sync_console' is used. Make itkaf24@firebug.cl.cam.ac.uk2006-06-201-2/+3
| | | | | | very obvious and mildly annoying. Signed-off-by: Keir Fraser <keir@xensource.com>
* Create new vmassist type 'pae_extended_cr3'. Only advertisekaf24@firebug.cl.cam.ac.uk2006-06-051-1/+4
| | | | | | | | | pae_pgdir_above_4gb tp guests that have enabled this vmassist. Control tools ensure all PAE page directories are below 4GB unless the vmassist is enabled (triggered via an extended-cr3 option in guest Elf header). Signed-off-by: Keir Fraser <keir@xensource.com>
* [PAE] Allow pgdirs above 4GB for paravirt guests.kaf24@firebug.cl.cam.ac.uk2006-05-261-3/+2
| | | | | | | | **NOTE**: This obviates the need for lowmem_emergency_pool. Unpriv guests no longer need to be able to allocate memory below 4GB for PAE PDPTs. Signed-off-by: Keir Fraser <keir@xensource.com>
* Rename *GUEST_HANDLE to *XEN_GUEST_HANDLE.kaf24@firebug.cl.cam.ac.uk2006-04-271-2/+2
| | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
* Fix command-line parsing in a few respects -- be morekaf24@firebug.cl.cam.ac.uk2006-04-211-12/+13
| | | | | | | | | | generous about what we accept, avoid stack overflow, and print the command line during boot (rather useful!). This should fix the 'lapic' and 'nolapic' boot options. Signed-off-by: Keir Fraser <keir@xensource.com>
* Merge nmi_op functionality with the callback_op hypercall.Ian.Campbell@xensource.com2006-04-211-17/+31
| | | | | Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
* Upgrade all hypercalls to use the new guest_handle interface (on the Xen side).kaf24@firebug.cl.cam.ac.uk2006-03-071-22/+26
| | | | | | Signed-off-by: Keir Fraser <keir@xensource.com>