From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756612AbdJPSS5 (ORCPT ); Mon, 16 Oct 2017 14:18:57 -0400 Received: from mail.skyhub.de ([5.9.137.197]:34284 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756552AbdJPSSx (ORCPT ); Mon, 16 Oct 2017 14:18:53 -0400 Date: Mon, 16 Oct 2017 20:18:35 +0200 From: Borislav Petkov To: Brijesh Singh Cc: x86@kernel.org, Tom Lendacky , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andy Lutomirski , linux-kernel@vger.kernel.org Subject: Re: [Part1 PATCH v6 02/17] x86/mm: Add Secure Encrypted Virtualization (SEV) support Message-ID: <20171016181835.a65fogoxdrl2j36z@pd.tnic> References: <20171016153423.2980-1-brijesh.singh@amd.com> <20171016153423.2980-3-brijesh.singh@amd.com> <20171016162118.i2n34wrfiaqytr5v@pd.tnic> <792fdb90-3416-2f4e-59c1-a203b2ca9b5f@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <792fdb90-3416-2f4e-59c1-a203b2ca9b5f@amd.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 16, 2017 at 12:46:20PM -0500, Brijesh Singh wrote: > sev_enabled lives in .data section and looking at the objdump it seems > to initialized to zero. So, I think its safe to remove the initialization. So I'd assume that static means it gets cleared to 0 automatically, even if it is not in the .bss section. And Tom put it in the .data section to protect it from the .bss clearing later. To quote the C99 standard: "If an object that has static storage duration is not initialized explicitly, then: ... — if it has arithmetic type, it is initialized to (positive or unsigned) zero;" -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.