Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp919722rwr; Wed, 19 Apr 2023 15:28:46 -0700 (PDT) X-Google-Smtp-Source: AKy350bnVywxFLta50q9srYotK9eHaZiel75GHOuIU/RhElBKAUqaw36qChWeShtv34HoOFPoawd X-Received: by 2002:a05:6a20:244a:b0:f0:a27:2f96 with SMTP id t10-20020a056a20244a00b000f00a272f96mr25282pzc.50.1681943326338; Wed, 19 Apr 2023 15:28:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681943326; cv=none; d=google.com; s=arc-20160816; b=Z2ChhYH08J18oGA+WyslHE2QgC84TF/nkN0+Bt/MA4/YP/yFIeh2KyEITbFY71+LqR XgCej6301caXcBZf+93xy5VtqoWAGKVaw2cgnsZm27tuNJO4P7vXRI1ggxI5kV9BeKaz jcOfCbcgIePa1tWlbo1Wd1XQQtLDEItt4BhYW6xdKOQWjUl2ukv5xjDP8e9wYe0/LxwL MT8p6jP693kcXnYBir2x5b/ZoP1hyW8HbOFYVYPUdYU+uyusMzv/0O4jTqvLvKnewFps ZP6rfI3k47ioHhOzmwa34iDQgVDbaVYMd88Oy9Yw1a+UwbR6bPR06y5pZBtLfmET5jtP Rq9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=92JmYNvjI4h3x1v84zDdO04a6NNcBv03E/psDBTJE8A=; b=b2WvDe91Zv2wDQuG+HWkE1NWwR9cRJSh5eQT1lkuoEBVwVsCtpa/0GMjuvJ/0xP5X+ R6mVGtUGe7qK2Z3w3/Xw38LEe0UfQp+L/4MqEGgQqKz2+KFReLnafJqkKrb/jyTix6jr 5xmOh9v9Iqz3gijmiHGJ2g8r0s9j3xEtWP1QC6bGMTSeFffiYMATbiQaHVqJe0eQCFt7 yaU9U/TLKVNDxcKphYc1Ru3niOkhm10FQFHgNzHzt8NDK2KUb7NWJIHwPvSQRh7q7mkQ CiZz/WFd/rJNsIrajYbNqw3CN5JqC1uy5dQnj5SziZwhtdUt+CcIhpWU2BGt3SbzlFAc rZWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=nUPF7sXf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b67-20020a62cf46000000b0063c29725444si8360704pfg.347.2023.04.19.15.28.32; Wed, 19 Apr 2023 15:28:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=nUPF7sXf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232191AbjDSW1n (ORCPT + 99 others); Wed, 19 Apr 2023 18:27:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232020AbjDSW1J (ORCPT ); Wed, 19 Apr 2023 18:27:09 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1488D309 for ; Wed, 19 Apr 2023 15:25:46 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-517bb01bac9so218160a12.0 for ; Wed, 19 Apr 2023 15:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1681943059; x=1684535059; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=92JmYNvjI4h3x1v84zDdO04a6NNcBv03E/psDBTJE8A=; b=nUPF7sXfdzfSW6QquvIfaq4GAfSYyZeAk0mT1xklq8pqmC8JoWNIvCjy+zgsODVUHq O1IjPJuK8sxnkfCXOFdrW+u9RpzMDpy7y7UdhAG0oCuYW3dH8GSGsOh9ODDRIxw2eaFz bkM34qwDSq7IzfX047RwYqZPP8OQknDg9R1karBknWrofSn/KUs6wUf/rHdpra1bOATf rzsEvtKv0XMZjsFArXphtLo3X7lGUkjGEGkW6yljl786vgCvygViLOvHooAc3u8hDTWy WbwJ4EH+yr+KTGNMLcFTkEfYKE8eHBN2A40w7EVpD08O7tCunWfP2Fwi90JATCfWffYG bUcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681943059; x=1684535059; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=92JmYNvjI4h3x1v84zDdO04a6NNcBv03E/psDBTJE8A=; b=PJy43iOoVWJzAXxi8o0u5f+adRyFG3jb05p5qHkoaVwLMb908wQ5KgaqkOpZnAGTOF MtUoGNSk1LR86Ak9203U0qP1y3id+UX+Z0cFXSBrGjpqdqeat29woucCuVLa3cGN40G1 0Uiuvz5gRNW5b3f2nbzuufWezhBKOgQI01itUaLnoB8JjPN3vVo3MEPidXy7a7aYazLY zeIGFrgF/Ct7UrEdEvwsRG8F3vB6S6PkrzRakyWMVyH+kpqGncTx3XfwzlqQSrPhSqXb YaV83pC0yqMFbuxkN5aG73DQYApKPRESbv5bwLGRQeRcG8jhPvaSWW/tamP9do6EC6r9 YmOg== X-Gm-Message-State: AAQBX9czsD3FeNz2uTL4IbV2LFYfgpMwcTQ2CRAAL3riodDDJ2jZF5fV plt199bizFE6Be192qTDelu409b4z4rURw/BbBg= X-Received: by 2002:a17:90a:cf81:b0:247:1f35:3314 with SMTP id i1-20020a17090acf8100b002471f353314mr3406729pju.48.1681943059019; Wed, 19 Apr 2023 15:24:19 -0700 (PDT) Received: from atishp.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id e4-20020a170902744400b001a681fb3e77sm11867810plt.44.2023.04.19.15.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 15:24:18 -0700 (PDT) From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Rajnesh Kanwal , Alexandre Ghiti , Andrew Jones , Andrew Morton , Anup Patel , Atish Patra , Suzuki K Poulose , Will Deacon , Marc Zyngier , Sean Christopherson , linux-coco@lists.linux.dev, Dylan Reid , abrestic@rivosinc.com, Samuel Ortiz , Jiri Slaby , kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, Palmer Dabbelt , Paolo Bonzini , Uladzislau Rezki Subject: [RFC kvmtool 09/10] riscv: Don't emit MMIO devices for CoVE VM. Date: Wed, 19 Apr 2023 15:23:49 -0700 Message-Id: <20230419222350.3604274-10-atishp@rivosinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230419222350.3604274-1-atishp@rivosinc.com> References: <20230419222350.3604274-1-atishp@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rajnesh Kanwal The CoVE VMs do not support MMIO devices yet. Do not emit MMIO device nodes for CoVE VMs. Signed-off-by: Rajnesh Kanwal --- riscv/fdt.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/riscv/fdt.c b/riscv/fdt.c index 07ec336..a7d32b3 100644 --- a/riscv/fdt.c +++ b/riscv/fdt.c @@ -210,22 +210,25 @@ static int setup_fdt(struct kvm *kvm) riscv_irqchip_phandle)); _FDT(fdt_property(fdt, "ranges", NULL, 0)); - /* Virtio MMIO devices */ - dev_hdr = device__first_dev(DEVICE_BUS_MMIO); - while (dev_hdr) { - generate_mmio_fdt_nodes = dev_hdr->data; - generate_mmio_fdt_nodes(fdt, dev_hdr, - riscv__generate_irq_prop); - dev_hdr = device__next_dev(dev_hdr); - } + /* CoVE VMs do not support MMIO devices yet */ + if (!kvm->cfg.arch.cove_vm) { + /* Virtio MMIO devices */ + dev_hdr = device__first_dev(DEVICE_BUS_MMIO); + while (dev_hdr) { + generate_mmio_fdt_nodes = dev_hdr->data; + generate_mmio_fdt_nodes(fdt, dev_hdr, + riscv__generate_irq_prop); + dev_hdr = device__next_dev(dev_hdr); + } - /* IOPORT devices */ - dev_hdr = device__first_dev(DEVICE_BUS_IOPORT); - while (dev_hdr) { - generate_mmio_fdt_nodes = dev_hdr->data; - generate_mmio_fdt_nodes(fdt, dev_hdr, - riscv__generate_irq_prop); - dev_hdr = device__next_dev(dev_hdr); + /* IOPORT devices */ + dev_hdr = device__first_dev(DEVICE_BUS_IOPORT); + while (dev_hdr) { + generate_mmio_fdt_nodes = dev_hdr->data; + generate_mmio_fdt_nodes(fdt, dev_hdr, + riscv__generate_irq_prop); + dev_hdr = device__next_dev(dev_hdr); + } } /* PCI host controller */ -- 2.25.1