From nobody Wed Nov 02 17:03:06 2022 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 4N2Y9k51Hcz4gNl8; Wed, 2 Nov 2022 17:03:06 +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 4N2Y9k4Pqmz3pnP; Wed, 2 Nov 2022 17:03:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667408586; 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=3poBar/b7hERWTXg0Vl2/sjvM5A4JmioWVXp7UljvqY=; b=mFdzGV5EPYaFlyZIjWKfGyAfgJGyAy5vaib2jYVS2EdZ0N33Y/N9ze5azgtTylSb8BjGJE C1gXh+BlW7ASEnWL6EAGbSeCSIl4YxxZD760HoSQkDjac4Sp3lyvRokz3ft208NDm3f3oR +xC4b/VSO7XL2h+5EG3O+WhYWBTq/P+6CeTdMigsGxzuJ6b8jX3/AeizY03NsedSJbGz6s 1XYGbEHpMRyUA78DZ7Fp4FTWoBwxIbLhFhx65IkkHsvHNygFR2V2IQS0VJOquMD+F/CPPd Pb+c9b9tZ8DFqpvcrYoeMrWTn9WBrKw7Kx+ri7wyGqV9cfAez4uInV09HQHeLg== 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 4N2Y9k3NMJz13mw; Wed, 2 Nov 2022 17:03:06 +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 2A2H36P9064957; Wed, 2 Nov 2022 17:03:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A2H36v8064956; Wed, 2 Nov 2022 17:03:06 GMT (envelope-from git) Date: Wed, 2 Nov 2022 17:03:06 GMT Message-Id: <202211021703.2A2H36v8064956@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: ffcb2897471b - stable/13 - kasan: provide bus peek/poke 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: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ffcb2897471b8971c62dedbde0caaca9396fb618 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667408586; 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=3poBar/b7hERWTXg0Vl2/sjvM5A4JmioWVXp7UljvqY=; b=yBwnm9D169ha/0qk57AoXODg1w03AUzRqn7h5T6rIzNe+I5E9AKgg5Sl5nnkU6vJdwhqJL Z4/rNzx2cdBqQBS8QStP4H+8InNLfOwrRV0oUCICKp2hc0QYM5iHck7FrQSbVpu3aJhnQ9 +2iLsGRAoaQyY8zy1KG0k8GavCPWPorapws9Mqx7QOjlOPAYi8iFfQ2Q3uXXrpZc7/i7cj cnXinlmbSDXBzffMsLy7gYhfJn2Um1qOjp5w9PteYtyh3tOOrJwyWEQYDkU0ecAXoEagdr yEhsSLCs9Hw6qj6CflayqRlGd9qv5gW5rCUBpM7reqcRMWZoxHJi8C9Jcu72SQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667408586; a=rsa-sha256; cv=none; b=rkAuB6zZqn9+0NZOqyzVQLNjpBSXgbA1b8Ibz1Tb9a0hsM95OJtW7RQRLrm0dfaiR827e1 ujjhogipUk4l1HeVBNf58+GX8Pd3YdDaP7A1zEZysO7xHcyRsj5i/8LMjR/jPdz0wFvYeZ 0XTuP+0kgA0YjyXv7tTUcQz74A/hyLczU4mQy2WbbxzaDDfGIq0S5aoryR9uoAOlaKP7pz w4pYxWy/rajUX2EvWg7qXFZoxSETlfAIRGBEM+8cxEkdALBGrTMprZkX1zKVUKWTc04lWB 1Vn0CFf7uHSahTln0TEiIvlOjibDBEZgf+2c4rnrv73BT50ZklR4UN0pc97Rbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=ffcb2897471b8971c62dedbde0caaca9396fb618 commit ffcb2897471b8971c62dedbde0caaca9396fb618 Author: Mitchell Horne AuthorDate: 2022-09-26 19:24:21 +0000 Commit: Kyle Evans CommitDate: 2022-11-02 17:02:24 +0000 kasan: provide bus peek/poke definitions Reviewed by: andrew, markj Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. (cherry picked from commit 818cae0ff7527f39ef5efe1180de3e6461fff93c) --- sys/kern/subr_asan.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c index cf7c27c9c418..70f7e11ef8f6 100644 --- a/sys/kern/subr_asan.c +++ b/sys/kern/subr_asan.c @@ -44,6 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.26 2020/09/10 14:10:46 maxv Exp $"); #include #include +#include /* ASAN constants. Part of the compiler ABI. */ #define KASAN_SHADOW_MASK (KASAN_SHADOW_SCALE - 1) @@ -930,6 +931,32 @@ ASAN_BUS_SET_FUNC(region, 4, uint32_t) ASAN_BUS_SET_FUNC(multi_stream, 4, uint32_t) ASAN_BUS_SET_FUNC(region_stream, 4, uint32_t) +#define ASAN_BUS_PEEK_FUNC(width, type) \ + int kasan_bus_space_peek_##width(bus_space_tag_t tag, \ + bus_space_handle_t hnd, bus_size_t offset, type *valuep) \ + { \ + return (bus_space_peek_##width(tag, hnd, offset, \ + valuep)); \ + } + +ASAN_BUS_PEEK_FUNC(1, uint8_t) +ASAN_BUS_PEEK_FUNC(2, uint16_t) +ASAN_BUS_PEEK_FUNC(4, uint32_t) +ASAN_BUS_PEEK_FUNC(8, uint64_t) + +#define ASAN_BUS_POKE_FUNC(width, type) \ + int kasan_bus_space_poke_##width(bus_space_tag_t tag, \ + bus_space_handle_t hnd, bus_size_t offset, type value) \ + { \ + return (bus_space_poke_##width(tag, hnd, offset, \ + value)); \ + } + +ASAN_BUS_POKE_FUNC(1, uint8_t) +ASAN_BUS_POKE_FUNC(2, uint16_t) +ASAN_BUS_POKE_FUNC(4, uint32_t) +ASAN_BUS_POKE_FUNC(8, uint64_t) + /* -------------------------------------------------------------------------- */ void __asan_register_globals(struct __asan_global *, size_t);