Hi, thanks for the diff -- I've just applied it.  According to
KASSERT(9), DIAGNOSTIC must be enabled in the kernel.  Could you
confirm that?

Thanks,
--Kor

On Tue, Dec 23, 2025 at 5:08 PM Miod Vallat <[email protected]> wrote:
>
> Could this diff help?
>
> Index: pmap.c
> ===================================================================
> RCS file: /OpenBSD/src/sys/arch/amd64/amd64/pmap.c,v
> diff -u -p -r1.182 pmap.c
> --- pmap.c      15 Aug 2025 13:40:43 -0000      1.182
> +++ pmap.c      23 Dec 2025 20:04:38 -0000
> @@ -3301,16 +3301,22 @@ pmap_tlb_shootrange(struct pmap *pm, vad
>         }
>
>         if (!pmap_use_pcid) {
> +               if (is_kva)
> +                       KASSERT(eva >= VM_MIN_KERNEL_ADDRESS);
> +               else
> +                       KASSERT(eva < VM_MIN_KERNEL_ADDRESS);
>                 if (shootself) {
>                         for (va = sva; va < eva; va += PAGE_SIZE)
>                                 pmap_update_pg(va);
>                 }
>         } else if (is_kva) {
> +               KASSERT(eva >= VM_MIN_KERNEL_ADDRESS);
>                 for (va = sva; va < eva; va += PAGE_SIZE) {
>                         invpcid(INVPCID_ADDR, PCID_PROC, va);
>                         invpcid(INVPCID_ADDR, PCID_KERN, va);
>                 }
>         } else if (shootself) {
> +               KASSERT(eva < VM_MIN_KERNEL_ADDRESS);
>                 if (cpu_meltdown) {
>                         for (va = sva; va < eva; va += PAGE_SIZE) {
>                                 invpcid(INVPCID_ADDR, PCID_PROC, va);
>

Reply via email to