From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0D21C2B9F4 for ; Tue, 15 Jun 2021 01:40:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2DA086140F for ; Tue, 15 Jun 2021 01:40:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DA086140F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsy4F-0003pQ-CH for qemu-devel@archiver.kernel.org; Mon, 14 Jun 2021 21:40:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsxxm-0000r3-7N; Mon, 14 Jun 2021 21:33:58 -0400 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]:40947) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsxxk-0002em-DF; Mon, 14 Jun 2021 21:33:57 -0400 Received: by mail-qk1-x736.google.com with SMTP id u30so40433409qke.7; Mon, 14 Jun 2021 18:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wUgGKo4Xbe8PZndEW+FwB83m/Vv6a6cLHQWWfrS+caU=; b=W/buIhwtArAVb5xWO+Lcflhvoe5FqlTwevuQiVYRfRehduvN9jDPHv52hQNYBi3Sk7 5TyzsdPqvBMoTJInals0pOThReAY+d5I76oKzPr4jKqfoF28e23Jo2SL/kOSc5rr0dtF am6rycITNYFLwvNNtiBmwCBrEISCDS/xaFJJKuSnjLbJYQw0d4SuZJoJCSnZw0kNbypU OLOR2bp8JsKt+PwtZj6EFHNzq6SJqH81zHj3KRhswB2gOx+lebtkbUpR3s85h0btjefV QSLi8yGu1ZNyeOXvR9/6cVuaYE2t92ULW0fAxbmo6MLUnnUnyBH/yLk/XDc3RWw2f3G0 Rcww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wUgGKo4Xbe8PZndEW+FwB83m/Vv6a6cLHQWWfrS+caU=; b=IbKLsgXcLTHu2Ro+VWXALxdCNoqyo214P3UXcRHlk2z70KZ6tkxDc1bfFyhH55LNhn Mpr8P2jAsW808uCVKncn6pvwcBV8DBmTwzM4Oa+QNCjuePKti3T9vQ6RxSYH1zbqXfZu WEX1B4VRqWdIwefsE3j6dKvRUBsf1ruHp4PKrP67NPdKdxX4bTZ4WLBjOjwLPd9Z62t4 Ey4t7o9y+ob+0Ylo8wxnwpOjtHSaLie5t9LyMJljtELPRxCbhJztRpXVxsXZ19FAJpvN Hn2ojGn6UtZSD8kbDvV/jNbJq0SbAqGf5jeLF8NNMRqIm1MQ2focfhnEKS4UsuexsCYP jzeg== X-Gm-Message-State: AOAM532e2dzm7cnzjbsYLYre0tcdhUhr2sx+Vvl72LmBEeXBXtNLg7W0 eVXm4Qs8j6P1Qv3LZaxxoxS2/qWjt5rGLA== X-Google-Smtp-Source: ABdhPJyoyFVv0qDK9eSpDJ6fdRYbch5juC2wqaXTKNDw/12BVQnXF32UqogUQGLoCB5SjfvMAgUxJw== X-Received: by 2002:a05:620a:2058:: with SMTP id d24mr13273434qka.472.1623720834999; Mon, 14 Jun 2021 18:33:54 -0700 (PDT) Received: from localhost.localdomain ([2804:431:c7c6:4d9a:784f:a7de:c020:5f1e]) by smtp.gmail.com with ESMTPSA id h2sm11639320qkf.106.2021.06.14.18.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 18:33:54 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [RFC PATCH 8/8] spapr: move memory/cpu less check to spapr_numa_FORM1_affinity_init() Date: Mon, 14 Jun 2021 22:33:09 -0300 Message-Id: <20210615013309.2833323-9-danielhb413@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210615013309.2833323-1-danielhb413@gmail.com> References: <20210615013309.2833323-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::736; envelope-from=danielhb413@gmail.com; helo=mail-qk1-x736.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aneesh.kumar@linux.ibm.com, Daniel Henrique Barboza , qemu-ppc@nongnu.org, groug@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" FORM2 NUMA affinity is prepared to deal with memory/cpu less NUMA nodes. This is used by the DAX KMEM driver to locate a PAPR SCM device that has a different latency than the original NUMA node from the regular memory. Move this verification to FORM1 affinity code. Signed-off-by: Daniel Henrique Barboza --- hw/ppc/spapr.c | 33 --------------------------------- hw/ppc/spapr_numa.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index c70b8b2f44..e42bfd314b 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2772,39 +2772,6 @@ static void spapr_machine_init(MachineState *machine) /* init CPUs */ spapr_init_cpus(spapr); - /* - * check we don't have a memory-less/cpu-less NUMA node - * Firmware relies on the existing memory/cpu topology to provide the - * NUMA topology to the kernel. - * And the linux kernel needs to know the NUMA topology at start - * to be able to hotplug CPUs later. - */ - if (machine->numa_state->num_nodes) { - for (i = 0; i < machine->numa_state->num_nodes; ++i) { - /* check for memory-less node */ - if (machine->numa_state->nodes[i].node_mem == 0) { - CPUState *cs; - int found = 0; - /* check for cpu-less node */ - CPU_FOREACH(cs) { - PowerPCCPU *cpu = POWERPC_CPU(cs); - if (cpu->node_id == i) { - found = 1; - break; - } - } - /* memory-less and cpu-less node */ - if (!found) { - error_report( - "Memory-less/cpu-less nodes are not supported (node %d)", - i); - exit(1); - } - } - } - - } - spapr->gpu_numa_id = spapr_numa_initial_nvgpu_numa_id(machine); if ((!kvm_enabled() || kvmppc_has_cap_mmu_radix()) && diff --git a/hw/ppc/spapr_numa.c b/hw/ppc/spapr_numa.c index 0cabb6757f..c7b0745455 100644 --- a/hw/ppc/spapr_numa.c +++ b/hw/ppc/spapr_numa.c @@ -162,6 +162,39 @@ static void spapr_numa_FORM1_affinity_init(SpaprMachineState *spapr, MachineState *machine) { bool using_legacy_numa = spapr_machine_using_legacy_numa(spapr); + int i; + + /* + * check we don't have a memory-less/cpu-less NUMA node + * Firmware relies on the existing memory/cpu topology to provide the + * NUMA topology to the kernel. + * And the linux kernel needs to know the NUMA topology at start + * to be able to hotplug CPUs later. + */ + if (machine->numa_state->num_nodes) { + for (i = 0; i < machine->numa_state->num_nodes; ++i) { + /* check for memory-less node */ + if (machine->numa_state->nodes[i].node_mem == 0) { + CPUState *cs; + int found = 0; + /* check for cpu-less node */ + CPU_FOREACH(cs) { + PowerPCCPU *cpu = POWERPC_CPU(cs); + if (cpu->node_id == i) { + found = 1; + break; + } + } + /* memory-less and cpu-less node */ + if (!found) { + error_report( + "Memory-less/cpu-less nodes are not supported (node %d)", + i); + exit(1); + } + } + } + } /* * Legacy NUMA guests (pseries-5.1 and older, or guests with only -- 2.31.1