From 44da4fbf418d36b6d2330c19e149be88524dda73 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 20 Mar 2024 16:42:00 -0700 Subject: [PATCH 1/5] style checker: Update for CheriBSD - Run for PRs against dev instead of main. - Make the check always succeed but still add annotations. --- .github/workflows/style.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 08d4242df5ed..5427e0f611cd 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -8,7 +8,7 @@ name: Style Checker on: pull_request: # maybe pull_request_target - branches: [ main ] + branches: [ dev ] types: [ opened, reopened, edited, synchronize ] permissions: @@ -31,4 +31,4 @@ jobs: - name: Run checker run: | sha=$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}) - tools/build/checkstyle9.pl --github ${sha}..${{ github.event.pull_request.head.sha }} + tools/build/checkstyle9.pl --github ${sha}..${{ github.event.pull_request.head.sha }} || true From 47216e3c172abb1d7a813e5f64880fefe9d64c28 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 20 Mar 2024 16:48:16 -0700 Subject: [PATCH 2/5] HACK: check on the disable_style branch as well --- .github/workflows/style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 5427e0f611cd..870a85df3e81 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -8,7 +8,7 @@ name: Style Checker on: pull_request: # maybe pull_request_target - branches: [ dev ] + branches: [ dev, disable_style ] types: [ opened, reopened, edited, synchronize ] permissions: From 765b13e9131e89644398151e3f4405e1d1d1115b Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 27 Mar 2024 08:45:10 -0700 Subject: [PATCH 3/5] squash! style checker: Update for CheriBSD - Check the style of the raw diff instead of each patch on the branch. --- .github/workflows/style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 870a85df3e81..5e501aafd23a 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -31,4 +31,4 @@ jobs: - name: Run checker run: | sha=$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}) - tools/build/checkstyle9.pl --github ${sha}..${{ github.event.pull_request.head.sha }} || true + git diff ${sha}..${{ github.event.pull_request.head.sha }} | tools/build/checkstyle9.pl --github - || true From eed04c2d1fed07c81a7a10eae3ce6d90e076bce0 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 8 Jun 2022 15:58:58 -0700 Subject: [PATCH 4/5] Gratuitous style bug. --- sys/kern/kern_exec.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 57c4e0ac897f..f792dfe2f6a1 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1080,12 +1080,13 @@ exec_map_first_page(struct image_params *imgp) VM_OBJECT_WUNLOCK(object); } #endif - error = vm_page_grab_valid_unlocked(&m, object, 0, - VM_ALLOC_COUNT(VM_INITIAL_PAGEIN) | + error = vm_page_grab_valid_unlocked(&m, object, 0, VM_ALLOC_COUNT(VM_INITIAL_PAGEIN) | VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED); if (error != VM_PAGER_OK) + { return (EIO); + } imgp->firstpage = sf_buf_alloc(m, 0); imgp->image_header = (char *)sf_buf_kva(imgp->firstpage); @@ -2324,7 +2325,8 @@ core_output_memtag_cheri(char * __capability base, size_t mem_len, hastags = false; map = &cp->td->td_proc->p_vmspace->vm_map; - for (; mem_len > 0; base += PAGE_SIZE, mem_len -= PAGE_SIZE) { + for (; mem_len > 0; base += PAGE_SIZE, mem_len -= PAGE_SIZE) + { if (core_dump_can_intr && curproc_sigkilled()) return (EINTR); @@ -2380,12 +2382,12 @@ core_output_memtag_cheri(char * __capability base, size_t mem_len, int sbuf_drain_core_output(void *arg, const char *data, int len) { - struct coredump_params *cp; - struct proc *p; - int error, locked; +struct coredump_params *cp; +struct proc *p; +int error, locked; - cp = arg; - p = cp->td->td_proc; +cp = arg; +p = cp->td->td_proc; /* * Some kern_proc out routines that print to this sbuf may From e480aa6cb2024bc6d59178c21d2647e9f21d879a Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 27 Mar 2024 08:33:34 -0700 Subject: [PATCH 5/5] fixup! Gratuitous style bug. --- sys/kern/kern_exec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index f792dfe2f6a1..dbfc7268b53e 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -2325,8 +2325,7 @@ core_output_memtag_cheri(char * __capability base, size_t mem_len, hastags = false; map = &cp->td->td_proc->p_vmspace->vm_map; - for (; mem_len > 0; base += PAGE_SIZE, mem_len -= PAGE_SIZE) - { + for (; mem_len > 0; base += PAGE_SIZE, mem_len -= PAGE_SIZE) { if (core_dump_can_intr && curproc_sigkilled()) return (EINTR);