Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4516189pxb; Mon, 27 Sep 2021 20:03:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzo06/0rqhSNe1G4MRACer5BG1sealc8PblThRYUW9PNoNt0xPNqd3rPDwAof/hvUnmyFuU X-Received: by 2002:a17:906:6841:: with SMTP id a1mr3992529ejs.501.1632798211148; Mon, 27 Sep 2021 20:03:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632798211; cv=none; d=google.com; s=arc-20160816; b=BaLaht3vk0jYsLHl3TA5W9wsVxOGQu+vHkT3Ky8FLSWvHy6Rs3+bqkZV/44WxB/JWh IEfKtYKqEBvXOO1zPXi6RU/cpATDW678I66sJEjqQtp7F5o6muSMnckDyPxEiE0PXNK7 XVYV1CQZndtPdV8jeCQRo8xDfWtiulYSwl+rkeYEIGlCoNWTNKrgjj44qV9dcmuCDZ5V kYkhtCiUmgwmZg3WCUyOuP0gcPHX/3jCsibpXnulXscJw5mymj2tXXMXg3aijsXXmWAf p/REGChevYDmpNxZjMwyvsLm5xAlnZWQQqhoemw5gVekdfB0m/3A0nP/GE8V9MLh9io9 WIVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=Iu8XrsJq3obF4ufqT5pzxqFBWYnzVMM19I539A2iiQU=; b=Y2drQkhzLbuwG6qQUsqdOHCVqVL4EyMWQLVB1t7iuCK4XwVnpkuohIIlyQUMdbm7fh J/nYW4I2kxKZCSkdOaFhy2RrszCU1ZiV/wzkyMYSOSf/+GMrmiA2v6dvkxj8kaKyXqI8 hES9F0Eem8etcB1UPPfEyLz4ctM7UR0R5jkrrSCZVBx8/LDEQ+PuLkpXMtykO8frPcNj +dFU2Ys7zOl1UYwVaGkjTrXEuSeyXHg2Xb3Wznzm/etYvRUPGo9f09DYyDNcyy72ZNlx sGQJOrKTodPfgcx5kEmlmLJWUDqLtbyQyhbYh13c+b4vJpyhZSA1pHi/sl98O4OSuQ7C WlCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RZH11clb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bh6si19361108ejb.691.2021.09.27.20.03.07; Mon, 27 Sep 2021 20:03:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RZH11clb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238750AbhI1DDU (ORCPT + 99 others); Mon, 27 Sep 2021 23:03:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:57142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238710AbhI1DDT (ORCPT ); Mon, 27 Sep 2021 23:03:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4751961156; Tue, 28 Sep 2021 03:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632798100; bh=etcWicIya78aAu3YgO2YZU7Km62u3r0LRoISmor1eqk=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=RZH11clboMwjHRzownDyG7gYVL9PPmQcoKVi2Lus11wvBCli72L/0F69o3iXvnrdW 4alwwpmN1cEx4jnbs3cRFxBsXBRHxwIT4MAoPOosfu2DLFBlCv1J4i/GDec6g6Kere 0na4r8UNblarbPQatQr5nwYrILfBtrjNMd+QH4xgNU74lzJ71oZCY9PqC/BCM0HAB1 I5d33KBl0YbxLT5oheLEVT6F+8nATnH8V9rwJRjGtioC+izah85Y7ZkHoLifobjGWi nr02yo+WUYSmQNxx8cMUSexOG1byzo9u488Uwq+NYo7TxnqGK4abYnud4hHK1LFDXC baGQ+Bj6QBayg== Message-ID: <20d92bf2ae51aac2e5acaf5a206f7cdbb065904b.camel@kernel.org> Subject: Re: [PATCH v5 2/2] x86/sgx: Add an attribute for the amount of SGX memory in a NUMA node From: Jarkko Sakkinen To: Reinette Chatre , Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Jonathan Corbet Cc: linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Date: Tue, 28 Sep 2021 06:01:38 +0300 In-Reply-To: <0f75a6db-27e6-dfc5-4025-e81d8e753e30@intel.com> References: <20210914030422.377601-1-jarkko@kernel.org> <20210914030422.377601-2-jarkko@kernel.org> <254864594af4cde213a37a4db527e293a1ef1d7a.camel@kernel.org> <0f75a6db-27e6-dfc5-4025-e81d8e753e30@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2021-09-23 at 13:39 -0700, Reinette Chatre wrote: > Hi Jarkko, >=20 > On 9/23/2021 1:30 PM, Jarkko Sakkinen wrote: > > So cat you pick these patches to your patch set, and squash > > this fix to it? >=20 > My patch set is focused on SGX selftests while this series target the=20 > x86 tree. I assumed that this series would go into x86 separately and=20 > after they land we can proceed with the SGX selftest work. But now your series has no chance to be applied, given that it contains patches which have discarded given a superior approach. Anyway, node fields are initialized here: if (!node_isset(nid, sgx_numa_mask)) { spin_lock_init(&sgx_numa_nodes[nid].lock); INIT_LIST_HEAD(&sgx_numa_nodes[nid].free_page_list); node_set(nid, sgx_numa_mask); } The correct way to fix the issue is to add sgx_numa_nodes[nid].size =3D 0; Using kcalloc() would not be very sound, since you would wastefully initialize the pre-existing fields of the struct two times: first with zeros, and then with "real" values. /Jarkko