Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4457799ybp; Mon, 7 Oct 2019 08:43:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqytfE1L5gNqTGkUAFajOuggYDR3den8leuyNQwKu0yePKKWS4E7b/XefQBQzqbfUEgaRDki X-Received: by 2002:a17:906:8258:: with SMTP id f24mr24046337ejx.234.1570463025047; Mon, 07 Oct 2019 08:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570463025; cv=none; d=google.com; s=arc-20160816; b=VUi5eMCUsZDuJ7Z5nhTWyp2mVKvdwWXvIrbNlHBPkxWQCXG3UGLgN4Qx6kOWyRTcpE TaXz3fqZ/0wARLIb2sIYvYFu6OC+jzJJ2xh/lnpxTHJxomcSVGBtS/0vCW0pKbTPjSF0 mglXCNeug8AzucYPgtQ7OvDvFFDwwR4It7b5ebNrPh6AOBwvPC28k4Ys8qcjSKDbEbNO jhu246nwC60/NI95Yzm9DlfDZEOR8khfqe4jZkB8Z7wT1w+C3xJHRd9bvQ1OxXBFIsEA 898+zok8exu3z2/+k9dladAa1BybtJHc/tyVKXb5ANiZYL5KwJjAoXIW38V47xl1JZM/ nA2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YvxpVFdJOEZrkQChM8Lq11d9YvLJbKpxKj8YQXF8h+c=; b=OcIGDCBnAkMHu3Ev5ohJaq8niTvIwHbveXx/2+8t8SVSAP3DOinWXS6SyBxJa0Anzg npc3A3j/DfWCJEnn2yC8kY/GNKSDQpng0cHkUjpF8j9vgjWAinZPa+mMGf53QyhBUDfx KeEh6gm+bgxl0Io37PlR1R8PDKqIf+7HRcUqAaj3blUTN4rZnKPVxSlMsjbwB8kvGVmo P5ZZ68igdaA94790EN2Gsxt/HcDTbFLGcy7O7+WeEjqj/D1ocKLGNErn+Y1OMyk8XmkM g8DcRQus9efRLhPtOuMbzd7IUMcGeA6PPq1W5Qb9PAqZc0QcjKNBkL7umZw4A0oXyxFZ hVbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=b4aG6tjL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m33si8769296edc.94.2019.10.07.08.43.21; Mon, 07 Oct 2019 08:43:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=b4aG6tjL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729378AbfJGPkN (ORCPT + 99 others); Mon, 7 Oct 2019 11:40:13 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:38223 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729169AbfJGPkL (ORCPT ); Mon, 7 Oct 2019 11:40:11 -0400 Received: by mail-wm1-f65.google.com with SMTP id 3so12870348wmi.3; Mon, 07 Oct 2019 08:40:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YvxpVFdJOEZrkQChM8Lq11d9YvLJbKpxKj8YQXF8h+c=; b=b4aG6tjLd5D2QbgnsraRnITHGMxPIlNYBw3yvdWYP1HXbsqS/SraQh9s6vsAGE01d6 MQIslDbt1wE18zCEStz+X9q7Y+jV6jLPKAjDeWSBoivuHmzk3dLr7uDU52DvuXSd1BTw ksD0DFhHtZ6gDqB3thMNT0kkZ388AIzXzMAVXxcOm6Weie/MQZPRYbHYdHbLwMvkG1hn mjV1Am8WsTi4xlAwdj5P4xVuX+Nj+pqwa5aM3dlPsSATUFr3NrmlTOJkFh9pgTFrn1BQ HpKoFh/IQSXAeHRrbbdvggubAAPtBj1XdU+YV1/fExBF7JZnI6PCKZ+M/CUlgGKP0Iag D0jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=YvxpVFdJOEZrkQChM8Lq11d9YvLJbKpxKj8YQXF8h+c=; b=iNuJLxNTvo7RGem/89WvjeG8DdkG5Q7hCpYpNpkWGGyw6ap19R+XErQBbT5zQuwIUU WqetegjJ+EJa0Ta9eMhaWPfvGr+XlMpeng+jJVCVc2gHFguUBYPkOMX5avh1jrVVm4v4 6qg7Yux6934RBBInf9bq80FdpdWc8R4m1/4fqKEfAkIXDEdiDip8CnfbEyW14CPKFVTM dB0BgvOFUReuAyKQhG7wYqNMGi1YUv/OcYH/mLXGTzHDCcEWX1BKyYwScM0HOwW7V+Vr pR5V8EuvDtvlwosxYVZFkE+3xSATzM3z/NMWw9J8Hr+D0Y3eMKuxqwzxybHpQik3fRGd 86kg== X-Gm-Message-State: APjAAAX10vbkuKDJ62W8jsPPnpOnANCRqKsszQDRFGuJx7vdsYXhla3O F+bbTQKf9Jm7MwAfj5lIpgo= X-Received: by 2002:a1c:7ec4:: with SMTP id z187mr20333322wmc.94.1570462809964; Mon, 07 Oct 2019 08:40:09 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id y5sm18605709wma.14.2019.10.07.08.40.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2019 08:40:09 -0700 (PDT) Date: Mon, 7 Oct 2019 17:40:07 +0200 From: Ingo Molnar To: Arvind Sankar Cc: Hans de Goede , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Herbert Xu , Ard Biesheuvel , linux-crypto@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Stephan Mueller Subject: Re: [PATCH v2 5.4 regression fix] x86/boot: Provide memzero_explicit Message-ID: <20191007154007.GA96929@gmail.com> References: <20191007134724.4019-1-hdegoede@redhat.com> <20191007140022.GA29008@gmail.com> <1dc3c53d-785e-f9a4-1b4c-3374c94ae0a7@redhat.com> <20191007142230.GA117630@gmail.com> <2982b666-e310-afb7-40eb-e536ce95e23d@redhat.com> <20191007144600.GB59713@gmail.com> <20191007152049.GA384920@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191007152049.GA384920@rani.riverdale.lan> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Arvind Sankar wrote: > With the barrier in there, is there any reason to *not* inline the > function? barrier_data() is an asm statement that tells the compiler > that the asm uses the memory that was set to zero, thus preventing it > from removing the memset even if nothing else uses that memory later. A > more detailed comment is there in compiler-gcc.h. I can't see why it > wouldn't work even if it were inlined. > > If the function can indeed be inlined, we could just make the common > implementation a macro and avoid duplicating it? As mentioned in another > mail, we otherwise will likely need another duplicate implementation for > arch/s390/purgatory as well. I suspect macro would be justified in this case. Mind sending a v3 patch to demonstrate how it would all look like? I'll zap v2 if the macro solution looks better. Thanks, Ingo