Received: by 2002:a19:c345:0:0:0:0:0 with SMTP id t66csp3937737lff; Sun, 15 Dec 2019 17:04:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwWQ1u2fCGqZkF9vXjzICF9KFmH1lKU4LzSEbU0R+1rSrngVoRigYb6zRzALNjLycLcprnA X-Received: by 2002:a05:6830:2306:: with SMTP id u6mr30640718ote.78.1576458286818; Sun, 15 Dec 2019 17:04:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576458286; cv=none; d=google.com; s=arc-20160816; b=TwrTc/XJW1HbBcWxGKv3Agn2k3iBNRL9kOOSUP4RUMGywRlYQruoEr6+ugcN94/ahI 7BK/JVvHIlXtBv4Dtxvbfoo1Gm7iVXQMwAyFxdxKqLROtKQ6k2XiYG3Yk7HCv01gdr3z Lv8wy4LH+gO8d+N1E6IpK7P8ESRD5y79wzsWwwPL/EU8lvKOJP0MKjw0Xmie+mKKmDEl f2MR2de03JvqyFtN9YSvE2rhdrA5k2wQgufVqCj6OtlTypZPZiobJL4gW0keXluzuxKl tiOfaFZXKNbgt0ACosd3Iox3EA8OVjvKT1yWG704/Q2JSUPq32/O+EuimDP0C8gO2oFC KXUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=3DCXgyPwzgE+O6Bop8spVTYIkBWv1NVk/5XN2ffhPLY=; b=wEbkEGP7iiRy3d23H0pqfZD/LFcfgW4AkYaem7IMeWIm+qAdmTiE1cebWJ4NCJWFHx XZH8stENN3dY9IFr+wti8DIsg9zP6i5LFtpXcwFEUYqfiN7hFYkfaS+PJ9rieWxYO2Dc Eogbag3aMunP263lwzwFOVtk0U0Mo0s0/vRDm1xaEUR8rNYtJqJSbuXh9Jf51CJcCvfq caApEguu9CylRslEW3tRKzbJld/1St98jkLjryL37cTtwKkK9h9LuHwweHCSjjGHTwdP oPppTyKG04sNawFp3Z8r3n8hph5mW3fw94UOtGbgTwJi6OWQyz/m0EHZUV2Km73ek8TM HNCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w129si9656751oig.83.2019.12.15.17.04.46 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 15 Dec 2019 17:04:46 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from localhost ([::1]:45112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igeoX-0001g4-W5 for alex.bennee@linaro.org; Sun, 15 Dec 2019 20:04:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41409) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igenZ-0000b8-QW for qemu-arm@nongnu.org; Sun, 15 Dec 2019 20:03:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igenY-0005Ue-J5 for qemu-arm@nongnu.org; Sun, 15 Dec 2019 20:03:45 -0500 Received: from mga01.intel.com ([192.55.52.88]:20795) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igenU-00053U-Ve; Sun, 15 Dec 2019 20:03:41 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Dec 2019 17:03:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,319,1571727600"; d="scan'208";a="414917184" Received: from txu2-mobl.ccr.corp.intel.com (HELO [10.239.196.238]) ([10.239.196.238]) by fmsmga005.fm.intel.com with ESMTP; 15 Dec 2019 17:03:30 -0800 Subject: Re: [PATCH 2/2] numa: properly check if numa is supported To: Igor Mammedov References: <1576154936-178362-1-git-send-email-imammedo@redhat.com> <1576154936-178362-3-git-send-email-imammedo@redhat.com> <20191213101219.0aa249dc@redhat.com> From: Tao Xu Message-ID: Date: Mon, 16 Dec 2019 09:03:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20191213101219.0aa249dc@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.88 X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Radoslaw Biernacki , Eduardo Habkost , "qemu-devel@nongnu.org" , Leif Lindholm , "qemu-stable@nongnu.org" , "qemu-arm@nongnu.org" , Marcel Apfelbaum Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: Qnfca7XUvdJJ On 12/13/2019 5:12 PM, Igor Mammedov wrote: > On Fri, 13 Dec 2019 09:33:10 +0800 > Tao Xu wrote: > >> On 12/12/2019 8:48 PM, Igor Mammedov wrote: >>> Commit aa57020774b, by mistake used MachineClass::numa_mem_supported >>> to check if NUMA is supported by machine and also as unrelated change >>> set it to true for sbsa-ref board. >>> >>> Luckily change didn't break machines that support NUMA, as the field >>> is set to true for them. >>> >>> But the field is not intended for checking if NUMA is supported and >>> will be flipped to false within this release for new machine types. >>> >>> Fix it: >>> - by using previously used condition >>> !mc->cpu_index_to_instance_props || !mc->get_default_cpu_node_id >>> the first time and then use MachineState::numa_state down the road >>> to check if NUMA is supported >>> - dropping stray sbsa-ref chunk >>> >>> Fixes: aa57020774b690a22be72453b8e91c9b5a68c516 >>> Signed-off-by: Igor Mammedov >>> --- >>> CC: Radoslaw Biernacki >>> CC: Peter Maydell >>> CC: Leif Lindholm >>> CC: qemu-arm@nongnu.org >>> CC: qemu-stable@nongnu.org >>> >>> >>> hw/arm/sbsa-ref.c | 1 - >>> hw/core/machine.c | 4 ++-- >>> 2 files changed, 2 insertions(+), 3 deletions(-) >>> >>> diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c >>> index 27046cc..c6261d4 100644 >>> --- a/hw/arm/sbsa-ref.c >>> +++ b/hw/arm/sbsa-ref.c >>> @@ -791,7 +791,6 @@ static void sbsa_ref_class_init(ObjectClass *oc, void *data) >>> mc->possible_cpu_arch_ids = sbsa_ref_possible_cpu_arch_ids; >>> mc->cpu_index_to_instance_props = sbsa_ref_cpu_index_to_props; >>> mc->get_default_cpu_node_id = sbsa_ref_get_default_cpu_node_id; >>> - mc->numa_mem_supported = true; >>> } >>> >>> static const TypeInfo sbsa_ref_info = { >>> diff --git a/hw/core/machine.c b/hw/core/machine.c >>> index 1689ad3..aa63231 100644 >>> --- a/hw/core/machine.c >>> +++ b/hw/core/machine.c >>> @@ -958,7 +958,7 @@ static void machine_initfn(Object *obj) >>> NULL); >>> } >>> >>> - if (mc->numa_mem_supported) { >>> + if (mc->cpu_index_to_instance_props && mc->get_default_cpu_node_id) { >>> ms->numa_state = g_new0(NumaState, 1); >>> } >> >> I am wondering if @numa_mem_supported is unused here, it is unused for >> QEMU, because the only usage of @numa_mem_supported is to initialize >> @numa_state. Or there is other usage? So should it be removed from >> struct MachineClass? > You are wrong, it's not intended for numa_state initialization, > read doc comment for it in include/hw/boards.h > (for full story look at commit cd5ff8333a3) > I understand.