Commit Graph
15 Commits
Author SHA1 Message Date
Denis Mukhin a48be48f0c x86/asm: remove HAVE_AS_CLAC_STAC
The new toolchain baseline knows the STAC/CLAC instructions,
no need to carry the workaround in the code.

Resolves: https://gitlab.com/xen-project/xen/-/work_items/203
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2025-04-02 13:16:27 +01:00
Denis Mukhin b7234d32e3 x86/irq: introduce APIC_VECTOR_VALID()
Add new macro APIC_VECTOR_VALID() to validate the interrupt vector
range as per [1]. This macro replaces hardcoded checks against the
open-coded value 16 in LAPIC and virtual LAPIC code and simplifies
the code a bit.

[1] Intel SDM volume 3A
    Chapter "ADVANCED PROGRAMMABLE INTERRUPT CONTROLLER"
    Section "Valid Interrupt Vectors"

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2025-03-25 09:22:59 +01:00
Denis Mukhin 6cc1862f54 xen/console: fix trailing whitespaces
Remove trailing whitespaces in the console driver.

No functional change.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2025-03-20 08:51:14 +01:00
Denis Mukhin 3c0745196c x86/irq: use NR_ISA_IRQS instead of open-coded value
Replace the open-coded value 16 with the NR_ISA_IRQS symbol to enhance
readability.

No functional changes.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2025-03-17 16:08:26 +00:00
Denis Mukhin 29975e126d x86/irq: rename NR_ISAIRQS to NR_ISA_IRQS
Rename NR_ISAIRQS to NR_ISA_IRQS to enhance readability.

No functional changes.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2025-03-17 16:08:25 +00:00
Denis Mukhin e3ed540f2e x86/hvm: add HVM-specific Kconfig
Add a separate menu for configuring HVM build-time settings to better
organize HVM-specific options.

HVM options will now appear in a dedicated sub-menu in the menuconfig
tool.

Also, make AMD_SVM config dependent on AMD config and INTEL_VMX on INTEL
respectively.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2025-03-17 15:01:25 +00:00
Denis Mukhin ec7a279a23 docs: add explanation for 'Resolves:'
'Resolves:' tag may be used if the patch addresses one of the tickets
logged via Gitlab to auto-close such ticket when the patch got merged.

Add documentation for the tag.

Resolves: https://gitlab.com/xen-project/xen/-/issues/199
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2025-03-11 22:30:10 +00:00
Denis Mukhin f147ccf2b3 xen/consoled: clean up console handling for PV shim
There are few places which check pv_shim console under CONFIG_PV_SHIM or
CONFIG_X86 in xen console driver.

Instead of inconsistent #ifdef-ing, introduce and use consoled_is_enabled() in
switch_serial_input() and __serial_rx().

PV shim case is fixed in __serial_rx() - should be under 'pv_shim &&
pv_console' check.

Signature of consoled_guest_{rx,tx} has changed so the errors can be logged
on the callsites.

Also, move get_initial_domain_id() to arch-independent header since it is now
required by console driver.

Lastly, add missing SPDX-License-Identifier to xen/consoled.h

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2025-03-10 09:53:11 +01:00
Denis Mukhin 91db39013a xen/console: introduce console_{get,put}_domain()
console_input_domain() takes an RCU lock to protect domain structure.
That implies call to rcu_unlock_domain() after use.

Introduce a pair of console_get_domain() / console_put_domain() to highlight
the correct use of the call within the code interacting with Xen console
driver.

The new calls used in __serial_rx(), which also fixed console forwarding to
late hardware domains which run with domain IDs different from 0.

While moving the guest_printk() invocation also drop the redundant _G infix.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2025-03-05 15:42:49 +01:00
Denis Mukhin 1b861bd95e xen/include: introduce resource.h
Move resource definitions to a new architecture-agnostic shared header file.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2025-03-03 16:06:17 -08:00
Denis Mukhin 478556f8e3 xen/console: print Xen version via keyhandler
Add Xen version printout to 'h' keyhandler output.

That is useful for debugging systems that have been left intact for a long
time.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2025-02-26 12:17:01 +01:00
Denis Mukhin 8743258747 xen/console: introduce is_console_printable()
Add is_console_printable() to implement a common check for printable characters
in the UART emulation and guest logging code.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2025-02-25 08:42:37 +01:00
Denis Mukhin b2da4fc055 tools: fix typo in sysconfig.xencommons.in
Fixes: 7b61011e14 ("tools: make xenstore domain easy configurable")
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
2025-02-11 17:09:00 +00:00
Denis Mukhin 4a06cc7178 xsm/flask: missing breaks, MISRA rule 16.4
While working on console forwarding for virtual NS8250 I stepped into
  flask_domain_alloc_security()
where break statement was missing in default case which violates MISRA
rule 16.4.

Fixed everywhere in hooks.c.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
2024-11-27 14:49:58 +00:00
Denis Mukhin 738df43521 x86/setup: fix typo in acpi=off description
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2024-11-27 11:41:16 +01:00