Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
e56fa86
i40e: fix i40e_count_filters() to count only active/new filters
PlaidCat Jan 27, 2025
3aae786
i40e: fix race condition by adding filter's intermediate sync state
PlaidCat Jan 27, 2025
252996c
dlm: fix recovery of middle conversions
PlaidCat Jan 27, 2025
bcf6726
x86/cpu/intel: Detect TME keyid bits before setting MTRR mask registers
PlaidCat Jan 27, 2025
12ee527
KVM: SVM: Get source vCPUs from source VM for SEV-ES intrahost migration
PlaidCat Jan 27, 2025
8886ef8
xfs: fix sparse inode limits on runt AG
PlaidCat Jan 27, 2025
502eeba
NFS: nfs_async_write_reschedule_io must not recurse into the writebac…
PlaidCat Jan 27, 2025
81588bf
mptcp: cope racing subflow creation in mptcp_rcv_space_adjust
PlaidCat Jan 27, 2025
7e4fb1a
Rebuild rocky8_10 with kernel-4.18.0-553.34.1.el8_10
PlaidCat Jan 27, 2025
7b476b5
scsi: storvsc: Handle additional SRB status values
PlaidCat Jan 27, 2025
bee8994
scsi: storvsc: Do not flag MAINTENANCE_IN return of SRB_STATUS_DATA_O…
PlaidCat Jan 27, 2025
e3765f3
samples: pktgen: add some helper functions for port parsing
PlaidCat Jan 27, 2025
22397ba
samples: pktgen: allow to specify destination port
PlaidCat Jan 27, 2025
f76c508
scsi: st: Don't modify unknown block number in MTIOCGET
PlaidCat Jan 27, 2025
769a4af
scsi: st: Add MTIOCGET and MTLOAD to ioctls allowed after device reset
PlaidCat Jan 27, 2025
91d0570
scsi: st: New session only when Unit Attention for new tape
PlaidCat Jan 27, 2025
6a52d1e
cpufreq: intel_pstate: Support Emerald Rapids OOB mode
PlaidCat Jan 27, 2025
4673f9b
Rebuild rocky8_10 with kernel-4.18.0-553.36.1.el8_10
PlaidCat Jan 27, 2025
b6f3b5c
github actions: Make builds on Merge Request
PlaidCat Jan 14, 2025
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
34 changes: 34 additions & 0 deletions .github/workflows/build-check_aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: aarch64 CI
on:
pull_request:
branches:
- '**'
- '!mainline'

jobs:
kernel-build-job:
runs-on:
labels: kernel-build-arm64
container:
image: rockylinux:8
env:
ROCKY_ENV: rocky8
ports:
- 80
options: --cpus 8
steps:
- name: Install tools and Libraries
run: |
dnf groupinstall 'Development Tools' -y
dnf install --enablerepo=devel bc dwarves kernel-devel openssl-devel elfutils-libelf-devel -y
- name: Checkout code
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0
- name: Build the Kernel
run: |
git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree
cp configs/kernel-aarch64.config .config
make olddefconfig
make -j8
34 changes: 34 additions & 0 deletions .github/workflows/build-check_x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: x86_64 CI
on:
pull_request:
branches:
- '**'
- '!mainline'

jobs:
kernel-build-job:
runs-on:
labels: kernel-build
container:
image: rockylinux:8
env:
ROCKY_ENV: rocky8
ports:
- 80
options: --cpus 8
steps:
- name: Install tools and Libraries
run: |
dnf groupinstall 'Development Tools' -y
dnf install --enablerepo=devel bc dwarves kernel-devel openssl-devel elfutils-libelf-devel -y
- name: Checkout code
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0
- name: Build the Kernel
run: |
git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree
cp configs/kernel-x86_64.config .config
make olddefconfig
make -j8
2 changes: 1 addition & 1 deletion Makefile.rhelver
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RHEL_MINOR = 10
#
# Use this spot to avoid future merge conflicts.
# Do not trim this comment.
RHEL_RELEASE = 553.33.1
RHEL_RELEASE = 553.36.1

#
# ZSTREAM
Expand Down
178 changes: 91 additions & 87 deletions arch/x86/kernel/cpu/intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,90 @@ int intel_microcode_sanity_check(void *mc, bool print_err, int hdr_type)
}
EXPORT_SYMBOL_GPL(intel_microcode_sanity_check);

#define MSR_IA32_TME_ACTIVATE 0x982

/* Helpers to access TME_ACTIVATE MSR */
#define TME_ACTIVATE_LOCKED(x) (x & 0x1)
#define TME_ACTIVATE_ENABLED(x) (x & 0x2)

#define TME_ACTIVATE_POLICY(x) ((x >> 4) & 0xf) /* Bits 7:4 */
#define TME_ACTIVATE_POLICY_AES_XTS_128 0

#define TME_ACTIVATE_KEYID_BITS(x) ((x >> 32) & 0xf) /* Bits 35:32 */

#define TME_ACTIVATE_CRYPTO_ALGS(x) ((x >> 48) & 0xffff) /* Bits 63:48 */
#define TME_ACTIVATE_CRYPTO_AES_XTS_128 1

/* Values for mktme_status (SW only construct) */
#define MKTME_ENABLED 0
#define MKTME_DISABLED 1
#define MKTME_UNINITIALIZED 2
static int mktme_status = MKTME_UNINITIALIZED;

static void detect_tme_early(struct cpuinfo_x86 *c)
{
u64 tme_activate, tme_policy, tme_crypto_algs;
int keyid_bits = 0, nr_keyids = 0;
static u64 tme_activate_cpu0 = 0;

rdmsrl(MSR_IA32_TME_ACTIVATE, tme_activate);

if (mktme_status != MKTME_UNINITIALIZED) {
if (tme_activate != tme_activate_cpu0) {
/* Broken BIOS? */
pr_err_once("x86/tme: configuration is inconsistent between CPUs\n");
pr_err_once("x86/tme: MKTME is not usable\n");
mktme_status = MKTME_DISABLED;

/* Proceed. We may need to exclude bits from x86_phys_bits. */
}
} else {
tme_activate_cpu0 = tme_activate;
}

if (!TME_ACTIVATE_LOCKED(tme_activate) || !TME_ACTIVATE_ENABLED(tme_activate)) {
pr_info_once("x86/tme: not enabled by BIOS\n");
mktme_status = MKTME_DISABLED;
return;
}

if (mktme_status != MKTME_UNINITIALIZED)
goto detect_keyid_bits;

pr_info("x86/tme: enabled by BIOS\n");

tme_policy = TME_ACTIVATE_POLICY(tme_activate);
if (tme_policy != TME_ACTIVATE_POLICY_AES_XTS_128)
pr_warn("x86/tme: Unknown policy is active: %#llx\n", tme_policy);

tme_crypto_algs = TME_ACTIVATE_CRYPTO_ALGS(tme_activate);
if (!(tme_crypto_algs & TME_ACTIVATE_CRYPTO_AES_XTS_128)) {
pr_err("x86/mktme: No known encryption algorithm is supported: %#llx\n",
tme_crypto_algs);
mktme_status = MKTME_DISABLED;
}
detect_keyid_bits:
keyid_bits = TME_ACTIVATE_KEYID_BITS(tme_activate);
nr_keyids = (1UL << keyid_bits) - 1;
if (nr_keyids) {
pr_info_once("x86/mktme: enabled by BIOS\n");
pr_info_once("x86/mktme: %d KeyIDs available\n", nr_keyids);
} else {
pr_info_once("x86/mktme: disabled by BIOS\n");
}

if (mktme_status == MKTME_UNINITIALIZED) {
/* MKTME is usable */
mktme_status = MKTME_ENABLED;
}

/*
* KeyID bits effectively lower the number of physical address
* bits. Update cpuinfo_x86::x86_phys_bits accordingly.
*/
c->x86_phys_bits -= keyid_bits;
}

static void early_init_intel(struct cpuinfo_x86 *c)
{
u64 misc_enable;
Expand Down Expand Up @@ -542,6 +626,13 @@ static void early_init_intel(struct cpuinfo_x86 *c)
*/
if (detect_extended_topology_early(c) < 0)
detect_ht_early(c);

/*
* Adjust the number of physical bits early because it affects the
* valid bits of the MTRR mask registers.
*/
if (cpu_has(c, X86_FEATURE_TME))
detect_tme_early(c);
}

static void bsp_init_intel(struct cpuinfo_x86 *c)
Expand Down Expand Up @@ -702,90 +793,6 @@ static void srat_detect_node(struct cpuinfo_x86 *c)
#endif
}

#define MSR_IA32_TME_ACTIVATE 0x982

/* Helpers to access TME_ACTIVATE MSR */
#define TME_ACTIVATE_LOCKED(x) (x & 0x1)
#define TME_ACTIVATE_ENABLED(x) (x & 0x2)

#define TME_ACTIVATE_POLICY(x) ((x >> 4) & 0xf) /* Bits 7:4 */
#define TME_ACTIVATE_POLICY_AES_XTS_128 0

#define TME_ACTIVATE_KEYID_BITS(x) ((x >> 32) & 0xf) /* Bits 35:32 */

#define TME_ACTIVATE_CRYPTO_ALGS(x) ((x >> 48) & 0xffff) /* Bits 63:48 */
#define TME_ACTIVATE_CRYPTO_AES_XTS_128 1

/* Values for mktme_status (SW only construct) */
#define MKTME_ENABLED 0
#define MKTME_DISABLED 1
#define MKTME_UNINITIALIZED 2
static int mktme_status = MKTME_UNINITIALIZED;

static void detect_tme(struct cpuinfo_x86 *c)
{
u64 tme_activate, tme_policy, tme_crypto_algs;
int keyid_bits = 0, nr_keyids = 0;
static u64 tme_activate_cpu0 = 0;

rdmsrl(MSR_IA32_TME_ACTIVATE, tme_activate);

if (mktme_status != MKTME_UNINITIALIZED) {
if (tme_activate != tme_activate_cpu0) {
/* Broken BIOS? */
pr_err_once("x86/tme: configuration is inconsistent between CPUs\n");
pr_err_once("x86/tme: MKTME is not usable\n");
mktme_status = MKTME_DISABLED;

/* Proceed. We may need to exclude bits from x86_phys_bits. */
}
} else {
tme_activate_cpu0 = tme_activate;
}

if (!TME_ACTIVATE_LOCKED(tme_activate) || !TME_ACTIVATE_ENABLED(tme_activate)) {
pr_info_once("x86/tme: not enabled by BIOS\n");
mktme_status = MKTME_DISABLED;
return;
}

if (mktme_status != MKTME_UNINITIALIZED)
goto detect_keyid_bits;

pr_info("x86/tme: enabled by BIOS\n");

tme_policy = TME_ACTIVATE_POLICY(tme_activate);
if (tme_policy != TME_ACTIVATE_POLICY_AES_XTS_128)
pr_warn("x86/tme: Unknown policy is active: %#llx\n", tme_policy);

tme_crypto_algs = TME_ACTIVATE_CRYPTO_ALGS(tme_activate);
if (!(tme_crypto_algs & TME_ACTIVATE_CRYPTO_AES_XTS_128)) {
pr_err("x86/mktme: No known encryption algorithm is supported: %#llx\n",
tme_crypto_algs);
mktme_status = MKTME_DISABLED;
}
detect_keyid_bits:
keyid_bits = TME_ACTIVATE_KEYID_BITS(tme_activate);
nr_keyids = (1UL << keyid_bits) - 1;
if (nr_keyids) {
pr_info_once("x86/mktme: enabled by BIOS\n");
pr_info_once("x86/mktme: %d KeyIDs available\n", nr_keyids);
} else {
pr_info_once("x86/mktme: disabled by BIOS\n");
}

if (mktme_status == MKTME_UNINITIALIZED) {
/* MKTME is usable */
mktme_status = MKTME_ENABLED;
}

/*
* KeyID bits effectively lower the number of physical address
* bits. Update cpuinfo_x86::x86_phys_bits accordingly.
*/
c->x86_phys_bits -= keyid_bits;
}

static void init_cpuid_fault(struct cpuinfo_x86 *c)
{
u64 msr;
Expand Down Expand Up @@ -922,9 +929,6 @@ static void init_intel(struct cpuinfo_x86 *c)

init_ia32_feat_ctl(c);

if (cpu_has(c, X86_FEATURE_TME))
detect_tme(c);

init_intel_misc_features(c);

split_lock_init();
Expand Down
14 changes: 14 additions & 0 deletions arch/x86/kernel/cpu/mtrr/mtrr.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,20 @@ void __init mtrr_bp_init(void)
if (mtrr_enabled())
mtrr_bp_pat_init();

/*
* RHEL-only: Intel systems with TME feature enabled reduce
* phys_addr by keyid_bits (see detect_tme_early()) but this does
* not affect mtrr_cleanup() as phys_addr is calculated independently
* here (see f6b980646b93 upstream). To make TME enabled systems boot
* and to minimize the change for other environments, use
* boot_cpu_data.x86_phys_bits here instead.
*/
if (boot_cpu_has(X86_FEATURE_TME)) {
phys_addr = boot_cpu_data.x86_phys_bits;
size_or_mask = SIZE_OR_MASK_BITS(phys_addr);
size_and_mask = ~size_or_mask & 0xfffff00000ULL;
}

if (mtrr_cleanup(phys_addr)) {
changed_by_mtrr_cleanup = 1;
mtrr_if->set_all();
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kvm/svm/sev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,7 @@ static void sev_migrate_from(struct kvm *dst_kvm, struct kvm *src_kvm)
* Note, the source is not required to have the same number of
* vCPUs as the destination when migrating a vanilla SEV VM.
*/
src_vcpu = kvm_get_vcpu(dst_kvm, i);
src_vcpu = kvm_get_vcpu(src_kvm, i);
src_svm = to_svm(src_vcpu);

/*
Expand Down
Loading