aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* libxl: Allow network driver domains when run_hotplug_scritps is setGeorge Dunlap2013-07-172-11/+2
| | | | | | | | | | | | | | As of commit 05bfd984dfe7014f1f5ea1133608b9bab589c120, hotplug scripts are not run if backend_domid != LIBXL_TOOSTACK_DOMID; so there is no reason to restrict this for network driver domains any more. This is a candidate for backporting to 4.3. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Roger Pau Monné <roger.pau@citrix.com> CC: Ian Campbell <ian.campbell@citrix.com> CC: Ian Jackson <ian.jackson@citrix.com> CC: Jan Beulich <jbeulich@suse.com>
* xen/arm: Dummy implementation of multi-bank supportJulien Grall2013-07-171-6/+17
| | | | | | | | | | | | U-boot for the arndale board splits the memory in 8 contiguous banks and rewrites the memory node. So most of the memory is lost. As the frametable is only able to handle contiguous memory, use the first contiguous banks and warn if some of the memory banks are not used. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ ijc -- "some banks" -> "some memory banks" ]
* docs: Fix minor error in xm man pageGeorge Dunlap2013-07-171-1/+1
| | | | | | | | | xm block-attach takes "r" as read-only, not "ro". This is a backport candidate for 4.3, and probably others. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: correctly configure NSACR.Ian Campbell2013-07-171-4/+5
| | | | | | | | | | | | | | | | | | | | | | | Previously we were setting it up twice, the second time neglecting to set the NS_SMP bit. NSACR.NS_SMP is a processor specific bit which on Cortex-A7 and -A15 regulates access to the (also processor specific) ACTLR.SMP bit. Not setting NSACR.NS_SMP meant that Xen's attempts to set ACTLR.SMP was silently ignored. Setting this bit is required in order to cause the processor to take part in cache and TLB coherency protocols. Failure to set this bit leads to random memory corruption in guests (although nothing like as catastrophic as you might expect!). An alternative fix would have been to set ACTLR.SMP when in Secure World, however Linux expects to set ACTLR.SMP itself in NS mode, so it's a good bet that bootloaders will set NSACR.NS_SMP instead. While here switch to a read-modify-write of NSACR to preserve any existing bits -- seems safer. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Julien Grall <julien.grall@linaro.org>
* Cleanup scmversion script, fix --save-scmversion optionMarek Marczykowski2013-07-171-9/+6
| | | | | | Remove unused variable, fix erroneously removed --save-scmversion code. Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
* xl: support for leaving domain paused after saveIan Murray2013-07-173-8/+21
| | | | | | | | | | | | | | New feature to allow xl save to leave a domain paused after its memory has been saved. This is to allow disk snapshots of domU to be taken that exactly correspond to the memory state at save time. Once the snapshot(s) have been taken or whatever, the domain can be unpaused in the usual manner. Usage: xl save -p <domid> <filespec> Signed-off-by: Ian Murray <murrayie@yahoo.co.uk> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* pygrub: allow user to specify an explicit offset to fsKjetil Torgrim Homme2013-07-171-4/+13
| | | | | | | This new option overrides partition table parsing Signed-off-by: Kjetil Torgrim Homme <kjetil.homme@redpill-linpro.com> Reviewed-by: Matt Wilson <msw@amazon.com>
* xen: arm: introduce Cortex-A7 supportBamvor Jian Zhang2013-07-1710-34/+128
| | | | | | | | | | | Introduce Cortex-A7 with a scalable proc_info_list which including cpu id and cpu initialize function. In head.S, search cpu specific MIDR in procinfo and call such initialize function. Currently, support Cortex-A7 and Cortex-A15. Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* x86: don't use destroy_xen_mappings() for vunmap()Jan Beulich2013-07-172-0/+7
| | | | | | | | | | | | | | | | | | Its attempt to tear down intermediate page table levels may race with map_pages_to_xen() establishing them, and now that map_domain_page_global() is backed by vmap() this teardown is also wasteful (as it's very likely to need the same address space populated again within foreseeable time). As the race between vmap() and vunmap(), according to the latest stage tester logs, doesn't appear to be the only one still left, the patch also adds logging for vmap() and vunmap() uses (there shouldn't be too many of them, so logs shouldn't get flooded). These are supposed to get removed (and are made stand out clearly) as soon as we're certain that there's no issue left. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* Viridian: cleanupJan Beulich2013-07-171-4/+4
| | | | | | | | | - functions used only locally should be static - constify parameters of dump functions Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Yang Zhang <yang.z.zhang@intel.com>
* Viridian: populate CPUID leaf 6Jan Beulich2013-07-171-0/+14
| | | | | | | | | Properly reporting hardware features we use can only help Windows in making decisions towards its own performance tuning. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Yang Zhang <yang.z.zhang@intel.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
* VMX: suppress pointless indirect callsJan Beulich2013-07-171-10/+8
| | | | | | | | | | | Get the other virtual interrupt delivery related actors in sync with the newly added handle_eoi() one: Clear the respective pointers (thus avoiding the call from generic code) when the feature is unavailable instead of checking feature availability in the actors. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Yang Zhang <yang.z.zhang@intel.com>
* VMX: fix interaction of APIC-V and Viridian emulationJan Beulich2013-07-173-1/+18
| | | | | | | | | | | | | Viridian using a synthetic MSR for issuing EOI notifications bypasses the normal in-processor handling, which would clear GUEST_INTR_STATUS.SVI. Hence we need to do this in software in order for future interrupts to get delivered. Based on analysis by Yang Z Zhang <yang.z.zhang@intel.com>. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Yang Zhang <yang.z.zhang@intel.com>
* x86/cpuidle: Change logging for unknown APIC IDsAndrew Cooper2013-07-172-2/+5
| | | | | | | | | | | | | | | Dom0 uses this hypercall to pass ACPI information to Xen. It is not very uncommon for more cpus to be listed in the ACPI tables than are present on the system, particularly on systems with a common BIOS for a 2 and 4 socket server varients. As Dom0 does not control the number of entries in the ACPI tables, and is required to pass everything it finds to Xen, change the logging. There is now an single unconditional warning for the first unknown ID, and further warnings if "cpuinfo" is requested by the user on the command line. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
* AMD IOMMU: Add debug-key for dumping IRTEsSuravee Suthikulpanit2013-07-161-0/+61
| | | | | | Support debug-key "V" to allow IOMMU IRTE dumping. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
* AMD IOMMU: enable for multi-vector MSIJan Beulich2013-07-161-12/+51
| | | | | | | | The main change being to make alloc_intremap_entry() capable of allocating a block of entries. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
* AMD IOMMU: untie remap and vector mapsJan Beulich2013-07-161-44/+0
| | | | | | | | | | With the specific IRTEs used for an interrupt no longer depending on the vector, there's no need to tie the remap sharing model to the vector sharing one. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
* AMD IOMMU: allocate IRTE entries instead of using a static mappingJan Beulich2013-07-166-87/+191
| | | | | | | | | | | For multi-vector MSI, where we surely don't want to allocate contiguous vectors and be able to set affinities of the individual vectors separately, we need to drop the use of the tuple of vector and delivery mode to determine the IRTE to use, and instead allocate IRTEs (which imo should have been done from the beginning). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
* extract register definitions from ns16550 into a separated headerChen Baozi2013-07-162-111/+148
| | | | | Signed-off-by: Chen Baozi <baozich@gmail.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: Special case __HYPERVISOR_iret rather more when writing hypercall pagesAndrew Cooper2013-07-164-2/+14
| | | | | | | | | | | | | | | | | | | | | | In all cases when a hypercall page is written, __HYPERVISOR_iret is first written as a regular hypercall, then subsequently rewritten in its special case. For VMX and SVM, this means that following the ud2a instruction is 3 bytes of an imm32 parameter. For a ring3 kernel, this means that following the syscall instruction is the second half of 'pop %r11'. For a ring1 kernel, the iret case ends up as the same number of bytes as the rest of the hypercalls, but it is pointless writing it twice, and is changed for consistency. Therefore, skip the loop iteration which would write the incorrect __HYPERVISOR_iret hypercall. This removes junk machine code from the tail and makes disassemblers rather more happy when looking at the hypercall page. Also, a miscellaneous whitespace fix in the comment for ring3 kernel. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
* AMD IOMMU: use ioremap()Jan Beulich2013-07-153-17/+3
| | | | | | | | | | There's no point in using the fixmap here, and it gets map_iommu_mmio_region() in line with unmap_iommu_mmio_region(), which was already using iounmap() (thus crashing if actually used). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
* VT-d: use ioremap()Jan Beulich2013-07-154-13/+4
| | | | | | | | | There's no point in using the fixmap here, and it gets iommu_alloc() in line with iommu_free(), which was already using iounmap() (thus crashing if actually used). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: add locking to map_pages_to_xen()Jan Beulich2013-07-154-81/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | While boot time calls don't need this, run time uses of the function which may result in L2 page tables getting populated need to be serialized to avoid two CPUs populating the same L2 (or L3) entry, overwriting each other's results. This is expected to fix what would seem to be a regression from commit b0581b92 ("x86: make map_domain_page_global() a simple wrapper around vmap()"), albeit that change only made more readily visible the already existing issue. This patch intentionally does not - add locking to the page table de-allocation logic in destroy_xen_mappings() (the only user having potential races here, msix_put_fixmap(), gets converted to use __set_fixmap() instead) - avoid races between super page splitting and reconstruction in map_pages_to_xen() (no such uses exist; races between multiple splitting attempts or between multiple reconstruction attempts are being taken care of) If we wanted to take care of these, we'd need to alter the behavior of virt_to_xen_l?e() - they would need to return with the lock held then. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* xl: Add 'xen_version' to `xl info`Andrew Cooper2013-07-121-0/+2
| | | | | | | | | | | | Getting the full Xen version in an easily scriptable way is awkward, especially if trying to piece together from xen_{major,minor,extra}. This reflects $(XEN_FULLVERSION) in the build system (but under a more sensible name, as $(XEN_VERSION) is just the major number). Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Matt Wilson <msw@amazon.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* docs: add xenstore-chmod man pageDavid Vrabel2013-07-121-0/+62
| | | | Signed-off-by: David Vrabel <david.vrabel@citrix.com>
* docs: add xenstore-ls man pageDavid Vrabel2013-07-121-0/+62
| | | | Signed-off-by: David Vrabel <david.vrabel@citrix.com>
* docs: add xenstore utility man pageDavid Vrabel2013-07-121-0/+52
| | | | Signed-off-by: David Vrabel <david.vrabel@citrix.com>
* x86/HVM: key handler registration functions can be __initJan Beulich2013-07-102-2/+2
| | | | | | | This applies to both SVM and VMX. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* arm: correct vfp save/restore asm constraintsIan Campbell2013-07-101-8/+9
| | | | | | | | | | | | | | | Some versions of gcc complain: > vfp.c: In function 'vfp_restore_state': > vfp.c:45:27: error: memory input 0 is not directly addressable > vfp.c:51:31: error: memory input 0 is not directly addressable There is no way to express the constraint we want (which is the address of the array, clobbering the whole array). Therefore we have to fake it up by using two constraints. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Will.Deacon@arm.com Acked-by: Julien Grall <julien.grall@linaro.org>
* also allow building .s files from .c onesJan Beulich2013-07-102-1/+4
| | | | | | | | ... along the lines of allowing .i files to be built from .c ones as well as .s from .S (aiding the analysis of occasional build problems). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* adjust x86 EFI buildJan Beulich2013-07-101-1/+1
| | | | | | | | | | | | While the rule to generate .init.o files from .o ones already correctly included $(extra-y), the setting of the necessary compiler flag didn't have the same. With some yet to be posted patch this resulted in build breakage because of the compiler deciding not to inline a few functions (which then results in .text not being empty as required for these object files). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* Revert "hvmloader: always include HPET table"Jan Beulich2013-07-081-5/+7
| | | | | | | | | | This reverts commit e4fd0475a08fda414da27c4e57b568f147cfc07e. Conflicts: tools/firmware/hvmloader/acpi/build.c Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir.xen@gmail.com>
* Revert "/home/jbeulich/tmp/commit.txt"Jan Beulich2013-07-081-7/+5
| | | | This reverts commit 80e3eddcc4896ab40c24506fd05f9795c4039b48.
* /home/jbeulich/tmp/commit.txtJan Beulich2013-07-081-5/+7
|
* netif.h: fix typo, BLKIF -> NETIFWei Liu2013-07-081-1/+1
| | | | | Signed-off-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* docs: record reservations of device IDs under the Xen vendor IDJames Bulpin2013-07-041-0/+31
| | | | | | | | This patch introduces a documentation file to record reservations of ranges of PCI device IDs within the Xen vendor ID 0x5853. Signed-off-by: James Bulpin <james.bulpin@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* xen/arm32: implement VFP context switchJulien Grall2013-07-0410-2/+210
| | | | | | | Add support for VFP context switch on arm32 and a dummy support for arm64 Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: don't enable VFP on XEN during the bootJulien Grall2013-07-044-49/+1
| | | | | | | | | We can safely remove VFP support in XEN because: - the guest will enable VFP support when a process requires it - XEN doesn't use VFP Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* mini-os: eliminate duplicated definition of spin_unlock_waitChen Baozi2013-07-042-2/+2
| | | | | Signed-off-by: Chen Baozi <baozich@gmail.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* libxl: do not call exit() in libxl_device_vtpm_listMarek Marczykowski2013-07-041-5/+6
| | | | | | | | Signal error with NULL return value, do not terminate the whole process. Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com> Reviewed-by: Jim Fehlig <jfehlig@suse.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* x86/mm: Ensure useful progress in alloc_l2_table()Andrew Cooper2013-07-041-1/+2
| | | | | | | | | | | | | | While debugging the issue which turned out to be XSA-58, a printk in this loop showed that it was quite easy to never make useful progress, because of consistently failing the preemption check. One single l2 entry is a reasonable amount of work to do, even if an action is pending, and also assures forwards progress across repeat continuations. Tweak the continuation criteria to fail on the first iteration of the loop. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* use SMP barrier in common code dealing with shared memory protocolsIan Campbell2013-07-0411-24/+24
| | | | | | | | | | | | | | | | | | | | | | | Xen currently makes no strong distinction between the SMP barriers (smp_mb etc) and the regular barrier (mb etc). In Linux, where we inherited these names from having imported Linux code which uses them, the SMP barriers are intended to be sufficient for implementing shared-memory protocols between processors in an SMP system while the standard barriers are useful for MMIO etc. On x86 with the stronger ordering model there is not much practical difference here but ARM has weaker barriers available which are suitable for use as SMP barriers. Therefore ensure that common code uses the SMP barriers when that is all which is required. On both ARM and x86 both types of barrier are currently identical so there is no actual change. A future patch will change smp_mb to a weaker barrier on ARM. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: make map_domain_page_global() a simple wrapper around vmap()Jan Beulich2013-07-043-69/+15
| | | | | | | | | | | | | | | This is in order to reduce the number of fundamental mapping mechanisms as well as to reduce the amount of code to be maintained. In the course of this the virtual space available to vmap() is being grown from 16Gb to 64Gb. Note that this requires callers of unmap_domain_page_global() to no longer pass misaligned pointers - map_domain_page_global() returns page size aligned pointers, so unmappinmg should be done accordingly. unmap_vcpu_info() violated this and is being adjusted here. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* bitmap_*() should cope with zero size bitmapsJan Beulich2013-07-042-80/+102
| | | | | | | | | | | | | | | | ... to match expectations set by memset()/memcpy(). Similarly for find_{first,next}_{,zero_}_bit() on x86. __bitmap_shift_{left,right}() would also need fixing (they more generally can't cope with the shift count being larger than the bitmap size, and they perform undefined operations by possibly shifting an unsigned long value by BITS_PER_LONG bits), but since these functions aren't really used anywhere I wonder if we wouldn't better simply get rid of them. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: drop MAX_VECTOR definitionJan Beulich2013-07-042-5/+3
| | | | | | | | | .. in favor of NR_VECTORS, as being redundant and as the latter is correct in terms of its naming, while the former is off by one. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
* x86: Restore reboot quirks by DMI, fix reboot on a number of systemsBen Guthro2013-07-041-0/+365
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following patch ports the functionality following changeset from Linux (from 2008) to xen: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=14d7ca5c It implements an additional reboot quirk to do a PCI reset via port CF9. This also restores some code dropped in the x86_32 target removal (changeset 5d1181a5ea5e0f11d481a94b16ed00d883f9726e) which sets some quirks based on DMI matching. This will add reboot quirks on the following systems that are known to be necessary on Linux: Dell E520 Dell PowerEdge 1300 Dell PowerEdge 300 Dell OptiPlex 745 Dell OptiPlex 745 Dell OptiPlex 745 Dell OptiPlex 330 Dell OptiPlex 360 Dell OptiPlex 760 Dell PowerEdge 2400 Dell Precision T5400 Dell Precision T7400 HP Compaq Laptop Dell XPS710 Dell DXP061 Sony VGN-Z540N ASUS P4S800 Acer Aspire One A110 Apple MacBook5 Apple MacBookPro5 Apple Macmini3,1 Apple iMac9,1 Dell Latitude E6320 Dell Latitude E5420 Dell Latitude E6220 Dell Latitude E6420 Dell OptiPlex 990 Dell OptiPlex 990 Dell Latitude E6520 Dell OptiPlex 790 Dell OptiPlex 990 Dell OptiPlex 390 Dell Latitude E6320 Dell Latitude E6420 Dell Latitude E6520 I clearly have not been able to test on all of these systems. It does fix rebooting on the Dell 790, and should *not* change the reboot paths of systems not on this DMI match list. Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com> Use driver_data, thus requiring only a single handler function. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org Acked-by: Ben Guthro <benjamin.guthro@citrix.com>
* docs: Pull Xen version from canonical locationAndrew Cooper2013-07-031-1/+1
| | | | | | | rather than hard coding it and being wrong every time we branch for a release. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* iommu/amd: Workaround for erratum 787Suravee Suthikulpanit2013-07-021-0/+16
| | | | | | | | | | | | | | | | | | | | | The IOMMU interrupt handling in bottom half must clear the PPR log interrupt and event log interrupt bits to re-enable the interrupt. This is done by writing 1 to the memory mapped register to clear the bit. Due to hardware bug, if the driver tries to clear this bit while the IOMMU hardware also setting this bit, the conflict will result with the bit being set. If the interrupt handling code does not make sure to clear this bit, subsequent changes in the event/PPR logs will no longer generating interrupts, and would result if buffer overflow. After clearing the bits, the driver must read back the register to verify. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Adjust to apply on top of heavily modified patch 1. Adjust flow to get away with a single readl() in each instance of the status register checks. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Tim Deegan <tim@xen.org> Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
* iommu/amd: Fix logic for clearing the IOMMU interrupt bitsSuravee Suthikulpanit2013-07-024-45/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The IOMMU interrupt bits in the IOMMU status registers are "read-only, and write-1-to-clear (RW1C). Therefore, the existing logic which reads the register, set the bit, and then writing back the values could accidentally clear certain bits if it has been set. The correct logic would just be writing only the value which only set the interrupt bits, and leave the rest to zeros. This patch also, clean up #define masks as Jan has suggested. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> With iommu_interrupt_handler() properly having got switched its readl() from status to control register, the subsequent writel() needed to be switched too (and the RW1C comment there was bogus). Some of the cleanup went too far - undone. Further, with iommu_interrupt_handler() now actually disabling the interrupt sources, they also need to get re-enabled by the tasklet once it finished processing the respective log. This also implies re-running the tasklet so that log entries added between reading the log and re- enabling the interrupt will get handled in a timely manner. Finally, guest write emulation to the status register needs to be done with the RW1C (and RO for all other bits) semantics in mind too. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Tim Deegan <tim@xen.org> Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
* x86: don't pass negative time to gtime_to_gtsc() (try 2)Jan Beulich2013-07-021-9/+6
| | | | | | | | | | | | | | | This mostly reverts commit eb60be3d ("x86: don't pass negative time to gtime_to_gtsc()") and instead corrects __update_vcpu_system_time()'s handling of this_cpu(cpu_time).stime_local_stamp dating back before the start of a HVM guest (which would otherwise lead to a negative value getting passed to gtime_to_gtsc(), causing scale_delta() to produce meaningless output). Flushing the value to zero was wrong, and printing a message for something that can validly happen wasn't very useful either. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>