aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/cam/cam_xpt.c8
-rw-r--r--sys/dev/amdtemp/amdtemp.c2
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_cal_iq.c2
-rw-r--r--sys/dev/bwi/if_bwi.c2
-rw-r--r--sys/dev/cesa/cesa.c4
-rw-r--r--sys/dev/ciss/ciss.c2
-rw-r--r--sys/dev/igc/if_igc.c2
-rw-r--r--sys/dev/isci/scil/scic_sds_remote_node_context.c4
-rw-r--r--sys/dev/mfi/mfi.c2
-rw-r--r--sys/dev/nvmf/controller/nvmft_controller.c2
-rw-r--r--sys/dev/oce/oce_sysctl.c12
-rw-r--r--sys/dev/random/fenestrasX/fx_pool.c3
-rw-r--r--sys/dev/random/random_harvestq.c6
-rw-r--r--sys/dev/uart/uart_bus_fdt.c6
-rw-r--r--sys/dev/uart/uart_dev_snps.c10
-rw-r--r--sys/dev/usb/serial/u3g.c2
-rw-r--r--sys/dev/usb/usbdevs2
-rw-r--r--sys/dev/vnic/nicvf_main.c2
-rw-r--r--sys/net/pfvar.h9
-rw-r--r--sys/netinet/in_pcb.c28
-rw-r--r--sys/netinet/in_pcb.h3
-rw-r--r--sys/netinet/tcp.h1
-rw-r--r--sys/netinet/tcp_usrreq.c21
-rw-r--r--sys/netpfil/pf/pf.c2
-rw-r--r--sys/netpfil/pf/pf_if.c2
-rw-r--r--sys/netpfil/pf/pf_ioctl.c2
-rw-r--r--sys/netpfil/pf/pf_lb.c101
-rw-r--r--sys/netpfil/pf/pf_nl.c44
-rw-r--r--sys/netpfil/pf/pf_nl.h2
-rw-r--r--sys/netpfil/pf/pf_table.c12
-rw-r--r--sys/riscv/riscv/fpe.c66
-rw-r--r--sys/riscv/vmm/vmm.c4
-rw-r--r--sys/riscv/vmm/vmm_aplic.c10
-rw-r--r--sys/riscv/vmm/vmm_aplic.h1
34 files changed, 282 insertions, 99 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index cae29226d13c..a11b688c4456 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -1046,6 +1046,7 @@ xpt_announce_periph(struct cam_periph *periph, char *announce_string)
sbuf_set_drain(&sb, sbuf_printf_drain, NULL);
xpt_announce_periph_sbuf(periph, &sb, announce_string);
(void)sbuf_finish(&sb);
+ (void)sbuf_delete(&sb);
}
void
@@ -1122,6 +1123,7 @@ xpt_denounce_periph(struct cam_periph *periph)
sbuf_set_drain(&sb, sbuf_printf_drain, NULL);
xpt_denounce_periph_sbuf(periph, &sb);
(void)sbuf_finish(&sb);
+ (void)sbuf_delete(&sb);
}
void
@@ -5547,7 +5549,7 @@ xpt_cam_path_debug(struct cam_path *path, const char *fmt, ...)
{
struct sbuf sbuf;
char buf[XPT_PRINT_LEN]; /* balance to not eat too much stack */
- struct sbuf *sb = sbuf_new(&sbuf, buf, sizeof(buf), SBUF_FIXEDLEN);
+ struct sbuf *sb = sbuf_new(&sbuf, buf, sizeof(buf), SBUF_FIXEDLEN | SBUF_INCLUDENUL);
va_list ap;
sbuf_set_drain(sb, sbuf_printf_drain, NULL);
@@ -5566,7 +5568,7 @@ xpt_cam_dev_debug(struct cam_ed *dev, const char *fmt, ...)
{
struct sbuf sbuf;
char buf[XPT_PRINT_LEN]; /* balance to not eat too much stack */
- struct sbuf *sb = sbuf_new(&sbuf, buf, sizeof(buf), SBUF_FIXEDLEN);
+ struct sbuf *sb = sbuf_new(&sbuf, buf, sizeof(buf), SBUF_FIXEDLEN | SBUF_INCLUDENUL);
va_list ap;
sbuf_set_drain(sb, sbuf_printf_drain, NULL);
@@ -5585,7 +5587,7 @@ xpt_cam_debug(const char *fmt, ...)
{
struct sbuf sbuf;
char buf[XPT_PRINT_LEN]; /* balance to not eat too much stack */
- struct sbuf *sb = sbuf_new(&sbuf, buf, sizeof(buf), SBUF_FIXEDLEN);
+ struct sbuf *sb = sbuf_new(&sbuf, buf, sizeof(buf), SBUF_FIXEDLEN | SBUF_INCLUDENUL);
va_list ap;
sbuf_set_drain(sb, sbuf_printf_drain, NULL);
diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c
index 79ccdc8c79fb..b1ecb014a2b0 100644
--- a/sys/dev/amdtemp/amdtemp.c
+++ b/sys/dev/amdtemp/amdtemp.c
@@ -642,7 +642,7 @@ amdtemp_intrhook(void *arg)
OID_AUTO, "temperature",
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE,
dev, sensor, amdtemp_sysctl, "IK",
- "Current temparature");
+ "Current temperature");
}
}
if (sc->sc_ich.ich_arg != NULL)
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_cal_iq.c b/sys/dev/ath/ath_hal/ar5416/ar5416_cal_iq.c
index a0c27828bbc1..50d7cc0aa7a8 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_cal_iq.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_cal_iq.c
@@ -76,7 +76,7 @@ ar5416IQCalibration(struct ath_hal *ah, uint8_t numChains)
HALDEBUG(ah, HAL_DEBUG_PERCAL,
"Start IQ Cal and Correction for Chain %d\n", i);
HALDEBUG(ah, HAL_DEBUG_PERCAL,
- "Orignal: iq_corr_meas = 0x%08x\n", iqCorrMeas);
+ "Original: iq_corr_meas = 0x%08x\n", iqCorrMeas);
iqCorrNeg = 0;
/* iqCorrMeas is always negative. */
diff --git a/sys/dev/bwi/if_bwi.c b/sys/dev/bwi/if_bwi.c
index 85146d4c4010..80fc5e9e47af 100644
--- a/sys/dev/bwi/if_bwi.c
+++ b/sys/dev/bwi/if_bwi.c
@@ -2900,7 +2900,7 @@ bwi_plcp_header(const struct ieee80211_rate_table *rt,
else if (modtype == IEEE80211_T_DS)
bwi_ds_plcp_header(plcp, pkt_len, rate);
else
- panic("unsupport modulation type %u\n", modtype);
+ panic("unsupported modulation type %u\n", modtype);
}
static int
diff --git a/sys/dev/cesa/cesa.c b/sys/dev/cesa/cesa.c
index 405b619d6e5b..7439dcdbc1ee 100644
--- a/sys/dev/cesa/cesa.c
+++ b/sys/dev/cesa/cesa.c
@@ -286,7 +286,7 @@ cesa_alloc_tdesc(struct cesa_softc *sc)
CESA_GENERIC_ALLOC_LOCKED(sc, ctd, tdesc);
if (!ctd)
- device_printf(sc->sc_dev, "TDMA descriptors pool exhaused. "
+ device_printf(sc->sc_dev, "TDMA descriptors pool exhausted. "
"Consider increasing CESA_TDMA_DESCRIPTORS.\n");
return (ctd);
@@ -299,7 +299,7 @@ cesa_alloc_sdesc(struct cesa_softc *sc, struct cesa_request *cr)
CESA_GENERIC_ALLOC_LOCKED(sc, csd, sdesc);
if (!csd) {
- device_printf(sc->sc_dev, "SA descriptors pool exhaused. "
+ device_printf(sc->sc_dev, "SA descriptors pool exhausted. "
"Consider increasing CESA_SA_DESCRIPTORS.\n");
return (NULL);
}
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c
index d4ede91f6b35..dd3df631119a 100644
--- a/sys/dev/ciss/ciss.c
+++ b/sys/dev/ciss/ciss.c
@@ -3140,7 +3140,7 @@ ciss_cam_action(struct cam_sim *sim, union ccb *ccb)
}
default: /* we can't do this */
- debug(1, "unspported func_code = 0x%x", ccb->ccb_h.func_code);
+ debug(1, "unsupported func_code = 0x%x", ccb->ccb_h.func_code);
ccb->ccb_h.status = CAM_REQ_INVALID;
break;
}
diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c
index f199a128c783..d6c06803990f 100644
--- a/sys/dev/igc/if_igc.c
+++ b/sys/dev/igc/if_igc.c
@@ -2816,7 +2816,7 @@ igc_add_hw_stats(struct igc_softc *sc)
"Oversized Packets Received");
SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "recv_jabber",
CTLFLAG_RD, &sc->stats.rjc,
- "Recevied Jabber");
+ "Received Jabber");
SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "recv_errs",
CTLFLAG_RD, &sc->stats.rxerrc,
"Receive Errors");
diff --git a/sys/dev/isci/scil/scic_sds_remote_node_context.c b/sys/dev/isci/scil/scic_sds_remote_node_context.c
index aa1e8d840282..42dd81aa1874 100644
--- a/sys/dev/isci/scil/scic_sds_remote_node_context.c
+++ b/sys/dev/isci/scil/scic_sds_remote_node_context.c
@@ -663,7 +663,7 @@ SCI_STATUS scic_sds_remote_node_context_invalidating_state_event_handler(
SCIC_LOG_OBJECT_SSP_REMOTE_TARGET |
SCIC_LOG_OBJECT_SMP_REMOTE_TARGET |
SCIC_LOG_OBJECT_STP_REMOTE_TARGET,
- "SCIC Remote Node Context 0x%x was suspeneded by hardware while being invalidated.\n",
+ "SCIC Remote Node Context 0x%x was suspended by hardware while being invalidated.\n",
this_rnc
));
status = SCI_SUCCESS;
@@ -718,7 +718,7 @@ SCI_STATUS scic_sds_remote_node_context_resuming_state_event_handler(
SCIC_LOG_OBJECT_SSP_REMOTE_TARGET |
SCIC_LOG_OBJECT_SMP_REMOTE_TARGET |
SCIC_LOG_OBJECT_STP_REMOTE_TARGET,
- "SCIC Remote Node Context 0x%x was suspeneded by hardware while being resumed.\n",
+ "SCIC Remote Node Context 0x%x was suspended by hardware while being resumed.\n",
this_rnc
));
status = SCI_SUCCESS;
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index 13e5dfc84fd1..a7d98f06aea3 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -2829,7 +2829,7 @@ mfi_check_command_post(struct mfi_softc *sc, struct mfi_command *cm)
if (ld->ld_id == cm->cm_frame->dcmd.mbox[0])
break;
}
- KASSERT(ld != NULL, ("volume dissappeared"));
+ KASSERT(ld != NULL, ("volume disappeared"));
if (cm->cm_frame->header.cmd_status == MFI_STAT_OK) {
mtx_unlock(&sc->mfi_io_lock);
bus_topo_lock();
diff --git a/sys/dev/nvmf/controller/nvmft_controller.c b/sys/dev/nvmf/controller/nvmft_controller.c
index 390467534ca2..e618972f46cf 100644
--- a/sys/dev/nvmf/controller/nvmft_controller.c
+++ b/sys/dev/nvmf/controller/nvmft_controller.c
@@ -31,7 +31,7 @@ nvmft_printf(struct nvmft_controller *ctrlr, const char *fmt, ...)
va_list ap;
size_t retval;
- sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN);
+ sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN | SBUF_INCLUDENUL);
sbuf_set_drain(&sb, sbuf_printf_drain, &retval);
sbuf_printf(&sb, "nvmft%u: ", ctrlr->cntlid);
diff --git a/sys/dev/oce/oce_sysctl.c b/sys/dev/oce/oce_sysctl.c
index 1b903d8d027a..544bec9438c4 100644
--- a/sys/dev/oce/oce_sysctl.c
+++ b/sys/dev/oce/oce_sysctl.c
@@ -716,7 +716,7 @@ oce_add_stats_sysctls_be3(POCE_SOFTC sc,
"Total Received Bytes");
SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "total_frags",
CTLFLAG_RD, &stats->rx.t_rx_frags, 0,
- "Total Received Fragements");
+ "Total Received Fragments");
SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "total_mcast_pkts",
CTLFLAG_RD, &stats->rx.t_rx_mcast_pkts, 0,
"Total Received Multicast Packets");
@@ -748,7 +748,7 @@ oce_add_stats_sysctls_be3(POCE_SOFTC sc,
"Receive Packets");
SYSCTL_ADD_QUAD(ctx, queue_stats_list, OID_AUTO, "rx_bytes",
CTLFLAG_RD, &sc->rq[i]->rx_stats.rx_bytes,
- "Recived Bytes");
+ "Received Bytes");
SYSCTL_ADD_UINT(ctx, queue_stats_list, OID_AUTO, "rx_frags",
CTLFLAG_RD, &sc->rq[i]->rx_stats.rx_frags, 0,
"Received Fragments");
@@ -786,7 +786,7 @@ oce_add_stats_sysctls_be3(POCE_SOFTC sc,
"ERX Errors");
SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "alignment_errors",
CTLFLAG_RD, &stats->u0.be.rx_drops_too_many_frags, 0,
- "RX Alignmnet Errors");
+ "RX Alignment Errors");
SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "in_range_errors",
CTLFLAG_RD, &stats->u0.be.rx_in_range_errors, 0,
"In Range Errors");
@@ -932,7 +932,7 @@ oce_add_stats_sysctls_xe201(POCE_SOFTC sc,
"Total Received Bytes");
SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "total_frags",
CTLFLAG_RD, &stats->rx.t_rx_frags, 0,
- "Total Received Fragements");
+ "Total Received Fragments");
SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "total_mcast_pkts",
CTLFLAG_RD, &stats->rx.t_rx_mcast_pkts, 0,
"Total Received Multicast Packets");
@@ -961,7 +961,7 @@ oce_add_stats_sysctls_xe201(POCE_SOFTC sc,
"Receive Packets");
SYSCTL_ADD_QUAD(ctx, queue_stats_list, OID_AUTO, "rx_bytes",
CTLFLAG_RD, &sc->rq[i]->rx_stats.rx_bytes,
- "Recived Bytes");
+ "Received Bytes");
SYSCTL_ADD_UINT(ctx, queue_stats_list, OID_AUTO, "rx_frags",
CTLFLAG_RD, &sc->rq[i]->rx_stats.rx_frags, 0,
"Received Fragments");
@@ -989,7 +989,7 @@ oce_add_stats_sysctls_xe201(POCE_SOFTC sc,
"CRC Errors");
SYSCTL_ADD_UQUAD(ctx, rx_stat_list, OID_AUTO, "alignment_errors",
CTLFLAG_RD, &stats->u0.xe201.rx_alignment_errors,
- "RX Alignmnet Errors");
+ "RX Alignment Errors");
SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "in_range_errors",
CTLFLAG_RD, &stats->u0.xe201.rx_in_range_errors, 0,
"In Range Errors");
diff --git a/sys/dev/random/fenestrasX/fx_pool.c b/sys/dev/random/fenestrasX/fx_pool.c
index 8e63b345a1bd..b6ffc202769e 100644
--- a/sys/dev/random/fenestrasX/fx_pool.c
+++ b/sys/dev/random/fenestrasX/fx_pool.c
@@ -127,7 +127,7 @@ static const struct fxrng_ent_cls fxrng_garbage = {
*/
static const struct fxrng_ent_char {
const struct fxrng_ent_cls *entc_cls;
-} fxrng_ent_char[ENTROPYSOURCE] = {
+} fxrng_ent_char[/*ENTROPYSOURCE*/] = {
[RANDOM_CACHED] = {
.entc_cls = &fxrng_hi_push,
},
@@ -213,6 +213,7 @@ static const struct fxrng_ent_char {
.entc_cls = &fxrng_hi_pull,
},
};
+CTASSERT(nitems(fxrng_ent_char) == ENTROPYSOURCE);
/* Useful for single-bit-per-source state. */
BITSET_DEFINE(fxrng_bits, ENTROPYSOURCE);
diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c
index 643dbac1fc8b..b591ffd3b544 100644
--- a/sys/dev/random/random_harvestq.c
+++ b/sys/dev/random/random_harvestq.c
@@ -88,7 +88,7 @@ static void random_sources_feed(void);
static __read_mostly bool epoch_inited;
static __read_mostly epoch_t rs_epoch;
-static const char *random_source_descr[ENTROPYSOURCE];
+static const char *random_source_descr[];
/*
* How many events to queue up. We create this many items in
@@ -109,6 +109,7 @@ volatile int random_kthread_control;
* Updates are synchronized by the harvest mutex.
*/
__read_frequently u_int hc_source_mask;
+CTASSERT(ENTROPYSOURCE <= sizeof(hc_source_mask) * NBBY);
struct random_sources {
CK_LIST_ENTRY(random_sources) rrs_entries;
@@ -647,7 +648,7 @@ SYSCTL_PROC(_kern_random_harvest, OID_AUTO, mask_bin,
random_print_harvestmask, "A",
"Entropy harvesting mask (printable)");
-static const char *random_source_descr[ENTROPYSOURCE] = {
+static const char *random_source_descr[/*ENTROPYSOURCE*/] = {
[RANDOM_CACHED] = "CACHED",
[RANDOM_ATTACH] = "ATTACH",
[RANDOM_KEYBOARD] = "KEYBOARD",
@@ -678,6 +679,7 @@ static const char *random_source_descr[ENTROPYSOURCE] = {
[RANDOM_PURE_ARM_TRNG] = "PURE_ARM_TRNG",
/* "ENTROPYSOURCE" */
};
+CTASSERT(nitems(random_source_descr) == ENTROPYSOURCE);
static int
random_print_harvestmask_symbolic(SYSCTL_HANDLER_ARGS)
diff --git a/sys/dev/uart/uart_bus_fdt.c b/sys/dev/uart/uart_bus_fdt.c
index 431f2962adb2..e9a7e04e4e0c 100644
--- a/sys/dev/uart/uart_bus_fdt.c
+++ b/sys/dev/uart/uart_bus_fdt.c
@@ -239,6 +239,12 @@ uart_cpu_fdt_probe(struct uart_class **classp, bus_space_tag_t *bst,
}
/*
+ * Grab the default rclk from the uart class.
+ */
+ if (clk == 0)
+ clk = class->uc_rclk;
+
+ /*
* Retrieve serial attributes.
*/
if (uart_fdt_get_shift(node, &shift) != 0)
diff --git a/sys/dev/uart/uart_dev_snps.c b/sys/dev/uart/uart_dev_snps.c
index 6067920e3c2a..0372a220282b 100644
--- a/sys/dev/uart/uart_dev_snps.c
+++ b/sys/dev/uart/uart_dev_snps.c
@@ -113,7 +113,17 @@ struct uart_class uart_snps_class = {
.uc_rclk = 0,
};
+struct uart_class uart_snps_jh7110_class = {
+ "snps",
+ snps_methods,
+ sizeof(struct snps_softc),
+ .uc_ops = &uart_ns8250_ops,
+ .uc_range = 8,
+ .uc_rclk = 24000000,
+};
+
static struct ofw_compat_data compat_data[] = {
+ { "starfive,jh7110-uart", (uintptr_t)&uart_snps_jh7110_class },
{ "snps,dw-apb-uart", (uintptr_t)&uart_snps_class },
{ "marvell,armada-38x-uart", (uintptr_t)&uart_snps_class },
{ NULL, (uintptr_t)NULL }
diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c
index a549f93b2af1..0fc774d83ee1 100644
--- a/sys/dev/usb/serial/u3g.c
+++ b/sys/dev/usb/serial/u3g.c
@@ -531,6 +531,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = {
U3G_DEV(QUECTEL, RG520, 0),
U3G_DEV(QUECTEL, EC200, 0),
U3G_DEV(QUECTEL, EC200S, 0),
+ U3G_DEV(QUECTEL, EM060K, 0),
U3G_DEV(QUECTEL, EC200T, 0),
U3G_DEV(QUECTEL, UC200, 0),
U3G_DEV(SIERRA, AC402, 0),
@@ -600,6 +601,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = {
U3G_DEV(SIERRA, EM7455_2, 0),
U3G_DEV(SIERRA, EM7565, 0),
U3G_DEV(SIERRA, EM7565_2, 0),
+ U3G_DEV(SIERRA, EM7590, 0),
U3G_DEV(SILABS, SAEL, U3GINIT_SAEL_M460),
U3G_DEV(STELERA, C105, 0),
U3G_DEV(STELERA, E1003, 0),
diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index 2318e6bd0017..bb039f59ce19 100644
--- a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -4070,6 +4070,7 @@ product QUECTEL RG500 0x0800 Quectel RG500/RM500/RG510/RM510
product QUECTEL RG520 0x0801 Quectel RG520/RM520/SG520
product QUECTEL EC200 0x6000 Quectel EC200/UC200
product QUECTEL EC200S 0x6002 Quectel EC200S
+product QUECTEL EM060K 0x6008 Quectel EM060K
product QUECTEL EC200T 0x6026 Quectel EC200T
product QUECTEL UC200 0x6120 Quectel UC200
@@ -4431,6 +4432,7 @@ product SIERRA EM7455 0x9078 Sierra Wireless EM7455 Qualcomm Snapdragon X7 LTE-
product SIERRA EM7455_2 0x9079 Sierra Wireless EM7455 Qualcomm Snapdragon X7 LTE-A
product SIERRA EM7565 0x9090 Sierra Wireless EM7565 Qualcomm Snapdragon X7 LTE-A
product SIERRA EM7565_2 0x9091 Sierra Wireless EM7565 Qualcomm Snapdragon X7 LTE-A
+product SIERRA EM7590 0xc081 Sierra Wireless EM7590 Qualcomm Snapdragon X7 LTE-A
/* Sigmatel products */
product SIGMATEL WBT_3052 0x4200 WBT-3052 IrDA/USB Bridge
diff --git a/sys/dev/vnic/nicvf_main.c b/sys/dev/vnic/nicvf_main.c
index dd44e420c78f..59f7abeacdd5 100644
--- a/sys/dev/vnic/nicvf_main.c
+++ b/sys/dev/vnic/nicvf_main.c
@@ -1402,7 +1402,7 @@ nicvf_allocate_net_interrupts(struct nicvf *nic)
/* MSI-X must be configured by now */
if (!nic->msix_enabled) {
- device_printf(nic->dev, "Cannot alloacte queue interrups. "
+ device_printf(nic->dev, "Cannot alloacte queue interrupts. "
"MSI-X interrupts disabled.\n");
return (ENXIO);
}
diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h
index 8aefe514946e..ce266a267f3c 100644
--- a/sys/net/pfvar.h
+++ b/sys/net/pfvar.h
@@ -2038,14 +2038,15 @@ struct pfioc_trans {
} *array;
};
-#define PFR_FLAG_ATOMIC 0x00000001 /* unused */
+#define PFR_FLAG_START 0x00000001
#define PFR_FLAG_DUMMY 0x00000002
#define PFR_FLAG_FEEDBACK 0x00000004
#define PFR_FLAG_CLSTATS 0x00000008
#define PFR_FLAG_ADDRSTOO 0x00000010
#define PFR_FLAG_REPLACE 0x00000020
#define PFR_FLAG_ALLRSETS 0x00000040
-#define PFR_FLAG_ALLMASK 0x0000007F
+#define PFR_FLAG_DONE 0x00000080
+#define PFR_FLAG_ALLMASK 0x000000FF
#ifdef _KERNEL
#define PFR_FLAG_USERIOCTL 0x10000000
#endif
@@ -2435,6 +2436,7 @@ extern struct pf_ksrc_node *pf_find_src_node(struct pf_addr *,
struct pf_srchash **, pf_sn_types_t, bool);
extern void pf_unlink_src_node(struct pf_ksrc_node *);
extern u_int pf_free_src_nodes(struct pf_ksrc_node_list *);
+extern void pf_free_src_node(struct pf_ksrc_node *);
extern void pf_print_state(struct pf_kstate *);
extern void pf_print_flags(uint16_t);
extern int pf_addr_wrap_neq(struct pf_addr_wrap *,
@@ -2521,6 +2523,9 @@ uint16_t pf_qname2qid(const char *, bool);
void pfr_initialize(void);
void pfr_cleanup(void);
+struct pfr_kentry *
+ pfr_kentry_byaddr(struct pfr_ktable *, struct pf_addr *, sa_family_t,
+ int);
int pfr_match_addr(struct pfr_ktable *, struct pf_addr *, sa_family_t);
void pfr_update_stats(struct pfr_ktable *, struct pf_addr *, sa_family_t,
u_int64_t, int, int, int);
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 712ff28768dc..79c77c105d9e 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -3076,10 +3076,6 @@ db_print_inpflags(int inp_flags)
db_printf("%sINP_RECVDSTADDR", comma ? ", " : "");
comma = 1;
}
- if (inp_flags & INP_ORIGDSTADDR) {
- db_printf("%sINP_ORIGDSTADDR", comma ? ", " : "");
- comma = 1;
- }
if (inp_flags & INP_HDRINCL) {
db_printf("%sINP_HDRINCL", comma ? ", " : "");
comma = 1;
@@ -3112,6 +3108,14 @@ db_print_inpflags(int inp_flags)
db_printf("%sINP_DONTFRAG", comma ? ", " : "");
comma = 1;
}
+ if (inp_flags & INP_BINDANY) {
+ db_printf("%sINP_BINDANY", comma ? ", " : "");
+ comma = 1;
+ }
+ if (inp_flags & INP_INHASHLIST) {
+ db_printf("%sINP_INHASHLIST", comma ? ", " : "");
+ comma = 1;
+ }
if (inp_flags & INP_RECVTOS) {
db_printf("%sINP_RECVTOS", comma ? ", " : "");
comma = 1;
@@ -3154,15 +3158,23 @@ db_print_inpflags(int inp_flags)
}
if (inp_flags & INP_ONESBCAST) {
db_printf("%sINP_ONESBCAST", comma ? ", " : "");
- comma = 1;
+ comma = 1;
}
if (inp_flags & INP_DROPPED) {
db_printf("%sINP_DROPPED", comma ? ", " : "");
- comma = 1;
+ comma = 1;
}
if (inp_flags & INP_SOCKREF) {
db_printf("%sINP_SOCKREF", comma ? ", " : "");
- comma = 1;
+ comma = 1;
+ }
+ if (inp_flags & INP_RESERVED_0) {
+ db_printf("%sINP_RESERVED_0", comma ? ", " : "");
+ comma = 1;
+ }
+ if (inp_flags & INP_BOUNDFIB) {
+ db_printf("%sINP_BOUNDFIB", comma ? ", " : "");
+ comma = 1;
}
if (inp_flags & IN6P_RFC2292) {
db_printf("%sIN6P_RFC2292", comma ? ", " : "");
@@ -3194,7 +3206,7 @@ db_print_inpvflag(u_char inp_vflag)
}
}
-static void
+void
db_print_inpcb(struct inpcb *inp, const char *name, int indent)
{
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index 9e0618e87601..7d41e3d690e0 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -730,6 +730,9 @@ int in_pcbquery_txrlevel(struct inpcb *, uint32_t *);
void in_pcboutput_txrtlmt(struct inpcb *, struct ifnet *, struct mbuf *);
void in_pcboutput_eagain(struct inpcb *);
#endif
+#ifdef DDB
+void db_print_inpcb(struct inpcb *, const char *, int);
+#endif
#endif /* _KERNEL */
#endif /* !_NETINET_IN_PCB_H_ */
diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h
index 41a49b318cd5..cab7d1c5e726 100644
--- a/sys/netinet/tcp.h
+++ b/sys/netinet/tcp.h
@@ -541,7 +541,6 @@ struct tcp_log_user {
#define TCP_HYBRID_PACING_H_MS 0x0008 /* A client hint for maxseg is present */
#define TCP_HYBRID_PACING_ENABLE 0x0010 /* We are enabling hybrid pacing else disable */
#define TCP_HYBRID_PACING_S_MSS 0x0020 /* Clent wants us to set the mss overriding gp est in CU */
-#define TCP_HAS_PLAYOUT_MS 0x0040 /* The client included the chunk playout milliseconds: deprecate */
/* the below are internal only flags */
#define TCP_HYBRID_PACING_USER_MASK 0x0FFF /* Non-internal flags mask */
#define TCP_HYBRID_PACING_SETMSS 0x1000 /* Internal flag that tells us we set the mss on this entry */
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 98c934955121..c4a54646f3a2 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -3088,7 +3088,8 @@ db_print_bblog_state(int state)
}
static void
-db_print_tcpcb(struct tcpcb *tp, const char *name, int indent, bool show_bblog)
+db_print_tcpcb(struct tcpcb *tp, const char *name, int indent, bool show_bblog,
+ bool show_inpcb)
{
db_print_indent(indent);
@@ -3096,6 +3097,9 @@ db_print_tcpcb(struct tcpcb *tp, const char *name, int indent, bool show_bblog)
indent += 2;
+ if (show_inpcb)
+ db_print_inpcb(tptoinpcb(tp), "t_inpcb", indent);
+
db_print_indent(indent);
db_printf("t_segq first: %p t_segqlen: %d t_dupacks: %d\n",
TAILQ_FIRST(&tp->t_segq), tp->t_segqlen, tp->t_dupacks);
@@ -3227,33 +3231,36 @@ db_print_tcpcb(struct tcpcb *tp, const char *name, int indent, bool show_bblog)
DB_SHOW_COMMAND(tcpcb, db_show_tcpcb)
{
struct tcpcb *tp;
- bool show_bblog;
+ bool show_bblog, show_inpcb;
if (!have_addr) {
- db_printf("usage: show tcpcb <addr>\n");
+ db_printf("usage: show tcpcb[/bi] <addr>\n");
return;
}
show_bblog = strchr(modif, 'b') != NULL;
+ show_inpcb = strchr(modif, 'i') != NULL;
tp = (struct tcpcb *)addr;
-
- db_print_tcpcb(tp, "tcpcb", 0, show_bblog);
+ db_print_tcpcb(tp, "tcpcb", 0, show_bblog, show_inpcb);
}
DB_SHOW_ALL_COMMAND(tcpcbs, db_show_all_tcpcbs)
{
VNET_ITERATOR_DECL(vnet_iter);
struct inpcb *inp;
- bool only_locked, show_bblog;
+ struct tcpcb *tp;
+ bool only_locked, show_bblog, show_inpcb;
only_locked = strchr(modif, 'l') != NULL;
show_bblog = strchr(modif, 'b') != NULL;
+ show_inpcb = strchr(modif, 'i') != NULL;
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
CK_LIST_FOREACH(inp, &V_tcbinfo.ipi_listhead, inp_list) {
if (only_locked &&
inp->inp_lock.rw_lock == RW_UNLOCKED)
continue;
- db_print_tcpcb(intotcpcb(inp), "tcpcb", 0, show_bblog);
+ tp = intotcpcb(inp);
+ db_print_tcpcb(tp, "tcpcb", 0, show_bblog, show_inpcb);
if (db_pager_quit)
break;
}
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index fd70fb1c8a36..a39f5fe58cd6 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -1007,7 +1007,7 @@ pf_src_node_exists(struct pf_ksrc_node **sn, struct pf_srchash *sh)
return (false);
}
-static void
+void
pf_free_src_node(struct pf_ksrc_node *sn)
{
diff --git a/sys/netpfil/pf/pf_if.c b/sys/netpfil/pf/pf_if.c
index f3be036ef745..6f41d453a7d1 100644
--- a/sys/netpfil/pf/pf_if.c
+++ b/sys/netpfil/pf/pf_if.c
@@ -702,7 +702,7 @@ pfi_table_update(struct pfr_ktable *kt, struct pfi_kkif *kif, uint8_t net,
}
if ((e = pfr_set_addrs(&kt->pfrkt_t, V_pfi_buffer, V_pfi_buffer_cnt, &size2,
- NULL, NULL, NULL, 0, PFR_TFLAG_ALLMASK)))
+ NULL, NULL, NULL, PFR_FLAG_START | PFR_FLAG_DONE, PFR_TFLAG_ALLMASK)))
printf("%s: cannot set %d new addresses into table %s: %d\n",
__func__, V_pfi_buffer_cnt, kt->pfrkt_name, e);
}
diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c
index 703ecf446fad..5ec67021068b 100644
--- a/sys/netpfil/pf/pf_ioctl.c
+++ b/sys/netpfil/pf/pf_ioctl.c
@@ -5142,7 +5142,7 @@ DIOCCHANGEADDR_error:
error = pfr_set_addrs(&io->pfrio_table, pfras,
io->pfrio_size, &io->pfrio_size2, &io->pfrio_nadd,
&io->pfrio_ndel, &io->pfrio_nchange, io->pfrio_flags |
- PFR_FLAG_USERIOCTL, 0);
+ PFR_FLAG_START | PFR_FLAG_DONE | PFR_FLAG_USERIOCTL, 0);
PF_RULES_WUNLOCK();
if (error == 0 && io->pfrio_flags & PFR_FLAG_FEEDBACK)
error = copyout(pfras, io->pfrio_buffer, totlen);
diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c
index 4b1d74e0e61f..7aeb8266ca8c 100644
--- a/sys/netpfil/pf/pf_lb.c
+++ b/sys/netpfil/pf/pf_lb.c
@@ -535,6 +535,63 @@ pf_get_mape_sport(struct pf_pdesc *pd, struct pf_krule *r,
return (1);
}
+static __inline u_short
+pf_check_src_node_valid(struct pf_ksrc_node *sn, struct pf_kpool *rpool)
+{
+ struct pf_addr *raddr, *rmask;
+ struct pf_addr *caddr; /* cached redirection address */
+ struct pf_kpooladdr *pa;
+ sa_family_t raf;
+ sa_family_t caf; /* cached redirection AF */
+ u_short valid = 0;
+
+ KASSERT(sn != NULL, ("sn is NULL"));
+ KASSERT(rpool != NULL, ("rpool is NULL"));
+
+ /* check if the cached entry is still valid */
+
+ if (sn->type == PF_SN_LIMIT) {
+ /* Always valid as it does not store redirection address */
+ return (1);
+ }
+
+ mtx_lock(&rpool->mtx);
+ caddr = &(sn->raddr);
+ caf = sn->raf;
+
+ TAILQ_FOREACH(pa, &rpool->list, entries) {
+ if (PF_AZERO(caddr, caf)) {
+ valid = 1;
+ goto done;
+ } else if (pa->addr.type == PF_ADDR_DYNIFTL) {
+ if (pfr_kentry_byaddr(pa->addr.p.dyn->pfid_kt, caddr, caf, 0)) {
+ valid = 1;
+ goto done;
+ }
+ } else if (pa->addr.type == PF_ADDR_TABLE) {
+ if (pfr_kentry_byaddr(pa->addr.p.tbl, caddr, caf, 0)) {
+ valid = 1;
+ goto done;
+ }
+ } else if (pa->addr.type != PF_ADDR_NOROUTE) {
+ /* PF_ADDR_URPFFAILED, PF_ADDR_RANGE, PF_ADDR_ADDRMASK */
+ raddr = &(pa->addr.v.a.addr);
+ rmask = &(pa->addr.v.a.mask);
+ raf = pa->af;
+ if (raf == caf && pf_match_addr(0, raddr, rmask, caddr, caf)) {
+ valid = 1;
+ goto done;
+ }
+ }
+ /* else PF_ADDR_NOROUTE */
+ }
+
+done:
+ mtx_unlock(&rpool->mtx);
+
+ return (valid);
+}
+
u_short
pf_map_addr(sa_family_t saf, struct pf_krule *r, struct pf_addr *saddr,
struct pf_addr *naddr, struct pfi_kkif **nkif, sa_family_t *naf,
@@ -874,6 +931,45 @@ pf_map_addr_sn(sa_family_t saf, struct pf_krule *r, struct pf_addr *saddr,
if (sn != NULL) {
PF_SRC_NODE_LOCK_ASSERT(sn);
+ /*
+ * Check if source node's redirection address still exists
+ * in pool from which the SN was created. If not, delete it.
+ * Similar to pf_kill_srcnodes(). Unlink the source node
+ * from tree, unlink it from states, then free it. Do not
+ * overlap source node and state locks to avoid LOR.
+ */
+ if (!pf_check_src_node_valid(sn, rpool)) {
+ pf_unlink_src_node(sn);
+ PF_SRC_NODE_UNLOCK(sn);
+ if (V_pf_status.debug >= PF_DEBUG_NOISY) {
+ printf("%s: stale src tracking (%d) ",
+ __func__, sn_type);
+ pf_print_host(saddr, 0, saf);
+ printf(" to ");
+ pf_print_host(&(sn->raddr), 0, sn->raf);
+ if (nkif)
+ printf("@%s", sn->rkif->pfik_name);
+ printf("\n");
+ }
+
+ for (int i = 0; i <= V_pf_hashmask; i++) {
+ struct pf_idhash *ih = &V_pf_idhash[i];
+ struct pf_kstate *st;
+
+ PF_HASHROW_LOCK(ih);
+ LIST_FOREACH(st, &ih->states, entry) {
+ if (st->sns[sn->type] == sn) {
+ st->sns[sn->type] = NULL;
+ }
+ }
+ PF_HASHROW_UNLOCK(ih);
+ }
+ pf_free_src_node(sn);
+ counter_u64_add(V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS], 1);
+ sn = NULL;
+ goto map_addr;
+ }
+
(*naf) = sn->raf;
/* If the supplied address is the same as the current one we've
@@ -902,9 +998,10 @@ pf_map_addr_sn(sa_family_t saf, struct pf_krule *r, struct pf_addr *saddr,
goto done;
}
+map_addr:
/*
- * Source node has not been found. Find a new address and store it
- * in variables given by the caller.
+ * Source node has not been found or is invalid. Find a new address
+ * and store it in variables given by the caller.
*/
if ((reason = pf_map_addr(saf, r, saddr, naddr, nkif, naf, init_addr,
rpool)) != 0) {
diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c
index 082b9b565153..21d4db1b8478 100644
--- a/sys/netpfil/pf/pf_nl.c
+++ b/sys/netpfil/pf/pf_nl.c
@@ -2100,6 +2100,7 @@ struct nl_parsed_table_addrs {
size_t addr_count;
int nadd;
int ndel;
+ int nchange;
};
#define _OUT(_field) offsetof(struct pfr_addr, _field)
static const struct nlattr_parser nla_p_pfr_addr[] = {
@@ -2209,6 +2210,42 @@ pf_handle_table_del_addrs(struct nlmsghdr *hdr, struct nl_pstate *npt)
return (error);
}
+static int
+pf_handle_table_set_addrs(struct nlmsghdr *hdr, struct nl_pstate *npt)
+{
+ struct nl_parsed_table_addrs attrs = { 0 };
+ struct nl_writer *nw = npt->nw;
+ struct genlmsghdr *ghdr_new;
+ int error;
+
+ error = nl_parse_nlmsg(hdr, &table_addr_parser, npt, &attrs);
+ if (error != 0)
+ return (error);
+
+ PF_RULES_WLOCK();
+ error = pfr_set_addrs(&attrs.table, &attrs.addrs[0],
+ attrs.addr_count, NULL, &attrs.nadd, &attrs.ndel, &attrs.nchange,
+ attrs.flags | PFR_FLAG_USERIOCTL, 0);
+ PF_RULES_WUNLOCK();
+
+ if (!nlmsg_reply(nw, hdr, sizeof(struct genlmsghdr)))
+ return (ENOMEM);
+
+ ghdr_new = nlmsg_reserve_object(nw, struct genlmsghdr);
+ ghdr_new->cmd = PFNL_CMD_TABLE_DEL_ADDR;
+ ghdr_new->version = 0;
+ ghdr_new->reserved = 0;
+
+ nlattr_add_u32(nw, PF_TA_NBR_ADDED, attrs.nadd);
+ nlattr_add_u32(nw, PF_TA_NBR_DELETED, attrs.ndel);
+ nlattr_add_u32(nw, PF_TA_NBR_CHANGED, attrs.nchange);
+
+ if (!nlmsg_end(nw))
+ return (ENOMEM);
+
+ return (error);
+}
+
static const struct nlhdr_parser *all_parsers[] = {
&state_parser,
&addrule_parser,
@@ -2460,6 +2497,13 @@ static const struct genl_cmd pf_cmds[] = {
.cmd_flags = GENL_CMD_CAP_DO | GENL_CMD_CAP_HASPOL,
.cmd_priv = PRIV_NETINET_PF,
},
+ {
+ .cmd_num = PFNL_CMD_TABLE_SET_ADDR,
+ .cmd_name = "TABLE_SET_ADDRS",
+ .cmd_cb = pf_handle_table_set_addrs,
+ .cmd_flags = GENL_CMD_CAP_DO | GENL_CMD_CAP_HASPOL,
+ .cmd_priv = PRIV_NETINET_PF,
+ },
};
void
diff --git a/sys/netpfil/pf/pf_nl.h b/sys/netpfil/pf/pf_nl.h
index c46c8f2b2592..d1538ab4ff5b 100644
--- a/sys/netpfil/pf/pf_nl.h
+++ b/sys/netpfil/pf/pf_nl.h
@@ -69,6 +69,7 @@ enum {
PFNL_CMD_CLR_ADDRS = 31,
PFNL_CMD_TABLE_ADD_ADDR = 32,
PFNL_CMD_TABLE_DEL_ADDR = 33,
+ PFNL_CMD_TABLE_SET_ADDR = 34,
__PFNL_CMD_MAX,
};
#define PFNL_CMD_MAX (__PFNL_CMD_MAX -1)
@@ -483,6 +484,7 @@ enum pf_table_addrs_t {
PF_TA_FLAGS = 3, /* u32 */
PF_TA_NBR_ADDED = 4, /* u32 */
PF_TA_NBR_DELETED = 5, /* u32 */
+ PF_TA_NBR_CHANGED = 6, /* u32 */
};
#ifdef _KERNEL
diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c
index 73ec18fa7646..0e2b9fe1cac8 100644
--- a/sys/netpfil/pf/pf_table.c
+++ b/sys/netpfil/pf/pf_table.c
@@ -399,7 +399,8 @@ pfr_set_addrs(struct pfr_table *tbl, struct pfr_addr *addr, int size,
PF_RULES_WASSERT();
- ACCEPT_FLAGS(flags, PFR_FLAG_DUMMY | PFR_FLAG_FEEDBACK);
+ ACCEPT_FLAGS(flags, PFR_FLAG_START | PFR_FLAG_DONE |
+ PFR_FLAG_DUMMY | PFR_FLAG_FEEDBACK);
if (pfr_validate_table(tbl, ignore_pfrt_flags, flags &
PFR_FLAG_USERIOCTL))
return (EINVAL);
@@ -411,7 +412,8 @@ pfr_set_addrs(struct pfr_table *tbl, struct pfr_addr *addr, int size,
tmpkt = pfr_create_ktable(&V_pfr_nulltable, 0, 0);
if (tmpkt == NULL)
return (ENOMEM);
- pfr_mark_addrs(kt);
+ if (flags & PFR_FLAG_START)
+ pfr_mark_addrs(kt);
SLIST_INIT(&addq);
SLIST_INIT(&delq);
SLIST_INIT(&changeq);
@@ -444,6 +446,7 @@ pfr_set_addrs(struct pfr_table *tbl, struct pfr_addr *addr, int size,
}
p = pfr_create_kentry(&ad,
(kt->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0);
+ p->pfrke_mark = PFR_FB_ADDED;
if (p == NULL)
senderr(ENOMEM);
if (pfr_route_kentry(tmpkt, p)) {
@@ -459,7 +462,8 @@ _skip:
if (flags & PFR_FLAG_FEEDBACK)
bcopy(&ad, addr + i, sizeof(ad));
}
- pfr_enqueue_addrs(kt, &delq, &xdel, ENQUEUE_UNMARKED_ONLY);
+ if (flags & PFR_FLAG_DONE)
+ pfr_enqueue_addrs(kt, &delq, &xdel, ENQUEUE_UNMARKED_ONLY);
if ((flags & PFR_FLAG_FEEDBACK) && *size2) {
if (*size2 < size+xdel) {
*size2 = size+xdel;
@@ -2071,7 +2075,7 @@ pfr_lookup_table(struct pfr_table *tbl)
(struct pfr_ktable *)tbl));
}
-static struct pfr_kentry *
+struct pfr_kentry *
pfr_kentry_byaddr(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af,
int exact)
{
diff --git a/sys/riscv/riscv/fpe.c b/sys/riscv/riscv/fpe.c
index b6c66e5e4f09..63103a794a8e 100644
--- a/sys/riscv/riscv/fpe.c
+++ b/sys/riscv/riscv/fpe.c
@@ -69,39 +69,39 @@ fpe_store(struct fpreg *regs)
__asm __volatile(
"frcsr %0 \n"
- "fsd f0, (16 * 0)(%1)\n"
- "fsd f1, (16 * 1)(%1)\n"
- "fsd f2, (16 * 2)(%1)\n"
- "fsd f3, (16 * 3)(%1)\n"
- "fsd f4, (16 * 4)(%1)\n"
- "fsd f5, (16 * 5)(%1)\n"
- "fsd f6, (16 * 6)(%1)\n"
- "fsd f7, (16 * 7)(%1)\n"
- "fsd f8, (16 * 8)(%1)\n"
- "fsd f9, (16 * 9)(%1)\n"
- "fsd f10, (16 * 10)(%1)\n"
- "fsd f11, (16 * 11)(%1)\n"
- "fsd f12, (16 * 12)(%1)\n"
- "fsd f13, (16 * 13)(%1)\n"
- "fsd f14, (16 * 14)(%1)\n"
- "fsd f15, (16 * 15)(%1)\n"
- "fsd f16, (16 * 16)(%1)\n"
- "fsd f17, (16 * 17)(%1)\n"
- "fsd f18, (16 * 18)(%1)\n"
- "fsd f19, (16 * 19)(%1)\n"
- "fsd f20, (16 * 20)(%1)\n"
- "fsd f21, (16 * 21)(%1)\n"
- "fsd f22, (16 * 22)(%1)\n"
- "fsd f23, (16 * 23)(%1)\n"
- "fsd f24, (16 * 24)(%1)\n"
- "fsd f25, (16 * 25)(%1)\n"
- "fsd f26, (16 * 26)(%1)\n"
- "fsd f27, (16 * 27)(%1)\n"
- "fsd f28, (16 * 28)(%1)\n"
- "fsd f29, (16 * 29)(%1)\n"
- "fsd f30, (16 * 30)(%1)\n"
- "fsd f31, (16 * 31)(%1)\n"
- : "=&r"(fcsr), "=r"(fp_x), "=m"(*fp_x));
+ "fsd f0, (16 * 0)(%2)\n"
+ "fsd f1, (16 * 1)(%2)\n"
+ "fsd f2, (16 * 2)(%2)\n"
+ "fsd f3, (16 * 3)(%2)\n"
+ "fsd f4, (16 * 4)(%2)\n"
+ "fsd f5, (16 * 5)(%2)\n"
+ "fsd f6, (16 * 6)(%2)\n"
+ "fsd f7, (16 * 7)(%2)\n"
+ "fsd f8, (16 * 8)(%2)\n"
+ "fsd f9, (16 * 9)(%2)\n"
+ "fsd f10, (16 * 10)(%2)\n"
+ "fsd f11, (16 * 11)(%2)\n"
+ "fsd f12, (16 * 12)(%2)\n"
+ "fsd f13, (16 * 13)(%2)\n"
+ "fsd f14, (16 * 14)(%2)\n"
+ "fsd f15, (16 * 15)(%2)\n"
+ "fsd f16, (16 * 16)(%2)\n"
+ "fsd f17, (16 * 17)(%2)\n"
+ "fsd f18, (16 * 18)(%2)\n"
+ "fsd f19, (16 * 19)(%2)\n"
+ "fsd f20, (16 * 20)(%2)\n"
+ "fsd f21, (16 * 21)(%2)\n"
+ "fsd f22, (16 * 22)(%2)\n"
+ "fsd f23, (16 * 23)(%2)\n"
+ "fsd f24, (16 * 24)(%2)\n"
+ "fsd f25, (16 * 25)(%2)\n"
+ "fsd f26, (16 * 26)(%2)\n"
+ "fsd f27, (16 * 27)(%2)\n"
+ "fsd f28, (16 * 28)(%2)\n"
+ "fsd f29, (16 * 29)(%2)\n"
+ "fsd f30, (16 * 30)(%2)\n"
+ "fsd f31, (16 * 31)(%2)\n"
+ : "=&r"(fcsr), "=m"(*fp_x) : "r"(fp_x));
regs->fp_fcsr = fcsr;
}
diff --git a/sys/riscv/vmm/vmm.c b/sys/riscv/vmm/vmm.c
index 24b4be89af48..a9eb9d144336 100644
--- a/sys/riscv/vmm/vmm.c
+++ b/sys/riscv/vmm/vmm.c
@@ -319,10 +319,6 @@ vm_alloc_vcpu(struct vm *vm, int vcpuid)
if (vcpuid < 0 || vcpuid >= vm_get_maxcpus(vm))
return (NULL);
- /* Some interrupt controllers may have a CPU limit */
- if (vcpuid >= aplic_max_cpu_count(vm->cookie))
- return (NULL);
-
vcpu = (struct vcpu *)
atomic_load_acq_ptr((uintptr_t *)&vm->vcpu[vcpuid]);
if (__predict_true(vcpu != NULL))
diff --git a/sys/riscv/vmm/vmm_aplic.c b/sys/riscv/vmm/vmm_aplic.c
index 4df41f2de1a5..74cb4fef4273 100644
--- a/sys/riscv/vmm/vmm_aplic.c
+++ b/sys/riscv/vmm/vmm_aplic.c
@@ -577,13 +577,3 @@ aplic_sync_hwstate(struct hypctx *hypctx)
{
}
-
-int
-aplic_max_cpu_count(struct hyp *hyp)
-{
- int16_t max_count;
-
- max_count = vm_get_maxcpus(hyp->vm);
-
- return (max_count);
-}
diff --git a/sys/riscv/vmm/vmm_aplic.h b/sys/riscv/vmm/vmm_aplic.h
index 49510221b419..96018fe9adda 100644
--- a/sys/riscv/vmm/vmm_aplic.h
+++ b/sys/riscv/vmm/vmm_aplic.h
@@ -49,6 +49,5 @@ void aplic_cpuinit(struct hypctx *hypctx);
void aplic_cpucleanup(struct hypctx *hypctx);
void aplic_flush_hwstate(struct hypctx *hypctx);
void aplic_sync_hwstate(struct hypctx *hypctx);
-int aplic_max_cpu_count(struct hyp *hyp);
#endif /* !_VMM_APLIC_H_ */