Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
1 change: 1 addition & 0 deletions .container_build_image
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rocky-10-kernel-builder
4 changes: 2 additions & 2 deletions .github/workflows/build-check_aarch64-rt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
dnf groupinstall 'Development Tools' -y
dnf install openssl -y
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0
Expand All @@ -35,4 +35,4 @@ jobs:
git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree
cp configs/kernel-aarch64-rt-rhel.config .config
make olddefconfig
make -j8
make -j$(nproc)
4 changes: 2 additions & 2 deletions .github/workflows/build-check_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
dnf groupinstall 'Development Tools' -y
dnf install openssl -y
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0
Expand All @@ -35,4 +35,4 @@ jobs:
git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree
cp configs/kernel-aarch64-rhel.config .config
make olddefconfig
make -j8
make -j$(nproc)
4 changes: 2 additions & 2 deletions .github/workflows/build-check_x86_64-rt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
dnf groupinstall 'Development Tools' -y
dnf install openssl -y
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0
Expand All @@ -35,4 +35,4 @@ jobs:
git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree
cp configs/kernel-x86_64-rt-rhel.config .config
make olddefconfig
make -j8
make -j$(nproc)
4 changes: 2 additions & 2 deletions .github/workflows/build-check_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
dnf groupinstall 'Development Tools' -y
dnf install openssl -y
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0
Expand All @@ -35,4 +35,4 @@ jobs:
git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree
cp configs/kernel-x86_64-rhel.config .config
make olddefconfig
make -j8
make -j$(nproc)
11 changes: 11 additions & 0 deletions .github/workflows/kernel-build-and-test-multiarch-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Trigger Automated kernel build and test (multi-arch)

on:
push:
branches:
- '*_rlc-10/**'

jobs:
kernelCI:
uses: ctrliq/kernel-src-tree/.github/workflows/kernel-build-and-test-multiarch-trigger.yml@main
secrets: inherit
6 changes: 4 additions & 2 deletions arch/arm64/kvm/at.c
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,8 @@ void __kvm_at_s12(struct kvm_vcpu *vcpu, u32 op, u64 vaddr)
/* Do the stage-2 translation */
ipa = (par & GENMASK_ULL(47, 12)) | (vaddr & GENMASK_ULL(11, 0));
out.esr = 0;
ret = kvm_walk_nested_s2(vcpu, ipa, &out);
scoped_guard(srcu, &vcpu->kvm->srcu)
ret = kvm_walk_nested_s2(vcpu, ipa, &out);
if (ret < 0)
return;

Expand Down Expand Up @@ -1623,7 +1624,8 @@ int __kvm_find_s1_desc_level(struct kvm_vcpu *vcpu, u64 va, u64 ipa, int *level)
}

/* Walk the guest's PT, looking for a match along the way */
ret = walk_s1(vcpu, &wi, &wr, va);
scoped_guard(srcu, &vcpu->kvm->srcu)
ret = walk_s1(vcpu, &wi, &wr, va);
switch (ret) {
case -EINTR:
/* We interrupted the walk on a match, return the level */
Expand Down
33 changes: 20 additions & 13 deletions arch/arm64/kvm/nested.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,28 @@ int kvm_vcpu_init_nested(struct kvm_vcpu *vcpu)
* again, and there is no reason to affect the whole VM for this.
*/
num_mmus = atomic_read(&kvm->online_vcpus) * S2_MMU_PER_VCPU;
tmp = kvrealloc(kvm->arch.nested_mmus,
size_mul(sizeof(*kvm->arch.nested_mmus), num_mmus),
GFP_KERNEL_ACCOUNT | __GFP_ZERO);
if (!tmp)
return -ENOMEM;

swap(kvm->arch.nested_mmus, tmp);
if (num_mmus > kvm->arch.nested_mmus_size) {
tmp = kvcalloc(num_mmus, sizeof(*tmp), GFP_KERNEL_ACCOUNT);
if (!tmp)
return -ENOMEM;

/*
* If we went through a realocation, adjust the MMU back-pointers in
* the previously initialised kvm_pgtable structures.
*/
if (kvm->arch.nested_mmus != tmp)
for (int i = 0; i < kvm->arch.nested_mmus_size; i++)
kvm->arch.nested_mmus[i].pgt->mmu = &kvm->arch.nested_mmus[i];
write_lock(&kvm->mmu_lock);

if (kvm->arch.nested_mmus_size) {
memcpy(tmp, kvm->arch.nested_mmus,
size_mul(sizeof(*tmp), kvm->arch.nested_mmus_size));

for (int i = 0; i < kvm->arch.nested_mmus_size; i++)
tmp[i].pgt->mmu = &tmp[i];
}

swap(kvm->arch.nested_mmus, tmp);

write_unlock(&kvm->mmu_lock);

kvfree(tmp);
}

for (int i = kvm->arch.nested_mmus_size; !ret && i < num_mmus; i++)
ret = init_nested_s2_mmu(kvm, &kvm->arch.nested_mmus[i]);
Expand Down
41 changes: 18 additions & 23 deletions arch/x86/kvm/mmu/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ static struct kmem_cache *pte_list_desc_cache;
struct kmem_cache *mmu_page_header_cache;

static void mmu_spte_set(u64 *sptep, u64 spte);
static int mmu_page_zap_pte(struct kvm *kvm, struct kvm_mmu_page *sp,
u64 *spte, struct list_head *invalid_list);

struct kvm_mmu_role_regs {
const unsigned long cr0;
Expand Down Expand Up @@ -1283,19 +1285,6 @@ static void drop_spte(struct kvm *kvm, u64 *sptep)
rmap_remove(kvm, sptep);
}

static void drop_large_spte(struct kvm *kvm, u64 *sptep, bool flush)
{
struct kvm_mmu_page *sp;

sp = sptep_to_sp(sptep);
WARN_ON_ONCE(sp->role.level == PG_LEVEL_4K);

drop_spte(kvm, sptep);

if (flush)
kvm_flush_remote_tlbs_sptep(kvm, sptep);
}

/*
* Write-protect on the specified @sptep, @pt_protect indicates whether
* spte write-protection is caused by protecting shadow page table.
Expand Down Expand Up @@ -2460,12 +2449,15 @@ static struct kvm_mmu_page *kvm_mmu_get_child_sp(struct kvm_vcpu *vcpu,
u64 *sptep, gfn_t gfn,
bool direct, unsigned int access)
{
union kvm_mmu_page_role role;
union kvm_mmu_page_role role = kvm_mmu_child_role(sptep, direct, access);

if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep))
if (is_shadow_present_pte(*sptep) &&
!is_large_pte(*sptep) &&
spte_to_child_sp(*sptep) &&
spte_to_child_sp(*sptep)->gfn == gfn &&
spte_to_child_sp(*sptep)->role.word == role.word)
return ERR_PTR(-EEXIST);

role = kvm_mmu_child_role(sptep, direct, access);
return kvm_mmu_get_shadow_page(vcpu, gfn, role);
}

Expand Down Expand Up @@ -2540,13 +2532,16 @@ static void __link_shadow_page(struct kvm *kvm,

BUILD_BUG_ON(VMX_EPT_WRITABLE_MASK != PT_WRITABLE_MASK);

/*
* If an SPTE is present already, it must be a leaf and therefore
* a large one. Drop it, and flush the TLB if needed, before
* installing sp.
*/
if (is_shadow_present_pte(*sptep))
drop_large_spte(kvm, sptep, flush);
if (is_shadow_present_pte(*sptep)) {
struct kvm_mmu_page *parent_sp;
LIST_HEAD(invalid_list);

parent_sp = sptep_to_sp(sptep);
WARN_ON_ONCE(parent_sp->role.level == PG_LEVEL_4K);

mmu_page_zap_pte(kvm, parent_sp, sptep, &invalid_list);
kvm_mmu_remote_flush_or_zap(kvm, &invalid_list, true);
}

spte = make_nonleaf_spte(sp->spt, sp_ad_disabled(sp));

Expand Down
18 changes: 12 additions & 6 deletions fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,15 @@ struct dentry *d_find_alias_rcu(struct inode *inode)
return de;
}

void d_dispose_if_unused(struct dentry *dentry, struct list_head *dispose)
{
spin_lock(&dentry->d_lock);
if (!dentry->d_lockref.count)
to_shrink_list(dentry, dispose);
spin_unlock(&dentry->d_lock);
}
EXPORT_SYMBOL(d_dispose_if_unused);

/*
* Try to kill dentries associated with this inode.
* WARNING: you must own a reference to inode.
Expand All @@ -1042,12 +1051,8 @@ void d_prune_aliases(struct inode *inode)
struct dentry *dentry;

spin_lock(&inode->i_lock);
hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
spin_lock(&dentry->d_lock);
if (!dentry->d_lockref.count)
to_shrink_list(dentry, &dispose);
spin_unlock(&dentry->d_lock);
}
hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias)
d_dispose_if_unused(dentry, &dispose);
spin_unlock(&inode->i_lock);
shrink_dentry_list(&dispose);
}
Expand Down Expand Up @@ -1087,6 +1092,7 @@ void shrink_dentry_list(struct list_head *list)
shrink_kill(dentry);
}
}
EXPORT_SYMBOL(shrink_dentry_list);

static enum lru_status dentry_lru_isolate(struct list_head *item,
struct list_lru_one *lru, void *arg)
Expand Down
33 changes: 32 additions & 1 deletion fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/swap.h>
#include <linux/splice.h>
#include <linux/sched.h>
#include <linux/seq_file.h>

#define CREATE_TRACE_POINTS
#include "fuse_trace.h"
Expand Down Expand Up @@ -1887,6 +1888,19 @@ static int fuse_notify_resend(struct fuse_conn *fc)
return 0;
}

/*
* Increments the fuse connection epoch. This will result of dentries from
* previous epochs to be invalidated.
*
* XXX optimization: add call to shrink_dcache_sb()?
*/
static int fuse_notify_inc_epoch(struct fuse_conn *fc)
{
atomic_inc(&fc->epoch);

return 0;
}

static int fuse_notify(struct fuse_conn *fc, enum fuse_notify_code code,
unsigned int size, struct fuse_copy_state *cs)
{
Expand Down Expand Up @@ -1915,6 +1929,9 @@ static int fuse_notify(struct fuse_conn *fc, enum fuse_notify_code code,
case FUSE_NOTIFY_RESEND:
return fuse_notify_resend(fc);

case FUSE_NOTIFY_INC_EPOCH:
return fuse_notify_inc_epoch(fc);

default:
fuse_copy_finish(cs);
return -EINVAL;
Expand Down Expand Up @@ -1989,7 +2006,7 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud,
*/
if (!oh.unique) {
err = fuse_notify(fc, oh.error, nbytes - sizeof(oh), cs);
goto out;
goto copy_finish;
}

err = -EINVAL;
Expand Down Expand Up @@ -2453,6 +2470,17 @@ static long fuse_dev_ioctl(struct file *file, unsigned int cmd,
}
}

#ifdef CONFIG_PROC_FS
static void fuse_dev_show_fdinfo(struct seq_file *seq, struct file *file)
{
struct fuse_dev *fud = fuse_get_dev(file);
if (!fud)
return;

seq_printf(seq, "fuse_connection:\t%u\n", fud->fc->dev);
}
#endif

const struct file_operations fuse_dev_operations = {
.owner = THIS_MODULE,
.open = fuse_dev_open,
Expand All @@ -2465,6 +2493,9 @@ const struct file_operations fuse_dev_operations = {
.fasync = fuse_dev_fasync,
.unlocked_ioctl = fuse_dev_ioctl,
.compat_ioctl = compat_ptr_ioctl,
#ifdef CONFIG_PROC_FS
.show_fdinfo = fuse_dev_show_fdinfo,
#endif
};
EXPORT_SYMBOL_GPL(fuse_dev_operations);

Expand Down
Loading