This commit is contained in:
purplerain 2023-07-06 21:55:14 +00:00
parent f1b2576417
commit 2a351e0cdc
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
347 changed files with 9596 additions and 5486 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: locore.S,v 1.134 2023/04/17 00:14:59 deraadt Exp $ */
/* $OpenBSD: locore.S,v 1.135 2023/07/05 18:23:10 anton Exp $ */
/* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */
/*
@ -1149,6 +1149,23 @@ NENTRY(rdmsr_resume)
lfence
END(rdmsr_safe)
#if NHYPERV > 0
/* uint64_t hv_hypercall_trampoline(uint64_t control, paddr_t input, paddr_t output) */
NENTRY(hv_hypercall_trampoline)
endbr64
mov %rdx, %r8
mov %rsi, %rdx
mov %rdi, %rcx
jmp hv_hypercall_page
END(hv_hypercall_trampoline)
/* Hypercall page needs to be page aligned */
.text
.align NBPG, 0xcc
.globl hv_hypercall_page
hv_hypercall_page:
.skip 0x1000, 0xcc
#endif /* NHYPERV > 0 */
#if NXEN > 0
/* Hypercall page needs to be page aligned */
.text
@ -1157,12 +1174,3 @@ END(rdmsr_safe)
xen_hypercall_page:
.skip 0x1000, 0xcc
#endif /* NXEN > 0 */
#if NHYPERV > 0
/* Hypercall page needs to be page aligned */
.text
.align NBPG, 0xcc
.globl hv_hypercall_page
hv_hypercall_page:
.skip 0x1000, 0xcc
#endif /* NXEN > 0 */

View file

@ -1,4 +1,4 @@
/* $OpenBSD: trap.c,v 1.100 2023/04/16 06:43:49 jsg Exp $ */
/* $OpenBSD: trap.c,v 1.101 2023/07/05 12:58:55 kn Exp $ */
/* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */
/*-
@ -216,9 +216,8 @@ upageflttrap(struct trapframe *frame, uint64_t cr2)
/*
* kpageflttrap(frame, usermode): page fault handler
* Returns non-zero if the fault was handled (possibly by generating
* a signal). Returns zero, possibly still holding the kernel lock,
* if something was so broken that we should panic.
* Returns non-zero if the fault was handled (possibly by generating a signal).
* Returns zero if something was so broken that we should panic.
*/
int
kpageflttrap(struct trapframe *frame, uint64_t cr2)
@ -240,11 +239,9 @@ kpageflttrap(struct trapframe *frame, uint64_t cr2)
caddr_t *nf = __nofault_start;
while (*nf++ != pcb->pcb_onfault) {
if (nf >= __nofault_end) {
KERNEL_LOCK();
fault("invalid pcb_nofault=%lx",
(long)pcb->pcb_onfault);
return 0;
/* retain kernel lock */
}
}
}
@ -252,19 +249,15 @@ kpageflttrap(struct trapframe *frame, uint64_t cr2)
/* This will only trigger if SMEP is enabled */
if (pcb->pcb_onfault == NULL && cr2 <= VM_MAXUSER_ADDRESS &&
frame->tf_err & PGEX_I) {
KERNEL_LOCK();
fault("attempt to execute user address %p "
"in supervisor mode", (void *)cr2);
/* retain kernel lock */
return 0;
}
/* This will only trigger if SMAP is enabled */
if (pcb->pcb_onfault == NULL && cr2 <= VM_MAXUSER_ADDRESS &&
frame->tf_err & PGEX_P) {
KERNEL_LOCK();
fault("attempt to access user address %p "
"in supervisor mode", (void *)cr2);
/* retain kernel lock */
return 0;
}
@ -294,10 +287,8 @@ kpageflttrap(struct trapframe *frame, uint64_t cr2)
if (error) {
if (pcb->pcb_onfault == NULL) {
/* bad memory access in the kernel */
KERNEL_LOCK();
fault("uvm_fault(%p, 0x%llx, 0, %d) -> %x",
map, cr2, access_type, error);
/* retain kernel lock */
return 0;
}
frame->tf_rip = (u_int64_t)pcb->pcb_onfault;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: _types.h,v 1.18 2022/11/08 17:34:13 cheloha Exp $ */
/* $OpenBSD: _types.h,v 1.19 2023/07/02 19:02:27 cheloha Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -35,8 +35,6 @@
#ifndef _MACHINE__TYPES_H_
#define _MACHINE__TYPES_H_
#define __HAVE_CLOCKINTR
/*
* _ALIGN(p) rounds p (pointer or byte index) up to a correctly-aligned
* value for all data types (int, long, ...). The result is an

View file

@ -1,4 +1,4 @@
/* $OpenBSD: cpu.h,v 1.154 2022/11/29 21:41:39 guenther Exp $ */
/* $OpenBSD: cpu.h,v 1.155 2023/07/04 17:29:32 cheloha Exp $ */
/* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */
/*-
@ -112,10 +112,8 @@ struct cpu_info {
#define ci_PAGEALIGN ci_dev
struct device *ci_dev; /* [I] */
struct cpu_info *ci_self; /* [I] */
struct schedstate_percpu ci_schedstate; /* scheduler state */
struct cpu_info *ci_next; /* [I] */
struct proc *ci_curproc; /* [o] */
u_int ci_cpuid; /* [I] */
u_int ci_apicid; /* [I] */
u_int ci_acpi_proc_id; /* [I] */
@ -129,6 +127,9 @@ struct cpu_info {
char ci_mds_tmp[32]; /* [o] 32byte aligned */
void *ci_mds_buf; /* [I] */
struct proc *ci_curproc; /* [o] */
struct schedstate_percpu ci_schedstate; /* scheduler state */
struct pmap *ci_proc_pmap; /* last userspace pmap */
struct pcb *ci_curpcb; /* [o] */
struct pcb *ci_idle_pcb; /* [o] */

View file

@ -1,4 +1,4 @@
/* $OpenBSD: _types.h,v 1.20 2023/01/17 02:27:14 cheloha Exp $ */
/* $OpenBSD: _types.h,v 1.21 2023/07/02 19:02:27 cheloha Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -35,8 +35,6 @@
#ifndef _ARM__TYPES_H_
#define _ARM__TYPES_H_
#define __HAVE_CLOCKINTR
#if defined(_KERNEL)
typedef struct label_t {
long val[11];

View file

@ -1,4 +1,4 @@
# $OpenBSD: GENERIC,v 1.274 2023/06/27 22:38:46 patrick Exp $
# $OpenBSD: GENERIC,v 1.275 2023/07/01 16:34:29 drahn Exp $
#
# GENERIC machine description file
#
@ -324,6 +324,7 @@ sdmmc* at dwmshc?
# Qualcomm SoCs
qcaoss* at fdt?
qccpu* at fdt?
qcdwusb* at fdt?
qcgpio* at acpi?
qcgpio* at fdt? early 1

View file

@ -1,4 +1,4 @@
/* $OpenBSD: agintc.c,v 1.50 2023/06/18 16:25:21 kettenis Exp $ */
/* $OpenBSD: agintc.c,v 1.51 2023/07/06 09:40:36 patrick Exp $ */
/*
* Copyright (c) 2007, 2009, 2011, 2017 Dale Rahn <drahn@dalerahn.com>
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
@ -339,7 +339,7 @@ agintc_attach(struct device *parent, struct device *self, void *aux)
}
sc->sc_pend = agintc_dmamem_alloc(sc->sc_dmat,
GICR_PEND_SIZE, GICR_PEND_SIZE);
if (sc->sc_prop == NULL) {
if (sc->sc_pend == NULL) {
printf(": can't alloc LPI pending table\n");
goto unmap;
}

View file

@ -1,4 +1,4 @@
/* $OpenBSD: apldc.c,v 1.8 2023/05/02 19:39:10 kettenis Exp $ */
/* $OpenBSD: apldc.c,v 1.9 2023/07/03 15:54:07 tobhe Exp $ */
/*
* Copyright (c) 2022 Mark Kettenis <kettenis@openbsd.org>
*
@ -1289,6 +1289,10 @@ int apldcms_enable(void *);
void apldcms_disable(void *);
int apldcms_ioctl(void *, u_long, caddr_t, int, struct proc *);
static struct wsmouse_param apldcms_wsmousecfg[] = {
{ WSMOUSECFG_MTBTN_MAXDIST, 0 }, /* 0: Compute a default value. */
};
const struct wsmouse_accessops apldcms_accessops = {
.enable = apldcms_enable,
.disable = apldcms_disable,
@ -1350,7 +1354,8 @@ apldcms_configure(struct apldcms_softc *sc)
hw->mt_slots = UBCMTP_MAX_FINGERS;
hw->flags = WSMOUSEHW_MT_TRACKING;
return wsmouse_configure(sc->sc_wsmousedev, NULL, 0);
return wsmouse_configure(sc->sc_wsmousedev, apldcms_wsmousecfg,
nitems(apldcms_wsmousecfg));
}
void

View file

@ -1,4 +1,4 @@
/* $OpenBSD: aplhidev.c,v 1.11 2023/04/10 15:14:04 tobhe Exp $ */
/* $OpenBSD: aplhidev.c,v 1.12 2023/07/02 21:44:04 bru Exp $ */
/*
* Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org>
* Copyright (c) 2013-2014 joshua stein <jcs@openbsd.org>
@ -683,6 +683,10 @@ struct ubcmtp_finger {
/* Use a constant, synaptics-compatible pressure value for now. */
#define DEFAULT_PRESSURE 40
static struct wsmouse_param aplms_wsmousecfg[] = {
{ WSMOUSECFG_MTBTN_MAXDIST, 0 }, /* 0: Compute a default value. */
};
struct aplms_softc {
struct device sc_dev;
struct device *sc_wsmousedev;
@ -762,7 +766,8 @@ aplms_configure(struct aplms_softc *sc)
hw->mt_slots = UBCMTP_MAX_FINGERS;
hw->flags = WSMOUSEHW_MT_TRACKING;
return wsmouse_configure(sc->sc_wsmousedev, NULL, 0);
return wsmouse_configure(sc->sc_wsmousedev,
aplms_wsmousecfg, nitems(aplms_wsmousecfg));
}
void

View file

@ -1,4 +1,4 @@
/* $OpenBSD: apm.c,v 1.22 2023/02/10 14:34:16 visa Exp $ */
/* $OpenBSD: apm.c,v 1.23 2023/07/05 08:26:56 tobhe Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
@ -60,6 +60,7 @@
struct taskq *suspend_taskq;
struct task suspend_task;
void do_suspend(void *);
void suspend(void);
#endif
struct apm_softc {
@ -223,7 +224,7 @@ apmioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
error = EBADF;
break;
}
sleep_state(NULL, SLEEP_SUSPEND);
suspend();
break;
#ifdef HIBERNATE
case APM_IOC_HIBERNATE:

View file

@ -1,4 +1,4 @@
/* $OpenBSD: _types.h,v 1.5 2022/11/08 17:56:38 cheloha Exp $ */
/* $OpenBSD: _types.h,v 1.6 2023/07/02 19:02:27 cheloha Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@ -34,8 +34,6 @@
#ifndef _MACHINE__TYPES_H_
#define _MACHINE__TYPES_H_
#define __HAVE_CLOCKINTR
#if defined(_KERNEL)
typedef struct label_t {
long val[13];

View file

@ -1,4 +1,4 @@
/* $OpenBSD: armv7_machdep.c,v 1.65 2022/10/03 19:32:22 kettenis Exp $ */
/* $OpenBSD: armv7_machdep.c,v 1.66 2023/07/05 08:15:34 jsg Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@ -154,11 +154,6 @@ u_int cpu_reset_address = 0;
vaddr_t physical_freestart;
int physmem;
/*int debug_flags;*/
#ifndef PMAP_STATIC_L1S
int max_processes = 64; /* Default number */
#endif /* !PMAP_STATIC_L1S */
/* Physical and virtual addresses for some global pages */
pv_addr_t systempage;
pv_addr_t irqstack;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: apm.c,v 1.131 2023/06/22 13:18:02 claudio Exp $ */
/* $OpenBSD: apm.c,v 1.132 2023/07/02 19:02:27 cheloha Exp $ */
/*-
* Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved.
@ -265,10 +265,8 @@ apm_suspend(int state)
rtcstart(); /* in i8254 mode, rtc is profclock */
inittodr(gettime());
#ifdef __HAVE_CLOCKINTR
clockintr_cpu_init(NULL);
clockintr_trigger();
#endif
config_suspend_all(DVACT_RESUME);
cold = 0;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: _types.h,v 1.24 2022/12/06 01:56:44 cheloha Exp $ */
/* $OpenBSD: _types.h,v 1.25 2023/07/02 19:02:27 cheloha Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -35,8 +35,6 @@
#ifndef _MACHINE__TYPES_H_
#define _MACHINE__TYPES_H_
#define __HAVE_CLOCKINTR
/*
* _ALIGN(p) rounds p (pointer or byte index) up to a correctly-aligned
* value for all data types (int, long, ...). The result is an