From owner-svn-src-head@freebsd.org Sat Jul 4 06:22:06 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 0E27C363081; Sat, 4 Jul 2020 06:22:06 +0000 (UTC) (envelope-from mjg@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49zMDs6VRxz4DfF; Sat, 4 Jul 2020 06:22:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C25C51813F; Sat, 4 Jul 2020 06:22:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0646M5OC025754; Sat, 4 Jul 2020 06:22:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0646M5OD025751; Sat, 4 Jul 2020 06:22:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007040622.0646M5OD025751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 4 Jul 2020 06:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362921 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 362921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Sat, 04 Jul 2020 06:22:06 -0000 Author: mjg Date: Sat Jul 4 06:22:05 2020 New Revision: 362921 URL: https://svnweb.freebsd.org/changeset/base/362921 Log: Add char and short types to kcsan Modified: head/sys/kern/subr_csan.c head/sys/sys/_cscan_atomic.h Modified: head/sys/kern/subr_csan.c ============================================================================== --- head/sys/kern/subr_csan.c Sat Jul 4 06:21:20 2020 (r362920) +++ head/sys/kern/subr_csan.c Sat Jul 4 06:22:05 2020 (r362921) @@ -590,6 +590,38 @@ CSAN_ATOMIC_FUNC_TESTANDCLEAR(64, uint64_t) CSAN_ATOMIC_FUNC_TESTANDSET(64, uint64_t) #endif +CSAN_ATOMIC_FUNC_ADD(char, uint8_t) +CSAN_ATOMIC_FUNC_CLEAR(char, uint8_t) +CSAN_ATOMIC_FUNC_CMPSET(char, uint8_t) +CSAN_ATOMIC_FUNC_FCMPSET(char, uint8_t) +CSAN_ATOMIC_FUNC_LOAD(char, uint8_t) +CSAN_ATOMIC_FUNC_SET(char, uint8_t) +CSAN_ATOMIC_FUNC_SUBTRACT(char, uint8_t) +_CSAN_ATOMIC_FUNC_STORE(char, uint8_t) +#if 0 +CSAN_ATOMIC_FUNC_FETCHADD(char, uint8_t) +CSAN_ATOMIC_FUNC_READANDCLEAR(char, uint8_t) +CSAN_ATOMIC_FUNC_SWAP(char, uint8_t) +CSAN_ATOMIC_FUNC_TESTANDCLEAR(char, uint8_t) +CSAN_ATOMIC_FUNC_TESTANDSET(char, uint8_t) +#endif + +CSAN_ATOMIC_FUNC_ADD(short, uint16_t) +CSAN_ATOMIC_FUNC_CLEAR(short, uint16_t) +CSAN_ATOMIC_FUNC_CMPSET(short, uint16_t) +CSAN_ATOMIC_FUNC_FCMPSET(short, uint16_t) +CSAN_ATOMIC_FUNC_LOAD(short, uint16_t) +CSAN_ATOMIC_FUNC_SET(short, uint16_t) +CSAN_ATOMIC_FUNC_SUBTRACT(short, uint16_t) +_CSAN_ATOMIC_FUNC_STORE(short, uint16_t) +#if 0 +CSAN_ATOMIC_FUNC_FETCHADD(short, uint16_t) +CSAN_ATOMIC_FUNC_READANDCLEAR(short, uint16_t) +CSAN_ATOMIC_FUNC_SWAP(short, uint16_t) +CSAN_ATOMIC_FUNC_TESTANDCLEAR(short, uint16_t) +CSAN_ATOMIC_FUNC_TESTANDSET(short, uint16_t) +#endif + CSAN_ATOMIC_FUNC_ADD(int, u_int) CSAN_ATOMIC_FUNC_CLEAR(int, u_int) CSAN_ATOMIC_FUNC_CMPSET(int, u_int) Modified: head/sys/sys/_cscan_atomic.h ============================================================================== --- head/sys/sys/_cscan_atomic.h Sat Jul 4 06:21:20 2020 (r362920) +++ head/sys/sys/_cscan_atomic.h Sat Jul 4 06:22:05 2020 (r362921) @@ -87,6 +87,8 @@ KCSAN_ATOMIC_TEST(testandclear, name, type); \ KCSAN_ATOMIC_TEST(testandset, name, type) +KCSAN_ATOMIC_FUNCS(char, uint8_t); +KCSAN_ATOMIC_FUNCS(short, uint16_t); KCSAN_ATOMIC_FUNCS(int, u_int); KCSAN_ATOMIC_FUNCS(long, u_long); KCSAN_ATOMIC_FUNCS(ptr, uintptr_t); @@ -101,6 +103,62 @@ void kcsan_atomic_thread_fence_rel(void); void kcsan_atomic_thread_fence_seq_cst(void); #ifndef KCSAN_RUNTIME + +#define atomic_add_char kcsan_atomic_add_char +#define atomic_add_acq_char kcsan_atomic_add_acq_char +#define atomic_add_rel_char kcsan_atomic_add_rel_char +#define atomic_clear_char kcsan_atomic_clear_char +#define atomic_clear_acq_char kcsan_atomic_clear_acq_char +#define atomic_clear_rel_char kcsan_atomic_clear_rel_char +#define atomic_cmpset_char kcsan_atomic_cmpset_char +#define atomic_cmpset_acq_char kcsan_atomic_cmpset_acq_char +#define atomic_cmpset_rel_char kcsan_atomic_cmpset_rel_char +#define atomic_fcmpset_char kcsan_atomic_fcmpset_char +#define atomic_fcmpset_acq_char kcsan_atomic_fcmpset_acq_char +#define atomic_fcmpset_rel_char kcsan_atomic_fcmpset_rel_char +#define atomic_fetchadd_char kcsan_atomic_fetchadd_char +#define atomic_load_char kcsan_atomic_load_char +#define atomic_load_acq_char kcsan_atomic_load_acq_char +#define atomic_readandclear_char kcsan_atomic_readandclear_char +#define atomic_set_char kcsan_atomic_set_char +#define atomic_set_acq_char kcsan_atomic_set_acq_char +#define atomic_set_rel_char kcsan_atomic_set_rel_char +#define atomic_subtract_char kcsan_atomic_subtract_char +#define atomic_subtract_acq_char kcsan_atomic_subtract_acq_char +#define atomic_subtract_rel_char kcsan_atomic_subtract_rel_char +#define atomic_store_char kcsan_atomic_store_char +#define atomic_store_rel_char kcsan_atomic_store_rel_char +#define atomic_swap_char kcsan_atomic_swap_char +#define atomic_testandclear_char kcsan_atomic_testandclear_char +#define atomic_testandset_char kcsan_atomic_testandset_char + +#define atomic_add_short kcsan_atomic_add_short +#define atomic_add_acq_short kcsan_atomic_add_acq_short +#define atomic_add_rel_short kcsan_atomic_add_rel_short +#define atomic_clear_short kcsan_atomic_clear_short +#define atomic_clear_acq_short kcsan_atomic_clear_acq_short +#define atomic_clear_rel_short kcsan_atomic_clear_rel_short +#define atomic_cmpset_short kcsan_atomic_cmpset_short +#define atomic_cmpset_acq_short kcsan_atomic_cmpset_acq_short +#define atomic_cmpset_rel_short kcsan_atomic_cmpset_rel_short +#define atomic_fcmpset_short kcsan_atomic_fcmpset_short +#define atomic_fcmpset_acq_short kcsan_atomic_fcmpset_acq_short +#define atomic_fcmpset_rel_short kcsan_atomic_fcmpset_rel_short +#define atomic_fetchadd_short kcsan_atomic_fetchadd_short +#define atomic_load_short kcsan_atomic_load_short +#define atomic_load_acq_short kcsan_atomic_load_acq_short +#define atomic_readandclear_short kcsan_atomic_readandclear_short +#define atomic_set_short kcsan_atomic_set_short +#define atomic_set_acq_short kcsan_atomic_set_acq_short +#define atomic_set_rel_short kcsan_atomic_set_rel_short +#define atomic_subtract_short kcsan_atomic_subtract_short +#define atomic_subtract_acq_short kcsan_atomic_subtract_acq_short +#define atomic_subtract_rel_short kcsan_atomic_subtract_rel_short +#define atomic_store_short kcsan_atomic_store_short +#define atomic_store_rel_short kcsan_atomic_store_rel_short +#define atomic_swap_short kcsan_atomic_swap_short +#define atomic_testandclear_short kcsan_atomic_testandclear_short +#define atomic_testandset_short kcsan_atomic_testandset_short #define atomic_add_int kcsan_atomic_add_int #define atomic_add_acq_int kcsan_atomic_add_acq_int