Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
972d665
expose-xsversion.patch
Sep 19, 2015
ea024a5
Write each kthread's pid into xenstore so that it can be ioniced by the
Sep 19, 2015
d56640a
Several order 4 & 5 allocations are required when setting up the
Sep 19, 2015
2b6375e
net: Do not scrub ignore_df within the same name space
anoobs Jul 27, 2017
807f1fc
enable-fragmention-gre-packets.patch
Sep 19, 2015
7dac577
At some point since kernel 4.19 the preemption of hypercalls has
Sep 19, 2015
8cb7ba9
skip cpuidle driver init if cpuidle function disabled
chunjiez Apr 11, 2024
a3e55d2
CA-392853: fix kdump kernel cannot find ACPI RSDP
chunjiez May 23, 2024
39a1401
CA-415346: export module symbol offsets
chunjiez Aug 26, 2025
992da73
x86,xen: correct dma_get_required_mask() for Xen PV guests
May 9, 2014
32e73a8
pci: export pci_probe_reset_function()
Jul 10, 2014
9041d34
Guests can potentially disable/cause the PCI device to stop respondin…
Sep 19, 2015
eede887
pciback-mask-root-port-comp-timeout.patch
Sep 19, 2015
d7a7706
Some devices advertise FLReset+ but do not support it. Add a quirk for
Sep 19, 2015
305268d
CA-135938-nfs-disconnect-on-rpc-retry.patch
Sep 19, 2015
054c3b0
sunrpc-force-disconnect-on-connection-timeout.patch
Sep 19, 2015
f51d90e
xen-ioemu-inject-msi.patch
Sep 19, 2015
f91f3ce
0001-xen-swiotlb-size-128MiB.patch
Sep 19, 2015
12f0485
The objective is to ensure we have a large enough collection of 2M
Sep 19, 2015
fdffee8
Revert to use num_online_cpus for default rss queues
minglumlu Nov 7, 2025
7ab7fdd
Add SBAT metadata to dom0 6.6 kernel
Sep 19, 2015
037ffd5
Enable lockdown integrity by default
Sep 19, 2015
99446e7
For XenServer, the desired behaviour is that signature checking is al…
Sep 19, 2015
15587ec
Use MoK variable fallback
Sep 19, 2015
a1ea8b0
Allows Xen Netback debug ring files to be read if lockdown mode is en…
Sep 19, 2015
b746c52
Import the Xen public headers in preparation for filtering hypercalls
Sep 19, 2015
61e3de7
module-hash-revocation.patch
Sep 19, 2015
53e8e98
CP-46343: common data structure padding
chunjiez Jul 18, 2025
2c0ab80
CP-46343: reserve cpuid leaves for future use
chunjiez Jul 18, 2025
dd9e594
xen-pciback: provide a "reset" sysfs file to try harder at an SBR
Jul 10, 2014
43d58b7
disable-mitigations-by-default.patch
Sep 19, 2015
404294d
call-kexec-before-offlining-noncrashing-cpus.patch
Sep 19, 2015
4df0651
SDEV_EVT_LUN_CHANGE_REPORTED events should only be reported when we're
Sep 19, 2015
01e920f
Filter and check hypercalls from userspace
Sep 19, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arch/x86/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ $(obj)/bzImage: asflags-y := $(SVGA_MODE)
quiet_cmd_image = BUILD $@
silent_redirect_image = >/dev/null
cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
$(obj)/zoffset.h $@ $($(quiet)redirect_image)
$(obj)/zoffset.h $@ $($(quiet)redirect_image) $(srctree)/arch/x86/boot/sbat.csv

$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
$(call if_changed,image)
Expand All @@ -88,7 +88,7 @@ $(obj)/zoffset.h: $(obj)/compressed/vmlinux FORCE
AFLAGS_header.o += -I$(objtree)/$(obj)
$(obj)/header.o: $(obj)/zoffset.h

LDFLAGS_setup.elf := -m elf_i386 -z noexecstack -T
LDFLAGS_setup.elf := --defsym CONFIG_EFI_STUB=$(if $(CONFIG_EFI_STUB),1,0) -m elf_i386 -z noexecstack -T
$(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE
$(call if_changed,ld)

Expand Down
16 changes: 15 additions & 1 deletion arch/x86/boot/header.S
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,22 @@ pecompat_fstart:
.byte 0x0 # Sentinel
.popsection
#else
.set pecompat_fstart, setup_size
.set pecompat_fstart, sbat_fstart
#endif

.ascii ".sbat\0\0\0"
.long sbat_fsize # VirtualSize
.long sbat_fstart # VirtualAddress
.long sbat_fsize # SizeOfRawData
.long sbat_fstart # PointerToRawData
.long 0 # PointerToRelocations
.long 0 # PointerToLineNumbers
.word 0 # NumberOfRelocations
.word 0 # NumberOfLineNumbers
.long IMAGE_SCN_CNT_INITIALIZED_DATA | \
IMAGE_SCN_MEM_READ | \
IMAGE_SCN_ALIGN_16BYTES # Characteristics

.ascii ".text"
.byte 0
.byte 0
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/boot/sbat.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
linux.xs,1,Cloud Software Group,linux,1,mailto:[email protected]
9 changes: 7 additions & 2 deletions arch/x86/boot/setup.ld
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ SECTIONS
.text32 : { *(.text32) }

.pecompat : { *(.pecompat) }
PROVIDE(pecompat_fsize = setup_size - pecompat_fstart);
PROVIDE(pecompat_fsize = sbat_fstart - pecompat_fstart);

.sbat : { *(.sbat) }
PROVIDE(sbat_fsize = 0x1000);
PROVIDE(sbat_fstart = CONFIG_EFI_STUB == 1 ? setup_size - sbat_fsize : setup_size);

. = ALIGN(16);
.rodata : { *(.rodata*) }
Expand All @@ -43,7 +47,8 @@ SECTIONS
setup_sig = .;
LONG(0x5a5aaa55)

setup_size = ALIGN(ABSOLUTE(.), 4096);
setup_size = ALIGN(ABSOLUTE(.) + (CONFIG_EFI_STUB == 1 ? sbat_fsize : 0), 4096);

setup_sects = ABSOLUTE(setup_size / 512);
}

Expand Down
40 changes: 39 additions & 1 deletion arch/x86/boot/tools/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ typedef unsigned int u32;
/* This must be large enough to hold the entire setup */
u8 buf[SETUP_SECT_MAX*512];

#define SBAT_FSIZE 0x1000

static unsigned long _edata;

/*----------------------------------------------------------------------*/
Expand Down Expand Up @@ -130,7 +132,11 @@ static void die(const char * str, ...)

static void usage(void)
{
#ifdef CONFIG_EFI_STUB
die("Usage: build setup system zoffset.h image sbat");
#else
die("Usage: build setup system zoffset.h image");
#endif
}

/*
Expand Down Expand Up @@ -178,8 +184,15 @@ int main(int argc, char ** argv)
int fd;
void *kernel;
u32 crc = 0xffffffffUL;
int expect_argc;

#ifdef CONFIG_EFI_STUB
expect_argc = 6;
#else
expect_argc = 5;
#endif

if (argc != 5)
if (argc < expect_argc)
usage();
parse_zoffset(argv[3]);

Expand All @@ -200,6 +213,11 @@ int main(int argc, char ** argv)
die("Boot block hasn't got boot flag (0xAA55)");
fclose(file);

#if CONFIG_EFI_STUB
/* Reserve space for .sbat section */
c += SBAT_FSIZE;
#endif

/* Pad unused space with zeros */
setup_sectors = (c + 4095) / 4096;
setup_sectors *= 8;
Expand All @@ -208,6 +226,26 @@ int main(int argc, char ** argv)
i = setup_sectors*512;
memset(buf+c, 0, i-c);

#if CONFIG_EFI_STUB
{
const char *sbat_filename = argv[5];
const unsigned int sbat_section_offset = i - SBAT_FSIZE;

FILE *file = fopen(sbat_filename, "rb");
if (!file)
die("Unable to open '%s': %m", sbat_filename);

fread(buf + sbat_section_offset, 1, SBAT_FSIZE-1, file);
if (ferror(file))
die("read-error on '%s'", sbat_filename);

if (!feof(file))
die("SBAT file too large '%s'", sbat_filename);

fclose(file);
}
#endif

/* Open and stat the kernel file */
fd = open(argv[2], O_RDONLY);
if (fd < 0)
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/include/asm/cpufeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 22, feature_bit) || \
CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 23, feature_bit) || \
REQUIRED_MASK_CHECK || \
BUILD_BUG_ON_ZERO(NCAPINTS != 24))
BUILD_BUG_ON_ZERO(NCAPINTS != 30))

#define DISABLED_MASK_BIT_SET(feature_bit) \
( CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 0, feature_bit) || \
Expand Down Expand Up @@ -127,7 +127,7 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 22, feature_bit) || \
CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 23, feature_bit) || \
DISABLED_MASK_CHECK || \
BUILD_BUG_ON_ZERO(NCAPINTS != 24))
BUILD_BUG_ON_ZERO(NCAPINTS != 30))

#define cpu_has(c, bit) \
(__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/include/asm/cpufeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
/*
* Defines x86 CPU feature bits
*/
#define NCAPINTS 24 /* N 32-bit words worth of info */
#define NBUGINTS 3 /* N 32-bit bug flags */
#define NCAPINTS 30 /* N 32-bit words worth of info */
#define NBUGINTS 4 /* N 32-bit bug flags */

/*
* Note: If the comment begins with a quoted string, that string is used
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/disabled-features.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,6 @@
#define DISABLED_MASK21 0
#define DISABLED_MASK22 0
#define DISABLED_MASK23 0
#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 24)
#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 30)

#endif /* _ASM_X86_DISABLED_FEATURES_H */
2 changes: 1 addition & 1 deletion arch/x86/include/asm/required-features.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@
#define REQUIRED_MASK21 0
#define REQUIRED_MASK22 0
#define REQUIRED_MASK23 0
#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 24)
#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 30)

#endif /* _ASM_X86_REQUIRED_FEATURES_H */
7 changes: 7 additions & 0 deletions arch/x86/include/asm/xen/hypercall.h
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,13 @@ HYPERVISOR_hvm_op(int op, void *arg)
return _hypercall2(unsigned long, hvm_op, op, arg);
}

static inline int __must_check
HYPERVISOR_kexec_op(
unsigned long op, void *args)
{
return _hypercall2(int, kexec_op, op, args);
}

static inline int
HYPERVISOR_xenpmu_op(unsigned int op, void *arg)
{
Expand Down
3 changes: 2 additions & 1 deletion arch/x86/include/asm/xen/swiotlb-xen.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#ifndef _ASM_X86_SWIOTLB_XEN_H
#define _ASM_X86_SWIOTLB_XEN_H

int xen_swiotlb_fixup(void *buf, unsigned long nslabs);
int xen_swiotlb_fixup(void *buf, unsigned long nslabs,
unsigned long *contig_pages);
int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order,
unsigned int address_bits,
dma_addr_t *dma_handle);
Expand Down
18 changes: 18 additions & 0 deletions arch/x86/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <crypto/aria.h>
#include <linux/sched.h>
#include <linux/stddef.h>
#include <linux/list.h>
#include <linux/hardirq.h>
#include <linux/suspend.h>
#include <linux/kbuild.h>
Expand Down Expand Up @@ -139,5 +140,22 @@ static void __used common(void)
OFFSET(SL_rlp_wakeup_addr, txt_sinit_mle_data, rlp_wakeup_addr);
OFFSET(SL_rlp_gdt_base, smx_rlp_mle_join, rlp_gdt_base);
OFFSET(SL_rlp_entry_point, smx_rlp_mle_join, rlp_entry_point);
#endif
BLANK();
OFFSET(MODULE_LIST_HEAD_next, list_head, next);
OFFSET(MODULE_state, module, state);
OFFSET(MODULE_next, module, list);
OFFSET(MODULE_name, module, name);
DEFINE(MODULE_name_len, MODULE_NAME_LEN);
#ifdef CONFIG_KALLSYMS
OFFSET(MODULE_notes_attrs, module, notes_attrs);
OFFSET(MODULE_notes_count, module_notes_attrs, notes);
OFFSET(MODULE_binattrs, module_notes_attrs, attrs);
DEFINE(SIZEOF_binattr, sizeof(struct bin_attribute));
OFFSET(MODULE_noteattr, bin_attribute, attr);
OFFSET(MODULE_notesize, bin_attribute, size);
OFFSET(MODULE_notedata, bin_attribute, private);
OFFSET(MODULE_notename, attribute, name);
DEFINE(MODULE_notename_len, PAGE_SIZE);
#endif
}
9 changes: 3 additions & 6 deletions arch/x86/kernel/cpu/bugs.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,7 @@ static void x86_amd_ssb_disable(void)
#define pr_fmt(fmt) "MDS: " fmt

/* Default mitigation for MDS-affected CPUs */
static enum mds_mitigations mds_mitigation __ro_after_init =
IS_ENABLED(CONFIG_MITIGATION_MDS) ? MDS_MITIGATION_FULL : MDS_MITIGATION_OFF;
static enum mds_mitigations mds_mitigation __ro_after_init = MDS_MITIGATION_OFF;
static bool mds_nosmt __ro_after_init = false;

static const char * const mds_strings[] = {
Expand Down Expand Up @@ -314,8 +313,7 @@ enum taa_mitigations {
};

/* Default mitigation for TAA-affected CPUs */
static enum taa_mitigations taa_mitigation __ro_after_init =
IS_ENABLED(CONFIG_MITIGATION_TAA) ? TAA_MITIGATION_VERW : TAA_MITIGATION_OFF;
static enum taa_mitigations taa_mitigation __ro_after_init = TAA_MITIGATION_OFF;
static bool taa_nosmt __ro_after_init;

static const char * const taa_strings[] = {
Expand Down Expand Up @@ -413,8 +411,7 @@ enum mmio_mitigations {
};

/* Default mitigation for Processor MMIO Stale Data vulnerabilities */
static enum mmio_mitigations mmio_mitigation __ro_after_init =
IS_ENABLED(CONFIG_MITIGATION_MMIO_STALE_DATA) ? MMIO_MITIGATION_VERW : MMIO_MITIGATION_OFF;
static enum mmio_mitigations mmio_mitigation __ro_after_init = MMIO_MITIGATION_OFF;
static bool mmio_nosmt __ro_after_init = false;

static const char * const mmio_strings[] = {
Expand Down
18 changes: 18 additions & 0 deletions arch/x86/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,17 @@ static void __init x86_report_nx(void)
}
}

static bool lockdown_disabled;

static int __init lockdown_disable_param(char *str)
{
lockdown_disabled = true;

return 0;
}

early_param("lockdown_disable", lockdown_disable_param);

/*
* Determine if we were loaded by an EFI loader. If so, then we have also been
* passed the efi memmap, systab, etc., so we should use these data structures
Expand Down Expand Up @@ -906,6 +917,13 @@ void __init setup_arch(char **cmdline_p)
efi_init();

efi_set_secure_boot(boot_params.secure_boot);
if (boot_params.secure_boot == efi_secureboot_mode_enabled)
security_lock_kernel_down("EFI Secure Boot mode",
LOCKDOWN_INTEGRITY_MAX);
else if (!lockdown_disabled)
security_lock_kernel_down("vendor policy",
LOCKDOWN_INTEGRITY_MAX);

reserve_ibft_region();
x86_init.resources.dmi_setup();

Expand Down
1 change: 1 addition & 0 deletions arch/x86/xen/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <linux/efi.h>
#include <linux/init.h>
#include <linux/string.h>
#include <linux/security.h>

#include <xen/xen.h>
#include <xen/xen-ops.h>
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/xen/enlighten_pv.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void *xen_initial_gdt;
static int xen_cpu_up_prepare_pv(unsigned int cpu);
static int xen_cpu_dead_pv(unsigned int cpu);

#ifndef CONFIG_PREEMPTION
#ifndef CONFIG_PREEMPT
/*
* Some hypercalls issued by the toolstack can take many 10s of
* seconds. Allow tasks running hypercalls via the privcmd driver to
Expand Down Expand Up @@ -746,7 +746,7 @@ __visible noinstr void xen_pv_evtchn_do_upcall(struct pt_regs *regs)

inhcall = get_and_clear_inhcall();
if (inhcall && !WARN_ON_ONCE(state.exit_rcu)) {
irqentry_exit_cond_resched();
raw_irqentry_exit_cond_resched();
instrumentation_end();
restore_inhcall(inhcall);
} else {
Expand Down
4 changes: 4 additions & 0 deletions block/elevator.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ struct elevator_mq_ops {
struct request *(*next_request)(struct request_queue *, struct request *);
void (*init_icq)(struct io_cq *);
void (*exit_icq)(struct io_cq *);

void *xs_kabi_padding;
};

#define ELV_NAME_MAX (16)
Expand Down Expand Up @@ -83,6 +85,8 @@ struct elevator_type
/* managed by elevator core */
char icq_cache_name[ELV_NAME_MAX + 6]; /* elvname + "_io_cq" */
struct list_head list;

void *xs_kabi_padding;
};

static inline bool elevator_tryget(struct elevator_type *e)
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void __printf(1, 0) acpi_os_vprintf(const char *fmt, va_list args)
#endif
}

#ifdef CONFIG_KEXEC
#ifdef CONFIG_KEXEC_CORE
static unsigned long acpi_rsdp;
static int __init setup_acpi_rsdp(char *arg)
{
Expand All @@ -187,7 +187,7 @@ acpi_physical_address __init acpi_os_get_root_pointer(void)
{
acpi_physical_address pa;

#ifdef CONFIG_KEXEC
#ifdef CONFIG_KEXEC_CORE
/*
* We may have been provided with an RSDP on the command line,
* but if a malicious user has done so they may be pointing us
Expand Down
17 changes: 14 additions & 3 deletions drivers/block/xen-blkback/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,14 @@ struct xen_vbd {
unsigned int overflow_max_grants:1;
};

struct backend_info;
struct backend_info {
struct xenbus_device *dev;
struct xen_blkif *blkif;
struct xenbus_watch backend_watch;
unsigned major;
unsigned minor;
char *mode;
};

/* Number of requests that we can fit in a ring */
#define XEN_BLKIF_REQS_PER_PAGE 32
Expand Down Expand Up @@ -365,8 +372,12 @@ struct pending_req {
#define xen_blkif_get(_b) (atomic_inc(&(_b)->refcnt))
#define xen_blkif_put(_b) \
do { \
if (atomic_dec_and_test(&(_b)->refcnt)) \
schedule_work(&(_b)->free_work);\
if (atomic_dec_and_test(&(_b)->refcnt)) { \
get_device(&(_b)->be->dev->dev); \
if (!schedule_work(&(_b)->free_work)) { \
put_device(&(_b)->be->dev->dev); \
} \
} \
} while (0)

struct phys_req {
Expand Down
Loading