From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2246D3A679 for ; Tue, 29 Oct 2024 17:38:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C6C36B0092; Tue, 29 Oct 2024 13:38:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1777E6B0096; Tue, 29 Oct 2024 13:38:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03E036B0099; Tue, 29 Oct 2024 13:38:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id DBD536B0092 for ; Tue, 29 Oct 2024 13:38:43 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8C32F402FD for ; Tue, 29 Oct 2024 17:38:43 +0000 (UTC) X-FDA: 82727348046.20.8DD5CB7 Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) by imf25.hostedemail.com (Postfix) with ESMTP id D6F11A0027 for ; Tue, 29 Oct 2024 17:38:23 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=TJIxb+nb; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf25.hostedemail.com: domain of junaids@google.com designates 209.85.160.182 as permitted sender) smtp.mailfrom=junaids@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730223466; a=rsa-sha256; cv=none; b=eKO1nRtag/Td16gOy/rOyiAskEvAcumUXsYNe5WPGQEQ+Xb9y+ySUwH+EcjFvWLaNOQDyK nIklewuxm3AIyEprq1Y+I+1Sf5ZZXcH4Ch3aa+H+On9xsA4ISCXkAf1d2unJvA0hClvXsB 86DRElubGaPp8VgXjHYY2V5oAaKd6Bo= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=TJIxb+nb; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf25.hostedemail.com: domain of junaids@google.com designates 209.85.160.182 as permitted sender) smtp.mailfrom=junaids@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730223466; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4NzyGHFNG2VmMmlShndRLXedmken+2X5Xff0mPyjqlA=; b=Bt2JzWcZcQSwBj49tCz3Cjchp2cJMp0saN6ZDxvOkCD6P8fyCte1gnOx3SI/A6+KVotR98 VcfcO8mkE6ulODei/VSKKrvL/ey/IjyqrRxfW/BwOaBPUK3lzGJZs4aGzcSWdcFPKUmdWo AqL5hMvVaCl7pICyex4yYydJsoLP4ic= Received: by mail-qt1-f182.google.com with SMTP id d75a77b69052e-4608dddaa35so29131cf.0 for ; Tue, 29 Oct 2024 10:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1730223521; x=1730828321; darn=kvack.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4NzyGHFNG2VmMmlShndRLXedmken+2X5Xff0mPyjqlA=; b=TJIxb+nb6LdA0ZwuahCfsc8a0oyy1kguiW4hPf1SoFnglgMufE6jgvOd/V3ifo6y5x pLOem5h+5S6ujnuPnurThNTZbLSog7jrpVOh3zGSi4PDq7ql7GPEbHg8xRTiVDrcfhyY 1c80QrJbcF+EGYh/6yQQ2xxRq3VWx/UletDxQx49rGUo4SOJ1v9pg/rf3kOf/6B6tVF8 gaY+4fS4eyjEdA8kCO/NkIJ64/VXe3bW9cYbcJCKKBzgMPI7oyN2uxGRb3v+e7ao5fgY N6W+IGJ9UsUFXaIR+vsCoUTv+uEfLyr3ERKX+0MsoMQplHC4s8HmRHNqNUdjISFO8YGe bLNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730223521; x=1730828321; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4NzyGHFNG2VmMmlShndRLXedmken+2X5Xff0mPyjqlA=; b=JXXkI6i02eF/Y0zAiA6VSCa5zDgl9ecLZ6G90pUhMT2uJpB7jt5kxkvolOlJfBGsJE u7xRqc051mfv41fBnoNCoa1EBSw/BrKDQm1Z9faHLbzpB830CRA2SbTm7cefQDr9G8wr x0uUnAbdCaKZ8PLGJXK72XEEw0AyT5sjBlp01D6FhaWbvbByL/sM6N1BooshQc2ds7Mp 4H8Enae6db00JkwiK+jjdJgw0glGDPo2r/fgINh0v0TxpXMaQetXSPpqXpt7Q39xfNHv LFYpkKxMXNLDfvqDAKRZVhC/U7DkqC2xLnOBJG7+QfjSgC1jvOv8atYyl0czxdZl1LJs O01Q== X-Forwarded-Encrypted: i=1; AJvYcCWeXrc/TkLkNxHVWdk7rTthe46jcybtNsF/vNyunBD+EQVnWmGIa26tpJP3KycPn7mGjehr3uXgSQ==@kvack.org X-Gm-Message-State: AOJu0YzT4cpDnHUNBTlx/FHVMPOHO3t+CKNyJKxIjiAKQDNrBmdf5K6p /g2n02CjIcOvW+tjhaEjuVt2uRRYFucMH8jvSuqywXHsZrbG0eXkZ075htC7cQ== X-Gm-Gg: ASbGncvzXn6wT8RDWiM44UTyze1DnUG0ZOa0bTjhAKJtYeTbGexxpnXHpmlYB2OIb+W oDirI9nYhIv4vWjdmluIMrv6rqZls8Y0uNl5YS7Nr8nRAWTfhUh61oKYjpVbtk8INHX8/REXy5a pW4Y2ULgKOlcUzLXZMM35yTvNhdE6yfFy17zNdynUMqluR5JYfacDzY1CaDoCR/J+7lwlQ3J7+q W/G7ER716iKKs1NhYqbsjvcb4NU3xqVMWV0mJIirbpqm2fBT27wmjqZez+puLqMwdSZMGOCEq/b nkLrvSjXDGOzF/WUKR8e X-Google-Smtp-Source: AGHT+IH+aatp5vvOT3MLmDgG/8NEz2ktnGYsU3OGGl2E+dYdZKM2fvH7N/zzBC7qLEmuQMllIaaB+w== X-Received: by 2002:a05:622a:1a9d:b0:460:f093:f259 with SMTP id d75a77b69052e-46164fcec8fmr4325821cf.22.1730223520365; Tue, 29 Oct 2024 10:38:40 -0700 (PDT) Received: from ?IPV6:2600:1700:38d4:55d0:4aae:c9af:39c8:58b? ([2600:1700:38d4:55d0:4aae:c9af:39c8:58b]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5ec187389a0sm2417435eaf.42.2024.10.29.10.38.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Oct 2024 10:38:38 -0700 (PDT) Message-ID: Date: Tue, 29 Oct 2024 10:38:27 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 01/26] mm: asi: Make some utility functions noinstr compatible To: Brendan Jackman , Borislav Petkov Cc: Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Sean Christopherson , Paolo Bonzini , Alexandre Chartre , Liran Alon , Jan Setje-Eilers , Catalin Marinas , Will Deacon , Mark Rutland , Andrew Morton , Mel Gorman , Lorenzo Stoakes , David Hildenbrand , Vlastimil Babka , Michal Hocko , Khalid Aziz , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Valentin Schneider , Paul Turner , Reiji Watanabe , Ofir Weisse , Yosry Ahmed , Patrick Bellasi , KP Singh , Alexandra Sandulescu , Matteo Rizzo , Jann Horn , x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kvm@vger.kernel.org References: <20240712-asi-rfc-24-v1-0-144b319a40d8@google.com> <20240712-asi-rfc-24-v1-1-144b319a40d8@google.com> <20241025113455.GMZxuCX2Tzu8ulwN3o@fat_crate.local> Content-Language: en-US From: Junaid Shahid In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Queue-Id: D6F11A0027 X-Rspamd-Server: rspam01 X-Stat-Signature: 6jjn9dy1arormczfejajai7cjaeigfoo X-HE-Tag: 1730223503-896680 X-HE-Meta: U2FsdGVkX19f0Xy3AuTBvDpKgUfQOTKPq20zaFiZxLZQ5pKDh5f+Qyx3ERwSbmq/BCvjyk0DMaHL830V9FNvFZZpnc3JMlfKYe9ENm5bvQWwXx6OqRA4M0WSJVH268xh+kfaxU0p3hQAB2Baqe1YcCcZKCgr2EMlOd9i3VqTHaUyv8I64+wDFx/IA+aP09IVMXcSLuQl2ibDg9H0JKcy44JpczzHiV2cEkqHheOWqaa62Mt2R2wrMVWxuYCduNc3Umy0XtTsh8lnC5IeR6VCzBbIeQG6L+lY54/3ys4wMaxzMhR9n79mpePgI3Z0CtE2xfImVwhIRhW+QX3cLzdRSR9WdOyODwNEIQnGhFhZTdAhPYWh4KBFlDrcE9MEn1WoAKrtgB/yEceJxxgopc8ySjq1Q7w9yBkGyu9BnxdZVBTxQwi6VzJfDgGI7d4Cy5025/JlgT2m5/JAJ4R7BCDfTZkmEh6UFB6gWknI1QSSmdoty0CzjpQZbrxPgmRQiY3yiFoQ7QhhuV9m4S5GHgWDIlYsxKNQghcWa/TZSDWpxhe1JQ3CGx9OvRCDn+jcSvTSXvJl/Fj27sWVY5SzBQ/vgur0LuHipIKorDPyn3AYgKwD9xXC8y3Mn8uX2675+wpGoMWrVvfoBcMbf/FOY2IP7CmC8vmyvxVDWTEgGD6D2H00yHnOuuFQrm/7xro0FsjI2u0MmuaW60riLFAeWPYmcH2JvGKrvahSuRI68QrV0i5oivcIy7i/2NvGOXtqWf/6t7RiBNI6IzAsANCpkCEI7WPRBZcm7prHUmyuM8Dfo8YFqC9Q1NZj1tXdriT2ymMspWLCMqlC35lg9RsHXXGVx7LRZeV9ZMcXg0XeyGjjXiv3fo6JtxwKIflpGt78QKkGmwS4hd5uDmHL99sHcup7mI/q8//sTtB/u+zJC/NnefTAIvTa9nUnRtQYUCsgOWs/Q/BFuoEblFgymgtp7EN 0v/8Roxh EGtNX52vULQv31VMWj4xLBXSvnwJaY+7J1CNxNQA3AVNp9SiwDe7/bE5XKZOH0JnsiF+BL4wXcGxmWjpuREqdrE/NKFclLqzjjHZPUvz48Nqug+1r2CjWFKqvfqQL9ASFfxw4PUfmcFm8fiJLGZfcHv552cRQFST9mKDlfhfLQf/nx4PHPu0OXn/Er0oKgI7qJWx761m7LyzBrUKit9mlEwOwxR1F45GmXyx02Qgw3l3ySuXW8R7hUk3BnQaue60VUfpeniHsnbNIIqpAyu2JW/w3GJRwhuE5Kv9mx2NvIKNHv4km5VEDYRQVi/dwFiipbQkhP314d1G3Eb6FUZHruNgG11eiTU8tPl+uaIxlTzBQ5kepvAyQ0nqskQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 10/25/24 6:21 AM, Brendan Jackman wrote: > Hey Boris, > > On Fri, 25 Oct 2024 at 13:41, Borislav Petkov wrote: >> >> On Fri, Jul 12, 2024 at 05:00:19PM +0000, Brendan Jackman wrote: >>> +/* >>> + * Can be used for functions which themselves are not strictly noinstr, but >>> + * may be called from noinstr code. >>> + */ >>> +#define inline_or_noinstr \ >> >> Hmm, this is confusing. So is it noinstr or is it getting inlined? > > We don't care if it's getting inlined, which is kinda the point. This > annotation means "you may call this function from noinstr code". My > current understanding is that the normal noinstr annotation means > "this function fundamentally mustn't be instrumented". > > So with inline_or_noinstr you get: > > 1. "Documentation" that the function itself doesn't have any problem > with getting traced etc. > 2. Freedom for the compiler to inline or not. > >> I'd expect you either always inline the small functions - as you do for some >> aleady - or mark the others noinstr. But not something in between. >> >> Why this? > > Overall it's pretty likely I'm wrong about the subtlety of noinstr's > meaning. And the benefits I listed above are pretty minor. I should > have looked into this as it would have been an opportunity to reduce > the patch count of this RFC! > > Maybe I'm also forgetting something more important, perhaps Junaid > will weigh in... Yes, IIRC the idea was that there is no need to prohibit inlining for this class of functions.