sync with OpenBSD -current
This commit is contained in:
parent
efaa6fdefb
commit
e1c03975e3
6 changed files with 55 additions and 32 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: agintc.c,v 1.56 2024/05/13 01:15:50 jsg Exp $ */
|
/* $OpenBSD: agintc.c,v 1.57 2024/06/19 22:10:45 patrick Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007, 2009, 2011, 2017 Dale Rahn <drahn@dalerahn.com>
|
* Copyright (c) 2007, 2009, 2011, 2017 Dale Rahn <drahn@dalerahn.com>
|
||||||
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
|
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
|
||||||
|
@ -312,6 +312,7 @@ agintc_attach(struct device *parent, struct device *self, void *aux)
|
||||||
uint32_t pmr, oldpmr;
|
uint32_t pmr, oldpmr;
|
||||||
uint32_t ctrl, bits;
|
uint32_t ctrl, bits;
|
||||||
uint32_t affinity;
|
uint32_t affinity;
|
||||||
|
uint64_t redist_stride;
|
||||||
int i, nbits, nintr;
|
int i, nbits, nintr;
|
||||||
int offset, nredist;
|
int offset, nredist;
|
||||||
#ifdef MULTIPROCESSOR
|
#ifdef MULTIPROCESSOR
|
||||||
|
@ -434,15 +435,20 @@ agintc_attach(struct device *parent, struct device *self, void *aux)
|
||||||
|
|
||||||
/* find the redistributors. */
|
/* find the redistributors. */
|
||||||
offset = 0;
|
offset = 0;
|
||||||
|
redist_stride = OF_getpropint64(faa->fa_node, "redistributor-stride", 0);
|
||||||
for (nredist = 0; ; nredist++) {
|
for (nredist = 0; ; nredist++) {
|
||||||
int32_t sz = (64 * 1024 * 2);
|
|
||||||
uint64_t typer;
|
uint64_t typer;
|
||||||
|
int32_t sz;
|
||||||
|
|
||||||
typer = bus_space_read_8(sc->sc_iot, sc->sc_redist_base,
|
typer = bus_space_read_8(sc->sc_iot, sc->sc_redist_base,
|
||||||
offset + GICR_TYPER);
|
offset + GICR_TYPER);
|
||||||
|
|
||||||
if (typer & GICR_TYPER_VLPIS)
|
if (redist_stride == 0) {
|
||||||
sz += (64 * 1024 * 2);
|
sz = (64 * 1024 * 2);
|
||||||
|
if (typer & GICR_TYPER_VLPIS)
|
||||||
|
sz += (64 * 1024 * 2);
|
||||||
|
} else
|
||||||
|
sz = redist_stride;
|
||||||
|
|
||||||
#ifdef DEBUG_AGINTC
|
#ifdef DEBUG_AGINTC
|
||||||
printf("probing redistributor %d %x\n", nredist, offset);
|
printf("probing redistributor %d %x\n", nredist, offset);
|
||||||
|
@ -466,14 +472,18 @@ agintc_attach(struct device *parent, struct device *self, void *aux)
|
||||||
/* submap and configure the redistributors. */
|
/* submap and configure the redistributors. */
|
||||||
offset = 0;
|
offset = 0;
|
||||||
for (nredist = 0; nredist < sc->sc_num_redist; nredist++) {
|
for (nredist = 0; nredist < sc->sc_num_redist; nredist++) {
|
||||||
int32_t sz = (64 * 1024 * 2);
|
|
||||||
uint64_t typer;
|
uint64_t typer;
|
||||||
|
int32_t sz;
|
||||||
|
|
||||||
typer = bus_space_read_8(sc->sc_iot, sc->sc_redist_base,
|
typer = bus_space_read_8(sc->sc_iot, sc->sc_redist_base,
|
||||||
offset + GICR_TYPER);
|
offset + GICR_TYPER);
|
||||||
|
|
||||||
if (typer & GICR_TYPER_VLPIS)
|
if (redist_stride == 0) {
|
||||||
sz += (64 * 1024 * 2);
|
sz = (64 * 1024 * 2);
|
||||||
|
if (typer & GICR_TYPER_VLPIS)
|
||||||
|
sz += (64 * 1024 * 2);
|
||||||
|
} else
|
||||||
|
sz = redist_stride;
|
||||||
|
|
||||||
affinity = bus_space_read_8(sc->sc_iot,
|
affinity = bus_space_read_8(sc->sc_iot,
|
||||||
sc->sc_redist_base, offset + GICR_TYPER) >> 32;
|
sc->sc_redist_base, offset + GICR_TYPER) >> 32;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: smmu_acpi.c,v 1.7 2022/09/08 19:30:05 kettenis Exp $ */
|
/* $OpenBSD: smmu_acpi.c,v 1.8 2024/06/19 21:25:41 patrick Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2021 Patrick Wildt <patrick@blueri.se>
|
* Copyright (c) 2021 Patrick Wildt <patrick@blueri.se>
|
||||||
*
|
*
|
||||||
|
@ -152,7 +152,8 @@ smmu_acpi_foundqcom(struct aml_node *node, void *arg)
|
||||||
|
|
||||||
if (strcmp(dev, "QCOM0409") == 0 || /* SC8180X/XP */
|
if (strcmp(dev, "QCOM0409") == 0 || /* SC8180X/XP */
|
||||||
strcmp(dev, "QCOM0609") == 0 || /* SC8280XP */
|
strcmp(dev, "QCOM0609") == 0 || /* SC8280XP */
|
||||||
strcmp(dev, "QCOM0809") == 0) /* SC7180 */
|
strcmp(dev, "QCOM0809") == 0 || /* SC7180 */
|
||||||
|
strcmp(dev, "QCOM0C09") == 0) /* X1E80100 */
|
||||||
sc->sc_is_qcom = 1;
|
sc->sc_is_qcom = 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: qciic.c,v 1.5 2022/11/06 15:36:13 patrick Exp $ */
|
/* $OpenBSD: qciic.c,v 1.6 2024/06/19 21:27:22 patrick Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022 Mark Kettenis <kettenis@openbsd.org>
|
* Copyright (c) 2022 Mark Kettenis <kettenis@openbsd.org>
|
||||||
*
|
*
|
||||||
|
@ -107,6 +107,7 @@ int qciic_acpi_found_ihidev(struct qciic_softc *,
|
||||||
const char *qciic_hids[] = {
|
const char *qciic_hids[] = {
|
||||||
"QCOM0610",
|
"QCOM0610",
|
||||||
"QCOM0811",
|
"QCOM0811",
|
||||||
|
"QCOM0C10",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: xhci_acpi.c,v 1.11 2022/10/30 15:34:54 patrick Exp $ */
|
/* $OpenBSD: xhci_acpi.c,v 1.12 2024/06/19 21:31:10 patrick Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018 Mark Kettenis
|
* Copyright (c) 2018 Mark Kettenis
|
||||||
*
|
*
|
||||||
|
@ -62,6 +62,9 @@ const char *xhci_hids[] = {
|
||||||
"QCOM0826", /* SC7180 USB */
|
"QCOM0826", /* SC7180 USB */
|
||||||
"QCOM24B6", /* SDM850 URS */
|
"QCOM24B6", /* SDM850 URS */
|
||||||
"QCOM24B7",
|
"QCOM24B7",
|
||||||
|
"QCOM0C8B", /* X1E80100 URS */
|
||||||
|
"QCOM0C8C",
|
||||||
|
"QCOM0D07",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -108,7 +111,10 @@ xhci_acpi_attach(struct device *parent, struct device *self, void *aux)
|
||||||
strcmp(aaa->aaa_dev, "QCOM068B") == 0 ||
|
strcmp(aaa->aaa_dev, "QCOM068B") == 0 ||
|
||||||
strcmp(aaa->aaa_dev, "QCOM068C") == 0 ||
|
strcmp(aaa->aaa_dev, "QCOM068C") == 0 ||
|
||||||
strcmp(aaa->aaa_dev, "QCOM24B6") == 0 ||
|
strcmp(aaa->aaa_dev, "QCOM24B6") == 0 ||
|
||||||
strcmp(aaa->aaa_dev, "QCOM24B7") == 0) {
|
strcmp(aaa->aaa_dev, "QCOM24B7") == 0 ||
|
||||||
|
strcmp(aaa->aaa_dev, "QCOM0C8B") == 0 ||
|
||||||
|
strcmp(aaa->aaa_dev, "QCOM0C8C") == 0 ||
|
||||||
|
strcmp(aaa->aaa_dev, "QCOM0D07") == 0) {
|
||||||
SIMPLEQ_FOREACH(node, &sc->sc_node->son, sib) {
|
SIMPLEQ_FOREACH(node, &sc->sc_node->son, sib) {
|
||||||
if (strncmp(node->name, "USB", 3) == 0) {
|
if (strncmp(node->name, "USB", 3) == 0) {
|
||||||
aaa->aaa_node = node;
|
aaa->aaa_node = node;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: monitor_wrap.c,v 1.135 2024/06/11 02:54:51 djm Exp $ */
|
/* $OpenBSD: monitor_wrap.c,v 1.136 2024/06/19 23:24:47 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
|
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
|
||||||
* Copyright 2002 Markus Friedl <markus@openbsd.org>
|
* Copyright 2002 Markus Friedl <markus@openbsd.org>
|
||||||
|
@ -117,24 +117,6 @@ mm_is_monitor(void)
|
||||||
return (pmonitor && pmonitor->m_pid > 0);
|
return (pmonitor && pmonitor->m_pid > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
mm_request_send(int sock, enum monitor_reqtype type, struct sshbuf *m)
|
|
||||||
{
|
|
||||||
size_t mlen = sshbuf_len(m);
|
|
||||||
u_char buf[5];
|
|
||||||
|
|
||||||
debug3_f("entering, type %d", type);
|
|
||||||
|
|
||||||
if (mlen >= 0xffffffff)
|
|
||||||
fatal_f("bad length %zu", mlen);
|
|
||||||
POKE_U32(buf, mlen + 1);
|
|
||||||
buf[4] = (u_char) type; /* 1st byte of payload is mesg-type */
|
|
||||||
if (atomicio(vwrite, sock, buf, sizeof(buf)) != sizeof(buf))
|
|
||||||
fatal_f("write: %s", strerror(errno));
|
|
||||||
if (atomicio(vwrite, sock, sshbuf_mutable_ptr(m), mlen) != mlen)
|
|
||||||
fatal_f("write: %s", strerror(errno));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mm_reap(void)
|
mm_reap(void)
|
||||||
{
|
{
|
||||||
|
@ -166,6 +148,29 @@ mm_reap(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
mm_request_send(int sock, enum monitor_reqtype type, struct sshbuf *m)
|
||||||
|
{
|
||||||
|
size_t mlen = sshbuf_len(m);
|
||||||
|
u_char buf[5];
|
||||||
|
|
||||||
|
debug3_f("entering, type %d", type);
|
||||||
|
|
||||||
|
if (mlen >= 0xffffffff)
|
||||||
|
fatal_f("bad length %zu", mlen);
|
||||||
|
POKE_U32(buf, mlen + 1);
|
||||||
|
buf[4] = (u_char) type; /* 1st byte of payload is mesg-type */
|
||||||
|
if (atomicio(vwrite, sock, buf, sizeof(buf)) != sizeof(buf) ||
|
||||||
|
atomicio(vwrite, sock, sshbuf_mutable_ptr(m), mlen) != mlen) {
|
||||||
|
if (errno == EPIPE) {
|
||||||
|
debug3_f("monitor fd closed");
|
||||||
|
mm_reap();
|
||||||
|
cleanup_exit(255);
|
||||||
|
}
|
||||||
|
fatal_f("write: %s", strerror(errno));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mm_request_receive(int sock, struct sshbuf *m)
|
mm_request_receive(int sock, struct sshbuf *m)
|
||||||
{
|
{
|
||||||
|
|
|
@ -403,7 +403,7 @@ srclimit_penalise(struct xaddr *addr, int penalty_type)
|
||||||
penalty_cfg.overflow_mode : penalty_cfg.overflow_mode6;
|
penalty_cfg.overflow_mode : penalty_cfg.overflow_mode6;
|
||||||
npenaltiesp = addr->af == AF_INET ? &npenalties4 : &npenalties6;
|
npenaltiesp = addr->af == AF_INET ? &npenalties4 : &npenalties6;
|
||||||
t = addr->af == AF_INET ? "ipv4" : "ipv6";
|
t = addr->af == AF_INET ? "ipv4" : "ipv6";
|
||||||
if (*npenaltiesp > (size_t)max_sources &&
|
if (*npenaltiesp >= (size_t)max_sources &&
|
||||||
overflow_mode == PER_SOURCE_PENALTY_OVERFLOW_DENY_ALL) {
|
overflow_mode == PER_SOURCE_PENALTY_OVERFLOW_DENY_ALL) {
|
||||||
verbose_f("%s penalty table full, cannot penalise %s for %s", t,
|
verbose_f("%s penalty table full, cannot penalise %s for %s", t,
|
||||||
addrnetmask, reason);
|
addrnetmask, reason);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue