From patchwork Thu Nov 5 17:51:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 319874 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 F0B85C4741F for ; Thu, 5 Nov 2020 17:53:48 +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 0E2FB20715 for ; Thu, 5 Nov 2020 17:53:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BiBSg2fp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E2FB20715 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kajSF-0005a6-0j for qemu-devel@archiver.kernel.org; Thu, 05 Nov 2020 12:53:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajQj-00044Z-Jd for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:13 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:35419) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kajQW-0004p3-BF for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:13 -0500 Received: by mail-wm1-x344.google.com with SMTP id h22so2468549wmb.0 for ; Thu, 05 Nov 2020 09:51:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Uv3S+O6k0+8H3cg+MrNAFsYprf26P4Y8mIZSm1+6Z60=; b=BiBSg2fpqPmF5oISxz1QtLb3N2KsdEkZItyHQdoEft1/VSMoJ55DtQ5dtzPgDT9TZA 8QSVl2YQbqQROrGRCS1cmP/i4t1e6QxxUskpq1gnp+2CwY33Ocbou9wyAMQ/XVrLYiQd juNYRT/OLOteltD6JnOicb5L+GsnOMnvBxReoXpZuFg4EC1XWS+vSCUwiMuubr4OSuyc Zd1l4ga66HDkUE6PjBS3p18TpAXdWqmGkfRBSnZ0aBcnGretwE7K5hJn3HHniI4ZHD5F 6Gq+T05x2Ch2+7Yvabj5k3w/ZpGYxemxf5SeHgnND1jF5kt0GIp4Re5BahjY7ENXigMG 14DA== 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=Uv3S+O6k0+8H3cg+MrNAFsYprf26P4Y8mIZSm1+6Z60=; b=Jq54QpfyvEbc2JKW6M84UcBNhmb8C214eDTsI679Lc+l08IA+oy7O4Hdb++RxMwq7w ehp099NhTJEHPBxl/QJPc84KGEacFHOo0su3vuw2CXo7ja2ReKSd9/3axeg/AOBbPvMS YGFkvgQmPKOI/lU8I3vASQSpcwPFbbFhy0V5cBawoPF3CuwG7CvlFNNqQkg3vme0OwEg DOzzmiieIzEn22mk+/+aUneoqID3qu52zSLcNPSG4tLqLE6SvDsWkDOe4jBGtfU0/e8A XMytZ6ewtPq/ZP3xmMWoowfrRbLcP72Hlnff3WxAq45UEl708g/P9Fy5ahBgYL9/BqC1 OchA== X-Gm-Message-State: AOAM5314mukNhIHLaencCP4WgFZgOHaGRvtmh1QGoxb34u0aPtaFLjLn dgXLp7hgwYwizr0X6jP4pdtZJQ== X-Google-Smtp-Source: ABdhPJzNOKFgSa/cuwuQovnuc0/kwtDKJ1wscMsdfnJeFwjgoj9ALG/x8NNzFbP7B/y2A5B6QULbEQ== X-Received: by 2002:a1c:2d53:: with SMTP id t80mr3809033wmt.125.1604598718640; Thu, 05 Nov 2020 09:51:58 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c10sm3493296wmb.20.2020.11.05.09.51.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:51:54 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C5CEF1FF87; Thu, 5 Nov 2020 17:51:53 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 01/15] hw/board: promote fdt from ARM VirtMachineState to MachineState Date: Thu, 5 Nov 2020 17:51:39 +0000 Message-Id: <20201105175153.30489-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: Peter Maydell , julien@xen.org, Eduardo Habkost , masami.hiramatsu@linaro.org, andre.przywara@arm.com, stefano.stabellini@linaro.org, takahiro.akashi@linaro.org, "open list:Virt" , stefano.stabellini@xilinx.com, =?utf-8?q?Alex_Benn=C3=A9e?= , stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The use of FDT's is quite common across our various platforms. To allow the generic loader to tweak it we need to make it available in the generic state. This creates the field and migrates the initial user to use the generic field. Other boards will be updated in later patches. Signed-off-by: Alex Bennée Message-Id: <20201021170842.25762-2-alex.bennee@linaro.org> Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- include/hw/arm/virt.h | 1 - include/hw/boards.h | 1 + hw/arm/virt.c | 322 ++++++++++++++++++++++-------------------- 3 files changed, 170 insertions(+), 154 deletions(-) diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index aad6d69841..648e5d6791 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -152,7 +152,6 @@ struct VirtMachineState { char *pciehb_nodename; const int *irqmap; int smp_cpus; - void *fdt; int fdt_size; uint32_t clock_phandle; uint32_t gic_phandle; diff --git a/include/hw/boards.h b/include/hw/boards.h index a49e3a6b44..7b835e361c 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -257,6 +257,7 @@ struct MachineState { /*< public >*/ + void *fdt; char *dtb; char *dumpdtb; int phandle_start; diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 27dbeb549e..14ba077bb0 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -216,14 +216,14 @@ static bool cpu_type_valid(const char *cpu) return false; } -static void create_kaslr_seed(VirtMachineState *vms, const char *node) +static void create_kaslr_seed(MachineState *ms, const char *node) { uint64_t seed; if (qemu_guest_getrandom(&seed, sizeof(seed), NULL)) { return; } - qemu_fdt_setprop_u64(vms->fdt, node, "kaslr-seed", seed); + qemu_fdt_setprop_u64(ms->fdt, node, "kaslr-seed", seed); } static void create_fdt(VirtMachineState *vms) @@ -237,7 +237,7 @@ static void create_fdt(VirtMachineState *vms) exit(1); } - vms->fdt = fdt; + ms->fdt = fdt; /* Header */ qemu_fdt_setprop_string(fdt, "/", "compatible", "linux,dummy-virt"); @@ -246,11 +246,11 @@ static void create_fdt(VirtMachineState *vms) /* /chosen must exist for load_dtb to fill in necessary properties later */ qemu_fdt_add_subnode(fdt, "/chosen"); - create_kaslr_seed(vms, "/chosen"); + create_kaslr_seed(ms, "/chosen"); if (vms->secure) { qemu_fdt_add_subnode(fdt, "/secure-chosen"); - create_kaslr_seed(vms, "/secure-chosen"); + create_kaslr_seed(ms, "/secure-chosen"); } /* Clock node, for the benefit of the UART. The kernel device tree @@ -314,6 +314,7 @@ static void fdt_add_timer_nodes(const VirtMachineState *vms) ARMCPU *armcpu; VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); uint32_t irqflags = GIC_FDT_IRQ_FLAGS_LEVEL_HI; + MachineState *ms = MACHINE(vms); if (vmc->claim_edge_triggered_timers) { irqflags = GIC_FDT_IRQ_FLAGS_EDGE_LO_HI; @@ -325,19 +326,19 @@ static void fdt_add_timer_nodes(const VirtMachineState *vms) (1 << vms->smp_cpus) - 1); } - qemu_fdt_add_subnode(vms->fdt, "/timer"); + qemu_fdt_add_subnode(ms->fdt, "/timer"); armcpu = ARM_CPU(qemu_get_cpu(0)); if (arm_feature(&armcpu->env, ARM_FEATURE_V8)) { const char compat[] = "arm,armv8-timer\0arm,armv7-timer"; - qemu_fdt_setprop(vms->fdt, "/timer", "compatible", + qemu_fdt_setprop(ms->fdt, "/timer", "compatible", compat, sizeof(compat)); } else { - qemu_fdt_setprop_string(vms->fdt, "/timer", "compatible", + qemu_fdt_setprop_string(ms->fdt, "/timer", "compatible", "arm,armv7-timer"); } - qemu_fdt_setprop(vms->fdt, "/timer", "always-on", NULL, 0); - qemu_fdt_setprop_cells(vms->fdt, "/timer", "interrupts", + qemu_fdt_setprop(ms->fdt, "/timer", "always-on", NULL, 0); + qemu_fdt_setprop_cells(ms->fdt, "/timer", "interrupts", GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_S_EL1_IRQ, irqflags, GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_NS_EL1_IRQ, irqflags, GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_VIRT_IRQ, irqflags, @@ -372,36 +373,36 @@ static void fdt_add_cpu_nodes(const VirtMachineState *vms) } } - qemu_fdt_add_subnode(vms->fdt, "/cpus"); - qemu_fdt_setprop_cell(vms->fdt, "/cpus", "#address-cells", addr_cells); - qemu_fdt_setprop_cell(vms->fdt, "/cpus", "#size-cells", 0x0); + qemu_fdt_add_subnode(ms->fdt, "/cpus"); + qemu_fdt_setprop_cell(ms->fdt, "/cpus", "#address-cells", addr_cells); + qemu_fdt_setprop_cell(ms->fdt, "/cpus", "#size-cells", 0x0); for (cpu = vms->smp_cpus - 1; cpu >= 0; cpu--) { char *nodename = g_strdup_printf("/cpus/cpu@%d", cpu); ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(cpu)); CPUState *cs = CPU(armcpu); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, "device_type", "cpu"); - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "device_type", "cpu"); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", armcpu->dtb_compatible); if (vms->psci_conduit != QEMU_PSCI_CONDUIT_DISABLED && vms->smp_cpus > 1) { - qemu_fdt_setprop_string(vms->fdt, nodename, + qemu_fdt_setprop_string(ms->fdt, nodename, "enable-method", "psci"); } if (addr_cells == 2) { - qemu_fdt_setprop_u64(vms->fdt, nodename, "reg", + qemu_fdt_setprop_u64(ms->fdt, nodename, "reg", armcpu->mp_affinity); } else { - qemu_fdt_setprop_cell(vms->fdt, nodename, "reg", + qemu_fdt_setprop_cell(ms->fdt, nodename, "reg", armcpu->mp_affinity); } if (ms->possible_cpus->cpus[cs->cpu_index].props.has_node_id) { - qemu_fdt_setprop_cell(vms->fdt, nodename, "numa-node-id", + qemu_fdt_setprop_cell(ms->fdt, nodename, "numa-node-id", ms->possible_cpus->cpus[cs->cpu_index].props.node_id); } @@ -412,71 +413,74 @@ static void fdt_add_cpu_nodes(const VirtMachineState *vms) static void fdt_add_its_gic_node(VirtMachineState *vms) { char *nodename; + MachineState *ms = MACHINE(vms); - vms->msi_phandle = qemu_fdt_alloc_phandle(vms->fdt); + vms->msi_phandle = qemu_fdt_alloc_phandle(ms->fdt); nodename = g_strdup_printf("/intc/its@%" PRIx64, vms->memmap[VIRT_GIC_ITS].base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "arm,gic-v3-its"); - qemu_fdt_setprop(vms->fdt, nodename, "msi-controller", NULL, 0); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop(ms->fdt, nodename, "msi-controller", NULL, 0); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, vms->memmap[VIRT_GIC_ITS].base, 2, vms->memmap[VIRT_GIC_ITS].size); - qemu_fdt_setprop_cell(vms->fdt, nodename, "phandle", vms->msi_phandle); + qemu_fdt_setprop_cell(ms->fdt, nodename, "phandle", vms->msi_phandle); g_free(nodename); } static void fdt_add_v2m_gic_node(VirtMachineState *vms) { + MachineState *ms = MACHINE(vms); char *nodename; nodename = g_strdup_printf("/intc/v2m@%" PRIx64, vms->memmap[VIRT_GIC_V2M].base); - vms->msi_phandle = qemu_fdt_alloc_phandle(vms->fdt); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", + vms->msi_phandle = qemu_fdt_alloc_phandle(ms->fdt); + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "arm,gic-v2m-frame"); - qemu_fdt_setprop(vms->fdt, nodename, "msi-controller", NULL, 0); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop(ms->fdt, nodename, "msi-controller", NULL, 0); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, vms->memmap[VIRT_GIC_V2M].base, 2, vms->memmap[VIRT_GIC_V2M].size); - qemu_fdt_setprop_cell(vms->fdt, nodename, "phandle", vms->msi_phandle); + qemu_fdt_setprop_cell(ms->fdt, nodename, "phandle", vms->msi_phandle); g_free(nodename); } static void fdt_add_gic_node(VirtMachineState *vms) { + MachineState *ms = MACHINE(vms); char *nodename; - vms->gic_phandle = qemu_fdt_alloc_phandle(vms->fdt); - qemu_fdt_setprop_cell(vms->fdt, "/", "interrupt-parent", vms->gic_phandle); + vms->gic_phandle = qemu_fdt_alloc_phandle(ms->fdt); + qemu_fdt_setprop_cell(ms->fdt, "/", "interrupt-parent", vms->gic_phandle); nodename = g_strdup_printf("/intc@%" PRIx64, vms->memmap[VIRT_GIC_DIST].base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_cell(vms->fdt, nodename, "#interrupt-cells", 3); - qemu_fdt_setprop(vms->fdt, nodename, "interrupt-controller", NULL, 0); - qemu_fdt_setprop_cell(vms->fdt, nodename, "#address-cells", 0x2); - qemu_fdt_setprop_cell(vms->fdt, nodename, "#size-cells", 0x2); - qemu_fdt_setprop(vms->fdt, nodename, "ranges", NULL, 0); + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_cell(ms->fdt, nodename, "#interrupt-cells", 3); + qemu_fdt_setprop(ms->fdt, nodename, "interrupt-controller", NULL, 0); + qemu_fdt_setprop_cell(ms->fdt, nodename, "#address-cells", 0x2); + qemu_fdt_setprop_cell(ms->fdt, nodename, "#size-cells", 0x2); + qemu_fdt_setprop(ms->fdt, nodename, "ranges", NULL, 0); if (vms->gic_version == VIRT_GIC_VERSION_3) { int nb_redist_regions = virt_gicv3_redist_region_count(vms); - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "arm,gic-v3"); - qemu_fdt_setprop_cell(vms->fdt, nodename, + qemu_fdt_setprop_cell(ms->fdt, nodename, "#redistributor-regions", nb_redist_regions); if (nb_redist_regions == 1) { - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, vms->memmap[VIRT_GIC_DIST].base, 2, vms->memmap[VIRT_GIC_DIST].size, 2, vms->memmap[VIRT_GIC_REDIST].base, 2, vms->memmap[VIRT_GIC_REDIST].size); } else { - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, vms->memmap[VIRT_GIC_DIST].base, 2, vms->memmap[VIRT_GIC_DIST].size, 2, vms->memmap[VIRT_GIC_REDIST].base, @@ -486,22 +490,22 @@ static void fdt_add_gic_node(VirtMachineState *vms) } if (vms->virt) { - qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts", + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", GIC_FDT_IRQ_TYPE_PPI, ARCH_GIC_MAINT_IRQ, GIC_FDT_IRQ_FLAGS_LEVEL_HI); } } else { /* 'cortex-a15-gic' means 'GIC v2' */ - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "arm,cortex-a15-gic"); if (!vms->virt) { - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, vms->memmap[VIRT_GIC_DIST].base, 2, vms->memmap[VIRT_GIC_DIST].size, 2, vms->memmap[VIRT_GIC_CPU].base, 2, vms->memmap[VIRT_GIC_CPU].size); } else { - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, vms->memmap[VIRT_GIC_DIST].base, 2, vms->memmap[VIRT_GIC_DIST].size, 2, vms->memmap[VIRT_GIC_CPU].base, @@ -510,13 +514,13 @@ static void fdt_add_gic_node(VirtMachineState *vms) 2, vms->memmap[VIRT_GIC_HYP].size, 2, vms->memmap[VIRT_GIC_VCPU].base, 2, vms->memmap[VIRT_GIC_VCPU].size); - qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts", + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", GIC_FDT_IRQ_TYPE_PPI, ARCH_GIC_MAINT_IRQ, GIC_FDT_IRQ_FLAGS_LEVEL_HI); } } - qemu_fdt_setprop_cell(vms->fdt, nodename, "phandle", vms->gic_phandle); + qemu_fdt_setprop_cell(ms->fdt, nodename, "phandle", vms->gic_phandle); g_free(nodename); } @@ -524,6 +528,7 @@ static void fdt_add_pmu_nodes(const VirtMachineState *vms) { ARMCPU *armcpu = ARM_CPU(first_cpu); uint32_t irqflags = GIC_FDT_IRQ_FLAGS_LEVEL_HI; + MachineState *ms = MACHINE(vms); if (!arm_feature(&armcpu->env, ARM_FEATURE_PMU)) { assert(!object_property_get_bool(OBJECT(armcpu), "pmu", NULL)); @@ -536,12 +541,12 @@ static void fdt_add_pmu_nodes(const VirtMachineState *vms) (1 << vms->smp_cpus) - 1); } - qemu_fdt_add_subnode(vms->fdt, "/pmu"); + qemu_fdt_add_subnode(ms->fdt, "/pmu"); if (arm_feature(&armcpu->env, ARM_FEATURE_V8)) { const char compat[] = "arm,armv8-pmuv3"; - qemu_fdt_setprop(vms->fdt, "/pmu", "compatible", + qemu_fdt_setprop(ms->fdt, "/pmu", "compatible", compat, sizeof(compat)); - qemu_fdt_setprop_cells(vms->fdt, "/pmu", "interrupts", + qemu_fdt_setprop_cells(ms->fdt, "/pmu", "interrupts", GIC_FDT_IRQ_TYPE_PPI, VIRTUAL_PMU_IRQ, irqflags); } } @@ -747,6 +752,7 @@ static void create_uart(const VirtMachineState *vms, int uart, const char clocknames[] = "uartclk\0apb_pclk"; DeviceState *dev = qdev_new(TYPE_PL011); SysBusDevice *s = SYS_BUS_DEVICE(dev); + MachineState *ms = MACHINE(vms); qdev_prop_set_chr(dev, "chardev", chr); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); @@ -755,28 +761,28 @@ static void create_uart(const VirtMachineState *vms, int uart, sysbus_connect_irq(s, 0, qdev_get_gpio_in(vms->gic, irq)); nodename = g_strdup_printf("/pl011@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, nodename); + qemu_fdt_add_subnode(ms->fdt, nodename); /* Note that we can't use setprop_string because of the embedded NUL */ - qemu_fdt_setprop(vms->fdt, nodename, "compatible", + qemu_fdt_setprop(ms->fdt, nodename, "compatible", compat, sizeof(compat)); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base, 2, size); - qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts", + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", GIC_FDT_IRQ_TYPE_SPI, irq, GIC_FDT_IRQ_FLAGS_LEVEL_HI); - qemu_fdt_setprop_cells(vms->fdt, nodename, "clocks", + qemu_fdt_setprop_cells(ms->fdt, nodename, "clocks", vms->clock_phandle, vms->clock_phandle); - qemu_fdt_setprop(vms->fdt, nodename, "clock-names", + qemu_fdt_setprop(ms->fdt, nodename, "clock-names", clocknames, sizeof(clocknames)); if (uart == VIRT_UART) { - qemu_fdt_setprop_string(vms->fdt, "/chosen", "stdout-path", nodename); + qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", nodename); } else { /* Mark as not usable by the normal world */ - qemu_fdt_setprop_string(vms->fdt, nodename, "status", "disabled"); - qemu_fdt_setprop_string(vms->fdt, nodename, "secure-status", "okay"); + qemu_fdt_setprop_string(ms->fdt, nodename, "status", "disabled"); + qemu_fdt_setprop_string(ms->fdt, nodename, "secure-status", "okay"); - qemu_fdt_setprop_string(vms->fdt, "/secure-chosen", "stdout-path", + qemu_fdt_setprop_string(ms->fdt, "/secure-chosen", "stdout-path", nodename); } @@ -790,19 +796,20 @@ static void create_rtc(const VirtMachineState *vms) hwaddr size = vms->memmap[VIRT_RTC].size; int irq = vms->irqmap[VIRT_RTC]; const char compat[] = "arm,pl031\0arm,primecell"; + MachineState *ms = MACHINE(vms); sysbus_create_simple("pl031", base, qdev_get_gpio_in(vms->gic, irq)); nodename = g_strdup_printf("/pl031@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop(vms->fdt, nodename, "compatible", compat, sizeof(compat)); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop(ms->fdt, nodename, "compatible", compat, sizeof(compat)); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base, 2, size); - qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts", + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", GIC_FDT_IRQ_TYPE_SPI, irq, GIC_FDT_IRQ_FLAGS_LEVEL_HI); - qemu_fdt_setprop_cell(vms->fdt, nodename, "clocks", vms->clock_phandle); - qemu_fdt_setprop_string(vms->fdt, nodename, "clock-names", "apb_pclk"); + qemu_fdt_setprop_cell(ms->fdt, nodename, "clocks", vms->clock_phandle); + qemu_fdt_setprop_string(ms->fdt, nodename, "clock-names", "apb_pclk"); g_free(nodename); } @@ -827,38 +834,39 @@ static void create_gpio(const VirtMachineState *vms) hwaddr size = vms->memmap[VIRT_GPIO].size; int irq = vms->irqmap[VIRT_GPIO]; const char compat[] = "arm,pl061\0arm,primecell"; + MachineState *ms = MACHINE(vms); pl061_dev = sysbus_create_simple("pl061", base, qdev_get_gpio_in(vms->gic, irq)); - uint32_t phandle = qemu_fdt_alloc_phandle(vms->fdt); + uint32_t phandle = qemu_fdt_alloc_phandle(ms->fdt); nodename = g_strdup_printf("/pl061@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base, 2, size); - qemu_fdt_setprop(vms->fdt, nodename, "compatible", compat, sizeof(compat)); - qemu_fdt_setprop_cell(vms->fdt, nodename, "#gpio-cells", 2); - qemu_fdt_setprop(vms->fdt, nodename, "gpio-controller", NULL, 0); - qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts", + qemu_fdt_setprop(ms->fdt, nodename, "compatible", compat, sizeof(compat)); + qemu_fdt_setprop_cell(ms->fdt, nodename, "#gpio-cells", 2); + qemu_fdt_setprop(ms->fdt, nodename, "gpio-controller", NULL, 0); + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", GIC_FDT_IRQ_TYPE_SPI, irq, GIC_FDT_IRQ_FLAGS_LEVEL_HI); - qemu_fdt_setprop_cell(vms->fdt, nodename, "clocks", vms->clock_phandle); - qemu_fdt_setprop_string(vms->fdt, nodename, "clock-names", "apb_pclk"); - qemu_fdt_setprop_cell(vms->fdt, nodename, "phandle", phandle); + qemu_fdt_setprop_cell(ms->fdt, nodename, "clocks", vms->clock_phandle); + qemu_fdt_setprop_string(ms->fdt, nodename, "clock-names", "apb_pclk"); + qemu_fdt_setprop_cell(ms->fdt, nodename, "phandle", phandle); gpio_key_dev = sysbus_create_simple("gpio-key", -1, qdev_get_gpio_in(pl061_dev, 3)); - qemu_fdt_add_subnode(vms->fdt, "/gpio-keys"); - qemu_fdt_setprop_string(vms->fdt, "/gpio-keys", "compatible", "gpio-keys"); - qemu_fdt_setprop_cell(vms->fdt, "/gpio-keys", "#size-cells", 0); - qemu_fdt_setprop_cell(vms->fdt, "/gpio-keys", "#address-cells", 1); + qemu_fdt_add_subnode(ms->fdt, "/gpio-keys"); + qemu_fdt_setprop_string(ms->fdt, "/gpio-keys", "compatible", "gpio-keys"); + qemu_fdt_setprop_cell(ms->fdt, "/gpio-keys", "#size-cells", 0); + qemu_fdt_setprop_cell(ms->fdt, "/gpio-keys", "#address-cells", 1); - qemu_fdt_add_subnode(vms->fdt, "/gpio-keys/poweroff"); - qemu_fdt_setprop_string(vms->fdt, "/gpio-keys/poweroff", + qemu_fdt_add_subnode(ms->fdt, "/gpio-keys/poweroff"); + qemu_fdt_setprop_string(ms->fdt, "/gpio-keys/poweroff", "label", "GPIO Key Poweroff"); - qemu_fdt_setprop_cell(vms->fdt, "/gpio-keys/poweroff", "linux,code", + qemu_fdt_setprop_cell(ms->fdt, "/gpio-keys/poweroff", "linux,code", KEY_POWER); - qemu_fdt_setprop_cells(vms->fdt, "/gpio-keys/poweroff", + qemu_fdt_setprop_cells(ms->fdt, "/gpio-keys/poweroff", "gpios", phandle, 3, 0); g_free(nodename); } @@ -867,6 +875,7 @@ static void create_virtio_devices(const VirtMachineState *vms) { int i; hwaddr size = vms->memmap[VIRT_MMIO].size; + MachineState *ms = MACHINE(vms); /* We create the transports in forwards order. Since qbus_realize() * prepends (not appends) new child buses, the incrementing loop below will @@ -916,15 +925,15 @@ static void create_virtio_devices(const VirtMachineState *vms) hwaddr base = vms->memmap[VIRT_MMIO].base + i * size; nodename = g_strdup_printf("/virtio_mmio@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "virtio,mmio"); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base, 2, size); - qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts", + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", GIC_FDT_IRQ_TYPE_SPI, irq, GIC_FDT_IRQ_FLAGS_EDGE_LO_HI); - qemu_fdt_setprop(vms->fdt, nodename, "dma-coherent", NULL, 0); + qemu_fdt_setprop(ms->fdt, nodename, "dma-coherent", NULL, 0); g_free(nodename); } } @@ -1005,17 +1014,18 @@ static void virt_flash_fdt(VirtMachineState *vms, { hwaddr flashsize = vms->memmap[VIRT_FLASH].size / 2; hwaddr flashbase = vms->memmap[VIRT_FLASH].base; + MachineState *ms = MACHINE(vms); char *nodename; if (sysmem == secure_sysmem) { /* Report both flash devices as a single node in the DT */ nodename = g_strdup_printf("/flash@%" PRIx64, flashbase); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", "cfi-flash"); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "cfi-flash"); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, flashbase, 2, flashsize, 2, flashbase + flashsize, 2, flashsize); - qemu_fdt_setprop_cell(vms->fdt, nodename, "bank-width", 4); + qemu_fdt_setprop_cell(ms->fdt, nodename, "bank-width", 4); g_free(nodename); } else { /* @@ -1023,21 +1033,21 @@ static void virt_flash_fdt(VirtMachineState *vms, * only visible to the secure world. */ nodename = g_strdup_printf("/secflash@%" PRIx64, flashbase); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", "cfi-flash"); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "cfi-flash"); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, flashbase, 2, flashsize); - qemu_fdt_setprop_cell(vms->fdt, nodename, "bank-width", 4); - qemu_fdt_setprop_string(vms->fdt, nodename, "status", "disabled"); - qemu_fdt_setprop_string(vms->fdt, nodename, "secure-status", "okay"); + qemu_fdt_setprop_cell(ms->fdt, nodename, "bank-width", 4); + qemu_fdt_setprop_string(ms->fdt, nodename, "status", "disabled"); + qemu_fdt_setprop_string(ms->fdt, nodename, "secure-status", "okay"); g_free(nodename); nodename = g_strdup_printf("/flash@%" PRIx64, flashbase); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", "cfi-flash"); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "cfi-flash"); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, flashbase + flashsize, 2, flashsize); - qemu_fdt_setprop_cell(vms->fdt, nodename, "bank-width", 4); + qemu_fdt_setprop_cell(ms->fdt, nodename, "bank-width", 4); g_free(nodename); } } @@ -1102,17 +1112,17 @@ static FWCfgState *create_fw_cfg(const VirtMachineState *vms, AddressSpace *as) fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)ms->smp.cpus); nodename = g_strdup_printf("/fw-cfg@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "qemu,fw-cfg-mmio"); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base, 2, size); - qemu_fdt_setprop(vms->fdt, nodename, "dma-coherent", NULL, 0); + qemu_fdt_setprop(ms->fdt, nodename, "dma-coherent", NULL, 0); g_free(nodename); return fw_cfg; } -static void create_pcie_irq_map(const VirtMachineState *vms, +static void create_pcie_irq_map(const MachineState *ms, uint32_t gic_phandle, int first_irq, const char *nodename) { @@ -1140,10 +1150,10 @@ static void create_pcie_irq_map(const VirtMachineState *vms, } } - qemu_fdt_setprop(vms->fdt, nodename, "interrupt-map", + qemu_fdt_setprop(ms->fdt, nodename, "interrupt-map", full_irq_map, sizeof(full_irq_map)); - qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupt-map-mask", + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupt-map-mask", 0x1800, 0, 0, /* devfn (PCI_SLOT(3)) */ 0x7 /* PCI irq */); } @@ -1159,6 +1169,7 @@ static void create_smmu(const VirtMachineState *vms, hwaddr size = vms->memmap[VIRT_SMMU].size; const char irq_names[] = "eventq\0priq\0cmdq-sync\0gerror"; DeviceState *dev; + MachineState *ms = MACHINE(vms); if (vms->iommu != VIRT_IOMMU_SMMUV3 || !vms->iommu_phandle) { return; @@ -1176,26 +1187,26 @@ static void create_smmu(const VirtMachineState *vms, } node = g_strdup_printf("/smmuv3@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, node); - qemu_fdt_setprop(vms->fdt, node, "compatible", compat, sizeof(compat)); - qemu_fdt_setprop_sized_cells(vms->fdt, node, "reg", 2, base, 2, size); + qemu_fdt_add_subnode(ms->fdt, node); + qemu_fdt_setprop(ms->fdt, node, "compatible", compat, sizeof(compat)); + qemu_fdt_setprop_sized_cells(ms->fdt, node, "reg", 2, base, 2, size); - qemu_fdt_setprop_cells(vms->fdt, node, "interrupts", + qemu_fdt_setprop_cells(ms->fdt, node, "interrupts", GIC_FDT_IRQ_TYPE_SPI, irq , GIC_FDT_IRQ_FLAGS_EDGE_LO_HI, GIC_FDT_IRQ_TYPE_SPI, irq + 1, GIC_FDT_IRQ_FLAGS_EDGE_LO_HI, GIC_FDT_IRQ_TYPE_SPI, irq + 2, GIC_FDT_IRQ_FLAGS_EDGE_LO_HI, GIC_FDT_IRQ_TYPE_SPI, irq + 3, GIC_FDT_IRQ_FLAGS_EDGE_LO_HI); - qemu_fdt_setprop(vms->fdt, node, "interrupt-names", irq_names, + qemu_fdt_setprop(ms->fdt, node, "interrupt-names", irq_names, sizeof(irq_names)); - qemu_fdt_setprop_cell(vms->fdt, node, "clocks", vms->clock_phandle); - qemu_fdt_setprop_string(vms->fdt, node, "clock-names", "apb_pclk"); - qemu_fdt_setprop(vms->fdt, node, "dma-coherent", NULL, 0); + qemu_fdt_setprop_cell(ms->fdt, node, "clocks", vms->clock_phandle); + qemu_fdt_setprop_string(ms->fdt, node, "clock-names", "apb_pclk"); + qemu_fdt_setprop(ms->fdt, node, "dma-coherent", NULL, 0); - qemu_fdt_setprop_cell(vms->fdt, node, "#iommu-cells", 1); + qemu_fdt_setprop_cell(ms->fdt, node, "#iommu-cells", 1); - qemu_fdt_setprop_cell(vms->fdt, node, "phandle", vms->iommu_phandle); + qemu_fdt_setprop_cell(ms->fdt, node, "phandle", vms->iommu_phandle); g_free(node); } @@ -1203,22 +1214,23 @@ static void create_virtio_iommu_dt_bindings(VirtMachineState *vms) { const char compat[] = "virtio,pci-iommu"; uint16_t bdf = vms->virtio_iommu_bdf; + MachineState *ms = MACHINE(vms); char *node; - vms->iommu_phandle = qemu_fdt_alloc_phandle(vms->fdt); + vms->iommu_phandle = qemu_fdt_alloc_phandle(ms->fdt); node = g_strdup_printf("%s/virtio_iommu@%d", vms->pciehb_nodename, bdf); - qemu_fdt_add_subnode(vms->fdt, node); - qemu_fdt_setprop(vms->fdt, node, "compatible", compat, sizeof(compat)); - qemu_fdt_setprop_sized_cells(vms->fdt, node, "reg", + qemu_fdt_add_subnode(ms->fdt, node); + qemu_fdt_setprop(ms->fdt, node, "compatible", compat, sizeof(compat)); + qemu_fdt_setprop_sized_cells(ms->fdt, node, "reg", 1, bdf << 8, 1, 0, 1, 0, 1, 0, 1, 0); - qemu_fdt_setprop_cell(vms->fdt, node, "#iommu-cells", 1); - qemu_fdt_setprop_cell(vms->fdt, node, "phandle", vms->iommu_phandle); + qemu_fdt_setprop_cell(ms->fdt, node, "#iommu-cells", 1); + qemu_fdt_setprop_cell(ms->fdt, node, "phandle", vms->iommu_phandle); g_free(node); - qemu_fdt_setprop_cells(vms->fdt, vms->pciehb_nodename, "iommu-map", + qemu_fdt_setprop_cells(ms->fdt, vms->pciehb_nodename, "iommu-map", 0x0, vms->iommu_phandle, 0x0, bdf, bdf + 1, vms->iommu_phandle, bdf + 1, 0xffff - bdf); } @@ -1243,6 +1255,7 @@ static void create_pcie(VirtMachineState *vms) char *nodename; int i, ecam_id; PCIHostState *pci; + MachineState *ms = MACHINE(vms); dev = qdev_new(TYPE_GPEX_HOST); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); @@ -1302,27 +1315,27 @@ static void create_pcie(VirtMachineState *vms) } nodename = vms->pciehb_nodename = g_strdup_printf("/pcie@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "pci-host-ecam-generic"); - qemu_fdt_setprop_string(vms->fdt, nodename, "device_type", "pci"); - qemu_fdt_setprop_cell(vms->fdt, nodename, "#address-cells", 3); - qemu_fdt_setprop_cell(vms->fdt, nodename, "#size-cells", 2); - qemu_fdt_setprop_cell(vms->fdt, nodename, "linux,pci-domain", 0); - qemu_fdt_setprop_cells(vms->fdt, nodename, "bus-range", 0, + qemu_fdt_setprop_string(ms->fdt, nodename, "device_type", "pci"); + qemu_fdt_setprop_cell(ms->fdt, nodename, "#address-cells", 3); + qemu_fdt_setprop_cell(ms->fdt, nodename, "#size-cells", 2); + qemu_fdt_setprop_cell(ms->fdt, nodename, "linux,pci-domain", 0); + qemu_fdt_setprop_cells(ms->fdt, nodename, "bus-range", 0, nr_pcie_buses - 1); - qemu_fdt_setprop(vms->fdt, nodename, "dma-coherent", NULL, 0); + qemu_fdt_setprop(ms->fdt, nodename, "dma-coherent", NULL, 0); if (vms->msi_phandle) { - qemu_fdt_setprop_cells(vms->fdt, nodename, "msi-parent", + qemu_fdt_setprop_cells(ms->fdt, nodename, "msi-parent", vms->msi_phandle); } - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base_ecam, 2, size_ecam); if (vms->highmem) { - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "ranges", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "ranges", 1, FDT_PCI_RANGE_IOPORT, 2, 0, 2, base_pio, 2, size_pio, 1, FDT_PCI_RANGE_MMIO, 2, base_mmio, @@ -1331,23 +1344,23 @@ static void create_pcie(VirtMachineState *vms) 2, base_mmio_high, 2, base_mmio_high, 2, size_mmio_high); } else { - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "ranges", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "ranges", 1, FDT_PCI_RANGE_IOPORT, 2, 0, 2, base_pio, 2, size_pio, 1, FDT_PCI_RANGE_MMIO, 2, base_mmio, 2, base_mmio, 2, size_mmio); } - qemu_fdt_setprop_cell(vms->fdt, nodename, "#interrupt-cells", 1); - create_pcie_irq_map(vms, vms->gic_phandle, irq, nodename); + qemu_fdt_setprop_cell(ms->fdt, nodename, "#interrupt-cells", 1); + create_pcie_irq_map(ms, vms->gic_phandle, irq, nodename); if (vms->iommu) { - vms->iommu_phandle = qemu_fdt_alloc_phandle(vms->fdt); + vms->iommu_phandle = qemu_fdt_alloc_phandle(ms->fdt); switch (vms->iommu) { case VIRT_IOMMU_SMMUV3: create_smmu(vms, pci->bus); - qemu_fdt_setprop_cells(vms->fdt, nodename, "iommu-map", + qemu_fdt_setprop_cells(ms->fdt, nodename, "iommu-map", 0x0, vms->iommu_phandle, 0x0, 0x10000); break; default: @@ -1399,17 +1412,18 @@ static void create_secure_ram(VirtMachineState *vms, char *nodename; hwaddr base = vms->memmap[VIRT_SECURE_MEM].base; hwaddr size = vms->memmap[VIRT_SECURE_MEM].size; + MachineState *ms = MACHINE(vms); memory_region_init_ram(secram, NULL, "virt.secure-ram", size, &error_fatal); memory_region_add_subregion(secure_sysmem, base, secram); nodename = g_strdup_printf("/secram@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, "device_type", "memory"); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", 2, base, 2, size); - qemu_fdt_setprop_string(vms->fdt, nodename, "status", "disabled"); - qemu_fdt_setprop_string(vms->fdt, nodename, "secure-status", "okay"); + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "device_type", "memory"); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base, 2, size); + qemu_fdt_setprop_string(ms->fdt, nodename, "status", "disabled"); + qemu_fdt_setprop_string(ms->fdt, nodename, "secure-status", "okay"); if (secure_tag_sysmem) { create_tag_ram(secure_tag_sysmem, base, size, "mach-virt.secure-tag"); @@ -1422,9 +1436,11 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size) { const VirtMachineState *board = container_of(binfo, VirtMachineState, bootinfo); + MachineState *ms = MACHINE(board); + *fdt_size = board->fdt_size; - return board->fdt; + return ms->fdt; } static void virt_build_smbios(VirtMachineState *vms) @@ -1472,7 +1488,7 @@ void virt_machine_done(Notifier *notifier, void *data) * while qemu takes charge of the qom stuff. */ if (info->dtb_filename == NULL) { - platform_bus_add_all_fdt_nodes(vms->fdt, "/intc", + platform_bus_add_all_fdt_nodes(ms->fdt, "/intc", vms->memmap[VIRT_PLATFORM_BUS].base, vms->memmap[VIRT_PLATFORM_BUS].size, vms->irqmap[VIRT_PLATFORM_BUS]); From patchwork Thu Nov 5 17:51:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 320652 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp649286ilc; Thu, 5 Nov 2020 09:57:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxulHziYy2zKp518cmvoG8KcpezmyYrEGYXdeZihROx3eto03+5zk1VedO5Bc5JgkWBR19 X-Received: by 2002:a05:620a:8c5:: with SMTP id z5mr3102497qkz.193.1604599043912; Thu, 05 Nov 2020 09:57:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604599043; cv=none; d=google.com; s=arc-20160816; b=lbpIJtejTCEKojAzoJZCVvSmgMILdWptTOE4R//QmgARDwI8geskvv/+IKA0BwMFLS D21Bkz5ybjS1FWxkTsQqltn9LGmA2z9GfWX0DYw/WG0Wip8Z3y1vpCdKWP6uFw6JMObu 8YXNKxJLV0MqhuqlIdtEbYOQNBSN2b51l8uOX52v4opfBUh3WP90PeWNVEjQFQXM02iz SIVws/M2a2Bc7I5SRiNsieq1BAE+NVFD0f5LDAOEkxj6If/W5ZuH5/slkL/kuIulEzXE Bbd7H+H178hb23oIhqWQp4zoX2DNqGOBexZcgimIuKIn3HAHjX2Sjxd3yQiHL8br/9hI UmPA== 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 :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=7Nz9MSyQVsT6uTf5IolftpS8uipcBc27d6vn+zZBZfo=; b=inTGvmJpvKJmqMlzcC0fUdwtTcRNn7TJs8WiG8ntDwqR9FRoM87l06c1byKcexGkUj m1i59slKKxdWVZU/GIpO3edPNWmdU6wwXEHjJoot88G7ok+4sQpqNFMNuDoHHL2faoXT 4ge1E4AH2vETmffToX0Ib7gUCGeIWP2epfcrQfhUxfJ93mcH5EqOWGoYMlZuNUSiDiR9 Dx/UalcIVyLm2qXrlC4honZUUnpklDrgukFV4d7WkVuXG8FQhIKYgn2w/eWTYbCBP5K1 hgwXcKONRdXaX3k++57ib0DHy0+40jyN2wVs1RWkZ26dlHDFbvlnHqiKZsc7+zm9NUSK grSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jJV7REPO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d20si1113602qkc.69.2020.11.05.09.57.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Nov 2020 09:57:23 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jJV7REPO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kajVj-0001cx-3v for patch@linaro.org; Thu, 05 Nov 2020 12:57:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajQl-00046U-27 for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:15 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:36777) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kajQh-0004pG-LF for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:14 -0500 Received: by mail-wm1-x343.google.com with SMTP id a65so2111162wme.1 for ; Thu, 05 Nov 2020 09:52:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7Nz9MSyQVsT6uTf5IolftpS8uipcBc27d6vn+zZBZfo=; b=jJV7REPO8q4WmM1H5lmQh9/AM0xYpocZfjtmflTPhdHgB3yHf/m4EbvsaMwERdNQr5 2HEAZOrQbvaRGUqOHJE87g9Tw90NVrWfeHZa8PmM4gTqHSQ/nIuWtroFrSmCoFUoCdaB yohJm/MTa4NCbM5nBR15YI8/5utt/Zj+og8qY7mdXgYjpV5x+d59xT8nzm3Ghavy01B4 Eves61Q2M6c6MDOv/5pLHjVNtRlkbsa0ixd7ofY30vdMNMGXb1l7XH8NEmxuoAq8wHk4 Qme+lTnpnqIkOFTSXd/fRbjl7kYARcHb9JUsGvOUP9ZEzXgN7mIOI7SyNoibzLX/q4+B JQDg== 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=7Nz9MSyQVsT6uTf5IolftpS8uipcBc27d6vn+zZBZfo=; b=VQ3b7J+MQHEDLOZvNFNMMZvwwEt3tsq8sT/3chN2bVaauOTP4zWFjjo09CVEMu/rDQ KFBzJPhG5JQkOQxKcDg85Np+b1E5U5pIP3Mp3XHwMgGDOVAKg5bJf83Z3r/KYF+N5NjQ 97DSh44PdijTU7tM1JMyyGJHwDUeVGwMR4S7xIWha1/CiuS0yj/fourwd2ByETXXRMqE GKx3GZqnYxgKvCfUIjuOrquKh4OODpoeXla3yuzub4LlFkXghRZCf3hbBLaFdXBkfrDf dD+RREszP88DKC2vFiQEqvBUX0CZ2f60w1qVTg5YkYQ8gTbmUyDjFkcaG0nAjAAqDKal 6Bug== X-Gm-Message-State: AOAM530gNCHvyGFqf30eJK8U83DqTMuQm1/bStup89O+mVrrEYV+GDg8 1EsGpcxC1aUmC3ke35c15hS3pg== X-Received: by 2002:a05:600c:2110:: with SMTP id u16mr3997847wml.4.1604598721029; Thu, 05 Nov 2020 09:52:01 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o184sm3590398wmo.37.2020.11.05.09.51.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:51:56 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E0D441FF8C; Thu, 5 Nov 2020 17:51:53 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 02/15] hw/riscv: migrate fdt field to generic MachineState Date: Thu, 5 Nov 2020 17:51:40 +0000 Message-Id: <20201105175153.30489-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: julien@xen.org, Sagar Karandikar , masami.hiramatsu@linaro.org, andre.przywara@arm.com, stefano.stabellini@linaro.org, takahiro.akashi@linaro.org, Alistair Francis , Bastian Koppelmann , Palmer Dabbelt , stefano.stabellini@xilinx.com, =?utf-8?q?Alex_Benn=C3=A9e?= , "open list:RISC-V TCG CPUs" , stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is a mechanical change to make the fdt available through MachineState. Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis Message-Id: <20201021170842.25762-3-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- include/hw/riscv/virt.h | 1 - hw/riscv/virt.c | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h index b4ed9a32eb..6505ae8d23 100644 --- a/include/hw/riscv/virt.h +++ b/include/hw/riscv/virt.h @@ -41,7 +41,6 @@ struct RISCVVirtState { DeviceState *plic[VIRT_SOCKETS_MAX]; PFlashCFI01 *flash[2]; - void *fdt; int fdt_size; }; diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 25cea7aa67..377400e02a 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -197,14 +197,14 @@ static void create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap, dtb_filename = qemu_opt_get(qemu_get_machine_opts(), "dtb"); if (dtb_filename) { - fdt = s->fdt = load_device_tree(dtb_filename, &s->fdt_size); + fdt = mc->fdt = load_device_tree(dtb_filename, &s->fdt_size); if (!fdt) { error_report("load_device_tree() failed"); exit(1); } goto update_bootargs; } else { - fdt = s->fdt = create_device_tree(&s->fdt_size); + fdt = mc->fdt = create_device_tree(&s->fdt_size); if (!fdt) { error_report("create_device_tree() failed"); exit(1); @@ -442,12 +442,12 @@ static void create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap, g_free(name); name = g_strdup_printf("/soc/flash@%" PRIx64, flashbase); - qemu_fdt_add_subnode(s->fdt, name); - qemu_fdt_setprop_string(s->fdt, name, "compatible", "cfi-flash"); - qemu_fdt_setprop_sized_cells(s->fdt, name, "reg", + qemu_fdt_add_subnode(mc->fdt, name); + qemu_fdt_setprop_string(mc->fdt, name, "compatible", "cfi-flash"); + qemu_fdt_setprop_sized_cells(mc->fdt, name, "reg", 2, flashbase, 2, flashsize, 2, flashbase + flashsize, 2, flashsize); - qemu_fdt_setprop_cell(s->fdt, name, "bank-width", 4); + qemu_fdt_setprop_cell(mc->fdt, name, "bank-width", 4); g_free(name); update_bootargs: @@ -631,9 +631,9 @@ static void virt_machine_init(MachineState *machine) hwaddr end = riscv_load_initrd(machine->initrd_filename, machine->ram_size, kernel_entry, &start); - qemu_fdt_setprop_cell(s->fdt, "/chosen", + qemu_fdt_setprop_cell(machine->fdt, "/chosen", "linux,initrd-start", start); - qemu_fdt_setprop_cell(s->fdt, "/chosen", "linux,initrd-end", + qemu_fdt_setprop_cell(machine->fdt, "/chosen", "linux,initrd-end", end); } } else { @@ -654,11 +654,11 @@ static void virt_machine_init(MachineState *machine) /* Compute the fdt load address in dram */ fdt_load_addr = riscv_load_fdt(memmap[VIRT_DRAM].base, - machine->ram_size, s->fdt); + machine->ram_size, machine->fdt); /* load the reset vector */ riscv_setup_rom_reset_vec(start_addr, virt_memmap[VIRT_MROM].base, virt_memmap[VIRT_MROM].size, kernel_entry, - fdt_load_addr, s->fdt); + fdt_load_addr, machine->fdt); /* SiFive Test MMIO device */ sifive_test_create(memmap[VIRT_TEST].base); From patchwork Thu Nov 5 17:51:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 319872 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 D8A1FC55178 for ; Thu, 5 Nov 2020 17:57:04 +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 4D89620709 for ; Thu, 5 Nov 2020 17:57:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dVUscYXc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D89620709 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kajVP-0000sl-6O for qemu-devel@archiver.kernel.org; Thu, 05 Nov 2020 12:57:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajQk-00045x-Iu for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:14 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:38742) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kajQh-0004pg-Ka for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:14 -0500 Received: by mail-wm1-x342.google.com with SMTP id h62so2451122wme.3 for ; Thu, 05 Nov 2020 09:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zcFV6Xll5pLIvhje0/+HAUCHWUfL1ANISG1KEVhrpQY=; b=dVUscYXcxYw2NMb+WxL5zOqB9qL9P5IPnOYGUL5YzALT00le5Y2IPhN+S7MY6r2yxY GK8fffo+50H99/E7bOmW2xipPp6cuh47EM6S5pLEYCPaQ4DYCWZTaZImSfC5BPDNNAUY jR1stu8PBlgG8nSlP+ErvYgfNPjad8JLkh3qdne9r24Oerd+erFJcmGLH8aJHzqrdXzl V3xBEOvK3Ubmvi3Eor8BrqVa7kL+L1k6sGLmm8KJ9nKfwgH0rJv2IWhzIjbwOgj60M9B rX6fr1itlTm1I9K7rT6OojEEvLZmTd6eu393AmN4WkyF2H7NFr4C3c6axWjBpDkiQ17K JhLw== 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=zcFV6Xll5pLIvhje0/+HAUCHWUfL1ANISG1KEVhrpQY=; b=uds5mDHyaB4/NvQ6/RtUl8BAPTQb4Uz1aemZkC5t7Zk41vubQoOknII0X6pic44yR3 YIeThH6DFg67BMYe51sEy4Pr/ZxnhCtN96idd9l9QlQoRPCitZamA/DjvvMxXfhaPrPl QBnytlJwg6C5LlANzn6veWoGHwT+Ozll+ekuvzEEQ7Njs8Zm9+HxFi+ZZ8l8+CmLVIak g2fECc91niik2ZL/Aj9xJ+a2rJWXGWVaLUNb3DRd7Ikome2XnAWjB/nEKwTdumhU4iQI WIBQIAQsywJ8KVphCkf/5nmb1wzVuadNd3GhWLacC1ovA3+mOW4cCqWQnwG0nyvymK2h HXhg== X-Gm-Message-State: AOAM5302b5+jvVxtNIjYiGvIfT/9WzTJyACcRTeMHcnATkNc1r/oN4Ai MFLpnqSq3FvPq5cZiAEoaFSRfg== X-Google-Smtp-Source: ABdhPJz6xQd2xybrGSF5UcqgRTO8fMHqNKnQxJt1xL+tqJUVFj1uynTFSGTyFcJG1mDyBVfTfAn04g== X-Received: by 2002:a1c:7f95:: with SMTP id a143mr3786214wmd.167.1604598725814; Thu, 05 Nov 2020 09:52:05 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h4sm3703390wrp.52.2020.11.05.09.51.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:51:58 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 04B361FF8F; Thu, 5 Nov 2020 17:51:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 03/15] device_tree: add qemu_fdt_setprop_string_array helper Date: Thu, 5 Nov 2020 17:51:41 +0000 Message-Id: <20201105175153.30489-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: julien@xen.org, masami.hiramatsu@linaro.org, andre.przywara@arm.com, stefano.stabellini@linaro.org, takahiro.akashi@linaro.org, Alistair Francis , David Gibson , stefano.stabellini@xilinx.com, =?utf-8?q?Alex_Benn=C3=A9e?= , stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" A string array in device tree is simply a series of \0 terminated strings next to each other. As libfdt doesn't support that directly we need to build it ourselves. Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis Message-Id: <20201021170842.25762-4-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- include/sysemu/device_tree.h | 17 +++++++++++++++++ softmmu/device_tree.c | 26 ++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h index 982c89345f..8a2fe55622 100644 --- a/include/sysemu/device_tree.h +++ b/include/sysemu/device_tree.h @@ -70,6 +70,23 @@ int qemu_fdt_setprop_u64(void *fdt, const char *node_path, const char *property, uint64_t val); int qemu_fdt_setprop_string(void *fdt, const char *node_path, const char *property, const char *string); + +/** + * qemu_fdt_setprop_string_array: set a string array property + * + * @fdt: pointer to the dt blob + * @name: node name + * @prop: property array + * @array: pointer to an array of string pointers + * @len: length of array + * + * assigns a string array to a property. This function converts and + * array of strings to a sequential string with \0 separators before + * setting the property. + */ +int qemu_fdt_setprop_string_array(void *fdt, const char *node_path, + const char *prop, char **array, int len); + int qemu_fdt_setprop_phandle(void *fdt, const char *node_path, const char *property, const char *target_node_path); diff --git a/softmmu/device_tree.c b/softmmu/device_tree.c index b335dae707..a19873316a 100644 --- a/softmmu/device_tree.c +++ b/softmmu/device_tree.c @@ -21,6 +21,7 @@ #include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/bswap.h" +#include "qemu/cutils.h" #include "sysemu/device_tree.h" #include "sysemu/sysemu.h" #include "hw/loader.h" @@ -397,6 +398,31 @@ int qemu_fdt_setprop_string(void *fdt, const char *node_path, return r; } +/* + * libfdt doesn't allow us to add string arrays directly but they are + * test a series of null terminated strings with a length. We build + * the string up here so we can calculate the final length. + */ +int qemu_fdt_setprop_string_array(void *fdt, const char *node_path, const char *prop, + char **array, int len) +{ + int ret, i, total_len = 0; + char *str, *p; + for (i = 0; i < len; i++) { + total_len += strlen(array[i]) + 1; + } + p = str = g_malloc0(total_len); + for (i = 0; i < len; i++) { + int len = strlen(array[i]) + 1; + pstrcpy(p, len, array[i]); + p += len; + } + + ret = qemu_fdt_setprop(fdt, node_path, prop, str, total_len); + g_free(str); + return ret; +} + const void *qemu_fdt_getprop(void *fdt, const char *node_path, const char *property, int *lenp, Error **errp) { From patchwork Thu Nov 5 17:51:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 320654 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp650334ilc; Thu, 5 Nov 2020 09:59:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyV3DrTA3YRl2tDu804HLjLECZLWr0X88qlaYqIqjo771ZOV5xJGlKnBbya7F9mAw8YJSBR X-Received: by 2002:a25:2d03:: with SMTP id t3mr5645192ybt.149.1604599143556; Thu, 05 Nov 2020 09:59:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604599143; cv=none; d=google.com; s=arc-20160816; b=rBMuKoctwrtTfVLVxaUlx5EK4TlP/iFihPlgMRk+9PWqrE4Bo8oYiNvINm4qk8MZln kEQpsL0LhXQcjqEUuj9RLIq9MWRimphTEdivODwhPGkPKWt6ldbna9CdRRCal5MCM+G1 8sMBBvQJZbHfjE6S3CIcmKoqsSZImr6N3ZdPKwsaDGFJ0UMs8FYptmnf5qyZL+IxJEk5 SbHiRFDOccoTxRgsojGtV9T2YzEnStOflWKspt94wlvdeT9jkWGufNEBl7R2N5N/bsMG tcYWQnzjpMIvxtDNqrKrJFHX1zWBdCOJrasaeO1CyhfKrElUplb+T3U8GyH8PmJgMyLS Ffew== 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 :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Rn0hUbcz35n6uIROHy212hfaK77GbH9OkiZ/hZAVCwc=; b=Bd7Jy2c7WdUthSRYKpJL/uRqHhXHYKTVGDUkm4tooOCsITDtKRk0+WnmJOyBfYEGsj 4qGn9UM8MUTD9leC+ZtANKPKAMc0M+V3PYW/rkEbkTSTN3szgOV3NgX+YemJvCMbnHCo kv6g3mg7wLZOkLNJMf5Y+6/kT5KUptedn5reGaRZAGlh/tUsg18NjLzrC9yHV3GsFFQZ nO/wO+KggLnpmZ/gzDBr2TI7xXRRwstPPDGyUCS7Wp21/+fmYOPAoT08lhqDQ90gAWty cs4R+iuizadic6K61hJS5lv5xWoZFQutmrnRU5tEDrfoYWcO0j7X+79wCa3uiAQxup// gQyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uj941NUr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b6si1846109ybq.1.2020.11.05.09.59.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Nov 2020 09:59:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uj941NUr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kajXL-0004Oe-0O for patch@linaro.org; Thu, 05 Nov 2020 12:59:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajQl-00047M-Ds for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:15 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:38741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kajQh-0004pb-M4 for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:15 -0500 Received: by mail-wm1-x341.google.com with SMTP id h62so2451046wme.3 for ; Thu, 05 Nov 2020 09:52:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Rn0hUbcz35n6uIROHy212hfaK77GbH9OkiZ/hZAVCwc=; b=uj941NUrndN5VYOa79bbAM7aBjJjPG7/T6nruCQYrE+BOMY+XAW9RcRDaV0QdrQIk5 r+BXydHiKzPlf39zCOl8gWe4ybF/+1gWOC6Af4ecfFXKe5boorT9sy9jalOMWXZDv0/j N3luJzW6tInEy43LCiyTlH/c0jK6U4oG9vs1t+2tE9a+elK+fE3+4kaCcAex/Ep4c+XX C4ZyU3ZT5ouJnNfMeBVNeG3ntDJW6hCUf2GGP3Fhbhewn1Va3NpwkS7i7K07ek1uF/ZC gY4TKv56UQlcM8SOFlQSwHtjiGFkgyIqbS7KJSnUVTwzYHBw6OSOftnw4Avn34kco3Sp NwpA== 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=Rn0hUbcz35n6uIROHy212hfaK77GbH9OkiZ/hZAVCwc=; b=feOqM+XEyciWlETUTYHvhdzEhwDWmu5U+OSQz7F2fxNlY/N5gX0EQpf4sI9460BZAf 3WVZmD0pVMl4tcurt/75vRh59zyqLgx5rnlf+1yjpt0kilFb0XFR37y6qZsEtheYlFjT U0l6r9MFoKboUmkK+hlPfOZdVg1s9nMWn+ykolG/dfJGwN2cQXauQFUMITpTNd3Rb/qY W4cjagdvRazXv36XMp/t8GT1larcFY+4FNekVKnWqXFcH40ik8+rXuNYncuKk7WzTPUl KKQaZQmwisPPQ413+L7uY73NtoG2hgrp+phXsrSrLFUaAss5PgLysRUR9x/mHasJWPUW 66fw== X-Gm-Message-State: AOAM532AyLWGC9yd2pNlmWpkKuiINdnsuI5OymsSg1ziyxO0g+6p6T9b 7zLjoDSa84LQ10cnDYuhb5FDIQ== X-Received: by 2002:a05:600c:2c4c:: with SMTP id r12mr3814578wmg.157.1604598724129; Thu, 05 Nov 2020 09:52:04 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id y187sm3711917wmg.33.2020.11.05.09.51.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:51:58 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1F44A1FF90; Thu, 5 Nov 2020 17:51:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 04/15] hw/core: implement a guest-loader to support static hypervisor guests Date: Thu, 5 Nov 2020 17:51:42 +0000 Message-Id: <20201105175153.30489-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: julien@xen.org, masami.hiramatsu@linaro.org, andre.przywara@arm.com, stefano.stabellini@linaro.org, takahiro.akashi@linaro.org, stefano.stabellini@xilinx.com, =?utf-8?q?Alex_Benn=C3=A9e?= , stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Hypervisors, especially type-1 ones, need the firmware/bootcode to put their initial guest somewhere in memory and pass the information to it via platform data. The guest-loader is modelled after the generic loader for exactly this sort of purpose: $QEMU $ARGS -kernel ~/xen.git/xen/xen \ -append "dom0_mem=1G,max:1G loglvl=all guest_loglvl=all" \ -device guest-loader,addr=0x42000000,kernel=Image,bootargs="root=/dev/sda2 ro console=hvc0 earlyprintk=xen" \ -device guest-loader,addr=0x47000000,initrd=rootfs.cpio Signed-off-by: Alex Bennée Message-Id: <20201021170842.25762-5-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- hw/core/guest-loader.h | 34 ++++++++++ hw/core/guest-loader.c | 140 +++++++++++++++++++++++++++++++++++++++++ hw/core/meson.build | 2 + 3 files changed, 176 insertions(+) create mode 100644 hw/core/guest-loader.h create mode 100644 hw/core/guest-loader.c -- 2.20.1 diff --git a/hw/core/guest-loader.h b/hw/core/guest-loader.h new file mode 100644 index 0000000000..07f4b4884b --- /dev/null +++ b/hw/core/guest-loader.h @@ -0,0 +1,34 @@ +/* + * Guest Loader + * + * Copyright (C) 2020 Linaro + * Written by Alex Bennée + * (based on the generic-loader by Li Guang ) + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef GUEST_LOADER_H +#define GUEST_LOADER_H + +#include "hw/qdev-core.h" +#include "qom/object.h" + +struct GuestLoaderState { + /* */ + DeviceState parent_obj; + + /* */ + uint64_t addr; + char *kernel; + char *args; + char *initrd; +}; + +#define TYPE_GUEST_LOADER "guest-loader" +OBJECT_DECLARE_SIMPLE_TYPE(GuestLoaderState, GUEST_LOADER) + +#endif diff --git a/hw/core/guest-loader.c b/hw/core/guest-loader.c new file mode 100644 index 0000000000..1ce39842be --- /dev/null +++ b/hw/core/guest-loader.c @@ -0,0 +1,140 @@ +/* + * Guest Loader + * + * Copyright (C) 2020 Linaro + * Written by Alex Bennée + * (based on the generic-loader by Li Guang ) + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +/* + * Much like the generic-loader this is treated as a special device + * inside QEMU. However unlike the generic-loader this device is used + * to load guest images for hypervisors. As part of that process the + * hypervisor needs to have platform information passed to it by the + * lower levels of the stack (e.g. firmware/bootloader). If you boot + * the hypervisor directly you use the guest-loader to load the Dom0 + * or equivalent guest images in the right place in the same way a + * boot loader would. + * + * This is only relevant for full system emulation. + */ + +#include "qemu/osdep.h" +#include "hw/core/cpu.h" +#include "hw/sysbus.h" +#include "sysemu/dma.h" +#include "hw/loader.h" +#include "hw/qdev-properties.h" +#include "qapi/error.h" +#include "qemu/module.h" +#include "guest-loader.h" +#include "sysemu/device_tree.h" +#include "hw/boards.h" + +/* + * Insert some FDT nodes for the loaded blob. + */ +static void loader_insert_platform_data(GuestLoaderState *s, int size, Error **errp) +{ + MachineState *machine = MACHINE(qdev_get_machine()); + void *fdt = machine->fdt; + g_autofree char *node = g_strdup_printf("/chosen/module@%#08lx", s->addr); + uint64_t reg_attr[2] = {cpu_to_be64(s->addr), cpu_to_be64(size)}; + + if (!fdt) { + error_setg(errp, "Cannot modify FDT fields if the machine has none"); + return; + } + + qemu_fdt_add_subnode(fdt, node); + qemu_fdt_setprop(fdt, node, "reg", ®_attr, sizeof(reg_attr)); + + if (s->kernel) { + const char *compat[2] = { "multiboot,module", "multiboot,kernel" }; + if (qemu_fdt_setprop_string_array + (fdt, node, "compatible", (char **) &compat, ARRAY_SIZE(compat)) < 0) { + error_setg(errp, "couldn't set %s/compatible", node); + return; + } + if (s->args) { + if (qemu_fdt_setprop_string(fdt, node, "bootargs", s->args) < 0) { + error_setg(errp, "couldn't set %s/bootargs", node); + } + } + } else if (s->initrd) { + const char * compat[2] = { "multiboot,module", "multiboot,ramdisk" }; + if (qemu_fdt_setprop_string_array + (fdt, node, "compatible", (char **) &compat, ARRAY_SIZE(compat)) < 0) { + error_setg(errp, "couldn't set %s/compatible", node); + return; + } + } +} + +static void guest_loader_realize(DeviceState *dev, Error **errp) +{ + GuestLoaderState *s = GUEST_LOADER(dev); + char *file = s->kernel ? s->kernel : s->initrd; + int size = 0; + + /* Perform some error checking on the user's options */ + if (s->kernel && s->initrd) { + error_setg(errp, "Cannot specify a kernel and initrd in the same stanza"); + return; + } else if (!s->kernel && !s->initrd) { + error_setg(errp, "Need to specify a kernel or initrd image"); + return; + } else if (!s->addr) { + error_setg(errp, "Need to specify the address of guest blob"); + return; + } else if (s->args && !s->kernel) { + error_setg(errp, "Boot args only relevant to kernel blobs"); + } + + /* Default to the maximum size being the machine's ram size */ + size = load_image_targphys_as(file, s->addr, ram_size, NULL); + if (size < 0) { + error_setg(errp, "Cannot load specified image %s", file); + return; + } + + /* Now the image is loaded we need to update the platform data */ + loader_insert_platform_data(s, size, errp); +} + +static Property guest_loader_props[] = { + DEFINE_PROP_UINT64("addr", GuestLoaderState, addr, 0), + DEFINE_PROP_STRING("kernel", GuestLoaderState, kernel), + DEFINE_PROP_STRING("bootargs", GuestLoaderState, args), + DEFINE_PROP_STRING("initrd", GuestLoaderState, initrd), + DEFINE_PROP_END_OF_LIST(), +}; + +static void guest_loader_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + + dc->realize = guest_loader_realize; + device_class_set_props(dc, guest_loader_props); + dc->desc = "Guest Loader"; + set_bit(DEVICE_CATEGORY_MISC, dc->categories); +} + +static TypeInfo guest_loader_info = { + .name = TYPE_GUEST_LOADER, + .parent = TYPE_DEVICE, + .instance_size = sizeof(GuestLoaderState), + .class_init = guest_loader_class_init, +}; + +static void guest_loader_register_type(void) +{ + type_register_static(&guest_loader_info); +} + +type_init(guest_loader_register_type) diff --git a/hw/core/meson.build b/hw/core/meson.build index 4a744f3b5e..27a69fc578 100644 --- a/hw/core/meson.build +++ b/hw/core/meson.build @@ -37,6 +37,8 @@ softmmu_ss.add(files( 'clock-vmstate.c', )) +softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('guest-loader.c')) + specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files( 'machine-qmp-cmds.c', 'numa.c', From patchwork Thu Nov 5 17:51:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 319870 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 42F88C55ABD for ; Thu, 5 Nov 2020 18:01:36 +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 9C180206A4 for ; Thu, 5 Nov 2020 18:01:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VZZtsvUA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C180206A4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kajZl-00068N-9e for qemu-devel@archiver.kernel.org; Thu, 05 Nov 2020 13:01:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajQm-0004A3-TE for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:16 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:51075) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kajQi-0004qC-RP for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:16 -0500 Received: by mail-wm1-x341.google.com with SMTP id h2so2456950wmm.0 for ; Thu, 05 Nov 2020 09:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7OQVV+4dDAK9BrsulGq6EIUpoaeySsacRv+eB9jEMfg=; b=VZZtsvUA/uHzyLX4oTtY1/6crPwkWLCDocuE/ohMOC2fsqr8Ndq7VLKjb7ZQ2uK7rR tmcW6h4wJVl67Cyqu9raO6o7xpy8XsTNEBr9K76gsGUqxjyqhWXMSuaud9o1I0vjDPZf 1oYkLrS/Y4fsfTdTT/MFNphjOEL/u05Im3oCsodFQivLBjKblk13KA73ac7xU+itZVjE mgZOcAKr82TgAaPS6PqnCijweSQg7wso9bCyKArSJohJsNz+v0KyraFY7jA7/ODF+tA5 4brbxJ4Xk+NX6+1YUN1yL4OA+4EXPFuc6/9xGJAjBEFd9RWIkkNIeiRixDjMOgNcHdLR nJCA== 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=7OQVV+4dDAK9BrsulGq6EIUpoaeySsacRv+eB9jEMfg=; b=chfS2wxdTKiB/VQVq52oeBtHUasXOZfxuJgbGH/IxvuL/cmVwpaJ5vZJs2vniBdwJ0 8QN3HQsdmMlxjU5ZtS3LWQtqaHBDGlgMi/HELkycl1Ngi8T3mPs0QLpgu78o5m7dbx/5 ycLufmzQ8mDCjiM5V4o62LW1/tU+6haFvunpkW1OZ0IIrfNa0eHU5Iitnm7py8PKkDFd bfawuvsurUQdG+/JH5vPug0srFMKHvPrqOsDbGsp0QqiuuQUv6/vvuqB778FLAjaZ9eM lcZAWfafd55cAmpQVz6CZSCPmE4PImWtsOLB61QgZbzw4bNer4zMA9p82v3YcWg0WsOW q02g== X-Gm-Message-State: AOAM533ZjY+oUJ40WDOnPnDIifxEC2ZI91wlPzc2uyIFmIEaC3QE7Rgm jMSQthGaZvM/EuL5tUdLPb/pTQ== X-Google-Smtp-Source: ABdhPJxrAHuCe6VDInEX4wLfPxKjiJZjj04n2QThFEG8TF8xsbjOQ1z7jMzDxi2NwMGvljwRkdQemg== X-Received: by 2002:a05:600c:210:: with SMTP id 16mr3909151wmi.122.1604598731412; Thu, 05 Nov 2020 09:52:11 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 90sm3736469wrl.30.2020.11.05.09.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:52:02 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 39BFB1FF91; Thu, 5 Nov 2020 17:51:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 05/15] docs: move generic-loader documentation into the main manual Date: Thu, 5 Nov 2020 17:51:43 +0000 Message-Id: <20201105175153.30489-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: julien@xen.org, masami.hiramatsu@linaro.org, andre.przywara@arm.com, stefano.stabellini@linaro.org, takahiro.akashi@linaro.org, stefano.stabellini@xilinx.com, =?utf-8?q?Alex_Benn=C3=A9e?= , stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We might as well surface this useful information in the manual so users can find it easily. It is a fairly simple conversion to rst with the only textual fixes being QemuOps to QemuOpts. Signed-off-by: Alex Bennée --- docs/generic-loader.txt | 92 -------------------------- docs/system/generic-loader.rst | 117 +++++++++++++++++++++++++++++++++ docs/system/index.rst | 1 + 3 files changed, 118 insertions(+), 92 deletions(-) delete mode 100644 docs/generic-loader.txt create mode 100644 docs/system/generic-loader.rst diff --git a/docs/generic-loader.txt b/docs/generic-loader.txt deleted file mode 100644 index a9603a2af7..0000000000 --- a/docs/generic-loader.txt +++ /dev/null @@ -1,92 +0,0 @@ -Copyright (c) 2016 Xilinx Inc. - -This work is licensed under the terms of the GNU GPL, version 2 or later. See -the COPYING file in the top-level directory. - - -The 'loader' device allows the user to load multiple images or values into -QEMU at startup. - -Loading Data into Memory Values -------------------------------- -The loader device allows memory values to be set from the command line. This -can be done by following the syntax below: - - -device loader,addr=,data=,data-len= - [,data-be=][,cpu-num=] - - - The address to store the data in. - - The value to be written to the address. The maximum size of - the data is 8 bytes. - - The length of the data in bytes. This argument must be - included if the data argument is. - - Set to true if the data to be stored on the guest should be - written as big endian data. The default is to write little - endian data. - - The number of the CPU's address space where the data should - be loaded. If not specified the address space of the first - CPU is used. - -All values are parsed using the standard QemuOps parsing. This allows the user -to specify any values in any format supported. By default the values -will be parsed as decimal. To use hex values the user should prefix the number -with a '0x'. - -An example of loading value 0x8000000e to address 0xfd1a0104 is: - -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 - -Setting a CPU's Program Counter -------------------------------- -The loader device allows the CPU's PC to be set from the command line. This -can be done by following the syntax below: - - -device loader,addr=,cpu-num= - - - The value to use as the CPU's PC. - - The number of the CPU whose PC should be set to the - specified value. - -All values are parsed using the standard QemuOps parsing. This allows the user -to specify any values in any format supported. By default the values -will be parsed as decimal. To use hex values the user should prefix the number -with a '0x'. - -An example of setting CPU 0's PC to 0x8000 is: - -device loader,addr=0x8000,cpu-num=0 - -Loading Files -------------- -The loader device also allows files to be loaded into memory. It can load ELF, -U-Boot, and Intel HEX executable formats as well as raw images. The syntax is -shown below: - - -device loader,file=[,addr=][,cpu-num=][,force-raw=] - - - A file to be loaded into memory - - The memory address where the file should be loaded. This is - required for raw images and ignored for non-raw files. - - This specifies the CPU that should be used. This is an - optional argument and will cause the CPU's PC to be set to - the memory address where the raw file is loaded or the entry - point specified in the executable format header. This option - should only be used for the boot image. - This will also cause the image to be written to the specified - CPU's address space. If not specified, the default is CPU 0. - - Setting force-raw=on forces the file to be treated as a raw - image. This can be used to load supported executable formats - as if they were raw. - -All values are parsed using the standard QemuOps parsing. This allows the user -to specify any values in any format supported. By default the values -will be parsed as decimal. To use hex values the user should prefix the number -with a '0x'. - -An example of loading an ELF file which CPU0 will boot is shown below: - -device loader,file=./images/boot.elf,cpu-num=0 - -Restrictions and ToDos ----------------------- - - At the moment it is just assumed that if you specify a cpu-num then you - want to set the PC as well. This might not always be the case. In future - the internal state 'set_pc' (which exists in the generic loader now) should - be exposed to the user so that they can choose if the PC is set or not. diff --git a/docs/system/generic-loader.rst b/docs/system/generic-loader.rst new file mode 100644 index 0000000000..59f28d1230 --- /dev/null +++ b/docs/system/generic-loader.rst @@ -0,0 +1,117 @@ +.. + Copyright (c) 2016, Xilinx Inc. + +This work is licensed under the terms of the GNU GPL, version 2 or later. See +the COPYING file in the top-level directory. + +Generic Loader +-------------- + +The 'loader' device allows the user to load multiple images or values into +QEMU at startup. + +Loading Data into Memory Values +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The loader device allows memory values to be set from the command line. This +can be done by following the syntax below:: + + -device loader,addr=,data=,data-len= \ + [,data-be=][,cpu-num=] + +```` + The address to store the data in. + +```` + The value to be written to the address. The maximum size of the data + is 8 bytes. + +```` + The length of the data in bytes. This argument must be included if + the data argument is. + +```` + Set to true if the data to be stored on the guest should be written + as big endian data. The default is to write little endian data. + +```` + The number of the CPU's address space where the data should be + loaded. If not specified the address space of the first CPU is used. + +All values are parsed using the standard QemuOps parsing. This allows the user +to specify any values in any format supported. By default the values +will be parsed as decimal. To use hex values the user should prefix the number +with a '0x'. + +An example of loading value 0x8000000e to address 0xfd1a0104 is:: + + -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 + +Setting a CPU's Program Counter +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The loader device allows the CPU's PC to be set from the command line. This +can be done by following the syntax below:: + + -device loader,addr=,cpu-num= + +```` + The value to use as the CPU's PC. + +```` + The number of the CPU whose PC should be set to the specified value. + +All values are parsed using the standard QemuOpts parsing. This allows the user +to specify any values in any format supported. By default the values +will be parsed as decimal. To use hex values the user should prefix the number +with a '0x'. + +An example of setting CPU 0's PC to 0x8000 is:: + + -device loader,addr=0x8000,cpu-num=0 + +Loading Files +^^^^^^^^^^^^^ + +The loader device also allows files to be loaded into memory. It can load ELF, +U-Boot, and Intel HEX executable formats as well as raw images. The syntax is +shown below: + + -device loader,file=[,addr=][,cpu-num=][,force-raw=] + +```` + A file to be loaded into memory + +```` + The memory address where the file should be loaded. This is required + for raw images and ignored for non-raw files. + +```` + This specifies the CPU that should be used. This is an + optional argument and will cause the CPU's PC to be set to the + memory address where the raw file is loaded or the entry point + specified in the executable format header. This option should only + be used for the boot image. This will also cause the image to be + written to the specified CPU's address space. If not specified, the + default is CPU 0. - Setting force-raw=on forces the file + to be treated as a raw image. This can be used to load supported + executable formats as if they were raw. + +All values are parsed using the standard QemuOpts parsing. This allows the user +to specify any values in any format supported. By default the values +will be parsed as decimal. To use hex values the user should prefix the number +with a '0x'. + +An example of loading an ELF file which CPU0 will boot is shown below:: + + -device loader,file=./images/boot.elf,cpu-num=0 + +Restrictions and ToDos +^^^^^^^^^^^^^^^^^^^^^^ + +At the moment it is just assumed that if you specify a cpu-num then +you want to set the PC as well. This might not always be the case. In +future the internal state 'set_pc' (which exists in the generic loader +now) should be exposed to the user so that they can choose if the PC +is set or not. + + diff --git a/docs/system/index.rst b/docs/system/index.rst index c0f685b818..3cff0ca98f 100644 --- a/docs/system/index.rst +++ b/docs/system/index.rst @@ -24,6 +24,7 @@ Contents: usb ivshmem linuxboot + generic-loader vnc-security tls gdb From patchwork Thu Nov 5 17:51:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 319871 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 0B5E3C4741F for ; Thu, 5 Nov 2020 17:58:46 +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 5E44020739 for ; Thu, 5 Nov 2020 17:58:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GZsjebyd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E44020739 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kajX2-0003dv-9N for qemu-devel@archiver.kernel.org; Thu, 05 Nov 2020 12:58:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajQm-00048R-0X for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:16 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:43085) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kajQh-0004pn-M1 for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:15 -0500 Received: by mail-wr1-x444.google.com with SMTP id g12so2773431wrp.10 for ; Thu, 05 Nov 2020 09:52:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uCs+X0itMjbvMk0yWT3IAMiCiy6to6triRO5oNOXhuI=; b=GZsjebyddibJv1BeSp1pS9QFQo75TKph+ojkOTGldmJpTWpQpB0xCwKLPzUu35aHAq BZ7t0eQaS1B0y60OgOCURv26JnJ2Ed2RQVDXJfrbaUK2NrweyK01M0W73OgN+e0rUOqj yIW9uhsjuzhYcU8yIU7rcNt3CJCJVN5mBJsQvdhQL4hjA2yRaUT2X3RJFIQBFRDUaZT5 9FhzrrgMaeU+K4bP14ZlDHTbFmF+gY7eVdHLKFWXyYAe31KzmLMIkCIerrUIcniKvK3i XlwsPBchFOy7H0tAYOg+rSlLXQBc6JpHJ+a0mJg4SkXSW6sMBRZE9eXD7drmk0r3xlco VLMQ== 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=uCs+X0itMjbvMk0yWT3IAMiCiy6to6triRO5oNOXhuI=; b=oryLpeY5mUSzpnW6Wq/cDX/3fOhIzuAoZi6XSJSTyOYEHb4eMyTM3/mCuoIabYggbd /xA2cJnmdi6t4+ClUjFrElGN2bUkSQEHEcMerpeFnIdKfQXybCAVM2LGltEfuWuGGUlO WNZM8ei5D8zQGmzQ5YC9uBCYmHB3AOJg5KUwAwcBJw8jGmeuPc1i7HXpQSWkVg4ZhcfY xyvdirMtcKw7Fi1Pz5nPlMXQaGdZFJbbPyGKp87MLTGLlT7Rcfjzazv2PHMJh08bJmF9 xe6a77WThsjsN5sprP5Y+XPXpvPB+wBAJOWfR7qKPZ4WCr49fMgOqTB72FZKFXG+I7Aq yypg== X-Gm-Message-State: AOAM532rgh6WOaJh8lfqmiaB7ux9dpvn+oL/iE9+5f5nZU7LGRBmjvKj bbPxFmPgfsQZqhjtuW73VFxIOg== X-Google-Smtp-Source: ABdhPJyyXmxG05QWc7n5bAtZC4+PYw3Z9KdzyXlJyfnL6oI7nVHVWB0PWgEEg2ZuU45fFV//a+jxvA== X-Received: by 2002:adf:fe48:: with SMTP id m8mr4263459wrs.127.1604598729939; Thu, 05 Nov 2020 09:52:09 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h4sm3703532wrp.52.2020.11.05.09.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:52:02 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4F7A91FF92; Thu, 5 Nov 2020 17:51:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 06/15] docs: add some documentation for the guest-loader Date: Thu, 5 Nov 2020 17:51:44 +0000 Message-Id: <20201105175153.30489-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: julien@xen.org, masami.hiramatsu@linaro.org, andre.przywara@arm.com, stefano.stabellini@linaro.org, takahiro.akashi@linaro.org, stefano.stabellini@xilinx.com, =?utf-8?q?Alex_Benn=C3=A9e?= , stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis --- docs/system/guest-loader.rst | 54 ++++++++++++++++++++++++++++++++++++ docs/system/index.rst | 1 + 2 files changed, 55 insertions(+) create mode 100644 docs/system/guest-loader.rst diff --git a/docs/system/guest-loader.rst b/docs/system/guest-loader.rst new file mode 100644 index 0000000000..37d03cbd89 --- /dev/null +++ b/docs/system/guest-loader.rst @@ -0,0 +1,54 @@ +.. + Copyright (c) 2020, Linaro + +Guest Loader +------------ + +The guest loader is similar to the `generic-loader` although it is +aimed at a particular use case of loading hypervisor guests. This is +useful for debugging hypervisors without having to jump through the +hoops of firmware and boot-loaders. + +The guest loader does two things: + + - load blobs (kernels and initial ram disks) into memory + - sets platform FDT data so hypervisors can find and boot them + +This is what is typically done by a boot-loader like grub using it's +multi-boot capability. A typical example would look like: + +.. parsed-literal:: + + |qemu_system| -kernel ~/xen.git/xen/xen \ + -append "dom0_mem=1G,max:1G loglvl=all guest_loglvl=all" \ + -device guest-loader,addr=0x42000000,kernel=Image,bootargs="root=/dev/sda2 ro console=hvc0 earlyprintk=xen" \ + -device guest-loader,addr=0x47000000,initrd=rootfs.cpio + +In the above example the Xen hypervisor is loaded by the -kernel +parameter and passed it's boot arguments via -append. The Dom0 guest +is loaded into the areas of memory. Each blob will get +`/chosen/module@` entry in the FDT to indicate it's location and +size. Additional information can be passed with by using additional +arguments. + +Currently the only supported machines which use FDT data to boot are +the ARM and RiscV `virt` machines. + +Arguments +^^^^^^^^^ + +The full syntax of the guest-loader is:: + + -device guest-loader,addr=[,kernel=,[bootargs=]][,initrd=] + +``addr=`` + This is mandatory and indicates the start address of the blob. + +``kernel|initrd=`` + Indicates the filename of the kernel or initrd blob. Both blobs will + have the "multiboot,module" compatibility string as well as + "multiboot,kernel" or "multiboot,ramdisk" as appropriate. + +``bootargs=`` + This is an optional field for kernel blobs which will pass command + like via the `/chosen/module@/bootargs` node. diff --git a/docs/system/index.rst b/docs/system/index.rst index 3cff0ca98f..b5cfe8ee93 100644 --- a/docs/system/index.rst +++ b/docs/system/index.rst @@ -25,6 +25,7 @@ Contents: ivshmem linuxboot generic-loader + guest-loader vnc-security tls gdb From patchwork Thu Nov 5 17:51:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 319868 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 D5EF9C4741F for ; Thu, 5 Nov 2020 18:09:21 +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 E37CC20709 for ; Thu, 5 Nov 2020 18:09:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KLv57ufL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E37CC20709 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kajhH-0003ri-Op for qemu-devel@archiver.kernel.org; Thu, 05 Nov 2020 13:09:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajR1-0004T6-I0 for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:31 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:53979) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kajQw-0004sj-TZ for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:31 -0500 Received: by mail-wm1-x343.google.com with SMTP id p22so2448740wmg.3 for ; Thu, 05 Nov 2020 09:52:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a5c1eKM/XybxvDJjKQOLiUdZhARb8RUFQ8wgNdzFCEM=; b=KLv57ufL0wf41x1AE66/8pYcnkE7tgcU+QuDpHdpDkhydu+GGJAX2j15O/1ECZH2Qi JAyK11xJz9DhnkxYFBQyDUkru63s38pRI96HRIcgfpqwcLO+tl5DUqgOy//9JvtV1Oix fkbgGxipAw9atvC+vDM/wQhSEvp1mQq+EYzf6cRnmJTfIgNEtPYViJf2Wq375pky6MUO mrbsflMe22hQEDPXP45PXc8OPaFkK4yzYjrlNa+8EZMaswvsEuVqtHKKYQ0oF2gZOi0/ 13RqjwMfzfFecl3NH6YoeXrIyQtRtZgxE042F2I+y5KDovYu0A5ZuyhWLAPQwd5v6zPG 0W8g== 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=a5c1eKM/XybxvDJjKQOLiUdZhARb8RUFQ8wgNdzFCEM=; b=HsPH6qNRXclrkm4F/H7ey36QiRX4UbqXmqg2oE9IpTPw1GEPufLc6uICfJ9JIF0CDw 2XzC77OkYzC/D2SpVtsuOUMKwwxZ6+Ab9nu5OcdvHQ/ZjcospgMTF+zTqJC6Und2QmJO 0D8Lwv5G/vVQwYmKyEkWbLLx74cFBSvoB5Oxg4VbSEKhQfsGfjttcQ5T1WN4FAXmujcb N3QBfYBUhlPMuqQ9PlLRLGojD59XUVeEx32vOVt2BfD37/1nOrk7lu41RsPR/gq4Q0ed ioVVZ0U/E2gsqAN4lKKrcjrsSOlwJctKe5CGF4xHu3kUcd2UdWhSD54deBMYYR4mrBkP quew== X-Gm-Message-State: AOAM533QPjVVRDNXasSqSuWkNcxQP07AZps/moryAM1sOMPfsRswBsxL UG/faq4a+cahT51XleHU0jsJPw== X-Google-Smtp-Source: ABdhPJyy9wj6MQCfwXAvJnhODAWKTVxucKRmoqBQ0EU4M1Cjc+IVsyynK0l0sXAKFpAfK4kNIJarew== X-Received: by 2002:a1c:7213:: with SMTP id n19mr3866935wmc.36.1604598744726; Thu, 05 Nov 2020 09:52:24 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id y187sm3712156wmg.33.2020.11.05.09.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:52:08 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 664FB1FF93; Thu, 5 Nov 2020 17:51:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 07/15] accel/meson: you only need accelerator stubs for softmmu builds Date: Thu, 5 Nov 2020 17:51:45 +0000 Message-Id: <20201105175153.30489-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: julien@xen.org, masami.hiramatsu@linaro.org, andre.przywara@arm.com, stefano.stabellini@linaro.org, takahiro.akashi@linaro.org, stefano.stabellini@xilinx.com, =?utf-8?q?Alex_Benn=C3=A9e?= , stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This avoids us pulling in Xen headers we don't need. The TCG accelerator will always exist for the *-user builds. Signed-off-by: Alex Bennée --- accel/meson.build | 4 +++- accel/stubs/meson.build | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/accel/meson.build b/accel/meson.build index b26cca227a..c4936698cd 100644 --- a/accel/meson.build +++ b/accel/meson.build @@ -4,7 +4,9 @@ subdir('qtest') subdir('kvm') subdir('tcg') subdir('xen') -subdir('stubs') +if have_system + subdir('stubs') +endif dummy_ss = ss.source_set() dummy_ss.add(files( diff --git a/accel/stubs/meson.build b/accel/stubs/meson.build index 12dd1539af..d65cb6a5e1 100644 --- a/accel/stubs/meson.build +++ b/accel/stubs/meson.build @@ -1,4 +1,8 @@ -specific_ss.add(when: 'CONFIG_HAX', if_false: files('hax-stub.c')) -specific_ss.add(when: 'CONFIG_XEN', if_false: files('xen-stub.c')) -specific_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) -specific_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c')) +softmmu_stub_ss = ss.source_set() + +softmmu_stub_ss.add(when: 'CONFIG_HAX', if_false: files('hax-stub.c')) +softmmu_stub_ss.add(when: 'CONFIG_XEN', if_false: files('xen-stub.c')) +softmmu_stub_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) +softmmu_stub_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c')) + +specific_ss.add_all(when: 'CONFIG_SOFTMMU', if_true: softmmu_stub_ss) From patchwork Thu Nov 5 17:51:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 320647 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp647008ilc; Thu, 5 Nov 2020 09:53:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwN1WfDqUy5EKyRfhcZao1mD2IpP99hekPnKQl5hKXcOBIou8FGwlJSSIWKMA5tNMjbe8bX X-Received: by 2002:a05:620a:4141:: with SMTP id k1mr3313109qko.60.1604598819481; Thu, 05 Nov 2020 09:53:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604598819; cv=none; d=google.com; s=arc-20160816; b=tW5DPBy02WmNLdIp9AQzNpaP1OHwnQdUWlt0AdbRszXkn8Vkn3D4215BJ4ocH2uyq6 G3m0wEyqwPTzZoWUyzTM7++MKYgxxlH7zUXRzz3n350jn8Mew5GKE1WItG7M63q5ZGil 9+Sc2hKlWqoEnpEGBYzUSibLFHovEzXoF3Podq7/4bOijcindnM0xBgKMxLgZYKs6Mm/ h7F+Z8N1zBBidxmbBuHRh8PLMN8Y77QXgPJKrucU39Q0z2vrvWnc/ycgDBQueSHsAuqw cRZcsqRjnqaVYSqnJeZv0wVjTcaeT2juoYRCoT7gEe8swApDxt4C96bDDjkpWxFqtDlP VH5w== 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 :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Q4/BNah4WCCk/oICyL+pXWdpc8fROe+nhzuyfin8Wc4=; b=udwR2lnldmwVXY5ey3hTyIB4n5JUGmPxtFjkqPM4Suupv5WCs60FxGgIgDamyvpMby rK04Hu2Kpas3FBgrrokRbD9mJ7jF523OW6eW62v7X10pw7e2f+5qrJBTrPnh1o6xXMWI WpIDbk4opTNARCO7clduR+01TQ+HOSAhzC/1aQK7xXoDCxriZBhJMCCv0x83Z5/qO6kZ NeUbUETk5BPAIZgOkmjL+dGjMa8K/QGLQ4ThGunYqxCsRV/Gu8ZIDYziuHAM2AVS2KV2 x0FFewvlXW7M5SpM67UCMETZ0MwmhEUT9I8HQoZE6w4vKFEMlUvj1hSrvh3Lg2V0hfda +SSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="em/jkiqx"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k3si1083202qko.375.2020.11.05.09.53.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Nov 2020 09:53:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="em/jkiqx"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kajS6-0004Vc-Ul for patch@linaro.org; Thu, 05 Nov 2020 12:53:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajQo-0004DO-Cb for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:18 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:51779) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kajQm-0004rg-Ky for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:18 -0500 Received: by mail-wm1-x342.google.com with SMTP id v5so2459651wmh.1 for ; Thu, 05 Nov 2020 09:52:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q4/BNah4WCCk/oICyL+pXWdpc8fROe+nhzuyfin8Wc4=; b=em/jkiqxe+irvulRikttAPOMQYUQ0aNRhKPGqdQk+qZqM3Oq2mdS0NozBiHi9rk9RX UEj73oswf+CEpuy5e+pbNnauxYbLIdi2JfejV0SYnA3o68ZZKzpRDFQ37MFo9vivst0b S6Zn2hCeC8kGbgxv3P+qnfcVximpOXzoxDzserEvXPvg6LKG5vs4VGMpHDZtogq1ij4E ZIHYAjzEqYMTjwh/KfBmspQ2fw9hrRPciL8+SU6mgR2kIXQHceZJ+9rnGUbJbJ0r3a8Y bRvGnFTp4pn5J7nBQnQp6nGC2Egq2tuzJTXNhU6FoOMF85FvtdC1SYX+w4DBbDpS1T7F 7Uhg== 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=Q4/BNah4WCCk/oICyL+pXWdpc8fROe+nhzuyfin8Wc4=; b=ZgL6oVu4A9dT3kGjaBaTBI3G0XStjxC5jXQvzA7sRzEZu/XuTkpM5oFQrOm0YWwHmy V0ASArstHb+De6eblzkJVnlyyma8BQJJx0Im0hK0O+qRdN8e3X1Y/sWyRhBDIIwa4ccw ezkoTUhwAFAVkePh0xuscTKug9FacQRu7JJ1Ix6g9fAx9G0aJy8S0B5bM62Tu5wTYmFs UJs6q0ZI1ZHtxyb/Zrn3BU7Q6yG/NDTkTHQhu1MNqZ/TZn36xHCx6SueKGedYTDubThg KjIuZhxiPs550tCzHvyyuddZxWXcdwUJs5N76jtXBG3jML2g4pJOIjOOtWdKGS43vpuM GR9g== X-Gm-Message-State: AOAM5336f7M+R0cWU7PmHQXerJ4ZLSub0FHg+sAdUefTr6kCrpg+ZZy2 30kH83pchjI1iJA8AtLZbxTg0g== X-Received: by 2002:a1c:a952:: with SMTP id s79mr4103730wme.155.1604598735391; Thu, 05 Nov 2020 09:52:15 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id e25sm4136670wra.71.2020.11.05.09.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:52:04 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7D2781FF96; Thu, 5 Nov 2020 17:51:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 08/15] meson.build: fix building of Xen support for aarch64 Date: Thu, 5 Nov 2020 17:51:46 +0000 Message-Id: <20201105175153.30489-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: Stefano Stabellini , julien@xen.org, masami.hiramatsu@linaro.org, Paul Durrant , andre.przywara@arm.com, stefano.stabellini@linaro.org, takahiro.akashi@linaro.org, Anthony Perard , Paolo Bonzini , stefano.stabellini@xilinx.com, =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Xen is supported on ARM although weirdly using the i386-softmmu model. Checking based on the host CPU meant we never enabled Xen support. It would be nice to enable CONFIG_XEN for aarch64-softmmu to make it not seem weird but that will require further build surgery. Suggested-by: Paolo Bonzini Signed-off-by: Alex Bennée Cc: Masami Hiramatsu Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Fixes: 8a19980e3f ("configure: move accelerator logic to meson") --- meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/meson.build b/meson.build index f5175010df..58e95227ea 100644 --- a/meson.build +++ b/meson.build @@ -74,10 +74,15 @@ else endif accelerator_targets = { 'CONFIG_KVM': kvm_targets } +if cpu in ['x86', 'x86_64', 'arm', 'aarch64'] + # i368 emulator provides xenpv machine type for multiple architectures + accelerator_targets += { + 'CONFIG_XEN': ['i386-softmmu', 'x86_64-softmmu'], + } +endif if cpu in ['x86', 'x86_64'] accelerator_targets += { 'CONFIG_HAX': ['i386-softmmu', 'x86_64-softmmu'], - 'CONFIG_XEN': ['i386-softmmu', 'x86_64-softmmu'], 'CONFIG_HVF': ['x86_64-softmmu'], 'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'], } From patchwork Thu Nov 5 17:51:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 320663 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp656491ilc; Thu, 5 Nov 2020 10:06:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsLGYtEU+zvPfIlWjbJKXaaTL+Fx+31lMmxrEpjkhSiBrWySgY0wBe7dzvUHhzFnG6hWCM X-Received: by 2002:a25:7455:: with SMTP id p82mr3448845ybc.28.1604599574990; Thu, 05 Nov 2020 10:06:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604599574; cv=none; d=google.com; s=arc-20160816; b=HDX9h0xDYekzs8LbEFNzTx621QUrjXK+savtmXiJsYUUis50u/lOku6Jpq1OJVPvcB MCqueFUH2EBXjCqw12zwQaEPm8S9O+CuiAKkuLrCISLMCBaPFXuKu+UNPahwSIN+iLAL ermF1UAAIHJ9qs88EeON+LaQaYxGZt7l2dA5N2j0yoOYSWFQCsuPK8DreNvBiXnF6JgK NqDTKbSLK5+maP11LQ+yLJ4RPqCLyKOyWdGbsR8x/u6BcFF4c2vXqH0ttjLxYxJItfT0 eFucC80PQLdHH0eoF2rw+UDZzFHeT6R4M+Sj+vQuLzXPqXGudOMzZFxPtk95oMu7wCCQ 7WwA== 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 :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=9rAsNLSka6AMk3Mjx1qnhDke8em3oiSkg4MaBZDRp2A=; b=E4NhRekl4028c06mQx8H+iz+qCJXI52XyTMC8g7rHV/Jj3tKtM/zimzTTPNFhwmgTx lKYeflCtKT8KB0B6Eqm1jftlgg+iUgbcTA/Yno2f7LFLx+N+nZLEEUH7ZDyJNT9poqgk xafgJ/zsLjJd5SalFgALROn5BBC+lRUQZNnWWR81CzBz7tYqccI8qQZhn7D+ftZRWP17 gCGczh5EVnGiM3wB3jUUU+HIe9mWvCyZiYL6NiwqJ7vJHWhUanMPqPYuKE2CesoCIucf 3nPaRVDFlu6jSFkylRjvd/nQeNCIduZ3IPoqkSBz2uxdbZz9XO//V8lRiMKXqz29zG1C N59g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rEcUh+9H; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b12si1808542ybg.190.2020.11.05.10.06.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Nov 2020 10:06:14 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rEcUh+9H; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kajeI-00011J-HN for patch@linaro.org; Thu, 05 Nov 2020 13:06:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajQz-0004Sw-83 for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:31 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:34211) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kajQt-0004sQ-EB for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:28 -0500 Received: by mail-wr1-x443.google.com with SMTP id e6so2797984wro.1 for ; Thu, 05 Nov 2020 09:52:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9rAsNLSka6AMk3Mjx1qnhDke8em3oiSkg4MaBZDRp2A=; b=rEcUh+9HaEgS3Rb+ma5TRQbrekXiMD/UO02zP0VaEgmPy7MXyUewjHo495AC/sMh2i v85sbu34LqeGJRWj0YXj9iXulkiav/EVNELT2iX33lMXFfpkdXxg8nR9H5AOs4+vgvEy bogZZs+3IJchr3Ei9u9cQeKOgslrLQEieTmZq8UE/r0mY78880nyTgqd1aZUC/pGxIGU Gm/zZqnpiMxVV7DhxCwxtKYXCCik91muO2F3j5Xk+48+MW9QrayG6rLXQ2b18q9r7aOC Z4xoudDKptEsoK2zRzznesXugiqX6HHet9WDidLWsaWWeHUp08u/KX+sptUP1Ids1cZQ YxBA== 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=9rAsNLSka6AMk3Mjx1qnhDke8em3oiSkg4MaBZDRp2A=; b=Zuoz14Jl/Ji/gcFTUFsZplFNagDbIBFCjEObIweItFa+qtJicytkqdbgpMAUVy1M+1 snx0zMDeu5tghpwlQg8b0X7iABa4yxzz/arTo7flqiVa7HQnixIwenWAnwfdAn2/hm/R ms35dNqaRjyk3Brk3U/qCzAJImD3lUHHf9KSIsC1lnyamQC0sae+IrSPs9CchEAwoQ2x sSRsncFD36RngqiKlCM4xv6Cy3dTokIGnNiTgbYuZszXkwrIsw7ivwdUNh3FhTO+xH7V xbgdAUDgz5DX5Qbr3aI0kGB0p6zDpb3R81SiAIZ9SzQVZ91gJVeMVL62A7ySjPYN6f8C KYHA== X-Gm-Message-State: AOAM530mYxIhAbhm6cDzVjwbakBlgDrwEusBvaxQKVQ+msoO4C9iCqi3 a2m6ugaSYCLCKDW9ZT9zOGGW2g== X-Received: by 2002:adf:e443:: with SMTP id t3mr4397740wrm.14.1604598742039; Thu, 05 Nov 2020 09:52:22 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id i33sm3597425wri.79.2020.11.05.09.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:52:08 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 92E741FF98; Thu, 5 Nov 2020 17:51:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 09/15] meson.build: introduce CONFIG_XEN_HVM flag Date: Thu, 5 Nov 2020 17:51:47 +0000 Message-Id: <20201105175153.30489-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: julien@xen.org, masami.hiramatsu@linaro.org, andre.przywara@arm.com, stefano.stabellini@linaro.org, takahiro.akashi@linaro.org, Paolo Bonzini , stefano.stabellini@xilinx.com, =?utf-8?q?Alex_?= =?utf-8?q?Benn=C3=A9e?= , stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" While Xen traditionally uses i386-softmmu to run it's PV models on all architectures some models are very much x86 only. This includes the full hardware virtualisation (HVM) which is only used on x86 HW. By introducing the symbol we can also fix the inclusion of XEN_PCI_PASSTHROUGH which should only be built for x86 (and Linux) systems. Suggested-by: Paolo Bonzini Signed-off-by: Alex Bennée --- meson.build | 6 +++++- accel/Kconfig | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/meson.build b/meson.build index 58e95227ea..46e4c2fc3a 100644 --- a/meson.build +++ b/meson.build @@ -83,6 +83,7 @@ endif if cpu in ['x86', 'x86_64'] accelerator_targets += { 'CONFIG_HAX': ['i386-softmmu', 'x86_64-softmmu'], + 'CONFIG_XEN_HVM': ['i386-softmmu', 'x86_64-softmmu'], 'CONFIG_HVF': ['x86_64-softmmu'], 'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'], } @@ -204,6 +205,9 @@ if not get_option('kvm').disabled() and targetos == 'linux' endif if not get_option('xen').disabled() and 'CONFIG_XEN_BACKEND' in config_host accelerators += 'CONFIG_XEN' + if host_machine.cpu() == 'x86_64' + accelerators += 'CONFIG_XEN_HVM' + endif have_xen_pci_passthrough = not get_option('xen_pci_passthrough').disabled() and targetos == 'linux' else have_xen_pci_passthrough = false @@ -916,7 +920,7 @@ foreach target : target_dirs if sym == 'CONFIG_TCG' or target in accelerator_targets.get(sym, []) config_target += { sym: 'y' } config_all += { sym: 'y' } - if sym == 'CONFIG_XEN' and have_xen_pci_passthrough + if sym == 'CONFIG_XEN_HVM' and have_xen_pci_passthrough config_target += { 'CONFIG_XEN_PCI_PASSTHROUGH': 'y' } endif have_accel = true diff --git a/accel/Kconfig b/accel/Kconfig index 2ad94a3839..4cd54029bd 100644 --- a/accel/Kconfig +++ b/accel/Kconfig @@ -7,3 +7,6 @@ config KVM config XEN bool select FSDEV_9P if VIRTFS + +config XEN_HVM + bool From patchwork Thu Nov 5 17:51:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 320662 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp653702ilc; Thu, 5 Nov 2020 10:03:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJziLzAMAIv/FtbIxwbHBZJY9mobfiNtLCd5wElfrxKu0o+H5AgIRf11xah3dOwhyfm/92EQ X-Received: by 2002:a25:9782:: with SMTP id i2mr4835723ybo.478.1604599381813; Thu, 05 Nov 2020 10:03:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604599381; cv=none; d=google.com; s=arc-20160816; b=Vp5By6B1uvfNQxRz9rApedj6gk07OYfidvl3+UA3adBqfItfP7KfJcuTGwhL6Vqc80 imYJTMlKWUkkHhzE2WM2MSZy/fFVCWRfGFshO/eD4ChBe2E5JwMikrUcD4uk6XDbzV7h L3kuL3ieDwynS19CLUmAIvhXPiEDwAHhzTNYSJbBEtnP96YxvSrLTH5GAEQ39VxZVu/+ ayY3GrM0+5O9tB+ovMsgn9vGGb7/YMsLfQrU090/2zwHsWPYEjT+GcBcLwzy2YvTWUs2 gVNerfDlAmWK5BJFgWW9h5/Z7wOFnphN4NH7kdMZDoeqVnIHpH90o0XMU1uYMy0wASoH hEEA== 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 :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=JUuYXLxqbj/H11iBsBJrgBGgIp9/33Tos9HDbHcOfOU=; b=00lZPA/yDI4cD5nxQvGPmmufThnLrAaU50Go2Rki3EMGsElCpCHdhBpnX1hRcNUmt/ ogQpqoQG1ey9sw5K22d/Jz6lH2LfM7pzgIqNkklNrgAAz+AQTaQG58Xt4fTZHEUVXWUG KnX4w8RkI6De8s6aNgpK6GPdguL79W2ptN0rD9fVhqt4mk1uQT9lBVKeIJLrakQcU3vK kLUcnrWsnM3q/DzBtJMePl3fkAIp4JEmgs/2SPuOrM9eQRv2NoJVBI0uT37ZNWGxlupZ q6popiO0WYTpWEmf5c1pwN0cEPcn99Es4nA/Mpqz+lXFo+u8Qm1/GpqUL+24Dih0nssS qVtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=g8P4hbsq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v137si1985890ybe.161.2020.11.05.10.03.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Nov 2020 10:03:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=g8P4hbsq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kajbA-0007FT-KY for patch@linaro.org; Thu, 05 Nov 2020 13:03:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajQs-0004Lo-RA for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:22 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:37350) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kajQq-0004sD-Vw for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:22 -0500 Received: by mail-wr1-x441.google.com with SMTP id w1so2797783wrm.4 for ; Thu, 05 Nov 2020 09:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JUuYXLxqbj/H11iBsBJrgBGgIp9/33Tos9HDbHcOfOU=; b=g8P4hbsq5PR4eAB+DvQTRsfkEr4tBEie9gVWObcgehdg2yM0l3T593yMa+2qa5JirD lIY+2XM7Uol+Mxus6oNXCWMPlw7xSgGUmts5qZGdvQnyAJk0XU9zCvS01VAsmLr9p49K 8qyP5uvdVfO+AbFb/CosYdv1jvmhGRLs+wNxlji0AgL8rvrtgxs6TnEEgBRIJtIuL1C0 EUJV9PQlP4iJ136z6x5DsocG7gpdshLYBrsMFMIKAlhdl0JDuPp1a+QwpYo7bgKEoHD3 9piheMQRo0PCa2Ynprw4KAGJzuZgVybMebhD32FSQUmDJZSAndp5pWnB83y1+qqn6rRX RSmA== 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=JUuYXLxqbj/H11iBsBJrgBGgIp9/33Tos9HDbHcOfOU=; b=VMGzaxXZZBR73p569Z/OtE9X0WUK9x0VSE0lcPEmhk8arr0qk9Xf3rl5ZLQY1lh7az hecoRcgoLbtEUld8Ae2lEDP1EjCc69W4rTsFSVIDzPM65+RXBESzCVzsnoeU5P1SHvL/ H5uzh+dibxDqz7K56xrFuX1qcwOOppDIZmr7qgCd3zyx3rao7wOYH+gQadN2HzQut5mZ XOhBjK61QjxXeaRSNuIqpvYNxdRaewRar0WIvsKJ3Wn12Fh+RjwQE2wbuthUBdQSPeyF PIhBsvHgQjj+BNavkgknW44kocoJsTr2oTZnGRYP3RZvh655uobbu6ccv5jn/4Fk3bQw gI2A== X-Gm-Message-State: AOAM531xL5YJUSiQyBCLqtmKXX5TFFOLjgP+BHRhL9/fNcHd8FLVz32b WQgmtAD/CftH/xfsB0cNhXSu4w== X-Received: by 2002:adf:ef83:: with SMTP id d3mr4345020wro.393.1604598739653; Thu, 05 Nov 2020 09:52:19 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id d3sm3965139wrg.16.2020.11.05.09.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:52:08 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A7A381FF99; Thu, 5 Nov 2020 17:51:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 10/15] meson.build: clean-up summary reporting of XEN and it's features Date: Thu, 5 Nov 2020 17:51:48 +0000 Message-Id: <20201105175153.30489-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: julien@xen.org, masami.hiramatsu@linaro.org, andre.przywara@arm.com, stefano.stabellini@linaro.org, takahiro.akashi@linaro.org, stefano.stabellini@xilinx.com, =?utf-8?q?Alex_Benn=C3=A9e?= , stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Report XEN support along with the rest of the accelerators. Repurposed the existing Xen support line to display details about the control API version and the additional enabled features. Signed-off-by: Alex Bennée --- meson.build | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/meson.build b/meson.build index 46e4c2fc3a..79b74fbda7 100644 --- a/meson.build +++ b/meson.build @@ -2078,8 +2078,15 @@ if vnc.found() summary_info += {'VNC JPEG support': jpeg.found()} summary_info += {'VNC PNG support': png.found()} endif -summary_info += {'xen support': config_host.has_key('CONFIG_XEN_BACKEND')} if config_host.has_key('CONFIG_XEN_BACKEND') + xen_features = ['backend'] + if config_all.has_key('CONFIG_XEN_HVM') + xen_features += 'HVM' + endif + if config_all.has_key('CONFIG_XEN_PCI_PASSTHROUGH') + xen_features += 'PCI Passthrough' + endif + summary_info += {'xen features': ' '.join(xen_features)} summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']} endif summary_info += {'brlapi support': config_host.has_key('CONFIG_BRLAPI')} @@ -2092,6 +2099,7 @@ summary_info += {'Linux io_uring support': config_host.has_key('CONFIG_LINUX_IO_ summary_info += {'ATTR/XATTR support': config_host.has_key('CONFIG_ATTR')} summary_info += {'Install blobs': get_option('install_blobs')} summary_info += {'KVM support': config_all.has_key('CONFIG_KVM')} +summary_info += {'XEN support': config_all.has_key('CONFIG_XEN')} summary_info += {'HAX support': config_all.has_key('CONFIG_HAX')} summary_info += {'HVF support': config_all.has_key('CONFIG_HVF')} summary_info += {'WHPX support': config_all.has_key('CONFIG_WHPX')} From patchwork Thu Nov 5 17:51:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 320656 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp650927ilc; Thu, 5 Nov 2020 09:59:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8Zepk7E1A8DZlWPFUckCELs9Slj/IhHom3xelFOXXUbrKOtxlIQTV5uGwA9xsRZQozd4p X-Received: by 2002:a92:8406:: with SMTP id l6mr2397047ild.12.1604599198214; Thu, 05 Nov 2020 09:59:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604599198; cv=none; d=google.com; s=arc-20160816; b=zarGnNItu9lG28Fa59/VmYqFzu9CgJ63KMMtcQPpYkWA40l74V1qCPCqisRkicYZ8S GJjslGT20TBaiD/jF+eYEy0ApZNzO7TwdZbKJMHoeovbSI4c0VG5mTjxxtoG7cC+KzJQ +NEB1mhmtREh5N1gXu7pupeDU9e2we46MaSEqT8vE7Y5/7f/mWah09FTNs0Yychn1ZKi GWLtpNBw/Ngfe1tCqJ9y2B1g9eTQ0wVWySLg+pW4Uw4SHEOkJ+t5TMqhr7PKSvwRc/mB tm7E6FZe/ykXBggFjeKUuTchpzw6jzmCDEUBY+73/TJLwmCzdGmm7LTclz/XeuCOzp6y /Gww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:sender:precedence :errors-to:list-subscribe:list-help:list-post:list-unsubscribe :list-id; bh=e1CT0XOx8Vvy8O4jAkV/r0nsAlwbNsoMSDp0qZ+mwlI=; b=NOvRr5KA6xbTlIVTNnSOLwcv/PP5FVMD3v7cHackPredZ5ZzfU2DpsgTg8KprkEq/3 fM576AKllLK/rVlvfR4TGank5Do6sJ5pZGkFdXoeE8lop/WZfT5QRWoOqi2eCBNe9oiZ c7HvlJ311HjJ0aihy6DhoH8lKU7V207+9ZTePWz1xdL55nY2aiUx50FTWKHDcTDjqkN4 XeIVbI3pgY9Md1x73rJM5I18xGuiHZRIARYD2WywOr9MvE9Fw3PSeNfTg4GO50y5Sapv 0Za2ofwy8TxPz8Y8q9nJTY/57OeP1dRNKQiU80SMqhS3lFIdiRohdJUIdKXkDahbjtAb LHtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IHQhRMPb; spf=pass (google.com: domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id d15si1322098ile.144.2020.11.05.09.59.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:59:58 -0800 (PST) Received-SPF: pass (google.com: domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IHQhRMPb; spf=pass (google.com: domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from list by lists.xenproject.org with outflank-mailman.19984.45549 (Exim 4.92) (envelope-from ) id 1kajWr-0000xG-I2; Thu, 05 Nov 2020 17:58:33 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 19984.45549; Thu, 05 Nov 2020 17:58:33 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kajWr-0000x9-Eu; Thu, 05 Nov 2020 17:58:33 +0000 Received: by outflank-mailman (input) for mailman id 19984; Thu, 05 Nov 2020 17:58:31 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kajWp-0000x3-Ph for xen-devel@lists.xenproject.org; Thu, 05 Nov 2020 17:58:31 +0000 Received: from mail-wm1-x343.google.com (unknown [2a00:1450:4864:20::343]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 22d79325-16cd-4ab9-a26b-e15f256cb57f; Thu, 05 Nov 2020 17:58:31 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id p19so1628514wmg.0 for ; Thu, 05 Nov 2020 09:58:31 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l16sm3421423wrr.83.2020.11.05.09.58.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:58:29 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BDA3B1FF9A; Thu, 5 Nov 2020 17:51:54 +0000 (GMT) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kajWp-0000x3-Ph for xen-devel@lists.xenproject.org; Thu, 05 Nov 2020 17:58:31 +0000 X-Inumbo-ID: 22d79325-16cd-4ab9-a26b-e15f256cb57f Received: from mail-wm1-x343.google.com (unknown [2a00:1450:4864:20::343]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 22d79325-16cd-4ab9-a26b-e15f256cb57f; Thu, 05 Nov 2020 17:58:31 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id p19so1628514wmg.0 for ; Thu, 05 Nov 2020 09:58:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e1CT0XOx8Vvy8O4jAkV/r0nsAlwbNsoMSDp0qZ+mwlI=; b=IHQhRMPbEglYB1FwSKkG+NGlzWF9RwV19ldmzO/oohRLPXz1nJLWx5YunHxGWGRPxo /Aqz0lTJ/nD7arDBcf0sbMwranwxpNdfVLle85fnpiHqG1927kcijKhgq1httip10pAa KdTz6HLhjzWm0b0qNDlogU0/nN1mAGqhYE2bd3V5QGsXt52QdnSO9PaAy82oAt43TSN+ IX8ENd//l1b1wJ2d9sbQ3iK8byU9/O/Q37z6PNy87kYYDQnEJtW9ygaJU0DTlRjf22vW toaG/0eERqixQ/tBJ3vBkMO1QSBse5bEngAD3ByWZ3P4n9rTt9XiI6N7lU+jtJE3csbr 9Iwg== 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=e1CT0XOx8Vvy8O4jAkV/r0nsAlwbNsoMSDp0qZ+mwlI=; b=a4+ggfAL34+oul7gwx2mrE6zW/SQblJsMruScPHMoE/1qspwATGLJLRKx0lIzBEk6Z vLCJHSrNEzaDD5RRC6la87SwzZLtpYlTJrOai42F/xyW0XCtcyUwtiJGAS9d7VyPOKps jWYR359P0AmUX+FRUg5rBb0HLZrEZxJqsbN4JOfSvGR9prfdaymeH/1g4kxu/ZXDrMb/ 4rnRYJ0qOAImdB1A5EDoYqRsyhz2sj++BMnCyVQTEPtdO49Ol9viilHjrcTtrUCN8yxB 606TXkj0xM/FhvSXx9/WaCtJkjNtOfr+Kg4es28Tt4gSB9CVmExAjuSh80jUsuwh8Qn9 bD+A== X-Gm-Message-State: AOAM530dy7QEbNWhRwPxMtrES/r+6aKzGyRP0P1WAPLwaBgM5hcc01yZ TBuxqlwSnYNqFSihuwLBuqXizg== X-Received: by 2002:a1c:9d08:: with SMTP id g8mr3981235wme.171.1604599110309; Thu, 05 Nov 2020 09:58:30 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l16sm3421423wrr.83.2020.11.05.09.58.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:58:29 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BDA3B1FF9A; Thu, 5 Nov 2020 17:51:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: julien@xen.org, stefano.stabellini@linaro.org, stefano.stabellini@xilinx.com, masami.hiramatsu@linaro.org, takahiro.akashi@linaro.org, andre.przywara@arm.com, stratos-dev@op-lists.linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Stefano Stabellini , Anthony Perard , Paul Durrant , xen-devel@lists.xenproject.org (open list:X86 Xen CPUs) Subject: [RFC PATCH 11/15] include/hw/xen.h: drop superfluous struct Date: Thu, 5 Nov 2020 17:51:49 +0000 Message-Id: <20201105175153.30489-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 Chardev is already a typedef'ed struct. Signed-off-by: Alex Bennée --- include/hw/xen/xen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h index 1406648ca5..0f9962b1c1 100644 --- a/include/hw/xen/xen.h +++ b/include/hw/xen/xen.h @@ -28,7 +28,7 @@ int xen_is_pirq_msi(uint32_t msi_data); qemu_irq *xen_interrupt_controller_init(void); -void xenstore_store_pv_console_info(int i, struct Chardev *chr); +void xenstore_store_pv_console_info(int i, Chardev *chr); void xen_register_framebuffer(struct MemoryRegion *mr); From patchwork Thu Nov 5 17:51:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 319869 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 2AA37C55178 for ; Thu, 5 Nov 2020 18:06:15 +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 5D24F2087D for ; Thu, 5 Nov 2020 18:06:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="y8VYfJKI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D24F2087D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kajeH-0000w9-3a for qemu-devel@archiver.kernel.org; Thu, 05 Nov 2020 13:06:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajR3-0004Xt-Uv for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:34 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:41101) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kajR2-0004t8-8q for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:33 -0500 Received: by mail-wr1-x444.google.com with SMTP id x12so2780636wrm.8 for ; Thu, 05 Nov 2020 09:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=S2GIs58/W24s0fp90d9pmy8FUWIlpMCzYhDdwe9s8Gc=; b=y8VYfJKIVgovo9dlAt6OJzV2fWsBxN2k3Qtrdb4hD1XgOw6zMwhgc41Dig59hy8yaH O1kh16ITKRkR907lC8Js4Ia8jgKPNg5sUs0krQPcEwDAT3Z2C5HTiuetC+S36lkiAVZx bofeE7M1HpcodfKTdRNYMmbUyAPkKzHAI6Ed7yK0gieBk6E84RYpJpRJTVzlnKDN04D8 qCxKR2hB3CbQkoutSoQqNta1PJIj1EpW8SSRQAaCqvWCSV3wgJ0heclI8x2ItRF6Wbwj 9iR7hjEF4+AEsU0s00PT1p1dLSfHDo0bEiAnjgxIl+uKkXsN91x13BMkXwgi4KWwluWx j0dQ== 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=S2GIs58/W24s0fp90d9pmy8FUWIlpMCzYhDdwe9s8Gc=; b=P7gR26+FNcJNW+rjszal3V07/aNRGnzTG66LeEPPb2qrLZfNHJsC5CD6sDyu45JKlJ ilsMo6zNwepTk/Dwc/GTK98ciwLmf/aTQP+s8/55ZyP3jVGMZF/kVmyXqkdAEJ+o/0qw TSYAIaR4X+UiMORfTid8/42T/pQ6eszi/p2M6o1MAC4Uy7MScAl8RsO4yPfJxe/cBoie TCm3nlMolXMQGKNmgbq+TH8EoEsskKXKEsnFefCWxkOonDu3zatjEl16om1zr8UkynzH QbdqUxAZOO18UmSvdscsVMZgjeLfCun78JJRcGYXMkc2pOVXEyhJUXg+giX3g5hq3bw5 8sjQ== X-Gm-Message-State: AOAM530ElV2N7FAJGOmbENIYB/SLtBlFGG+Tp1xNp59I9bJZT7ngt3X4 A3SoW7ZDuuejQHuXr+xNkD7y9A== X-Google-Smtp-Source: ABdhPJxUNz66xbbtM4Jjtwf6tt59B2TjgPZjQafK+I+tj512i1f7vkBJ0d6klAGbXLkJQvMTFOkFIg== X-Received: by 2002:adf:e443:: with SMTP id t3mr4398348wrm.14.1604598750991; Thu, 05 Nov 2020 09:52:30 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id e6sm3707860wrs.7.2020.11.05.09.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:52:15 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D505B1FF9B; Thu, 5 Nov 2020 17:51:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 12/15] stubs/xen-hw-stub: drop xenstore_store_pv_console_info stub Date: Thu, 5 Nov 2020 17:51:50 +0000 Message-Id: <20201105175153.30489-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: Stefano Stabellini , julien@xen.org, masami.hiramatsu@linaro.org, Paul Durrant , andre.przywara@arm.com, stefano.stabellini@linaro.org, takahiro.akashi@linaro.org, "open list:X86 Xen CPUs" , Anthony Perard , Paolo Bonzini , stefano.stabellini@xilinx.com, =?utf-8?q?Alex_Benn=C3=A9e?= , stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We should never build something that calls this without having it. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- stubs/xen-hw-stub.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/stubs/xen-hw-stub.c b/stubs/xen-hw-stub.c index 2ea8190921..15f3921a76 100644 --- a/stubs/xen-hw-stub.c +++ b/stubs/xen-hw-stub.c @@ -10,10 +10,6 @@ #include "hw/xen/xen.h" #include "hw/xen/xen-x86.h" -void xenstore_store_pv_console_info(int i, Chardev *chr) -{ -} - int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num) { return -1; From patchwork Thu Nov 5 17:51:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 320665 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp660064ilc; Thu, 5 Nov 2020 10:10:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJypnfav3bWbUtynf7G+Joe0/Lc/4PO1IugRk9pvXYZTzt5V/SM7Pj4rijdv8kfTOmEA7de/ X-Received: by 2002:a25:a242:: with SMTP id b60mr5405884ybi.353.1604599832408; Thu, 05 Nov 2020 10:10:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604599832; cv=none; d=google.com; s=arc-20160816; b=N5DbjEzn+Ge7oFVx4M3bkkzHdM1vXJEi3esdT2mYiy+HLkjm8FO0IAL2uLCC8p2xl6 kB2xsPRK1Fob5l4MYrwn3mI5wYe0qhHS0MXQ+JDZd9NhrrxBy9u3GTLUYlErcXWaLcZr C+ynjYdMrO2Uza+ICR+sEC2RLI6Sa0isLnoJ7IYoeHX7kf9bIqDGxmQ8ig6dIaZmISVX 1UdGm+wbE3fUG1NuRUNQtcWAhvl54jipH8H4NF54bVGlYQ70BtzJKll9bZoXtTQuHEyq 9LLgl8tdbg8z6PhSdd3LWrY9aCulYM13PgPZn4Wo7iK+S+QN1CBiFzrlUXWhRhRTjQNi WDzA== 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 :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=6HDnL9lHgiiH9MDMI0qBRqslGyWUb9BrATmyPde4NtI=; b=fVpzc1iO3V+wXLymxFtCtKWa8Gs8jzYzrrmyWhbSJbNjltnD0X3vlSVTu4dGLBNVQt YpRgGhrckHESnVu5bxO3RSsCwKFmUhKBpUYuuvvQ9qYu8TDMO8e8WTmX7O8W+MhDQ7eE 12N0414TkKvuuB8H0Q5AhuU/GxSJX20nnC7iomcNO1rqh0zOg7vab1ie70OdDZVyFQ0q 1pAKiYrWDOZlYJ7EepwrF7XMFeZ6QeXnms4V1EDwa9gLLMP4evpdDQzdzl4eo+9d+tGs v5g0Ia8b0i0hudMNnKp8FJoXNXb5O+RCtfAkJqyCjYpfS3Q7s+QrkswO2d34bM769Tl+ t23g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="ojJ/7JWg"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m11si1780291ybk.20.2020.11.05.10.10.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Nov 2020 10:10:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="ojJ/7JWg"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kajiR-0004ou-Tr for patch@linaro.org; Thu, 05 Nov 2020 13:10:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajR5-0004Zo-15 for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:35 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:46737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kajR1-0004t2-7S for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:34 -0500 Received: by mail-wr1-x443.google.com with SMTP id a3so2628555wrx.13 for ; Thu, 05 Nov 2020 09:52:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6HDnL9lHgiiH9MDMI0qBRqslGyWUb9BrATmyPde4NtI=; b=ojJ/7JWg/Rttp9cb91BI9irG0lx9GyYLxNzVECXDlBcd6WL9uYvsVynlaG+vWbVVkq oStz5uNAVI+mPOmt1VmkISYUFYg5VNvdooNrczxm49L6weCQUihresOWDEzI+Lg1+qxD kuZvPpsOUEDXXJjwWMh+UCORCSekNQ1NEtKXKilTCIU38/8V05j205C/en1wYtcAwBgd wLRST6+YZKGI+HTqHemHyHBXFeXFvoIlomyCCfvVOpl6LfGLtoZdCohe5iyOd17wv+5k ODvasRzD676TgTouvraQiTpfZ+lkp6cGsjbv4Zt65nMfz6Zi9HVhXjw1V6m8V2kpb/B2 /lBw== 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=6HDnL9lHgiiH9MDMI0qBRqslGyWUb9BrATmyPde4NtI=; b=GIuTANg2KeZeogi17D8Z1prbgUhxgmllqFQ+rjULR5kc7eTB40iO2yC+bo/7bDA7hQ cqX5H+/tHCtvKA+kqRxtKQRpxf79EO02v0Q2+ZDNxpy6pR2X3+RGkDI6CwC9ODZEMMxN zVvWW3mZFxojnlsTjEV3/rFIArp319g0bXx8NmSovDtO0Wvw87fFhdlb9x0W26PKymTd EI02ZKlE3R98IpWkQ4F5w/K6URoJITjEoQu+1pyX5OT6IcqpFgGLdT896fFzc29H3CJy NWLJOK0W+8JrjFocZAzwH5ceaSI0olHou8Ot4sIzMj4PpNZfunGjvBoOTOe0HMZOHp7A 21vw== X-Gm-Message-State: AOAM5317jXuB8rguOLWDDCHI1zC89ehM+QI6qpUE0Kpl6ixZFpWDK9Ab uzE+PC1dFSfTrxr3PDGjp3LUTw== X-Received: by 2002:a5d:4bd1:: with SMTP id l17mr4643449wrt.38.1604598749318; Thu, 05 Nov 2020 09:52:29 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id u6sm3257348wmj.40.2020.11.05.09.52.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:52:15 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EA3E51FF9C; Thu, 5 Nov 2020 17:51:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 13/15] accel/stubs: drop unused cpu.h include Date: Thu, 5 Nov 2020 17:51:51 +0000 Message-Id: <20201105175153.30489-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: julien@xen.org, masami.hiramatsu@linaro.org, andre.przywara@arm.com, stefano.stabellini@linaro.org, takahiro.akashi@linaro.org, Colin Xu , Wenchao Wang , "open list:X86 HAXM CPUs" , stefano.stabellini@xilinx.com, =?utf-8?q?Alex_Benn=C3=A9e?= , stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée --- accel/stubs/hax-stub.c | 1 - 1 file changed, 1 deletion(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/accel/stubs/hax-stub.c b/accel/stubs/hax-stub.c index 1a9da83185..49077f88e3 100644 --- a/accel/stubs/hax-stub.c +++ b/accel/stubs/hax-stub.c @@ -14,7 +14,6 @@ */ #include "qemu/osdep.h" -#include "cpu.h" #include "sysemu/hax.h" int hax_sync_vcpus(void) From patchwork Thu Nov 5 17:51:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 320649 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp647346ilc; Thu, 5 Nov 2020 09:54:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzS67l5QQ3pDSVZqL29pzKJzUcsaFb/51TzZmXUhzcpqEQZIdjtKnv0UrTKCXuwwCJeyMso X-Received: by 2002:a6b:7841:: with SMTP id h1mr2591770iop.72.1604598851205; Thu, 05 Nov 2020 09:54:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604598851; cv=none; d=google.com; s=arc-20160816; b=ColPQzxExO6L0bpy7FxWgH5MtX4628N6vUpZ+EuoqirrMT1+/TrYaBpgSefx0PaoAX NeIkCJCEOOZaz2OMCB/X0/khNkPFHlivPeb5uiP/u8yKcZADMNR/N6kxicJEvcKjFyZQ QPklR3EUcVjel42gMwaeUrRRlM5oBZ/52hkXpA2RaErJuyqUhb4u9xTlKZ+yHhjQfJlc OBOHZ+Ks2msSZ/PB+wcAvpnrtzTJewmjUXbP0vBBw4POwmkXbSyOAWnF+onbY0c+dtPG Ha5kTHlsPZaRprqQy3K2apCZW88Z5AZXhRQYOqQA0trcj+okvzSA7tL3Q5VRqN6m8C7Z 8p5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:sender:precedence :errors-to:list-subscribe:list-help:list-post:list-unsubscribe :list-id; bh=PWX79l8aK71+AYI8WeJL1C20BLKUbqb3b0w9LAzwhV8=; b=xCF3uvTADxrtaSGTtXIPgUJLJggZqeOOndhvHKinrcEJFU/0PCmw/PduX6T8KTkZZa FIKfBgyvJiVdsH+eCEenpJCWRk4GoML9Q/GyULzRCrsrhqTb9xt5TP+b/NOt44b+WTQm p+kkDTAIWEwaHhj09uVsNFoFZLiudGxmdn2xWhio6M2HSxynLugmXgqdKNQ4nm44iNb8 1oyR5PqozOaNO+AhwK+Bk7NgoJ+X1Ae+mEz92yIlisibXt+Q5a0xf+pjn4bvFQ8J3xyL 7/Nyfnsgycu5VOIqexclZRd0e3dbXHJvs3cojIQbvZXQaVXz+r9NkQ1/bf5AtqJaCYYT b3iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sKuBjdxg; spf=pass (google.com: domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id j2si1291567jat.103.2020.11.05.09.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:54:11 -0800 (PST) Received-SPF: pass (google.com: domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sKuBjdxg; spf=pass (google.com: domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from list by lists.xenproject.org with outflank-mailman.19960.45494 (Exim 4.92) (envelope-from ) id 1kajQz-0000KL-Nd; Thu, 05 Nov 2020 17:52:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 19960.45494; Thu, 05 Nov 2020 17:52:29 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kajQz-0000KE-KU; Thu, 05 Nov 2020 17:52:29 +0000 Received: by outflank-mailman (input) for mailman id 19960; Thu, 05 Nov 2020 17:52:28 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kajQy-0000K9-GG for xen-devel@lists.xenproject.org; Thu, 05 Nov 2020 17:52:28 +0000 Received: from mail-wr1-x444.google.com (unknown [2a00:1450:4864:20::444]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 02f3b7a5-5495-46fd-b349-d5c92d25a256; Thu, 05 Nov 2020 17:52:27 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id g12so2774371wrp.10 for ; Thu, 05 Nov 2020 09:52:27 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a185sm3323029wmf.24.2020.11.05.09.52.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:52:15 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 154F51FF9D; Thu, 5 Nov 2020 17:51:55 +0000 (GMT) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kajQy-0000K9-GG for xen-devel@lists.xenproject.org; Thu, 05 Nov 2020 17:52:28 +0000 X-Inumbo-ID: 02f3b7a5-5495-46fd-b349-d5c92d25a256 Received: from mail-wr1-x444.google.com (unknown [2a00:1450:4864:20::444]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 02f3b7a5-5495-46fd-b349-d5c92d25a256; Thu, 05 Nov 2020 17:52:27 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id g12so2774371wrp.10 for ; Thu, 05 Nov 2020 09:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PWX79l8aK71+AYI8WeJL1C20BLKUbqb3b0w9LAzwhV8=; b=sKuBjdxgzO5u9D8pgwF/tGU3Jl9e9kVQLXkjUZin+MoLsmfLdqrVeqhqiki4zrHNmt 5hy7oStzIxiY+o16gdITJ6d17aQlrLazLaOKd1So+BBwfe/FRh1q20LBPkyH1CYBKIBc 89BFyfERsJdvAKbEqLP1/bDRte++Si1BFXcV5wA53Yg3P8t5AiT8ptxNXg/9K4dFdUJ5 sPXa8twvD5cGmJ5dvqqFdwnTja/ybh6DzAOswcsvh1WULOZk8Tif6W1wiM9fUjihlpqK kiMe6f4QE/wGEOHChHWXznLNi+6OKoDNmYdzcJDS8aOMnUWcpxcWrDD/Hk5hUq8sEImR ikkQ== 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=PWX79l8aK71+AYI8WeJL1C20BLKUbqb3b0w9LAzwhV8=; b=l93Kg90nRJu20jRooqwyZ1DWg2j8+W76gO7/wzUC/XaNcmycjpcBJjiY6XPFw1Drc3 dV+gVXYxGD2j+PWCWPWzI34+5L/K0K4+qj9gfSJ3Yzu0GeLvXgOskohu+QqxVJEImHb4 UdjKbX1C9rZWCqkO93ojH484gGHIQrfOgT1r3jePnVt1YCVBtwGiKp+lanGUGWYUlniF QqZL747Rfr7zBCiDfBcm86NIE9K/XjPlpWooPYpkH4E+2+tGICFl/p60NWNKWLh3Bmpi 8XcwlW7okmvSbE6ZgemwSy6eVv1CQCTGYZBeOqzP8XmpIyRGW5HGQq8moEl1P1StewJ2 CCNQ== X-Gm-Message-State: AOAM5308b1ppuTNkXw20n0dTnqp1wqeiPYYlqCXTJp8fmhSmVnWnoEQh wij/AW6Fs7z1S/Xm40gLaBzXnA== X-Received: by 2002:adf:eb4c:: with SMTP id u12mr4588066wrn.73.1604598746349; Thu, 05 Nov 2020 09:52:26 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a185sm3323029wmf.24.2020.11.05.09.52.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:52:15 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 154F51FF9D; Thu, 5 Nov 2020 17:51:55 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: julien@xen.org, stefano.stabellini@linaro.org, stefano.stabellini@xilinx.com, masami.hiramatsu@linaro.org, takahiro.akashi@linaro.org, andre.przywara@arm.com, stratos-dev@op-lists.linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Stefano Stabellini , Anthony Perard , Paul Durrant , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , xen-devel@lists.xenproject.org (open list:X86 Xen CPUs) Subject: [RFC PATCH 14/15] xen: only build HVM support under CONFIG_XEN_HVM Date: Thu, 5 Nov 2020 17:51:52 +0000 Message-Id: <20201105175153.30489-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 When running on non-x86 systems there is no point building HVM support because we will never see such things. To achieve this we need to shuffle a little bit of the inline and other stubs about. Signed-off-by: Alex Bennée --- include/sysemu/xen-mapcache.h | 2 +- include/sysemu/xen.h | 9 +++++---- accel/stubs/xen-all-stub.c | 11 +++++++++++ accel/stubs/xen-stub.c | 2 -- accel/stubs/meson.build | 3 ++- hw/i386/xen/meson.build | 2 +- 6 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 accel/stubs/xen-all-stub.c -- 2.20.1 diff --git a/include/sysemu/xen-mapcache.h b/include/sysemu/xen-mapcache.h index c8e7c2f6cf..4bba764745 100644 --- a/include/sysemu/xen-mapcache.h +++ b/include/sysemu/xen-mapcache.h @@ -13,7 +13,7 @@ typedef hwaddr (*phys_offset_to_gaddr_t)(hwaddr phys_offset, ram_addr_t size); -#ifdef CONFIG_XEN +#ifdef CONFIG_XEN_HVM void xen_map_cache_init(phys_offset_to_gaddr_t f, void *opaque); diff --git a/include/sysemu/xen.h b/include/sysemu/xen.h index 0ca25697e4..43d2314441 100644 --- a/include/sysemu/xen.h +++ b/include/sysemu/xen.h @@ -24,7 +24,7 @@ extern bool xen_allowed; #define xen_enabled() (xen_allowed) -#ifndef CONFIG_USER_ONLY +#ifdef CONFIG_XEN_HVM void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length); void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, struct MemoryRegion *mr, Error **errp); @@ -33,7 +33,10 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, #else /* !CONFIG_XEN_IS_POSSIBLE */ #define xen_enabled() 0 -#ifndef CONFIG_USER_ONLY + +#endif /* CONFIG_XEN_IS_POSSIBLE */ + +#if !defined(CONFIG_XEN_HVM) && !defined(CONFIG_USER_ONLY) static inline void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) { /* nothing */ @@ -45,6 +48,4 @@ static inline void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, } #endif -#endif /* CONFIG_XEN_IS_POSSIBLE */ - #endif diff --git a/accel/stubs/xen-all-stub.c b/accel/stubs/xen-all-stub.c new file mode 100644 index 0000000000..597c5789cc --- /dev/null +++ b/accel/stubs/xen-all-stub.c @@ -0,0 +1,11 @@ +/* + * Copyright (C) 2014 Citrix Systems UK Ltd. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "sysemu/xen.h" + +bool xen_allowed; diff --git a/accel/stubs/xen-stub.c b/accel/stubs/xen-stub.c index 7054965c48..6bc9906239 100644 --- a/accel/stubs/xen-stub.c +++ b/accel/stubs/xen-stub.c @@ -9,8 +9,6 @@ #include "sysemu/xen.h" #include "qapi/qapi-commands-migration.h" -bool xen_allowed; - void qmp_xen_set_global_dirty_log(bool enable, Error **errp) { } diff --git a/accel/stubs/meson.build b/accel/stubs/meson.build index d65cb6a5e1..dca468c82a 100644 --- a/accel/stubs/meson.build +++ b/accel/stubs/meson.build @@ -1,7 +1,8 @@ softmmu_stub_ss = ss.source_set() softmmu_stub_ss.add(when: 'CONFIG_HAX', if_false: files('hax-stub.c')) -softmmu_stub_ss.add(when: 'CONFIG_XEN', if_false: files('xen-stub.c')) +softmmu_stub_ss.add(when: 'CONFIG_XEN', if_false: files('xen-all-stub.c')) +softmmu_stub_ss.add(when: 'CONFIG_XEN_HVM', if_false: files('xen-stub.c')) softmmu_stub_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) softmmu_stub_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c')) diff --git a/hw/i386/xen/meson.build b/hw/i386/xen/meson.build index be84130300..576e2cc5dc 100644 --- a/hw/i386/xen/meson.build +++ b/hw/i386/xen/meson.build @@ -1,4 +1,4 @@ -i386_ss.add(when: 'CONFIG_XEN', if_true: files( +i386_ss.add(when: 'CONFIG_XEN_HVM', if_true: files( 'xen-hvm.c', 'xen-mapcache.c', 'xen_apic.c', From patchwork Thu Nov 5 17:51:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 319867 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 04BBAC4741F for ; Thu, 5 Nov 2020 18:12:17 +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 589D620709 for ; Thu, 5 Nov 2020 18:12:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wsI27co3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 589D620709 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kajk7-0006Tk-BH for qemu-devel@archiver.kernel.org; Thu, 05 Nov 2020 13:12:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kajR7-0004fT-AZ for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:37 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:33258) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kajR5-0004tT-Mp for qemu-devel@nongnu.org; Thu, 05 Nov 2020 12:52:37 -0500 Received: by mail-wm1-x341.google.com with SMTP id p19so1618538wmg.0 for ; Thu, 05 Nov 2020 09:52:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eQvIGlUj5ZImrXjMOfJf5Uck7kBzZj6a/Ka3js7fkVU=; b=wsI27co3r65Cnwo4ix7Gc225yTcc/aJvBuZm+Q7W2XVyJtyIDeCoBy0q21Wi3TabW+ AOK2J+C/DBZUzDsPMw0e/+PtYt0IYUKbMP+/I7aQ5cvnSXIEdTLvrMvq8lq4EQ1TB8Ye pJXm+J1NoY6lVBePaMVGfRzQ/NGkL4/duLc8SUHB5BHkjs8E2FYw9OHHpbx9Tvb5/IiF zKb1gEok6oqWqalQENd7bYFWRrCgHXHB0thPF/Eh3d8fhceBlOHh27SodBP8XNZKe8T7 tBAjJBj8fS0iYgBdANIfAgjT+MhKATf2N4zKDTnMhLoQ8kvfB1D+5mjDdzGV7imuS8BB 1LLg== 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=eQvIGlUj5ZImrXjMOfJf5Uck7kBzZj6a/Ka3js7fkVU=; b=MuC9wF3L0T7UCnTkpSvGBwex2b6HJ2u0w8+He+EmKc3ItS5X6OKtOs5ZGWWdikUumA jZxNHO8sviYaXidPwGv49Kp8UpRT3duTPkNbOwvflMR6yNfFBszCu8HaiXNgcVlfl44t yJhRyMJY4lx/IURz/89SidOSvKTufjJLYUdO490mLMx9xMTi//P0IadDlzflkdTv04bZ mqe6prEdufDJESPeFf6sjMhi4oS2zVyS5j+agCu3BitWWcFue/qPRVlVL488J/MjR/X/ NLSdqtUWKEZCw+bCqW0zWf0P1cXcNQFrp6JgfJgZg2SkYJvQ5igNiXO34dfTnsGxbja7 KnhQ== X-Gm-Message-State: AOAM530LqU9PYmkUWwWRbhcyoUq0meriCeT8w0vj2Qn+xdzE39otunQU I/9U9d3XNsg6QUd9+TYyj38X5g== X-Google-Smtp-Source: ABdhPJzxHj7bd+GZ1L5+bw6UTAm3wwt5nI/3cOlJB+2ijOYvQTf0m0J1G8TJfEYSJ00XpEhFA9XqQw== X-Received: by 2002:a1c:6843:: with SMTP id d64mr4084355wmc.131.1604598754433; Thu, 05 Nov 2020 09:52:34 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id y185sm3759171wmb.29.2020.11.05.09.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 09:52:32 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2B0991FF9E; Thu, 5 Nov 2020 17:51:55 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 15/15] meson.build: build a Xen aware qemu-aarch64-system Date: Thu, 5 Nov 2020 17:51:53 +0000 Message-Id: <20201105175153.30489-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201105175153.30489-1-alex.bennee@linaro.org> References: <20201105175153.30489-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: julien@xen.org, masami.hiramatsu@linaro.org, andre.przywara@arm.com, stefano.stabellini@linaro.org, takahiro.akashi@linaro.org, stefano.stabellini@xilinx.com, =?utf-8?q?Alex_Benn=C3=A9e?= , stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The i386-softmmu is a bit of an oddity for running ARM Xen guests so lets allow us to build an aarch64 binary with a reasonable name as well. Signed-off-by: Alex Bennée --- meson.build | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 79b74fbda7..5280cd9e8f 100644 --- a/meson.build +++ b/meson.build @@ -74,15 +74,16 @@ else endif accelerator_targets = { 'CONFIG_KVM': kvm_targets } -if cpu in ['x86', 'x86_64', 'arm', 'aarch64'] - # i368 emulator provides xenpv machine type for multiple architectures +if cpu in ['arm', 'aarch64'] + # i386 emulator used to provide xenpv machine type for all + # supported architectures accelerator_targets += { - 'CONFIG_XEN': ['i386-softmmu', 'x86_64-softmmu'], + 'CONFIG_XEN': ['i386-softmmu', 'x86_64-softmmu', 'arm-softmmu', 'aarch64-softmmu'], } -endif -if cpu in ['x86', 'x86_64'] +elif cpu in ['x86', 'x86_64'] accelerator_targets += { 'CONFIG_HAX': ['i386-softmmu', 'x86_64-softmmu'], + 'CONFIG_XEN': ['i386-softmmu', 'x86_64-softmmu'], 'CONFIG_XEN_HVM': ['i386-softmmu', 'x86_64-softmmu'], 'CONFIG_HVF': ['x86_64-softmmu'], 'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'],