From nobody Sat Jun 03 17:05: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 4QYR801XKQz4Z8lR; Sat, 3 Jun 2023 17:05:20 +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 4QYR800rM7z3HH9; Sat, 3 Jun 2023 17:05:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685811920; 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=mWi/bxEM1i4r6xBzeId0jQC/UDenUeqiiAx3fMokicw=; b=xVA/KNnM8Fnj+Hqn06xDJnGY/5SnDs3Yd9vzS82O3I7feBcsc0HUCy4upTACA8zcX6kbZV EOfAGgVP6tX0vVyDlUXdwPa1lPVNzZ/aeqCu7MtMz9QiIKf+toFmPr40OR5uL/46UFVHe2 YwejRxkIsWo1QjWIMIZhstwkymJyY1X5fqIeHC2uYj++Xs3RwTgLmFHQMA0CxI+QbGl6l3 57YBdMor2DqWNfdPbh85/Hqu7q4IRi0xm24qL6S3C40BW73BkEfTr7G87aXoOBiWGSC8H9 bjVAYM3aMRDcbBzoeVt+dUoIOfI4twJfGgRx59pbprpDbe1mQ3S6GPA+kORu4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685811920; 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=mWi/bxEM1i4r6xBzeId0jQC/UDenUeqiiAx3fMokicw=; b=MggCRtxu4DasasTDiOY3pVd0zQh4eRsnOSgTH/oMZamf0A5lpbZCu2dAMLCI+HNnfe1AFs AC3dxuTpcLPE3C49enG/f9XTHCMrvemS6nsKtLx1zTa9ozUPfo5m0ID/fQiXabe3/BmQxC 3z9QH9DOW59XlmXlE49B/wRZcmBrjyZpZ4sY1l6Ega6KYfoecoKOr7I5QUDl/y4nxyhmr7 QwCa+iCCZIQc7+4XsBZ4ik5KP6Hd7Jaqj/nL8UR0Rnm0DMLPK1VWI1rzwiK2yWFxSQymTk umXgmojRvDtBYGy1FUves9XGdEYOiciltIId1cbRVH5Kmpu/NmjBbrKu/eKoXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685811920; a=rsa-sha256; cv=none; b=V+X0SGaNgVNK4ybQuLB4Z6X3gF3OzvkVzr2UW8L5g+VRkgxJjTA65pbxt3i72QN6ZU6Uri 6PnveIOa42m6BPYO6ad3xITpquHq8TzcUgh7L6+2Hvx4gZru6rJYYLO9hCspAMIzmZgxRW psSs+EA27cdZzkD9qSX+MDPk2zvK50NNM6ef//WqpvMJzHB0HFW2mVYaHgCzXPb894+wGV sE0hedZ+w0iLB6Bg7gdlnynF791h5YFamtdHsB7KzU0YnC60obsnQTsSbGL8bje85nCfij OxMVwn5ZPHlkbOw42yByG5xSpv84IwPEmmhMxaymcjUH46EZFzPnXohfsdkNsA== 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 4QYR7z71SjzY6V; Sat, 3 Jun 2023 17:05:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 353H5JNv019461; Sat, 3 Jun 2023 17:05:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 353H5JPj019460; Sat, 3 Jun 2023 17:05:19 GMT (envelope-from git) Date: Sat, 3 Jun 2023 17:05:19 GMT Message-Id: <202306031705.353H5JPj019460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 9b091f12008f - main - kinst: simplify trampoline fill definitions 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: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b091f12008f060cd1c03b91b020f24187341d60 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9b091f12008f060cd1c03b91b020f24187341d60 commit 9b091f12008f060cd1c03b91b020f24187341d60 Author: Christos Margiolis AuthorDate: 2023-06-03 17:04:57 +0000 Commit: Christos Margiolis CommitDate: 2023-06-03 17:04:57 +0000 kinst: simplify trampoline fill definitions Centralize KINST_TRAMP_FILL_PATTERN and KINST_TRAMP_FILL_SIZE to reduce redefinitions, and use the architecture-dependent kinst_patchval_t as their size. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40406 --- sys/cddl/dev/kinst/amd64/kinst_isa.h | 6 ++---- sys/cddl/dev/kinst/trampoline.c | 5 ++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/cddl/dev/kinst/amd64/kinst_isa.h b/sys/cddl/dev/kinst/amd64/kinst_isa.h index eb4f79c4c726..bd7d40f4bd06 100644 --- a/sys/cddl/dev/kinst/amd64/kinst_isa.h +++ b/sys/cddl/dev/kinst/amd64/kinst_isa.h @@ -17,10 +17,8 @@ * have 2 instructions stored in the trampoline, and each of them can take up * to 16 bytes, 32 bytes is enough to cover even the worst case scenario. */ -#define KINST_TRAMP_SIZE 32 -#define KINST_TRAMPCHUNK_SIZE PAGE_SIZE -#define KINST_TRAMP_FILL_PATTERN ((uint8_t []){KINST_PATCHVAL}) -#define KINST_TRAMP_FILL_SIZE sizeof(uint8_t) +#define KINST_TRAMP_SIZE 32 +#define KINST_TRAMPCHUNK_SIZE PAGE_SIZE typedef uint8_t kinst_patchval_t; diff --git a/sys/cddl/dev/kinst/trampoline.c b/sys/cddl/dev/kinst/trampoline.c index 75efd022fb20..5c8c27343201 100644 --- a/sys/cddl/dev/kinst/trampoline.c +++ b/sys/cddl/dev/kinst/trampoline.c @@ -28,7 +28,10 @@ #include "kinst.h" #include "kinst_isa.h" -#define KINST_TRAMPS_PER_CHUNK (KINST_TRAMPCHUNK_SIZE / KINST_TRAMP_SIZE) +#define KINST_TRAMP_FILL_PATTERN ((kinst_patchval_t []){KINST_PATCHVAL}) +#define KINST_TRAMP_FILL_SIZE sizeof(kinst_patchval_t) + +#define KINST_TRAMPS_PER_CHUNK (KINST_TRAMPCHUNK_SIZE / KINST_TRAMP_SIZE) struct trampchunk { TAILQ_ENTRY(trampchunk) next;