From nobody Tue Oct 24 19:00:19 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SFLwg3lBbz4yN2X; Tue, 24 Oct 2023 19:00:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SFLwg2ydyz4GY7; Tue, 24 Oct 2023 19:00:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698174019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0U8csX9Shnn26GhPP/L453LWSJJ2gqhu6774IP7XIS8=; b=DT5cCuyr7BTL73d3W9zFesSl0Zp565zJPe65xdWlkY+2dT4iskqU3FPSGxVcOKWEc/HlMS CLKPulxN4edWs/NF1JHjwBtQnfGPtjV00xUTwteyHqjs0mkPbN4bzgHDs5scVgCoWea1cb bkg6GVy6TnTa74eJ+tqbP3VcJRHxDC0ix9LcKWZmBY/2uxZA9798J8fWUYcTjEiXRh7nTe pr6Q1vs3VPVnmO5Ea6jhHuEI7IK+Z9tdCvmKIbHaB+OR1VmwYK19V5qKqPoRLgsDE5T8Ui xoUSXg/OUDehPR4dyX9eabhSFRNLozoKQq9RjYFdA2uYGdYLB1ktWwhGgyckPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698174019; a=rsa-sha256; cv=none; b=mhUKFb27pG3iZjm7Ku9O6m2AZvVA5hEUbl5Qq0HDJZEKl/nYGA5P424h+VNmjPzyvqt5bO up2hXsguPrknBITTQaJJjmI/55TeNhYLaS4uR13osiow8LYWqL/25GACM/orn7sJD8H5Z8 kFdUaBsLhhwimpPg0F6+mjd7fuymjrav3wmnrx1wFbbE1TeIj4w7YglYFUhcX5EylFxsSN gbVqofMuEWIOe1tRfKnv/XTdAQsptLOzPGL7OlLRcdSnRZP3EfDxOPRsD9EUQbo23pZSb0 gKy06xCtqz6eHgCBHafKECSOlUoTQ8Ndd57HfndX7BGSz+4PU+erkB7woJi6hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698174019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0U8csX9Shnn26GhPP/L453LWSJJ2gqhu6774IP7XIS8=; b=agYCy34Hv/bZwsBILNN6YQzPTAX1LEETA/xhUo1fMjwK2ZbdJA/60ofRKCFiLnYXKaqDPn VN/Pyh9etliGxbD8tRUxj8PjlgT+FPXspPyCjd+0flT5sB0Ml8/6LRN4sRxj3WvbWU8Ln6 qDGQGpXcLupUxxewwW0OUkrwNZMhFMuMXmXljIidxjJ3wC/sXujlbG+F+kawdJucyP3O+Z TqmkdcUHykagR/lfu0gOO3sfVo3+B2wvaTTwdJ5jksaIDa2D9+1UXVN+ybJyEB76GBlffy NZII2+72bwHjAFpkSjsfqgh0ar8XKcpba7xyrjJoVIuoPk/NkYvYfMO4miEOUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SFLwg1zQvzZdf; Tue, 24 Oct 2023 19:00:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39OJ0J6p032884; Tue, 24 Oct 2023 19:00:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39OJ0JXq032881; Tue, 24 Oct 2023 19:00:19 GMT (envelope-from git) Date: Tue, 24 Oct 2023 19:00:19 GMT Message-Id: <202310241900.39OJ0JXq032881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 67d6141e1581 - stable/14 - bhyve: Some fwctl simplifications. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 67d6141e1581897d0fd1e1ecf35a99d088b10f97 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=67d6141e1581897d0fd1e1ecf35a99d088b10f97 commit 67d6141e1581897d0fd1e1ecf35a99d088b10f97 Author: John Baldwin AuthorDate: 2023-10-13 19:26:22 +0000 Commit: John Baldwin CommitDate: 2023-10-24 18:43:45 +0000 bhyve: Some fwctl simplifications. - Collapse IDENT_SEND/IDENT_WAIT states down to a single state. - Remove unused 'len' argument to op_data callback. The value passed in (total amount of remaining data to receive) didn't seem very useful and no op_data implementations used it. Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D41286 (cherry picked from commit f0852344e7abf4d74508185e67a1b98d6cdbd026) --- usr.sbin/bhyve/amd64/fwctl.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/usr.sbin/bhyve/amd64/fwctl.c b/usr.sbin/bhyve/amd64/fwctl.c index 01b16c38f3a7..5e930cdb2051 100644 --- a/usr.sbin/bhyve/amd64/fwctl.c +++ b/usr.sbin/bhyve/amd64/fwctl.c @@ -63,8 +63,7 @@ * Back-end state-machine */ static enum state { - IDENT_WAIT, - IDENT_SEND, + IDENT, REQ, RESP } be_state; @@ -75,7 +74,7 @@ static u_int ident_idx; struct op_info { int op; int (*op_start)(uint32_t len); - void (*op_data)(uint32_t data, uint32_t len); + void (*op_data)(uint32_t data); int (*op_result)(struct iovec **data); void (*op_done)(struct iovec *data); }; @@ -120,7 +119,7 @@ errop_start(uint32_t len __unused) } static void -errop_data(uint32_t data __unused, uint32_t len __unused) +errop_data(uint32_t data __unused) { /* ignore */ @@ -192,7 +191,7 @@ fget_start(uint32_t len) } static void -fget_data(uint32_t data, uint32_t len __unused) +fget_data(uint32_t data) { assert(fget_cnt + sizeof(uint32_t) <= sizeof(fget_str)); @@ -347,7 +346,7 @@ fwctl_request_data(uint32_t value) else rinfo.req_size -= sizeof(uint32_t); - (*rinfo.req_op->op_data)(value, rinfo.req_size); + (*rinfo.req_op->op_data)(value); if (rinfo.req_size < sizeof(uint32_t)) { fwctl_request_done(); @@ -360,7 +359,6 @@ fwctl_request_data(uint32_t value) static int fwctl_request(uint32_t value) { - int ret; ret = 0; @@ -451,12 +449,11 @@ fwctl_reset(void) /* Discard partially-received request. */ memset(&rinfo, 0, sizeof(rinfo)); break; - case IDENT_WAIT: - case IDENT_SEND: + case IDENT: break; } - be_state = IDENT_SEND; + be_state = IDENT; ident_idx = 0; } @@ -472,7 +469,7 @@ fwctl_inb(void) retval = 0xff; switch (be_state) { - case IDENT_SEND: + case IDENT: retval = sig[ident_idx++]; if (ident_idx >= sizeof(sig)) be_state = REQ; @@ -580,5 +577,5 @@ fwctl_init(void) ops[OP_GET_LEN] = &fgetlen_info; ops[OP_GET] = &fgetval_info; - be_state = IDENT_WAIT; + be_state = IDENT; }