Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4411968ioa; Wed, 27 Apr 2022 03:20:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwoydt6aLKFqbSGgaICQ0SsUzl8wyowHMa5K7r7dg2v3xOVAZei837B7m0TkuUrGJUMUa5 X-Received: by 2002:a17:90b:4b45:b0:1d9:b448:a925 with SMTP id mi5-20020a17090b4b4500b001d9b448a925mr8037521pjb.7.1651054842795; Wed, 27 Apr 2022 03:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651054842; cv=none; d=google.com; s=arc-20160816; b=aCqvO/EDUC8HdFHAYdopq6TlE9nCH8f/bEFMuOvwakAdxTjnMbgrV4227z3QQ5zQZj G0VtGkmrM4ZypyLOdHHOhSRdae7dDN7otnIjZyRUY8IXTn9XbinVto/fQfUjeS3LanDX 9Z89r1RFEgJlFRtL8Ij2+LSH8LSR5MxF/iZPeSaPMp9QQVxFmrQQr4QYZsu1d341foEV oKg1/Rg8bmSCig7ho5UrFkJOlf/mhGYHlZ6s8rpWx/l17bA3AclK2d0qrWMhMNv6JsEE /BBAhoei9lmSg1thTSPqdAEcftv9sYcfFooVPXoM/AMIfDXej7i3vY+v6668lnH7178G 4+wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WAOGG0OkpdT6SFUFkDwSRCJIK2b9iJROhZINeRXHsyQ=; b=VOJjonrCaun9SGKeA4jyICV1qtudymf4sDd2CuHWtMzZDY4bQCwMmxC/8TYZLxdR6k gkGY319sY33E5a088KhGDg51Ve9Rg0c3W6yOtkC1rIv28oZUnHT2JAB7vcHn/sIoY68x xBU+XUVVrezKPeuLGSyx2wy8ErA9g9k6bECYM8lTifDZnp+J00c5keN63cs/VotaViCB 5U3F3E1VhJ5EoGrrWqJiWcg1XKdgCV1d65SJelll0FeoMDJuDCDRKttiDd3+50VQzItD YPFuZO47UkFswxLcz7EkjUjEaFHuSSNvUM3Zb3kOAp0xTJri5kaMx7hsxKZQw5JllmZY JMpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=TZENyvqd; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p19-20020a1709028a9300b0015d3604e495si1171338plo.165.2022.04.27.03.20.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 03:20:42 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=TZENyvqd; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B566E3681CB; Wed, 27 Apr 2022 02:40:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245258AbiDZRbU (ORCPT + 99 others); Tue, 26 Apr 2022 13:31:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242618AbiDZRbP (ORCPT ); Tue, 26 Apr 2022 13:31:15 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDEC16EB32; Tue, 26 Apr 2022 10:28:07 -0700 (PDT) Received: from zn.tnic (p5de8eeb4.dip0.t-ipconnect.de [93.232.238.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 6A2C71EC04F9; Tue, 26 Apr 2022 19:28:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1650994082; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WAOGG0OkpdT6SFUFkDwSRCJIK2b9iJROhZINeRXHsyQ=; b=TZENyvqdhyawlUAK9vwmhZucaAdPMq8m7nHO78qFioNOuw664oY33uTH5tXWyfhB+mkA7d 3PG+BxTIQxlkjlNkUdy7OEeWwJlvrZgHk231FeeXbSY7YgTBf9qWQDH4SElg4yh6oagqrq c/+lRxdH/edHObAUi/zQRiY3s2W09GI= Date: Tue, 26 Apr 2022 19:27:59 +0200 From: Borislav Petkov To: "Rafael J. Wysocki" Cc: Matthieu Baerts , Pavel Machek , Thomas Gleixner , Ingo Molnar , Dave Hansen , the arch/x86 maintainers , "H. Peter Anvin" , Chen Yu , Pawan Gupta , Catalin Marinas , Linux Memory Management List , Mat Martineau , Ingo Molnar , "Rafael J. Wysocki" , Linux PM , Linux Kernel Mailing List Subject: Re: [PATCH v2] x86/pm: fix false positive kmemleak report in msr_build_context() Message-ID: References: <20220423182410.1841114-1-matthieu.baerts@tessares.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 06:24:04PM +0200, Rafael J. Wysocki wrote: > So can the comment be dropped entirely? Looks like it to me. All the accesses in wakeup_64.S are done through those offsets which are computed at build-time so they should always be valid. OTOH, I wouldn't mind having there some text making any future person touching this, aware of where to look when making changes. Some changes like removing a struct member are nicely caught, ofc, see below. But for something else which is a lot more subtle having a comment say "hey, have a look at where this is used in wakeup_64.S and make sure everything is still kosher" is better than having no comment at all. IMHO. Thx. In file included from arch/x86/kernel/asm-offsets.c:14: arch/x86/kernel/asm-offsets_64.c: In function ‘main’: ./include/linux/stddef.h:16:33: error: ‘struct saved_context’ has no member named ‘gdt_desc’ 16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER) | ^~~~~~~~~~~~~~~~~~ ./include/linux/kbuild.h:6:69: note: in definition of macro ‘DEFINE’ 6 | asm volatile("\n.ascii \"->" #sym " %0 " #val "\"" : : "i" (val)) | ^~~ ./include/linux/kbuild.h:11:21: note: in expansion of macro ‘offsetof’ 11 | DEFINE(sym, offsetof(struct str, mem)) | -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette