Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4580874ioa; Wed, 27 Apr 2022 06:55:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxVOKbrNPw/Oks+QC7czppgs8Nukuo1qPsVHitZuuQrwPkIKy+/HMpF9HGTiKL80XauxiT X-Received: by 2002:a17:90b:4d86:b0:1da:3cba:bd56 with SMTP id oj6-20020a17090b4d8600b001da3cbabd56mr3083396pjb.116.1651067750744; Wed, 27 Apr 2022 06:55:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651067750; cv=none; d=google.com; s=arc-20160816; b=TVYOhrMgesuFMJR43GW02Zvt9hZL2DXsISvl5jgl1geBSCs5spM/H+XtdmjC8zN1JW 1F+OF2YOzJDPFYm82BQQQuOXkovuE3fIrBIunpyWXqc0K+rUNJLOttnoLSYvhzDtBMtm TPGZDu9o0cXExB4AjXIWXG91j2y2LmelcNdX2F8mghWJEQ+bmbJEE/gYr6NUGfUCZisB gX6OV0/YMuiIUC3Rs5R3uczEhrot2enY/S0ndsDjtap7MeLlfiyeXl0RzSRJTVV/SBxS EVabf6ryQwvcRBVKWEUzOQcPm7kmWUsKdG+bg5dEBBPy2iVkblJAHhrpl5XiuboRoUUD pcjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=XeLkj9226T84S9BXMt19LKkxjN+pWXBCLzkSQX80Wy0=; b=lMU+ENm9Qu1UpphQh0ry8dLBpdjtUXQnSKc9LmlCl6KHiJnHTCRMrHIrKFmKOBhrhB OkBZ9xsCba2q55bB9fdVGe+heDq0PZOyV53Ce8ErYjPqYOZu2vxou5hsONR0IReDDCkb //Z1y3hGA/0HQl1Lx92L9S77bAZhjQtGPH+zEv+1kUoVLlxL/vb69jO5qdiXGCtoaoVF rKZ1vKIN6B/2xjRkF+yP2BHAPb3bacCwTKSTUAWe6dowbYMio+fdl4zfdqfR0LOv/+wu QJSAjqN1JAztcTmr9x14ex0eXxs6kQvTA12Okl6M9yAmIzj0BGgf2QVgEdQ5QZsjwfqO 1bfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CnD8+0uD; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=mqNvTWF9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id nv12-20020a17090b1b4c00b001cb95c53172si6320507pjb.78.2022.04.27.06.55.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 06:55:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CnD8+0uD; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=mqNvTWF9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C8E13419A2; Wed, 27 Apr 2022 06:28:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235911AbiD0Nbn (ORCPT + 99 others); Wed, 27 Apr 2022 09:31:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235860AbiD0Nbm (ORCPT ); Wed, 27 Apr 2022 09:31:42 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 574C633E23; Wed, 27 Apr 2022 06:28:26 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1651066104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XeLkj9226T84S9BXMt19LKkxjN+pWXBCLzkSQX80Wy0=; b=CnD8+0uDIKN5dkS4D3kOiZHg/aTrcuU3CSgu/18pNHX4Bq8eAM1hY3aI4Xu+WNh8Jmn/j7 R+SzJ5YdJvI5nC5LZnNvdrrvEC1pm6pUjngAw2WcmmOvWeilo9o88BsPnZiOq5IP7iVI/U Ld+1XVU5417idG7bq4A6e0TRt8nItIYLaV0EYBB8dfsEPPtRua6GcUSKSQk5VEUw7RDcyu sGfWU16My8O6Qii/arx971F7FyOPp6CQNVj3UlU8KnyEdjlbltkVPpGGF181Oy1zG3PJcb dlAkAuEeKrWfS/iDZAZL6H5bcANyx5Px2Bs4sti+fqx2XT88qk8IB+qGc5NGQA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1651066104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XeLkj9226T84S9BXMt19LKkxjN+pWXBCLzkSQX80Wy0=; b=mqNvTWF9p2Pn5UfW0rssM+TDypdzsffTK7XDNT84SfjwuIlFAdc4suevqEXX1MmYnM9rdo Ccy/wwrc6gkF4WCA== To: Alexander Potapenko , glider@google.com Cc: Alexander Viro , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Marco Elver , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 27/46] kmsan: instrumentation.h: add instrumentation_begin_with_regs() In-Reply-To: <20220426164315.625149-28-glider@google.com> References: <20220426164315.625149-1-glider@google.com> <20220426164315.625149-28-glider@google.com> Date: Wed, 27 Apr 2022 15:28:23 +0200 Message-ID: <87bkwmy7t4.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 26 2022 at 18:42, Alexander Potapenko wrote: > +void kmsan_instrumentation_begin(struct pt_regs *regs) > +{ > + struct kmsan_context_state *state = &kmsan_get_context()->cstate; > + > + if (state) > + __memset(state, 0, sizeof(struct kmsan_context_state)); sizeof(*state) please > + if (!kmsan_enabled || !regs) > + return; Why has state to be cleared when kmsan is not enabled and how do you end up with regs == NULL here? Thanks, tglx