Commit Graph
2158 Commits
Author SHA1 Message Date
Juergen Gross fce27a1fd0 docs: clarify tag sequence in sending-patches
Make clear what an "Assisted-by:" tag relates to in
sending-patches.pandoc.

Add the possibility to clarify how AI was used.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Julien Grall <julien@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2026-09-21 10:49:38 +02:00
Jan Beulich 68c3f7fb3a Eclair: relax long <-> function-pointer conversion deviation
What is true for unsigned long is also true for plain/signed long, thus
also taking care of two instances of __x86_return_thunk() being cast to
long.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
2026-09-21 09:59:08 +02:00
Michal Orzel 422484e55c cmdline: Document console=dtuart option
Document the default console= option on Arm and RISC-V that is
"dtuart" indicating a generic UART parsed from a device tree or
ACPI SPCR table. This serial utilizes SERHND_DTUART handle.

Take the opportunity to:
 - fix documented x86 default to vga to match OPT_CONSOLE_STR,
 - mark dtuart option as available on RISC-V,
 - document fall back to /chosen/stdout-path.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2026-09-15 17:13:02 +02:00
Andrew Cooper cfad3bc123 x86/bitops: Remove ADDR
All this does is obfuscate the usage sites.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
2026-09-02 21:44:30 +01:00
Jan Beulich 9d2bbfb797 x86/time: CMOS RTC may run in binary mode
Indicating it would always use BCD mode is just wrong (and then the
comment there said the opposite). All halfway recent (and really all 64-
bit capable) systems having a CMOS RTC should properly indicate the mode
in control register B.

Make use of the flag, but provide a fallback mechanism in case people run
into systems not matching the above assumption. Additionally, when binary
mode is indicated and when "cmos-rtc-probe" is in use (but "cmos-rtc-bcd"
isn't), probe whether the clock really runs in binary mode. (This probing,
sadly, can take up to 10 seconds.)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger@xenproject.org>
2026-09-02 15:11:50 +02:00
Juergen Gross b01e4c0c36 docs: remove stale stubdom entries from stubdom.txt
There are several stubdoms mentioned in docs/misc/stubdom.txt which
no longer exist. Remove them.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2026-08-13 15:11:36 +02:00
Tu Dinh 644ea6f845 xenstore-paths: Specify ipvX/$INDEX/prefix
In the guest-reported IP address in xenstore, it's useful to know which
subnet it belongs to.

Add a specification for a subkey of each IP address, containing that
address's subnet prefix.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
Reviewed-by: Juergen Gross <jgross@suse.com>
2026-07-23 10:20:45 +02:00
Andrew Cooper 1383141821 Rerun ./autogen.sh for 4.23
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-06-29 18:06:24 +01:00
Cody Zuschlag b13f2f3fb1 docs/process: document AI-assisted patch tags
Add documentation for the Assisted-by tag to clarify how
AI-assisted tooling may be disclosed in Xen patches.

The guidance follows the Linux kernel documentation.

Signed-off-by: Cody Zuschlag <cody.zuschlag@gmail.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@vates.tech>
2026-06-19 17:23:46 +01:00
Roger Pau Monne f12caafc04 docs: remove non-breaking space from xen-command-line
Fixes rendering of the generated html.

Fixes: 31d9c88a38 ("pdx: introduce command line compression toggle")
Signed-of-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
2026-06-08 14:06:40 +01:00
Andrew Cooper 286059a3bb x86/fred: Enable FRED by default on AMD systems
FRED is now believed to be complete for AMD systems, and has had its tyres
kicked by both XenServer and AMD.  Enable FRED by default on capable AMD
systems (Zen6 and later).

Support on Intel is still not yet complete.  Leave it as tech preview and not
security supported.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
2026-06-03 10:48:49 +01:00
Eduardo Marinho d38a353eac docs/specs: drop duplicated word in libxl-migration-stream.pandoc
Remove the duplicated word "to" in the libxl migration stream specification.

Signed-off-by: Eduardo Marinho <eduardomarinho@pm.me>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-06-01 12:25:48 +01:00
Eduardo Marinho 9db2c3b29f docs/admin-guide: drop duplicated word in microcode-loading.rst
Remove the duplicated word "contains" in the microcode loading documentation.

Signed-off-by: Eduardo Marinho <eduardomarinho@pm.me>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-06-01 12:25:48 +01:00
Eduardo Marinho 2121ecf1c3 docs: fix spelling of 'necessarily' in index.rst
Correct a minor typo in the introduction section to improve readability.

Signed-off-by: Eduardo Marinho <eduardomarinho@pm.me>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-06-01 12:25:48 +01:00
Ravindra Kumar Bundela 5fa6f95842 docs: fix spelling of 'receiver' and 'receiving' in libxc-migration-stream
Signed-off-by: Ravindra Kumar Bundela <ravindrarkb1205@gmail.com>
Acked-by: Michal Orzel <michal.orzel@amd.com>
2026-06-01 10:36:15 +02:00
Ravindra Kumar Bundela 275ae20dd7 docs: fix spelling of 'receive' in xen-command-line
Signed-off-by: Ravindra Kumar Bundela <ravindrarkb1205@gmail.com>
Acked-by: Michal Orzel <michal.orzel@amd.com>
2026-06-01 10:36:15 +02:00
Ravindra Kumar Bundela b7809aad2d docs: fix typo in printk-formats documentation
Signed-off-by: Ravindra Kumar Bundela <ravindrarkb1205@gmail.com>
Acked-by: Michal Orzel <michal.orzel@amd.com>
2026-06-01 10:36:15 +02:00
Mykola Kvach f8523357f0 docs/arm: Document GICv3 vCPU limit for host-layout domains
The number of vCPUs requested for a boot-time Arm domain is not bounded
solely by Xen's generic domain limits. For GICv3 domains using the host
memory layout, Xen can only create vCPUs whose virtual redistributor
frame is covered by redistributor MMIO regions exposed for that layout.

This can affect the hardware domain and direct-mapped domains. Document
the GICv3-specific limit in the `cpus` property description in the Arm
device-tree booting guide. Also add a generic domain-limit caveat to the
`dom0_max_vcpus` command-line documentation.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
2026-05-27 08:56:26 +02:00
Teddy Astie f47c2e96ab docs: Update console=pv requirement
PV console doesn't require Xen to be running as a shim and only
requires CONFIG_XEN_GUEST and running as a Xen guest. Update the
documentation accordingly.

Fixes: 4f6609d6a6 ("x86/guest: use PV console for Xen/Dom0 I/O")
Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-05-21 09:13:42 +02:00
Juergen Gross 42aeed3b53 tools/xenstored: add support for "all domains" node permission
Add support for using DOMID_ANY in node permissions to indicate that
all domains are allowed to access the node.

Add a new feature bit for indicating the support of DOMID_ANY.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
2026-05-21 09:12:54 +02:00
Artem Bityutskiy 78c159bdf6 x86/mwait-idle: Add cmdline option to adjust C-states table
Add a new module parameter that allows adjusting the C-states table used by
the driver.

Currently, the C-states table is hardcoded in the driver based on the CPU
model. The goal is to have good enough defaults for most users.

However, C-state characteristics, such as exit latency and residency, can
vary between different variants of the same CPU model and BIOS settings.
Moreover, different platform usage models and user preferences may benefit
from different C-state target_residency values.

Provide a way for users to adjust the C-states table via a module parameter
"table". The general format is:
"state1:latency1:target_residency1,state2:latency2:target_residency2,..."

In other words, represent each C-state by its name, exit latency (in
microseconds), and target residency (in microseconds), separated by colons.
Separate multiple C-states by commas.

For example, suppose a CPU has 3 C-states with the following
characteristics:
  C1:  exit_latency=1, target_residency=2
  C1E: exit_latency=10, target_residency=10
  C6:  exit_latency=100, target_residency=500

Users can specify a custom C-states table as follows:

1. intel_idle.table="C1:2:2,C1E:5:20,C6:150:600"
   Result: C1:  exit_latency=2, target_residency=2
           C1E: exit_latency=5, target_residency=20
           C6:  exit_latency=150, target_residency=600
2. intel_idle.table="C6::400"
   Result: C1:  exit_latency=1, target_residency=2 (unchanged)
           C1E: exit_latency=10, target_residency=10 (unchanged)
           C6:  exit_latency=100, target_residency=400
                (only target_residency changed)

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Link: https://patch.msgid.link/20251216080402.156988-3-dedekind1@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 111f77a23348

Add __init to get_cmdline_field(). Put cmdline_table_str[] in .init.data.
Other adjustments to fit our env.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
2026-05-18 08:57:36 +02:00
Artem Bityutskiy 217db3fe62 x86/mwait-idle: Remove the 'preferred_cstates' parameter
Remove the 'preferred_cstates' module parameter as it is not really useful.

The parameter currently only affects Alder Lake, where it controls C1/C1E
preference, with C1E being the default. The parameter does not support any
other platform. For example, Meteor Lake has a similar C1/C1E limitation,
but the parameter does not support Meteor Lake. This indicates that the
parameter is not very useful.

Generally, independent C1 and C1E are important for server platforms where
low latency is key. However, they are not as important for client platforms,
like Alder Lake, where C1E providing better energy savings is generally
preferred.

The parameter was originally introduced for Sapphire Rapids Xeon:
da0e58c038e6 intel_idle: add 'preferred_cstates' module argument

Later it was added to Alder Lake:
d1cf8bbfed1ed ("intel_idle: Add AlderLake support")

But it was removed from Sapphire Rapids when firmware fixed the C1/C1E
limitation:
1548fac47a114 ("intel_idle: make SPR C1 and C1E be independent")

So Alder Lake is the only platform left where this parameter has any effect.
Remove this parameter to simplify the driver and reduce maintenance burden.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Link: https://patch.msgid.link/20251215111300.132803-1-dedekind1@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a36dc37b5672
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
2026-05-18 08:56:42 +02:00
Harry Ramsey 1afacf7b15 arm/mpu: Introduce v8r_el1_msa device tree property for domains
Add a new device tree property `v8r_el1_msa` to select the MSA (memory
system architecture) at EL1 for Armv8-R architecture: MPU or MMU, the
former is the default if the property is not passed.

Implement the dom0less path to parse the new device tree property, add
a new domctl hypercall input parameter `v8r_el1_msa` for arm and
add the sanitisation in arch_sanitise_domain_config(), the parameter
is intended to be used on CONFIG_MPU systems and returns an error if
selected for MMU.

While there, add explicit padding and check that it's zero during
arch domain config sanitisation, given the breaking change, bump the
XEN_DOMCTL_INTERFACE_VERSION.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
2026-05-15 09:08:19 +02:00
Roger Pau Monne fa8687810a x86/dom0: enable pf-fixup by default for PVH dom0
A non-trivial amount of issues related to PVH dom0 are fixed by enabling
the `pf-fixup` command line option, and no issues have been reported as a
result of its usage.  Enable the option by default to make PVH dom0 more
robust in its default configuration.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
2026-05-12 18:02:44 +02:00
Juergen Gross 464b7f4f26 tools/xs-clients: support depth with xenstore-watch
Add a "-d <depth>" parameter to xenstore-watch, allowing to specify
the depth parameter of the XS_WATCH command.

Using "-d" without support of depth by xenstored will refuse to set
the watch(es).

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2026-04-22 08:59:03 +02:00
Juergen Gross 27d908e74e tools/libs/store: add support to use watches with a depth parameter
Add a new xs_watch_depth() function to libxenstore allowing to limit
the scope of a Xenstore watch. It can be used only in case Xenstore is
supporting the XENSTORE_SERVER_FEATURE_WATCHDEPTH feature.

For convenience add a xs_watch_try_depth() wrapper, which will call
xs_watch_depth() if supported and xs_watch() otherwise.

Cache the supported features of Xenstore in order not having to get
them from Xenstore for each call of one of the new functions.

While touching xs.c fix a whitespace issue there.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2026-04-22 08:57:44 +02:00
Juergen Gross cb8972017c tools/xenstored: allow domU to get own features
Expand the XS_GET_FEATURE command to allow an unprivileged domain to
read its own available features. While this information is available
via the related field in the shared page used for communication with
Xenstore, user land components of the domU would need special support
in the related kernel driver to obtain that data. With supporting the
XS_GET_FEATURE for that purpose, only an up to date libxenstore is
needed.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2026-04-21 12:06:09 +02:00
Juergen Gross fbcf400e72 docs: clarify Xenstore watch depth feature
Make it explicit that for watching the @releaseDomain/<domid> special
node, the XENSTORE_SERVER_FEATURE_WATCHDEPTH is needed.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2026-04-21 09:04:48 +02:00
Ross Lagerwall 70a6abd2cd x86: Always use eager-fpu
Lazy FPU avoids some work during a context switch but pushes more
expensive costs elsewhere:

* For a workload running some Windows VMs, I measured about 83% of
  context switches out had used the FPU so most of the time the FPU
  save/restore is not avoided, just delayed.
* A key difference between 32-bit and 64-bit OSes is that %xmm is in the
  base featureset for 64-bit and thus gets ubiquitous use in userspace.
  This is likely why we hit 83%.
* Setting/clearing the cr0.TS bit is serializing and reportedly slower
  than the processor optimized xsave/restore.
* Linux uses PKRU so a partial xsave/restore is performed on each
  context switch anyway, followed by a second xsave/restore at some
  point during execution. This interferes with the 'modified'
  optimisation that hardware uses to try and reduce the cost of the
  following XSAVE.

There is no measurable performance benefit for using lazy FPU and it
adds unwanted complexity so remove the option and always use eager-fpu.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-03-30 15:48:13 +01:00
Andrew Cooper d9fcdb0c7a docs/hypfs: Adjust the hypfs layout example
The controls for cpu-bugs were ultimately not taken.  As the paths are
documented fully below, pick only a small subset for the example.  Include
cpupool/ as it exists now.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
2026-03-30 15:48:13 +01:00
Juergen Gross ea3099e191 tools/xl: add support for xenstore quota setting via domain config
Add a new "xenstore_quota" domain config parameter for setting the
Xenstore quota of a new domain via a list of <quota>=<val> items.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
2026-03-27 12:06:37 +01:00
Juergen Gross 66eed7cbd4 docs: add man page for xenstore-watch
There is no man page for xenstore-watch, add it.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-03-13 17:18:04 +00:00
Juergen Gross a2e95641ab docs: add man page for xenstore-rm
There is no man page for xenstore-rm, add it.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-03-13 17:18:04 +00:00
Juergen Gross 6d8731c384 docs: add man page for xenstore-list
There is no man page for xenstore-list, add it.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-03-13 17:18:04 +00:00
Juergen Gross 94b31456bf docs: add man page for xenstore-exists
There is no man page for xenstore-exists, add it.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-03-13 17:18:04 +00:00
Juergen Gross 48899ad696 docs: add -h parameter description to xenstore-* man pages
The "-h" parameter is missing in the man pages of the xenstore-*
programs.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-03-13 17:18:04 +00:00
Andrew Cooper 31cbb8e2a5 docs/guest-guide: Describe the PV traps and entrypoints ABI
... seeing as I've had to thoroughly reverse engineer it for FRED and make
tweaks in places.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2026-03-03 15:15:53 +00:00
Andrew Cooper 878a9cfa45 x86/ucode: Support discrete modules being CPIO archives
Multiple downstream distros have tried passing discrete CPIO archives and
tripped over this not working.  It turns out to be easy to support, so do so.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Teddy Astie <teddy.astie@vates.tech>
2026-03-03 15:15:53 +00:00
Jan Beulich 173787d191 PCI: determine whether a device has extended config space
Legacy PCI devices don't have any extended config space. Reading any part
thereof may return all ones or other arbitrary data, e.g. in some cases
base config space contents repeatedly.

Logic follows Linux 6.19-rc's pci_cfg_space_size(), albeit leveraging our
determination of device type; in particular some comments are taken
verbatim from there. Like with Linux'es CONFIG_PCI_QUIRKS, only the alias
detection logic is covered by the new "pci=no-quirks". The singular access
at PCI_CFG_SPACE_SIZE is left unconditional.

For Misra's sake the PCI_X_STATUS_533HMZ definition also needs amending.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
2026-02-02 10:19:57 +01:00
Andrew Cooper 3a814060bb x86/ucode: Adjust parse_ucode() to match other list handling
parse_ucode() is abnormal compared to similar parsing elsewhere in Xen.

Invert the ucode_mod_forced check with respect to the "scan" and integer
handling, so we can warn the user when we've elected to ignore the parameters,
and yield -EINVAL for any unrecognised list element.

Rewrite the ucode= command line docs for clarity.

No practical change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2026-01-27 13:59:12 +00:00
Alejandro Vallejo f6cd299be9 earlycpio: lib-ify earlycpio.c
It's only used for microcode loading on x86. By lib-ifying it, it will be
discarded automatically by the linker when CONFIG_MICROCODE_LOADING=n.

Update the path in exclude-list.json, as the code is still not clean.

Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-01-22 19:42:36 +00:00
Alejandro Vallejo c4fecc5267 x86/ucode: Add Kconfig option to remove microcode loading
Amend docs to reflect ucode= command/stanza depend on MICROCODE_LOADING
being set.

The new MICROCODE_OP() is a conditional setter for the microcode_ops
struct. By using IS_ENABLED() there rather than ifdef we allow DCE to
remove all statics no longer used when microcode loading is disabled
without tagging them with __maybe_unused.

Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-01-21 10:47:46 +00:00
Alejandro Vallejo f4f68ddc60 x86/ucode: Rename UCODE_SCAN_DEFAULT to MICROCODE_SCAN_DEFAULT
We'd rather have the full spelling in Kconfig. Adjusts every other
reference to the name too.

Not a functional change.

Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-01-13 15:47:02 +00:00
Andrew Cooper 6238c97ea4 xen: Use auto keyword as per C23
In macros it is common to declare local variables using typeof(param) in order
to ensure that side effects are only evaluated once.  A consequence of this is
double textural expansion of the parameter, which can get out of hand very
quickly with nested macros.

In C23, the auto keyword has been repurposed to perform type inference.

A GCC extension, __auto_type, is now available in the new toolchain baseline
and avoids the double textural expansion.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Reviewed-by: Frediano Ziglio <frediano.ziglio@cloud.com>
2026-01-09 20:20:57 +00:00
Andrew Cooper 69e8aaf9cc xen: Drop xenoprofile support
The most recent xenoprof change was 300ef0cb4f ("x86: Add Xenoprofile
support for AMD Family16h") in 2013, despite there being 42 changes worth of
other cleanup/rearranging since then.

Oprofile themselves dropped Xen support in commit 0c142c3a096d ("Remove
opcontrol and the GUI and processor models dependent on it") in 2014, as part
of releasing version 1.0 and switching over to using operf based on the Linux
perf_event subsystem.  Linux's version of this patch was merged in commit
24880bef417f ("Merge tag 'oprofile-removal-5.12'") in 2021.

Drop xenoprof and all supporting infrastructure, including the hypercall, the
XSM hook and flask vectors which lose their only caller, and even shrinks
struct domain by one pointer which wasn't properly excluded in
!CONFIG_XENOPROF builds.

Retain the public xenoprof.h header as it is ABI, but note that the
functionality is removed.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
2026-01-09 19:05:45 +00:00
Andrew Cooper fe0ede8fe4 MISRA: Extend the R3.1 deviation for URLs to include git://
xen/drivers/passthrough/arm/ipmmu-vmsa.c contains a git:// URL in a block
comment.  This is also not an example of commented out code, so shouldn't be
considered a R3.1 violation.

Extend the regex to include git://, and swap hyperlink for URL in the
associated documentation to be more precise.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
2026-01-09 14:24:24 +00:00
Nicola Vetrini bbad59569e misra: allow using binary literals in c99 as an extension.
There is consensus towards using more binary literals in Xen,
so they are enabled both for X86_64 and ARM64.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-01-08 18:50:27 +00:00
Jan Beulich 227475c278 VT-d: move {,un}map_vtd_domain_page()
..., thus allowing them to become static. There's nothing x86-specific
about these functions anyway.

Since only the "iommu_inclusive_mapping" parameter declaration would be
left in the file, move that as well. There's nothing VT-d specific about
it (anymore?): "dom0-iommu=map-inclusive" is similarly generic, and
documentation also doesn't say anything.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
2026-01-08 08:07:19 +01:00
Nicola Vetrini c89b864a8e xen: rework deviation to address varargs MISRA violations
MISRA C Rule 17.1 prohibits the use of the features that support
variadic functions. Make the deviation already in place for controlled
use of such features more general, relying on the presence of the
`format' attribute on the function declaration.

Add attributes where missing in order to avoid special-casing
certain functions that use variadic arguments.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2026-01-05 20:34:36 +00:00
Oleksii Kurochko bff3b9ea46 xen/riscv: introduce VMID allocation and manegement
Current implementation is based on x86's way to allocate VMIDs:
  VMIDs partition the physical TLB. In the current implementation VMIDs are
  introduced to reduce the number of TLB flushes. Each time a guest-physical
  address space changes, instead of flushing the TLB, a new VMID is
  assigned. This reduces the number of TLB flushes to at most 1/#VMIDs.
  The biggest advantage is that hot parts of the hypervisor's code and data
  retain in the TLB.

  VMIDs are a hart-local resource.  As preemption of VMIDs is not possible,
  VMIDs are assigned in a round-robin scheme. To minimize the overhead of
  VMID invalidation, at the time of a TLB flush, VMIDs are tagged with a
  64-bit generation. Only on a generation overflow the code needs to
  invalidate all VMID information stored at the VCPUs with are run on the
  specific physical processor. When this overflow appears VMID usage is
  disabled to retain correctness.

Only minor changes are made compared to the x86 implementation.
These include using RISC-V-specific terminology, adding a check to ensure
the type used for storing the VMID has enough bits to hold VMIDLEN,
and introducing a new function vmidlen_detect() to clarify the VMIDLEN
value, rename stuff connected to VMID enable/disable to "VMID use
enable/disable".

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2025-12-18 09:58:56 +01:00