- 16 May, 2020 4 commits
-
-
Wei Liu authored
Signed-off-by:
Wei Liu <wl@xen.org> Acked-by:
Paul Durrant <paul@xen.org>
-
Juergen Gross authored
The dirty_cpu field of struct vcpu denotes which cpu still holds data of a vcpu. All accesses to this field should be atomic in case the vcpu could just be running, as it is accessed without any lock held in most cases. Especially sync_local_execstate() and context_switch() for the same vcpu running concurrently have a risk for failing. There are some instances where accesses are not atomically done, and even worse where multiple accesses are done when a single one would be mandated. Correct that in order to avoid potential problems. Add some assertions to verify dirty_cpu is handled properly. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Jan Beulich <jbeulich@suse.com>
-
Juergen Gross authored
With support of core scheduling sched_unit_migrate_finish() gained a call of sync_vcpu_execstate() as it was believed to be called as a result of vcpu migration in any case. In case of migrating a vcpu away from a physical cpu for a short period of time but without ever being scheduled on the selected new cpu, this might not be true so drop the call and let the lazy state syncing do its job. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Jan Beulich <jbeulich@suse.com> Reviewed-by:
Dario Faggioli <dfaggioli@suse.com>
-
Roger Pau Monne authored
Add entries for the relevant changes I've been working on during the 4.14 development time frame. Mostly performance improvements related to pvshim scalability issues when running with high number of vCPUs. Signed-off-by:
Roger Pau Monné <roger.pau@citrix.com> Acked-by:
Paul Durrant <paul@xen.org>
-
- 15 May, 2020 11 commits
-
-
Stewart Hildebrand authored
This resolves the following observed error during config merge: /bin/sh /path/to/xen/xen/../xen/tools/kconfig/merge_config.sh -m .config /path/to/xen/xen/../xen/arch/arm/configs/custom.config Using .config as base Merging /path/to/xen/xen/../xen/arch/arm/configs/custom.config # # merged configuration written to .config (needs make) # make -f /path/to/xen/xen/../xen/Makefile olddefconfig make[2]: Entering directory '/path/to/xen/xen' make[2]: *** No rule to make target 'olddefconfig'. Stop. make[2]: Leaving directory '/path/to/xen/xen' tools/kconfig/Makefile:95: recipe for target 'custom.config' failed The build was invoked by first doing a defconfig (which succeeded): $ make -C xen XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig Followed by the config fragment merge command (which failed before this patch) $ cat > xen/arch/arm/configs/custom.config <<EOF CONFIG_DEBUG=y CONFIG_EARLY_PRINTK_ZYNQMP=y EOF $ make -C xen XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- custom.config Signed-off-by:
Stewart Hildebrand <stewart.hildebrand@dornerworks.com> Reviewed-by:
Anthony PERARD <anthony.perard@citrix.com>
-
Hongyan Xia authored
The macro version UNMAP_DOMAIN_PAGE() does both NULL checking and variable clearing. Move NULL checking into the function itself so that the semantics is consistent with other similar constructs like XFREE(). This also eases the use unmap_domain_page() in error handling paths, where we only care about NULL checking but not about variable clearing. Signed-off-by:
Hongyan Xia <hongyxia@amazon.com> Reviewed-by:
Wei Liu <wl@xen.org> Acked-by:
Jan Beulich <jbeulich@suse.com> Acked-by:
Julien Grall <jgrall@amazon.com>
-
Stewart Hildebrand authored
This resolves the following observed error: /bin/sh: /path/to/xen/xen/../xen/scripts/kconfig/merge_config.sh: No such file or directory Signed-off-by:
Stewart Hildebrand <stewart.hildebrand@dornerworks.com> Reviewed-by:
Anthony PERARD <anthony.perard@citrix.com>
-
Jan Beulich authored
While from just a single Skylake system it is already clear that we can't base any of our logic on CPUID leaf 15 [1] (leaf 16 is documented to be used for display purposes only anyway), logging this information may still give us some reference in case of problems as well as for future work. Additionally on the AMD side it is unclear whether the deviation between reported and measured frequencies is because of us not doing well, or because of nominal and actual frequencies being quite far apart. The chosen variable naming in amd_log_freq() has pointed out a naming problem in rdmsr_safe(), which is being taken care of at the same time. Symmetrically wrmsr_safe(), being an inline function, also gets an unnecessary underscore dropped from one of its local variables. [1] With a core crystal clock of 24MHz and a ratio of 216/2, the reported frequency nevertheless is 2600MHz, rather than the to be expected (and calibrated by both us and Linux) 2592MHz. Suggested-by:
Andrew Cooper <andrew.cooper3@citrix.com> Signed-off-by:
Jan Beulich <jbeulich@suse.com> Reviewed-by:
Roger Pau Monné <roger.pau@citrix.com>
-
Jan Beulich authored
There's nothing to be done by the emulator, as we unconditionally abort any XBEGIN. Signed-off-by:
Jan Beulich <jbeulich@suse.com> Acked-by:
Andrew Cooper <andrew.cooper3@citrix.com>
-
Jan Beulich authored
... enabling its use by all guest kinds at the same time. Signed-off-by:
Jan Beulich <jbeulich@suse.com> Acked-by:
Andrew Cooper <andrew.cooper3@citrix.com>
-
Juergen Gross authored
With RCU barriers moved from tasklets to normal RCU processing cpu offlining in core scheduling might deadlock due to cpu synchronization required by RCU processing and core scheduling concurrently. Fix that by bailing out from core scheduling synchronization in case of pending RCU work. Additionally the RCU softirq is now required to be of higher priority than the scheduling softirqs in order to do RCU processing before entering the scheduler again, as bailing out from the core scheduling synchronization requires to raise another softirq SCHED_SLAVE, which would bypass RCU processing again. Reported-by:
Sergey Dyasli <sergey.dyasli@citrix.com> Tested-by:
Sergey Dyasli <sergey.dyasli@citrix.com> Signed-off-by:
Juergen Gross <jgross@suse.com> Acked-by:
Dario Faggioli <dfaggioli@suse.com>
-
Jan Beulich authored
While full checking is impossible (as the lock is being acquired/ released down the call tree), perform at least a lock level check. Signed-off-by:
Jan Beulich <jbeulich@suse.com> Reviewed-by:
Roger Pau Monné <roger.pau@citrix.com>
-
Jan Beulich authored
Communicating errors from p2m_set_entry() to the caller is not enough: Neither the M2P nor the stats updates should occur in such a case. Instead the allocated page needs to be freed again; for cleanliness reasons also properly take into account _PGC_allocated there. Signed-off-by:
Jan Beulich <jbeulich@suse.com> Reviewed-by:
Roger Pau Monné <roger.pau@citrix.com>
-
Jan Beulich authored
The condition of the second can be true only if the condition of the first was met; the second half of the condition of the second then also is redundant with an earlier check. Combine them, drop a pointless local variable, and take the liberty to drop the affected gdprintk() altogether, as we don't normally log anything on -EFAULT paths. Signed-off-by:
Jan Beulich <jbeulich@suse.com> Reviewed-by:
Roger Pau Monné <roger.pau@citrix.com> Acked-by:
Andrew Cooper <andrew.cooper3@citrix.com>
-
Andrew Cooper authored
Allow lowercase a/s/h to be used to annotate a non-default feature. However, until the toolstack migration logic is fixed, it is not safe to activate yet. Tolerate the annotations, but ignore them for now. Signed-off-by:
Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by:
Jan Beulich <jbeulich@suse.com>
-
- 14 May, 2020 5 commits
-
-
Jan Beulich authored
All CPUs get an equal setting of EOI broadcast suppression; no need to log one message per CPU, even if it's only in verbose APIC mode. Only the BSP is eligible to possibly get ExtINT enabled; no need to log that it gets disabled on all APs, even if - again - it's only in verbose APIC mode. Take the opportunity and introduce a "bsp" parameter to the function, to stop using smp_processor_id() to tell BSP from APs. No functional change from this. Signed-off-by:
Jan Beulich <jbeulich@suse.com> Reviewed-by:
Roger Pau Monné <roger.pau@citrix.com>
-
Julien Grall authored
EXPERT mode is currently used to gate any options that are in technical preview or not security supported. At the moment, this is selected by adding XEN_CONFIG_EXPERT=y on the make command line, or to the (currently undocumented) top-level .config file. This makes the option very unintuitive to use: If the user forgets to add the option when (re)building or when using menuconfig, then xen/.config will be silently rewritten, leading to behavior which is very difficult to diagnose. Adding XEN_CONFIG_EXPERT=y to the top-level .config is not obvious behavior, particularly as the file is undocumented. A lot of the options behind EXPERT would benefit from being more accessible so users can experiment with them and voice any concerns before they are fully supported. To make this option more discoverable and consistent to use, make it possible to select it from the menuconfig. This doesn't change the fact a Xen with EXPERT mode selected will not be security supported. Signed-off-by:
Julien Grall <jgrall@amazon.com> Signed-off-by:
George Dunlap <george.dunlap@citrix.com> Acked-by:
Ian Jackson <ian.jackson@eu.citrix.com>
-
Julien Grall authored
Since commit f80fe2b3 "xen: Update Kconfig to Linux v5.4" EXPERT can only have two values (enabled or disabled). So switch from a string to a bool. Take the opportunity to replace all "EXPERT = y" to "EXPERT" and use squash the lines bool and prompt together in modified place. Signed-off-by:
Julien Grall <jgrall@amazon.com> Acked-by:
Dario Faggioli <dfaggioli@suse.com> Acked-by:
Stefano Stabellini <sstabellini@kernel.org> Acked-by:
Jan Beulich <jbeulich@suse.com>
-
Juergen Gross authored
The XS_INTRODUCE command has two parameters: the mfn (or better: gfn) of the domain's xenstore ring page and the event channel of the domain for communicating with Xenstore. The gfn is not really needed. It is stored in the per-domain struct in xenstored and in case of another XS_INTRODUCE for the domain it is tested to match the original value. If it doesn't match the command is aborted via EINVAL, otherwise the event channel to the domain is recreated. As XS_INTRODUCE is limited to dom0 and there is no real downside of recreating the event channel just omit the test for the gfn to match and don't return EINVAL for multiple XS_INTRODUCE calls. Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Julien Grall <jgrall@amazon.com> Acked-by:
Wei Liu <wl@xen.org>
-
Jan Beulich authored
The op has a "is reserved" flag, and hence registration shouldn't happen unilaterally. Fixes: eb3dd90e ("x86/physdev: enable PHYSDEVOP_pci_mmcfg_reserved for PVH Dom0") Signed-off-by:
Jan Beulich <jbeulich@suse.com> Reviewed-by:
Roger Pau Monné <roger.pau@citrix.com>
-
- 13 May, 2020 11 commits
-
-
Andrew Cooper authored
Xen doesn't support CET-IBT yet. At a minimum, logic is required to enable it for supervisor use, but the livepatch functionality needs to learn not to overwrite ENDBR64 instructions. Furthermore, Ubuntu enables -fcf-protection by default, along with a buggy version of GCC-9 which objects to it in combination with -mindirect-branch=thunk-extern (Fixed in GCC 10, 9.4). Various objects (Xen boot path, Rombios 32 stubs) require .text to be at the beginning of the object. These paths explode when .note.gnu.properties gets put ahead of .text and we end up executing the notes data. Disable -fcf-protection for all embedded objects. Reported-by:
Jason Andryuk <jandryuk@gmail.com> Signed-off-by:
Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by:
Jason Andryuk <jandryuk@gmail.com> Reviewed-by:
Jan Beulich <jbeulich@suse.com>
-
Andrew Cooper authored
Users of EMBEDDED_EXTRA_CFLAGS already use -fno-asynchronous-unwind-tables, or ought to. This shrinks the size of the rombios 32bit stubs in guest memory. Signed-off-by:
Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by:
Jan Beulich <jbeulich@suse.com>
-
Andrew Cooper authored
Linkers may put orphaned sections ahead of .text, which breaks the calling requirements. A concrete example is Ubuntu's GCC-9 default of enabling -fcf-protection which causes us to try and execute .note.gnu.properties during Xen's boot. Put .got.plt in its own section as it specifically needs preserving from the linkers point of view, and discard everything else. This will hopefully be more robust to other unexpected toolchain properties. Fixes boot from an Ubuntu build of Xen. Reported-by:
Jason Andryuk <jandryuk@gmail.com> Signed-off-by:
Andrew Cooper <andrew.cooper3@citrix.com> Tested-by:
Jason Andryuk <jandryuk@gmail.com> Acked-by:
Jan Beulich <jbeulich@suse.com>
-
Andrew Cooper authored
GAS of at least version 2.34 complains: hypercall_page.S: Assembler messages: hypercall_page.S:24: Warning: symbol 'HYPERCALL_set_trap_table' already has its type set ... hypercall_page.S:71: Warning: symbol 'HYPERCALL_arch_7' already has its type set which is because the whole page is declared as STT_OBJECT already. Rearrange .set with respect to .type in DECLARE_HYPERCALL() so STT_FUNC is already in place. Signed-off-by:
Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by:
Jan Beulich <jbeulich@suse.com>
-
Andrew Cooper authored
This prevents syntax highlighting from believing the rest of the file is a string. Signed-off-by:
Andrew Cooper <andrew.cooper3@citrix.com> Acked-by:
Julien Grall <jgrall@amazon.com>
-
Andrew Cooper authored
xc_cpuid_apply_policy() is gaining extra parameters to untangle CPUID complexity in Xen. While an improvement in general, it does have the unfortunate side effect of duplicating some settings across multiple parameters. Rearrange the logic to only consider 'pae' if no explicit featureset is provided. This reduces the complexity for callers who have already provided a pae setting in the featureset. Signed-off-by:
Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by:
Paul Durrant <pdurrant@amzn.com> Acked-by:
Wei Liu <wl@xen.org>
-
Nick Rosbrook authored
Add a README and package comment giving a brief overview of the package. These also help pkg.go.dev generate better documentation. Also, add a copy of the LGPL (the same license used by libxl) to tools/golang/xenlight. This is required for the package to be shown on pkg.go.dev and added to the default module proxy, proxy.golang.org. Finally, add an entry for the xenlight package to SUPPORT.md. Signed-off-by:
Nick Rosbrook <rosbrookn@ainfosec.com> Reviewed-by:
George Dunlap <george.dunlap@citrix.com>
-
Nick Rosbrook authored
Initialize the xenlight Go module using the xenbits git-http URL, xenbits.xenproject.org/git-http/xen.git/tools/golang/xenlight. Also simplify the build Make target by using `go build` instead of `go install`, and do not set GOPATH here because it is now unnecessary. Signed-off-by:
Nick Rosbrook <rosbrookn@ainfosec.com> Reviewed-by:
George Dunlap <george.dunlap@citrix.com>
-
Nick Rosbrook authored
Commit df669de0 un-tracked the generated Go code, but it was decided that we actually keep the generated code in-tree. Undo the changes to ignore the generated code, and re-generate it. Signed-off-by:
Nick Rosbrook <rosbrookn@ainfosec.com> Reviewed-by:
George Dunlap <george.dunlap@citrix.com>
-
Nick Rosbrook authored
Many exported functions in xenlight require a domid as an argument. Make it easier for package users to use these functions by adding wrappers for the libxl utility functions libxl_name_to_domid and libxl_domid_to_name. Signed-off-by:
Nick Rosbrook <rosbrookn@ainfosec.com> Reviewed-by:
George Dunlap <george.dunlap@citrix.com>
-
Paul Durrant authored
... to specify a separate migration stream that will also be suitable for live update. The original scope of the document was to support non-cooperative migration of guests [1] but, since then, live update of xenstored has been brought into scope. Thus it makes more sense to define a separate image format for serializing xenstore state that is suitable for both purposes. The document has been limited to specifying a new image format. The mechanism for acquiring the image for live update or migration is not covered as that is more appropriately dealt with by a patch to docs/misc/xenstore.txt. It is also expected that, when the first implementation of live update or migration making use of this specification is committed, that the document is moved from docs/designs into docs/specs. NOTE: It will only be necessary to save and restore state for active xenstore connections, but the documentation for 'RESUME' in xenstore.txt implies otherwise. That command is unused so this patch deletes it from the specification. [1] See https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=docs/designs/non-cooperative-migration.mdSigned-off-by:
Paul Durrant <pdurrant@amazon.com> Reviewed-by:
Juergen Gross <jgross@suse.com> Acked-by:
Julien Grall <jgrall@amazon.com>
-
- 11 May, 2020 4 commits
-
-
Julien Grall authored
At the moment, write_atomic() will happily write to a pointer to const. While there are no use in Xen, it would be best to catch them at compilation time. Signed-off-by:
Julien Grall <jgrall@amazon.com> Acked-by:
Jan Beulich <jbeulich@suse.com>
-
Julien Grall authored
The current implementation of write_atomic has two issues: 1) It cannot be used to write pointer value because the switch contains cast to other size than the size of the pointer. 2) It will happily allow to write to a pointer to const. Additionally, the Arm implementation is returning a value when the x86 implementation does not anymore. This was introduced in commit 2934148a "x86: simplify a few macros / inline functions". There are no users of the return value, so it is fine to drop it. The switch is now moved in a static inline helper allowing the compiler to prevent use of const pointer and also allow to write pointer value. Signed-off-by:
Julien Grall <jgrall@amazon.com> Reviewed-by:
Stefano Stabellini <sstabellini@kernel.org>
-
Julien Grall authored
The current implementation of read_atomic() on Arm will not allow to: 1) Read a value from a pointer to const because the temporary variable will be const and therefore it is not possible to assign any value. This can be solved by using a union between the type and a char[0]. 2) Read a pointer value (e.g void *) because the switch contains cast from other type than the size of a pointer. This can be solved by by introducing a static inline for the switch and use void * for the pointer. Reported-by:
Juergen Gross <jgross@suse.com> Signed-off-by:
Julien Grall <jgrall@amazon.com> Reviewed-by:
Stefano Stabellini <sstabellini@kernel.org>
-
Julien Grall authored
After XSA-273, it is not possible to modify the vCPU soft affinity using xl vcpu-pin without modifying the hard affinity. Instead the command will crash. 42sh> gdb /usr/local/sbin/xl (gdb) r vcpu-pin 0 0 - 10 [...] Program received signal SIGSEGV, Segmentation fault. [...] (gdb) bt This is happening because 'xl' will use NULL when an affinity doesn't need to be modified. However, we will still try to apply the global affinity in the this case. As the hard affinity is not changed, then we don't need to apply the global affinity. So skip it when hard is NULL. Backport: 4.6+ # Any release with XSA-273 Fixes: aa67b97e ("xl.conf: Add global affinity masks") Reported-by:
Pawel Wieczorkiewicz <wipawel@amazon.de> Signed-off-by:
Julien Grall <jgrall@amazon.com> Acked-by:
Wei Liu <wl@xen.org>
-
- 10 May, 2020 2 commits
-
-
Roger Pau Monne authored
Clang 10 complains with: 13: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] if ( ! yyg->yy_state_buf ) ^ libxlu_disk_l.c:1259:9: note: previous statement is here if ( ! yyg->yy_state_buf ) ^ Due to the missing braces in single line statements and the wrong indentation. Fix this by disabling the warning for that specific file. I haven't found a way to force flex to add braces around single line statements in conditional blocks. Signed-off-by:
Roger Pau Monné <roger.pau@citrix.com> [ wei: regenerate output files ] Acked-by:
Wei Liu <wl@xen.org>
-
Wei Liu authored
Use flex 2.6.4 that is shipped in Debian Buster. Signed-off-by:
Wei Liu <wl@xen.org> Acked-by:
Roger Pau Monné <roger.pau@citrix.com>
-
- 08 May, 2020 2 commits
-
-
Juergen Gross authored
credit2 is currently modifying the pause flags of vcpus non-atomically via sched_set_pause_flags() and sched_clear_pause_flags(). This is dangerous as there are cases where the paus flags are modified without any lock held. So drop the non-atomic pause flag modification functions and rename the atomic ones dropping the _atomic suffix. Fixes: a76255b4 ("xen/sched: make credit2 scheduler vcpu agnostic.") Signed-off-by:
Juergen Gross <jgross@suse.com> Reviewed-by:
Dario Faggioli <dfaggioli@suse.com>
-
Juergen Gross authored
Commit cb563d76 ("xen/sched: support core scheduling for moving cpus to/from cpupools") introduced a regression when trying to remove an offline cpu from a cpupool, as the system would crash in this situation. Fix that by testing the cpu to be online. Fixes: cb563d76 ("xen/sched: support core scheduling for moving cpus to/from cpupools") Signed-off-by:
Juergen Gross <jgross@suse.com> Acked-by:
Dario Faggioli <dfaggioli@suse.com>
-
- 07 May, 2020 1 commit
-
-
Sergey Dyasli authored
Currently it might be not obvious which scheduling mode (e.g. core- scheduling) is being used by the scheduler. Alleviate this by printing additional information about the selected granularity per-cpupool. Note: per-cpupool granularity selection is not implemented yet. Every cpupool gets its granularity from the single global value. Take this opportunity to introduce struct sched_gran_name array and refactor sched_select_granularity(). Signed-off-by:
Sergey Dyasli <sergey.dyasli@citrix.com> Acked-by:
Dario Faggioli <dfaggioli@suse.com>
-