From owner-svn-src-head@freebsd.org Thu Sep 24 09:03:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAFFB3F1800; Thu, 24 Sep 2020 09:03:33 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BxpxJ6h6Rz49BT; Thu, 24 Sep 2020 09:03:32 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id z1so2942037wrt.3; Thu, 24 Sep 2020 02:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:reply-to:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Nf5kL0mERAHa0GP0mWJ54erOiEyuJEHHwOHQGpeCFZA=; b=GrsrDYvyFCAWIalyJdTubbPhTYoo+uKo9yiYwm5MILYimvNeMveBOjZBVWIgQ5gPoF zEsfkGvv6q6rlH6nwTk4kXExS6DRXoWRRflG4MjRn10tBGi+b4+umgMv7U8JaQlf19BP kFV9rM5s8mve0UBbhpmK794GG+6QehAYmh4LmhyFeLw1QD5UDstV1pzau1aSvdRxtN9Z 7Vi2Ctljz8rZJ/FHlzJF3hiPadu2o/t//bnR97fZVb0RsO2Ho9WzdwBW+urtY/GRSAY0 NCqdo5q8DwyPxj/Nt33WLQ9OU8UU0UzCtHJwabXEOHjVBO9M5kVHGkFk3terJILUahRQ hfJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:reply-to:subject:to:references :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Nf5kL0mERAHa0GP0mWJ54erOiEyuJEHHwOHQGpeCFZA=; b=axTisyuuF5L9yGAayS25T2RrZfqgRzo52EFOZ4RddbR6fr0zgBGvc6qLVUCsYJ4UpE OrPnsobzFGJDaAhvy3sTaiHFK6ytIW2LXNpXDqQAfGjzg5wzXov3uuw717z5Zalh5vO8 qcZul1eJGonILugbcMFQTLwQjNju4CYNGRun8w8NuLUgHWN0xW0/Z/K+QQNcnqEgtmXQ oao74RqAOMtBKfOnA/hKKfyUjiwESQj4MbFHwYqmhSi+AojT0NL0xnK7bLuXIK/4YvDm 6Q80jAO3dlE0pPByEWfsnRAhbP8S4OAecP4Y7WBxSitHZt/j8SQ8F4u6/zl5MOJ80Yj9 6Y0A== X-Gm-Message-State: AOAM532lJcADpaLpPUFCnX3gIt4BDlsdP47azPSpyzSrK8Ghsy47Chcv VLr/Cd36N3ct9Wo5PAcZjkXqEvupE0E= X-Google-Smtp-Source: ABdhPJwU12opGVZeN/UBlCPuwZgP5/OnxbXEbzlRf/3LstSsHAeNhZFvUdsHc+AvC0Gnu8SX9WzDJw== X-Received: by 2002:a5d:69c9:: with SMTP id s9mr3919016wrw.348.1600938210442; Thu, 24 Sep 2020 02:03:30 -0700 (PDT) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id u186sm2630330wmu.34.2020.09.24.02.03.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Sep 2020 02:03:29 -0700 (PDT) Sender: Michal Meloun From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: svn commit: r365899 - in head: share/man/man9 sys/arm/include sys/arm64/arm64 sys/arm64/include sys/kern sys/mips/include sys/powerpc/include sys/riscv/include sys/sys sys/tools sys/x86/include To: Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009191106.08JB6fE9010167@repo.freebsd.org> <4D257266-3703-4513-9301-33E03F9FF9BE@panasas.com> Message-ID: <302b7d21-8712-ad5e-a46d-1b38e4b14194@freebsd.org> Date: Thu, 24 Sep 2020 11:03:31 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: <4D257266-3703-4513-9301-33E03F9FF9BE@panasas.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4BxpxJ6h6Rz49BT X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=GrsrDYvy; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of melounmichal@gmail.com designates 2a00:1450:4864:20::443 as permitted sender) smtp.mailfrom=melounmichal@gmail.com X-Spamd-Result: default: False [-2.11 / 15.00]; HAS_REPLYTO(0.00)[mmel@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.15)[-0.152]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.93)[-0.927]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.03)[-1.028]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; MID_RHS_MATCH_TO(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::443:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2020 09:03:33 -0000 On 22.09.2020 7:18, Ravi Pokala wrote: > This breaks amd64.GENERIC-KCSAN: I’m sorry, seems that I forgotten to run GENERIC-KCSAN build additionally to universe build also for the final version of this change. Thanks for report and sorry for troubles. Fixed in r366107. Michal > ================================================================ > ${SRCTOP}/sys/kern/subr_csan.c:895:1: error: implicit declaration of function 'bus_space_peek_8' is invalid in C99 [-Werror,-Wimplicit-function-declaration] > CSAN_BUS_PEEK_FUNC(8, uint64_t) > ^ > ${SRCTOP}/sys/kern/subr_csan.c:888:11: note: expanded from macro 'CSAN_BUS_PEEK_FUNC' > return (bus_space_peek_##width(tag, hnd, offset, value)); \ > ^ > :56:1: note: expanded from here > bus_space_peek_8 > ^ > ${SRCTOP}/sys/kern/subr_csan.c:909:1: error: implicit declaration of function 'bus_space_poke_8' is invalid in C99 [-Werror,-Wimplicit-function-declaration] > CSAN_BUS_POKE_FUNC(8, uint64_t) > ^ > ${SRCTOP}/sys/kern/subr_csan.c:902:11: note: expanded from macro 'CSAN_BUS_POKE_FUNC' > return (bus_space_poke_##width(tag, hnd, offset, value)); \ > ^ > :64:1: note: expanded from here > bus_space_poke_8 > ^ > 2 errors generated. > --- subr_csan.o --- > *** [subr_csan.o] Error code 1 > ================================================================ > > Thanks, > > Ravi (rpokala@) > > -----Original Message----- > From: on behalf of Michal Meloun > Date: 2020-09-19, Saturday at 04:06 > To: , , > Subject: svn commit: r365899 - in head: share/man/man9 sys/arm/include sys/arm64/arm64 sys/arm64/include sys/kern sys/mips/include sys/powerpc/include sys/riscv/include sys/sys sys/tools sys/x86/include > > Author: mmel > Date: Sat Sep 19 11:06:41 2020 > New Revision: 365899 > URL: https://svnweb.freebsd.org/changeset/base/365899 > > Log: > Add NetBSD compatible bus_space_peek_N() and bus_space_poke_N() functions. > One problem with the bus_space_read_N() and bus_space_write_N() family of > functions is that they provide no protection against exceptions which can > occur when no physical hardware or device responds to the read or write > cycles. In such a situation, the system typically would panic due to a > kernel-mode bus error. The bus_space_peek_N() and bus_space_poke_N() family > of functions provide a mechanism to handle these exceptions gracefully > without the risk of crashing the system. > > Typical example is access to PCI(e) configuration space in bus enumeration > function on badly implemented PCI(e) root complexes (RK3399 or Neoverse > N1 N1SDP and/or access to PCI(e) register when device is in deep sleep state. > > This commit adds a real implementation for arm64 only. The remaining > architectures have bus_space_peek()/bus_space_poke() emulated by using > bus_space_read()/bus_space_write() (without exception handling). > > MFC after: 1 month > Reviewed by: kib > Differential Revision: https://reviews.freebsd.org/D25371 > > Modified: > head/share/man/man9/bus_space.9 > head/sys/arm/include/bus.h > head/sys/arm64/arm64/bus_machdep.c > head/sys/arm64/arm64/bus_space_asm.S > head/sys/arm64/arm64/trap.c > head/sys/arm64/include/bus.h > head/sys/arm64/include/md_var.h > head/sys/kern/subr_csan.c > head/sys/mips/include/bus.h > head/sys/powerpc/include/bus.h > head/sys/riscv/include/bus.h > head/sys/sys/_cscan_bus.h > head/sys/sys/bus.h > head/sys/tools/bus_macro.sh > head/sys/x86/include/bus.h > > Modified: head/share/man/man9/bus_space.9 > ============================================================================== > --- head/share/man/man9/bus_space.9 Sat Sep 19 02:15:56 2020 (r365898) > +++ head/share/man/man9/bus_space.9 Sat Sep 19 11:06:41 2020 (r365899) > @@ -52,7 +52,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd January 15, 2017 > +.Dd July 7, 2020 > .Dt BUS_SPACE 9 > .Os > .Sh NAME > @@ -68,6 +68,14 @@ > .Nm bus_space_copy_region_stream_8 , > .Nm bus_space_free , > .Nm bus_space_map , > +.Nm bus_space_peek_1 , > +.Nm bus_space_peek_2 , > +.Nm bus_space_peek_4 , > +.Nm bus_space_peek_8 , > +.Nm bus_space_poke_1 , > +.Nm bus_space_poke_2 , > +.Nm bus_space_poke_4 , > +.Nm bus_space_poke_8 , > .Nm bus_space_read_1 , > .Nm bus_space_read_2 , > .Nm bus_space_read_4 , > @@ -161,6 +169,46 @@ > .Fo bus_space_free > .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t size" > .Fc > +.Ft int > +.Fo bus_space_peek_1 > +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" > +.Fa "uint8_t *datap" > +.Fc > +.Ft int > +.Fo bus_space_peek_2 > +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" > +.Fa "uint8_t *datap" > +.Fc > +.Ft int > +.Fo bus_space_peek_4 > +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" > +.Fa "uint8_t *datap" > +.Fc > +.Ft int > +.Fo bus_space_peek_8 > +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" > +.Fa "uint8_t *datap" > +.Fc > +.Ft int > +.Fo bus_space_poke_1 > +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" > +.Fa "uint8_t *datap" > +.Fc > +.Ft int > +.Fo bus_space_poke_2 > +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" > +.Fa "uint8_t *datap" > +.Fc > +.Ft int > +.Fo bus_space_poke_4 > +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" > +.Fa "uint8_t *datap" > +.Fc > +.Ft int > +.Fo bus_space_poke_8 > +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" > +.Fa "uint8_t *datap" > +.Fc > .Ft uint8_t > .Fo bus_space_read_1 > .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" > @@ -1124,6 +1172,105 @@ If they would fail (e.g.\& because of an > argument error), that indicates a software bug which should cause a > panic. > In that case, they will never return. > +.Sh PROBING BUS SPACE FOR HARDWARE WHICH MAY NOT RESPOND > +One problem with the > +.Fn bus_space_read_N > +and > +.Fn bus_space_write_N > +family of functions is that they provide no protection against > +exceptions which can occur when no physical hardware or > +device responds to the read or write cycles. > +In such a situation, the system typically would panic due to a kernel-mode > +bus error. > +The > +.Fn bus_space_peek_N > +and > +.Fn bus_space_poke_N > +family of functions provide a mechanism to handle these exceptions > +gracefully without the risk of crashing the system. > +.Pp > +As with > +.Fn bus_space_read_N > +and > +.Fn bus_space_write_N , > +the peek and poke functions provide the ability to read and > +write 1, 2, 4, and 8 byte data items on busses which support those > +access sizes. > +All of the constraints specified in the descriptions of the > +.Fn bus_space_read_N > +and > +.Fn bus_space_write_N > +functions also apply to > +.Fn bus_space_peek_N > +and > +.Fn bus_space_poke_N . > +.Pp > +In addition, explicit calls to the > +.Fn bus_space_barrier > +function are not required as the implementation will ensure all > +pending operations complete before the peek or poke operation starts. > +The implementation will also ensure that the peek or poke operations > +complete before returning. > +.Pp > +The return value indicates the outcome of the peek or poke operation. > +A return value of zero implies that a hardware device is > +responding to the operation at the specified offset in the bus space. > +A non-zero return value indicates that the kernel intercepted a > +hardware exception (e.g., bus error) when the peek or poke operation > +was attempted. > +Note that some busses are incapable of generating exceptions when > +non-existent hardware is accessed. > +In such cases, these functions will always return zero and the value of > +the data read by > +.Fn bus_space_peek_N > +will be unspecified. > +.Pp > +Finally, it should be noted that at this time the > +.Fn bus_space_peek_N > +and > +.Fn bus_space_poke_N > +functions are not re-entrant and should not, therefore, be used > +from within an interrupt service routine. > +This constraint may be removed at some point in the future. > +.Pp > +.Bl -ohang -compact > +.It Fn bus_space_peek_1 "space" "handle" "offset" "datap" > +.It Fn bus_space_peek_2 "space" "handle" "offset" "datap" > +.It Fn bus_space_peek_4 "space" "handle" "offset" "datap" > +.It Fn bus_space_peek_8 "space" "handle" "offset" "datap" > +.Pp > +The > +.Fn bus_space_peek_N > +family of functions cautiously read a 1, 2, 4, or 8 byte data item from > +the offset specified by > +.Fa offset > +in the region specified by > +.Fa handle > +of the bus space specified by > +.Fa space . > +The data item read is stored in the location pointed to by > +.Fa datap . > +It is permissible for > +.Fa datap > +to be NULL, in which case the data item will be discarded after being read. > +.Pp > +.It Fn bus_space_poke_1 "space" "handle" "offset" "value" > +.It Fn bus_space_poke_2 "space" "handle" "offset" "value" > +.It Fn bus_space_poke_4 "space" "handle" "offset" "value" > +.It Fn bus_space_poke_8 "space" "handle" "offset" "value" > +.Pp > +The > +.Fn bus_space_poke_N > +family of functions cautiously write a 1, 2, 4, or 8 byte data item > +specified by > +.Fa value > +to the offset specified by > +.Fa offset > +in the region specified by > +.Fa handle > +of the bus space specified by > +.Fa space . > +.El > .Sh BARRIERS > In order to allow high-performance buffering implementations to avoid bus > activity on every operation, read and write ordering should be specified > > Modified: head/sys/arm/include/bus.h > ============================================================================== > --- head/sys/arm/include/bus.h Sat Sep 19 02:15:56 2020 (r365898) > +++ head/sys/arm/include/bus.h Sat Sep 19 11:06:41 2020 (r365899) > @@ -747,6 +747,33 @@ void generic_bs_unimplemented(void); > > #define BUS_SPACE_UNRESTRICTED (~0) > > +#define BUS_PEEK_FUNC(width, type) \ > + static inline int \ > + bus_space_peek_##width(bus_space_tag_t tag, \ > + bus_space_handle_t hnd, bus_size_t offset, type *value) \ > + { \ > + type tmp; \ > + tmp = bus_space_read_##width(tag, hnd, offset); \ > + return (0); \ > + } > +BUS_PEEK_FUNC(1, uint8_t) > +BUS_PEEK_FUNC(2, uint16_t) > +BUS_PEEK_FUNC(4, uint32_t) > +BUS_PEEK_FUNC(8, uint64_t) > + > +#define BUS_POKE_FUNC(width, type) \ > + static inline int \ > + bus_space_poke_##width(bus_space_tag_t tag, \ > + bus_space_handle_t hnd, bus_size_t offset, type value) \ > + { \ > + bus_space_write_##width(tag, hnd, offset, value); \ > + return (0); \ > + } > +BUS_POKE_FUNC(1, uint8_t) > +BUS_POKE_FUNC(2, uint16_t) > +BUS_POKE_FUNC(4, uint32_t) > +BUS_POKE_FUNC(8, uint64_t) > + > #include > > /* > > Modified: head/sys/arm64/arm64/bus_machdep.c > ============================================================================== > --- head/sys/arm64/arm64/bus_machdep.c Sat Sep 19 02:15:56 2020 (r365898) > +++ head/sys/arm64/arm64/bus_machdep.c Sat Sep 19 11:06:41 2020 (r365899) > @@ -83,6 +83,16 @@ void generic_bs_wr_4(void *, bus_space_handle_t, bus_s > void generic_bs_wr_8(void *, bus_space_handle_t, bus_size_t, const uint64_t *, > bus_size_t); > > +int generic_bs_peek_1(void *, bus_space_handle_t, bus_size_t , uint8_t *); > +int generic_bs_peek_2(void *, bus_space_handle_t, bus_size_t , uint16_t *); > +int generic_bs_peek_4(void *, bus_space_handle_t, bus_size_t , uint32_t *); > +int generic_bs_peek_8(void *, bus_space_handle_t, bus_size_t , uint64_t *); > + > +int generic_bs_poke_1(void *, bus_space_handle_t, bus_size_t, uint8_t); > +int generic_bs_poke_2(void *, bus_space_handle_t, bus_size_t, uint16_t); > +int generic_bs_poke_4(void *, bus_space_handle_t, bus_size_t, uint32_t); > +int generic_bs_poke_8(void *, bus_space_handle_t, bus_size_t, uint64_t); > + > static int > generic_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, > bus_space_handle_t *bshp) > @@ -223,6 +233,18 @@ struct bus_space memmap_bus = { > .bs_wr_2_s = NULL, > .bs_wr_4_s = NULL, > .bs_wr_8_s = NULL, > + > + /* peek */ > + .bs_peek_1 = generic_bs_peek_1, > + .bs_peek_2 = generic_bs_peek_2, > + .bs_peek_4 = generic_bs_peek_4, > + .bs_peek_8 = generic_bs_peek_8, > + > + /* poke */ > + .bs_poke_1 = generic_bs_poke_1, > + .bs_poke_2 = generic_bs_poke_2, > + .bs_poke_4 = generic_bs_poke_4, > + .bs_poke_8 = generic_bs_poke_8, > }; > > #ifdef FDT > > Modified: head/sys/arm64/arm64/bus_space_asm.S > ============================================================================== > --- head/sys/arm64/arm64/bus_space_asm.S Sat Sep 19 02:15:56 2020 (r365898) > +++ head/sys/arm64/arm64/bus_space_asm.S Sat Sep 19 11:06:41 2020 (r365899) > @@ -26,7 +26,6 @@ > */ > > #include > - > __FBSDID("$FreeBSD$"); > > ENTRY(generic_bs_r_1) > @@ -397,3 +396,84 @@ ENTRY(generic_bs_wr_8) > > 2: ret > END(generic_bs_wr_8) > + > +ENTRY(generic_bs_fault) > + mov x0, #-1 > + ret > +END(bus_fault) > + > +ENTRY(generic_bs_peek_1) > + .globl generic_bs_peek_1f > +generic_bs_peek_1f: > + ldrb w0, [x1, x2] /* Checked instruction */ > + dsb sy > + strb w0,[x3] > + mov x0, #0 > + ret > +END(generic_bs_peek_1) > + > +ENTRY(generic_bs_peek_2) > + .globl generic_bs_peek_2f > +generic_bs_peek_2f: > + ldrh w0, [x1, x2] /* Checked instruction */ > + dsb sy > + strh w0,[x3] > + mov x0, #0 > + ret > +END(generic_bs_peek_2) > + > +ENTRY(generic_bs_peek_4) > + .globl generic_bs_peek_4f > +generic_bs_peek_4f: > + ldr w0, [x1, x2] /* Checked instruction */ > + dsb sy > + str w0,[x3] > + mov x0, #0 > + ret > +END(generic_bs_peek_4) > + > +ENTRY(generic_bs_peek_8) > + .globl generic_bs_peek_8f > +generic_bs_peek_8f: > + ldr x0, [x1, x2] /* Checked instruction */ > + dsb sy > + str x0,[x3] > + mov x0, #0 > + ret > +END(generic_bs_peek_8) > + > +ENTRY(generic_bs_poke_1) > + .globl generic_bs_poke_1f > +generic_bs_poke_1f: > + strb w3, [x1, x2] /* Checked instruction */ > + dsb sy > + mov x0, #0 > + ret > +END(generic_bs_poke_1) > + > +ENTRY(generic_bs_poke_2) > + .globl generic_bs_poke_2f > +generic_bs_poke_2f: > + strh w3, [x1, x2] /* Checked instruction */ > + dsb sy > + mov x0, #0 > + ret > +END(generic_bs_poke_2) > + > +ENTRY(generic_bs_poke_4) > + .globl generic_bs_poke_4f > +generic_bs_poke_4f: > + str w3, [x1, x2] /* Checked instruction */ > + dsb sy > + mov x0, #0 > + ret > +END(generic_bs_poke_4) > + > +ENTRY(generic_bs_poke_8) > + .globl generic_bs_poke_8f > +generic_bs_poke_8f: > + str x3, [x1, x2] /* Checked instruction */ > + dsb sy > + mov x0, #0 > + ret > +END(generic_bs_poke_8) > > Modified: head/sys/arm64/arm64/trap.c > ============================================================================== > --- head/sys/arm64/arm64/trap.c Sat Sep 19 02:15:56 2020 (r365898) > +++ head/sys/arm64/arm64/trap.c Sat Sep 19 11:06:41 2020 (r365899) > @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > #include > #include > #include > @@ -88,6 +89,7 @@ typedef void (abort_handler)(struct thread *, struct t > > static abort_handler align_abort; > static abort_handler data_abort; > +static abort_handler external_abort; > > static abort_handler *abort_handlers[] = { > [ISS_DATA_DFSC_TF_L0] = data_abort, > @@ -101,6 +103,7 @@ static abort_handler *abort_handlers[] = { > [ISS_DATA_DFSC_PF_L2] = data_abort, > [ISS_DATA_DFSC_PF_L3] = data_abort, > [ISS_DATA_DFSC_ALIGN] = align_abort, > + [ISS_DATA_DFSC_EXT] = external_abort, > }; > > static __inline void > @@ -154,6 +157,28 @@ cpu_fetch_syscall_args(struct thread *td) > > #include "../../kern/subr_syscall.c" > > +/* > + * Test for fault generated by given access instruction in > + * bus_peek_ or bus_poke_ bus function. > + */ > +extern uint32_t generic_bs_peek_1f, generic_bs_peek_2f; > +extern uint32_t generic_bs_peek_4f, generic_bs_peek_8f; > +extern uint32_t generic_bs_poke_1f, generic_bs_poke_2f; > +extern uint32_t generic_bs_poke_4f, generic_bs_poke_8f; > + > +static bool > +test_bs_fault(void *addr) > +{ > + return (addr == &generic_bs_peek_1f || > + addr == &generic_bs_peek_2f || > + addr == &generic_bs_peek_4f || > + addr == &generic_bs_peek_8f || > + addr == &generic_bs_poke_1f || > + addr == &generic_bs_poke_2f || > + addr == &generic_bs_poke_4f || > + addr == &generic_bs_poke_8f); > +} > + > static void > svc_handler(struct thread *td, struct trapframe *frame) > { > @@ -182,6 +207,26 @@ align_abort(struct thread *td, struct trapframe *frame > call_trapsignal(td, SIGBUS, BUS_ADRALN, (void *)frame->tf_elr, > ESR_ELx_EXCEPTION(frame->tf_esr)); > userret(td, frame); > +} > + > + > +static void > +external_abort(struct thread *td, struct trapframe *frame, uint64_t esr, > + uint64_t far, int lower) > +{ > + > + /* > + * Try to handle synchronous external aborts caused by > + * bus_space_peek() and/or bus_space_poke() functions. > + */ > + if (!lower && test_bs_fault((void *)frame->tf_elr)) { > + frame->tf_elr = (uint64_t)generic_bs_fault; > + return; > + } > + > + print_registers(frame); > + printf(" far: %16lx\n", far); > + panic("Unhandled EL%d external data abort", lower ? 0: 1); > } > > static void > > Modified: head/sys/arm64/include/bus.h > ============================================================================== > --- head/sys/arm64/include/bus.h Sat Sep 19 02:15:56 2020 (r365898) > +++ head/sys/arm64/include/bus.h Sat Sep 19 11:06:41 2020 (r365899) > @@ -259,6 +259,24 @@ struct bus_space { > bus_size_t, const u_int32_t *, bus_size_t); > void (*bs_wr_8_s) (void *, bus_space_handle_t, > bus_size_t, const u_int64_t *, bus_size_t); > + /* peek */ > + int (*bs_peek_1)(void *, bus_space_handle_t, > + bus_size_t , uint8_t *); > + int (*bs_peek_2)(void *, bus_space_handle_t, > + bus_size_t , uint16_t *); > + int (*bs_peek_4)(void *, bus_space_handle_t, > + bus_size_t , uint32_t *); > + int (*bs_peek_8)(void *, bus_space_handle_t, > + bus_size_t , uint64_t *); > + /* poke */ > + int (*bs_poke_1)(void *, bus_space_handle_t, > + bus_size_t, uint8_t); > + int (*bs_poke_2)(void *, bus_space_handle_t, > + bus_size_t, uint16_t); > + int (*bs_poke_4)(void *, bus_space_handle_t, > + bus_size_t, uint32_t); > + int (*bs_poke_8)(void *, bus_space_handle_t, > + bus_size_t, uint64_t); > }; > > /* > @@ -283,6 +301,10 @@ struct bus_space { > (*(t)->__bs_opname_s(r,sz))((t)->bs_cookie, h, o) > #define __bs_ws_s(sz, t, h, o, v) \ > (*(t)->__bs_opname_s(w,sz))((t)->bs_cookie, h, o, v) > +#define __bs_peek(sz, t, h, o, vp) \ > + (*(t)->__bs_opname(peek, sz))((t)->bs_cookie, h, o, vp) > +#define __bs_poke(sz, t, h, o, v) \ > + (*(t)->__bs_opname(poke, sz))((t)->bs_cookie, h, o, v) > #define __bs_nonsingle_s(type, sz, t, h, o, a, c) \ > (*(t)->__bs_opname_s(type,sz))((t)->bs_cookie, h, o, a, c) > > @@ -456,6 +478,22 @@ struct bus_space { > __bs_copy(4, t, h1, o1, h2, o2, c) > #define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \ > __bs_copy(8, t, h1, o1, h2, o2, c) > + > +/* > + * Poke (checked write) operations. > + */ > +#define bus_space_poke_1(t, h, o, v) __bs_poke(1, (t), (h), (o), (v)) > +#define bus_space_poke_2(t, h, o, v) __bs_poke(2, (t), (h), (o), (v)) > +#define bus_space_poke_4(t, h, o, v) __bs_poke(4, (t), (h), (o), (v)) > +#define bus_space_poke_8(t, h, o, v) __bs_poke(8, (t), (h), (o), (v)) > + > +/* > + * Peek (checked read) operations. > + */ > +#define bus_space_peek_1(t, h, o, vp) __bs_peek(1, (t), (h), (o), (vp)) > +#define bus_space_peek_2(t, h, o, vp) __bs_peek(2, (t), (h), (o), (vp)) > +#define bus_space_peek_4(t, h, o, vp) __bs_peek(4, (t), (h), (o), (vp)) > +#define bus_space_peek_8(t, h, o, vp) __bs_peek(8, (t), (h), (o), (vp)) > > #endif > > > Modified: head/sys/arm64/include/md_var.h > ============================================================================== > --- head/sys/arm64/include/md_var.h Sat Sep 19 02:15:56 2020 (r365898) > +++ head/sys/arm64/include/md_var.h Sat Sep 19 11:06:41 2020 (r365899) > @@ -48,5 +48,14 @@ void busdma_swi(void); > void dump_add_page(vm_paddr_t); > void dump_drop_page(vm_paddr_t); > int minidumpsys(struct dumperinfo *); > +void generic_bs_fault(void) __asm(__STRING(generic_bs_fault)); > +void generic_bs_peek_1(void) __asm(__STRING(generic_bs_peek_1)); > +void generic_bs_peek_2(void) __asm(__STRING(generic_bs_peek_2)); > +void generic_bs_peek_4(void) __asm(__STRING(generic_bs_peek_4)); > +void generic_bs_peek_8(void) __asm(__STRING(generic_bs_peek_8)); > +void generic_bs_poke_1(void) __asm(__STRING(generic_bs_poke_1)); > +void generic_bs_poke_2(void) __asm(__STRING(generic_bs_poke_2)); > +void generic_bs_poke_4(void) __asm(__STRING(generic_bs_poke_4)); > +void generic_bs_poke_8(void) __asm(__STRING(generic_bs_poke_8)); > > #endif /* !_MACHINE_MD_VAR_H_ */ > > Modified: head/sys/kern/subr_csan.c > ============================================================================== > --- head/sys/kern/subr_csan.c Sat Sep 19 02:15:56 2020 (r365898) > +++ head/sys/kern/subr_csan.c Sat Sep 19 11:06:41 2020 (r365899) > @@ -878,3 +878,33 @@ CSAN_BUS_SET_FUNC(multi_stream, 8, uint64_t) > CSAN_BUS_SET_FUNC(region_stream, 8, uint64_t) > #endif > #endif > + > +#define CSAN_BUS_PEEK_FUNC(width, type) \ > + int kcsan_bus_space_peek_##width(bus_space_tag_t tag, \ > + bus_space_handle_t hnd, bus_size_t offset, type *value) \ > + { \ > + kcsan_access((uintptr_t)value, sizeof(type), true, false, \ > + __RET_ADDR); \ > + return (bus_space_peek_##width(tag, hnd, offset, value)); \ > + } > + > +CSAN_BUS_PEEK_FUNC(1, uint8_t) > +CSAN_BUS_PEEK_FUNC(2, uint16_t) > +CSAN_BUS_PEEK_FUNC(4, uint32_t) > +#if !defined(__i386__) > +CSAN_BUS_PEEK_FUNC(8, uint64_t) > +#endif > + > +#define CSAN_BUS_POKE_FUNC(width, type) \ > + int kcsan_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)); \ > + } > + > +CSAN_BUS_POKE_FUNC(1, uint8_t) > +CSAN_BUS_POKE_FUNC(2, uint16_t) > +CSAN_BUS_POKE_FUNC(4, uint32_t) > +#if !defined(__i386__) > +CSAN_BUS_POKE_FUNC(8, uint64_t) > +#endif > > Modified: head/sys/mips/include/bus.h > ============================================================================== > --- head/sys/mips/include/bus.h Sat Sep 19 02:15:56 2020 (r365898) > +++ head/sys/mips/include/bus.h Sat Sep 19 11:06:41 2020 (r365899) > @@ -689,6 +689,33 @@ void __bs_c(f,_bs_c_8) (void *t, bus_space_handle_t bs > bs_c_4_proto(f); \ > bs_c_8_proto(f); > > +#define BUS_PEEK_FUNC(width, type) \ > + static inline int \ > + bus_space_peek_##width(bus_space_tag_t tag, \ > + bus_space_handle_t hnd, bus_size_t offset, type *value) \ > + { \ > + type tmp; \ > + tmp = bus_space_read_##width(tag, hnd, offset); \ > + return (0); \ > + } > +BUS_PEEK_FUNC(1, uint8_t) > +BUS_PEEK_FUNC(2, uint16_t) > +BUS_PEEK_FUNC(4, uint32_t) > +BUS_PEEK_FUNC(8, uint64_t) > + > +#define BUS_POKE_FUNC(width, type) \ > + static inline int \ > + bus_space_poke_##width(bus_space_tag_t tag, \ > + bus_space_handle_t hnd, bus_size_t offset, type value) \ > + { \ > + bus_space_write_##width(tag, hnd, offset, value); \ > + return (0); \ > + } > +BUS_POKE_FUNC(1, uint8_t) > +BUS_POKE_FUNC(2, uint16_t) > +BUS_POKE_FUNC(4, uint32_t) > +BUS_POKE_FUNC(8, uint64_t) > + > #define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t) > > #define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF > > Modified: head/sys/powerpc/include/bus.h > ============================================================================== > --- head/sys/powerpc/include/bus.h Sat Sep 19 02:15:56 2020 (r365898) > +++ head/sys/powerpc/include/bus.h Sat Sep 19 11:06:41 2020 (r365899) > @@ -462,6 +462,33 @@ extern struct bus_space bs_le_tag; > __bs_copy(s_8, t, h1, o1, h2, o2, c) > #endif > > +#define BUS_PEEK_FUNC(width, type) \ > + static inline int \ > + bus_space_peek_##width(bus_space_tag_t tag, \ > + bus_space_handle_t hnd, bus_size_t offset, type *value) \ > + { \ > + type tmp; \ > + tmp = bus_space_read_##width(tag, hnd, offset); \ > + return (0); \ > + } > +BUS_PEEK_FUNC(1, uint8_t) > +BUS_PEEK_FUNC(2, uint16_t) > +BUS_PEEK_FUNC(4, uint32_t) > +BUS_PEEK_FUNC(8, uint64_t) > + > +#define BUS_POKE_FUNC(width, type) \ > + static inline int \ > + bus_space_poke_##width(bus_space_tag_t tag, \ > + bus_space_handle_t hnd, bus_size_t offset, type value) \ > + { \ > + bus_space_write_##width(tag, hnd, offset, value); \ > + return (0); \ > + } > +BUS_POKE_FUNC(1, uint8_t) > +BUS_POKE_FUNC(2, uint16_t) > +BUS_POKE_FUNC(4, uint32_t) > +BUS_POKE_FUNC(8, uint64_t) > + > #include > > #endif /* _MACHINE_BUS_H_ */ > > Modified: head/sys/riscv/include/bus.h > ============================================================================== > --- head/sys/riscv/include/bus.h Sat Sep 19 02:15:56 2020 (r365898) > +++ head/sys/riscv/include/bus.h Sat Sep 19 11:06:41 2020 (r365899) > @@ -451,6 +451,33 @@ struct bus_space { > #define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \ > __bs_copy(8, t, h1, o1, h2, o2, c) > > +#define BUS_PEEK_FUNC(width, type) \ > + static inline int \ > + bus_space_peek_##width(bus_space_tag_t tag, \ > + bus_space_handle_t hnd, bus_size_t offset, type *value) \ > + { \ > + type tmp; \ > + tmp = bus_space_read_##width(tag, hnd, offset); \ > + return (0); \ > + } > +BUS_PEEK_FUNC(1, uint8_t) > +BUS_PEEK_FUNC(2, uint16_t) > +BUS_PEEK_FUNC(4, uint32_t) > +BUS_PEEK_FUNC(8, uint64_t) > + > +#define BUS_POKE_FUNC(width, type) \ > + static inline int \ > + bus_space_poke_##width(bus_space_tag_t tag, \ > + bus_space_handle_t hnd, bus_size_t offset, type value) \ > + { \ > + bus_space_write_##width(tag, hnd, offset, value); \ > + return (0); \ > + } > +BUS_POKE_FUNC(1, uint8_t) > +BUS_POKE_FUNC(2, uint16_t) > +BUS_POKE_FUNC(4, uint32_t) > +BUS_POKE_FUNC(8, uint64_t) > + > #include > > #endif /* _MACHINE_BUS_H_ */ > > Modified: head/sys/sys/_cscan_bus.h > ============================================================================== > --- head/sys/sys/_cscan_bus.h Sat Sep 19 02:15:56 2020 (r365898) > +++ head/sys/sys/_cscan_bus.h Sat Sep 19 11:06:41 2020 (r365899) > @@ -77,11 +77,21 @@ > bus_space_handle_t, bus_size_t, bus_space_handle_t, \ > bus_size_t, bus_size_t); > > +#define KCSAN_BS_PEEK(width, type) \ > + int kcsan_bus_space_peek_##width(bus_space_tag_t, \ > + bus_space_handle_t, bus_size_t, type *); > + > +#define KCSAN_BS_POKE(width, type) \ > + int kcsan_bus_space_poke_##width(bus_space_tag_t, \ > + bus_space_handle_t, bus_size_t, type); > + > #define KCSAN_BS(width, type) \ > KCSAN_BS_READ(width, type); \ > KCSAN_BS_WRITE(width, type); \ > KCSAN_BS_SET(width, type); \ > - KCSAN_BS_COPY(width, type) > + KCSAN_BS_COPY(width, type) \ > + KCSAN_BS_PEEK(width, type); \ > + KCSAN_BS_POKE(width, type); > > KCSAN_BS(1, uint8_t); > KCSAN_BS(2, uint16_t); > @@ -127,6 +137,8 @@ void kcsan_bus_space_barrier(bus_space_tag_t, bus_spac > #define bus_space_set_region_stream_1 kcsan_bus_space_set_region_stream_1 > #define bus_space_copy_multi_1 kcsan_bus_space_copy_multi_1 > #define bus_space_copy_multi_stream_1 kcsan_bus_space_copy_multi_stream_1 > +#define bus_space_poke_1 kcsan_bus_space_poke_1 > +#define bus_space_peek_1 kcsan_bus_space_peek_1 > > #define bus_space_read_2 kcsan_bus_space_read_2 > #define bus_space_read_stream_2 kcsan_bus_space_read_stream_2 > @@ -146,6 +158,8 @@ void kcsan_bus_space_barrier(bus_space_tag_t, bus_spac > #define bus_space_set_region_stream_2 kcsan_bus_space_set_region_stream_2 > #define bus_space_copy_multi_2 kcsan_bus_space_copy_multi_2 > #define bus_space_copy_multi_stream_2 kcsan_bus_space_copy_multi_stream_2 > +#define bus_space_poke_2 kcsan_bus_space_poke_2 > +#define bus_space_peek_2 kcsan_bus_space_peek_2 > > #define bus_space_read_4 kcsan_bus_space_read_4 > #define bus_space_read_stream_4 kcsan_bus_space_read_stream_4 > @@ -165,6 +179,8 @@ void kcsan_bus_space_barrier(bus_space_tag_t, bus_spac > #define bus_space_set_region_stream_4 kcsan_bus_space_set_region_stream_4 > #define bus_space_copy_multi_4 kcsan_bus_space_copy_multi_4 > #define bus_space_copy_multi_stream_4 kcsan_bus_space_copy_multi_stream_4 > +#define bus_space_poke_4 kcsan_bus_space_poke_4 > +#define bus_space_peek_4 kcsan_bus_space_peek_4 > > #define bus_space_read_8 kcsan_bus_space_read_8 > #define bus_space_read_stream_8 kcsan_bus_space_read_stream_8 > @@ -184,6 +200,9 @@ void kcsan_bus_space_barrier(bus_space_tag_t, bus_spac > #define bus_space_set_region_stream_8 kcsan_bus_space_set_region_stream_8 > #define bus_space_copy_multi_8 kcsan_bus_space_copy_multi_8 > #define bus_space_copy_multi_stream_8 kcsan_bus_space_copy_multi_stream_8 > +#define bus_space_poke_8 kcsan_bus_space_poke_8 > +#define bus_space_peek_8 kcsan_bus_space_peek_8 > + > > #endif /* !KCSAN_RUNTIME */ > > > Modified: head/sys/sys/bus.h > ============================================================================== > --- head/sys/sys/bus.h Sat Sep 19 02:15:56 2020 (r365898) > +++ head/sys/sys/bus.h Sat Sep 19 11:06:41 2020 (r365899) > @@ -827,6 +827,10 @@ static __inline void varp ## _set_ ## var(device_t dev > > #define bus_barrier(r, o, l, f) \ > bus_space_barrier((r)->r_bustag, (r)->r_bushandle, (o), (l), (f)) > +#define bus_poke_1(r, o, v) \ > + bus_space_poke_1((r)->r_bustag, (r)->r_bushandle, (o), (v)) > +#define bus_peek_1(r, o, vp) \ > + bus_space_peek_1((r)->r_bustag, (r)->r_bushandle, (o), (vp)) > #define bus_read_1(r, o) \ > bus_space_read_1((r)->r_bustag, (r)->r_bushandle, (o)) > #define bus_read_multi_1(r, o, d, c) \ > @@ -859,6 +863,10 @@ static __inline void varp ## _set_ ## var(device_t dev > bus_space_write_multi_stream_1((r)->r_bustag, (r)->r_bushandle, (o), (d), (c)) > #define bus_write_region_stream_1(r, o, d, c) \ > bus_space_write_region_stream_1((r)->r_bustag, (r)->r_bushandle, (o), (d), (c)) > +#define bus_poke_2(r, o, v) \ > + bus_space_poke_2((r)->r_bustag, (r)->r_bushandle, (o), (v)) > +#define bus_peek_2(r, o, vp) \ > + bus_space_peek_2((r)->r_bustag, (r)->r_bushandle, (o), (vp)) > #define bus_read_2(r, o) \ > bus_space_read_2((r)->r_bustag, (r)->r_bushandle, (o)) > #define bus_read_multi_2(r, o, d, c) \ > @@ -891,6 +899,10 @@ static __inline void varp ## _set_ ## var(device_t dev > bus_space_write_multi_stream_2((r)->r_bustag, (r)->r_bushandle, (o), (d), (c)) > #define bus_write_region_stream_2(r, o, d, c) \ > bus_space_write_region_stream_2((r)->r_bustag, (r)->r_bushandle, (o), (d), (c)) > +#define bus_poke_4(r, o, v) \ > + bus_space_poke_4((r)->r_bustag, (r)->r_bushandle, (o), (v)) > +#define bus_peek_4(r, o, vp) \ > + bus_space_peek_4((r)->r_bustag, (r)->r_bushandle, (o), (vp)) > #define bus_read_4(r, o) \ > bus_space_read_4((r)->r_bustag, (r)->r_bushandle, (o)) > #define bus_read_multi_4(r, o, d, c) \ > @@ -923,6 +935,10 @@ static __inline void varp ## _set_ ## var(device_t dev > bus_space_write_multi_stream_4((r)->r_bustag, (r)->r_bushandle, (o), (d), (c)) > #define bus_write_region_stream_4(r, o, d, c) \ > bus_space_write_region_stream_4((r)->r_bustag, (r)->r_bushandle, (o), (d), (c)) > +#define bus_poke_8(r, o, v) \ > + bus_space_poke_8((r)->r_bustag, (r)->r_bushandle, (o), (v)) > +#define bus_peek_8(r, o, vp) \ > + bus_space_peek_8((r)->r_bustag, (r)->r_bushandle, (o), (vp)) > #define bus_read_8(r, o) \ > bus_space_read_8((r)->r_bustag, (r)->r_bushandle, (o)) > #define bus_read_multi_8(r, o, d, c) \ > > Modified: head/sys/tools/bus_macro.sh > ============================================================================== > --- head/sys/tools/bus_macro.sh Sat Sep 19 02:15:56 2020 (r365898) > +++ head/sys/tools/bus_macro.sh Sat Sep 19 11:06:41 2020 (r365899) > @@ -55,7 +55,8 @@ for w in 1 2 4 8 > do > # macro copy_region_$w so dh do c > # macro copy_region_stream_$w ? > - # macro peek_$w > + macro poke_$w o v > + macro peek_$w o vp > for s in "" stream_ > do > macro read_$s$w o > > Modified: head/sys/x86/include/bus.h > ============================================================================== > --- head/sys/x86/include/bus.h Sat Sep 19 02:15:56 2020 (r365898) > +++ head/sys/x86/include/bus.h Sat Sep 19 11:06:41 2020 (r365899) > @@ -1089,6 +1089,31 @@ bus_space_barrier(bus_space_tag_t tag __unused, bus_sp > #define bus_space_copy_region_stream_4(t, h1, o1, h2, o2, c) \ > bus_space_copy_region_4((t), (h1), (o1), (h2), (o2), (c)) > > +#define BUS_PEEK_FUNC(width, type) \ > + static inline int \ > + bus_space_peek_##width(bus_space_tag_t tag, \ > + bus_space_handle_t hnd, bus_size_t offset, type *value) \ > + { \ > + type tmp; \ > + tmp = bus_space_read_##width(tag, hnd, offset); \ > + return (0); \ > + } > +BUS_PEEK_FUNC(1, uint8_t) > +BUS_PEEK_FUNC(2, uint16_t) > +BUS_PEEK_FUNC(4, uint32_t) > + > +#define BUS_POKE_FUNC(width, type) \ > + static inline int \ > + bus_space_poke_##width(bus_space_tag_t tag, \ > + bus_space_handle_t hnd, bus_size_t offset, type value) \ > + { \ > + bus_space_write_##width(tag, hnd, offset, value); \ > + return (0); \ > + } > +BUS_POKE_FUNC(1, uint8_t) > +BUS_POKE_FUNC(2, uint16_t) > +BUS_POKE_FUNC(4, uint32_t) > + > #endif /* KCSAN && !KCSAN_RUNTIME */ > > #endif /* _X86_BUS_H_ */ > >