From patchwork Tue Feb 8 11:39:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 540797 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp554177imo; Tue, 8 Feb 2022 06:56:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuE6GtMYJsWtau4z5NuXvez+hXHCyLiOQWnVSaWvc4d5WHS4M6OVTqa7SavrI5wTgdB454 X-Received: by 2002:a0d:e0c2:: with SMTP id j185mr5074128ywe.86.1644332161249; Tue, 08 Feb 2022 06:56:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644332161; cv=none; d=google.com; s=arc-20160816; b=g2DQNy/vQgFFx/ST13j4UrWOttEY8rH8RAjFKqaUsWJ5QpxXH9is4u5Nv+rXGDU3tb kcIPHbO77w2vTfbvY+s90PjQLGq8eNqPELC/w4VG27fs5/pJZe8L4DFnYp6ovsDnZHcA +1zsDEX9zSqDDHOiu7OP9fbEpVjUNiR1BR/FGWz6w2kjjAwCJg7ihlNMQ0HoowmoSkhz hSk9CF1mbRS8Red/ENBjKKJA7LEYF4Xh94aZX6iPhWx04unrf33rRTco0JsS5DZtsIGM +c747zrQmEPYW3pqeta/SEVFcMX+j6IFKBOXMLdhv/apbwDi+2ogYlcbhf40jPgobHEa 28Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=7U9MMxjs5aOmUbpGxUkDHRsFOCc8L4YhvKF6hVVJTbc=; b=W4DtTS21/lVIpsiWDDMktJvabOGsVvlPxbTTaZxxdIaUnVFwek6fjGoxL7cgT2Tfh8 RdtfJVVD8GMWBOEVvKbseRyg38i8n4fUFfm1ldtNn7sdzwL8BkmBLRKn47WVtePcF0GD gS/noQJt6O2DLoDCd1cU3w6GJGyP4Lx5GFvpku1hQj/kYTU9BsvqEkmY9n4HMzFXTHeh ozxIcJYoqmguvJcNIX6xcFMOMxIdBbidINhLG5jnTFPIpn8IqF2mU/es+77hWqSCEQ4g j9I4Sr1kJHzAEAeaYd4Ik4GfzeITsZSueHPnxajIBaNU/PDGzlDEpiTdmiL5TRWe+DQ6 zZyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xyrDHvAT; 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=pass (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 p12si15701136ybu.805.2022.02.08.06.56.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Feb 2022 06:56: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=pass header.i=@linaro.org header.s=google header.b=xyrDHvAT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHRuS-0004SR-Ns for patch@linaro.org; Tue, 08 Feb 2022 09:56:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHOrT-000166-4g for qemu-devel@nongnu.org; Tue, 08 Feb 2022 06:40:45 -0500 Received: from [2a00:1450:4864:20::431] (port=42892 helo=mail-wr1-x431.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHOqt-00028W-7L for qemu-devel@nongnu.org; Tue, 08 Feb 2022 06:40:23 -0500 Received: by mail-wr1-x431.google.com with SMTP id h6so11460998wrb.9 for ; Tue, 08 Feb 2022 03:40:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=7U9MMxjs5aOmUbpGxUkDHRsFOCc8L4YhvKF6hVVJTbc=; b=xyrDHvATWOFIDFmyTHcMrGrVhqBc4piJqMb8pT/NJgOT5fKM/WkMTatkgqT6egn9uQ nMOv0HR5Qb8lfO5DmkfAUhkqiHLBunzGC78ZwctK+zMvDGWI+LVoQET2SZWbH/Pr02/h Ua0pv2r3E/BssqbjL6GSnSv8W/++kgW5bhLM+j1toYwImdTUJOt2h7p2vjrZCvBkiPp+ O/zakHETsy6SagyPuE+vC2rhZSBtZh5xKSafOtXQVrGuTNqs3N8G7OjKN5O6OWhge4qE pdX+S0x5Gjl/n8+UXdpMwYIr2Z6BoBO1yGsK2t3g4CAxXOFIZrK6HNJg7zCJVntfueWs a5Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7U9MMxjs5aOmUbpGxUkDHRsFOCc8L4YhvKF6hVVJTbc=; b=mXvxdhNzNjUl0n6fd2OLLFdsaA9vHAqRjjpaEE/GfBz6uehCn9myhgqJfal/rEf/au Ged5Qu3dJiuxh2wiSbgKlkj9p63IRe6EXiaosJv/lkGKZLxDdvjoYyvvWr/DfBSCIuah oYJDiTKBGWQACKg20qsSLp9gSyRW7XbOk7BtMJN7YbUvjUMba+SywrDHpvFjblLbBIkc 62Ap4gNPaiZ6cTaJ6yKzuAPjbc2JDhrqQpttFD7OqB8ucKR0yZ1TgBITsi30zu81O1qc SW31f2czS+9OJuRGmYQ9VCktmleyBHv9dGjlzrf4YGOeUTakm3Em+uYacFx0YgNtYaDN F8lA== X-Gm-Message-State: AOAM530hw4IuxfPa/jPeluUxSXS/26qvyubDCyaunMwK0V7yzCFPKQJq p1JiR88yUMlKmUPANaB6IzrtTrqEatN29Q== X-Received: by 2002:adf:fac8:: with SMTP id a8mr1525810wrs.330.1644320402451; Tue, 08 Feb 2022 03:40:02 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r11sm4245199wrt.28.2022.02.08.03.40.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 03:40:02 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/39] hw/arm/highbank: Drop unused secondary boot stub code Date: Tue, 8 Feb 2022 11:39:28 +0000 Message-Id: <20220208113948.3217356-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208113948.3217356-1-peter.maydell@linaro.org> References: <20220208113948.3217356-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::431 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The highbank and midway board code includes boot-stub code for handling secondary CPU boot which keeps the secondaries in a pen until the primary writes to a known location with the address they should jump to. This code is never used, because the boards enable QEMU's PSCI emulation, so secondary CPUs are kept powered off until the PSCI call which turns them on, and then start execution from the address given by the guest in that PSCI call. Delete the unreachable code. (The code was wrong for midway in any case -- on the Cortex-A15 the GIC CPU interface registers are at a different offset from PERIPHBASE compared to the Cortex-A9, and the code baked-in the offsets for highbank's A9.) Note that this commit implicitly depends on the preceding "Don't write secondary boot stub if using PSCI" commit -- the default secondary-boot stub code overlaps with one of the highbank-specific bootcode rom blobs, so we must suppress the secondary-boot stub code entirely, not merely replace the highbank-specific version with the default. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Niek Linnenbank Tested-by: Cédric Le Goater Tested-by: Niek Linnenbank Message-id: 20220127154639.2090164-15-peter.maydell@linaro.org --- hw/arm/highbank.c | 56 ----------------------------------------------- 1 file changed, 56 deletions(-) diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index a21afd178d1..da681b15708 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -48,60 +48,6 @@ /* Board init. */ -static void hb_write_secondary(ARMCPU *cpu, const struct arm_boot_info *info) -{ - int n; - uint32_t smpboot[] = { - 0xee100fb0, /* mrc p15, 0, r0, c0, c0, 5 - read current core id */ - 0xe210000f, /* ands r0, r0, #0x0f */ - 0xe3a03040, /* mov r3, #0x40 - jump address is 0x40 + 0x10 * core id */ - 0xe0830200, /* add r0, r3, r0, lsl #4 */ - 0xe59f2024, /* ldr r2, privbase */ - 0xe3a01001, /* mov r1, #1 */ - 0xe5821100, /* str r1, [r2, #256] - set GICC_CTLR.Enable */ - 0xe3a010ff, /* mov r1, #0xff */ - 0xe5821104, /* str r1, [r2, #260] - set GICC_PMR.Priority to 0xff */ - 0xf57ff04f, /* dsb */ - 0xe320f003, /* wfi */ - 0xe5901000, /* ldr r1, [r0] */ - 0xe1110001, /* tst r1, r1 */ - 0x0afffffb, /* beq */ - 0xe12fff11, /* bx r1 */ - MPCORE_PERIPHBASE /* privbase: MPCore peripheral base address. */ - }; - for (n = 0; n < ARRAY_SIZE(smpboot); n++) { - smpboot[n] = tswap32(smpboot[n]); - } - rom_add_blob_fixed_as("smpboot", smpboot, sizeof(smpboot), SMP_BOOT_ADDR, - arm_boot_address_space(cpu, info)); -} - -static void hb_reset_secondary(ARMCPU *cpu, const struct arm_boot_info *info) -{ - CPUARMState *env = &cpu->env; - - switch (info->nb_cpus) { - case 4: - address_space_stl_notdirty(&address_space_memory, - SMP_BOOT_REG + 0x30, 0, - MEMTXATTRS_UNSPECIFIED, NULL); - /* fallthrough */ - case 3: - address_space_stl_notdirty(&address_space_memory, - SMP_BOOT_REG + 0x20, 0, - MEMTXATTRS_UNSPECIFIED, NULL); - /* fallthrough */ - case 2: - address_space_stl_notdirty(&address_space_memory, - SMP_BOOT_REG + 0x10, 0, - MEMTXATTRS_UNSPECIFIED, NULL); - env->regs[15] = SMP_BOOT_ADDR; - break; - default: - break; - } -} - #define NUM_REGS 0x200 static void hb_regs_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) @@ -380,8 +326,6 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id) highbank_binfo.board_id = -1; highbank_binfo.nb_cpus = smp_cpus; highbank_binfo.loader_start = 0; - highbank_binfo.write_secondary_boot = hb_write_secondary; - highbank_binfo.secondary_cpu_reset_hook = hb_reset_secondary; highbank_binfo.board_setup_addr = BOARD_SETUP_ADDR; highbank_binfo.psci_conduit = QEMU_PSCI_CONDUIT_SMC;