From patchwork Mon Mar 11 19:12:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 779435 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp1690361wrt; Mon, 11 Mar 2024 12:22:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXyKnpcohkMZnhh0alf6uzOqewTbvMDh1F4xk4nOn4p7mD7xaoXQgDlMaDiY4iVC3+5f0/pFgLa4BHzUsnUBaJ8 X-Google-Smtp-Source: AGHT+IGQ2MFug4mhLSh/e2BgSpTVJCNtRqxtiKlci2gTdkA/yQweVOTbazS+78eba0zccYvDMTEK X-Received: by 2002:a81:f207:0:b0:60a:170e:574a with SMTP id i7-20020a81f207000000b0060a170e574amr6011411ywm.43.1710184946190; Mon, 11 Mar 2024 12:22:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710184946; cv=none; d=google.com; s=arc-20160816; b=s8SrA/qw90nGatThQ/dlvoV2mKDWO/tJP0PnwdPQAddryHQJSvy3jV22BfwrXXgO/Q hfWYNjSkvSna9atF3MybC2CrP6OEZWY58MMKeyEcW+eL+ZLD86937uvqfE4uvUdeZbof DTcWAmzEMJa85P+amxu2rDRGjVau7VwYwigPFENQmRcLmlOm4xEb6t0oqIBTU+uWtDvB JQQYAieOv5FCkdi1wKBEdRJ5yh04MVbXTuELBHUhluckCSbjzH/f9n35KUpuS3VRSlrL G4kISgPcDsOx3bMlT6KoWxjXCHCmrQGM4TMyRXKYKTq/9jeGZeetkLp2u6iAcrBNUzqo jrow== 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=uGkqi61JFcx0yploTSJU0yOV4s33JLq/DllCnbokV38=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Hv51Dsurac86usQnCmgVn6a3du4amXMguw+Up54gS0m8LSH/k7sBkFgAceZ5iqKB9W 7Jz56iB2AkWommrJb5JUzPnfLnhVzCEw5i8vCUBbxe5MOgD84z81RBBMCP+uk1SN+qVx NQIGVbIdBugiQ9fTv4DP72beP8gqfDIoqqrMWVJMkYIevdjW9qTvELVpIoe+z1NUdLwF f04EByhdxraSpORzr7+xEEGWtg1wIpyuRiOPCYadNYFtjKd5FLYyYQgZmqPGfF/Kfh4p c6isqR/Y1yJ/UX9ODZqwloieDkQ/OkMGigEwRZvl96UqWLuZnIb02zLQOxNGzzwLb23y wN+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nPi0jeCD; 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 c9-20020ac85a89000000b0042f2009c9e4si6116827qtc.762.2024.03.11.12.22.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Mar 2024 12:22:26 -0700 (PDT) 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=nPi0jeCD; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjl9K-0006aJ-Ku; Mon, 11 Mar 2024 15:17:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjl4u-0003OD-4h for qemu-devel@nongnu.org; Mon, 11 Mar 2024 15:12:59 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rjl4r-0000M8-4D for qemu-devel@nongnu.org; Mon, 11 Mar 2024 15:12:51 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4132600824bso9416725e9.2 for ; Mon, 11 Mar 2024 12:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710184365; x=1710789165; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=uGkqi61JFcx0yploTSJU0yOV4s33JLq/DllCnbokV38=; b=nPi0jeCD+2iLMXV2964VV52M9+/H6ck+LZ/sDDOqy+yvLnhV5a2pw318A2cdszWJ6E 5QcrIcKTm2Grq/pItCQLdiVlEVODU7i19kugEiX5DrEt6+U80lLNG7grFMUl8KhGagqt 46dWu8rhssjH4+Zuo8MDtNkz0k1scIvCM6ovbP3v71hh/dFzHx5nPYFLSp33coXqxwuw gwFRaUun6sMq4jYKQSKhyeE3TZBiAowEWBSY3YaafbMLvxmmijzTuBbm7m+g9gBGiyoo BYYqMo1YvFnqwz3utm1Spd/yF0BIS4/rTGwUBvBOJgxdJDYZZoblkSFaiBOw3oSUn16/ e37g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710184365; x=1710789165; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uGkqi61JFcx0yploTSJU0yOV4s33JLq/DllCnbokV38=; b=pBnMf0RUfzFLo4I+KU/AjdvajFdCrJ6pPUcksznB7jrUNHJVi/MFQrlZ984GK4a1Wj BqwHm63377yBemT3XsaQmsuqziOsWZlZeZgolN31dLyQBO6UzzEQa2uFGQsC32tgBK9q PiFnNyXZfVt+peIU0yvWTFVyLCLharxFOIHLe2aBCP23eKmxNck/t8ys7osTIxEFe4Ep MuCvRAL2O9M0kRKZCVkewCReqGFHk2yQJ09JMozR5Lwy0yo2u3p986S4CdRvKPTZVba9 UCA/eeiV/A6Kz+u3KVFkfa6o02nHvjNvJh0M723Q8x+YCbigREdXMGg2huYHdD0ZbN0M 2JkQ== X-Gm-Message-State: AOJu0YzHdqPpuNcVTGzAkBwDMn7suAvRzhlBMTJCkyEvnwhFmCo2OHHD ZVnNPSC2OhSkj/YqtBQEn3MC3ZRQ0kXiq/qGd2rQSEWL73xKluWZ9MimYX5nuhzC7lkTqrb+UGS Q X-Received: by 2002:a05:600c:3b07:b0:413:27d0:45f4 with SMTP id m7-20020a05600c3b0700b0041327d045f4mr1039924wms.6.1710184365205; Mon, 11 Mar 2024 12:12:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id t10-20020a05600c450a00b004131388d948sm14425266wmo.0.2024.03.11.12.12.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 12:12:44 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/20] contrib/elf2dmp: Change pa_space_create() signature Date: Mon, 11 Mar 2024 19:12:26 +0000 Message-Id: <20240311191241.4177990-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240311191241.4177990-1-peter.maydell@linaro.org> References: <20240311191241.4177990-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.google.com 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki pa_space_create() used to return an integer to propagate error, but it never fails so let it return void. Signed-off-by: Akihiko Odaki Tested-by: Viktor Prutyanov Reviewed-by: Philippe Mathieu-Daudé Message-id: 20240307-elf2dmp-v4-4-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell --- contrib/elf2dmp/addrspace.h | 2 +- contrib/elf2dmp/addrspace.c | 4 +--- contrib/elf2dmp/main.c | 5 +---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/contrib/elf2dmp/addrspace.h b/contrib/elf2dmp/addrspace.h index 039c70c5b07..c868d647387 100644 --- a/contrib/elf2dmp/addrspace.h +++ b/contrib/elf2dmp/addrspace.h @@ -33,7 +33,7 @@ struct va_space { struct pa_space *ps; }; -int pa_space_create(struct pa_space *ps, QEMU_Elf *qemu_elf); +void pa_space_create(struct pa_space *ps, QEMU_Elf *qemu_elf); void pa_space_destroy(struct pa_space *ps); void va_space_create(struct va_space *vs, struct pa_space *ps, uint64_t dtb); diff --git a/contrib/elf2dmp/addrspace.c b/contrib/elf2dmp/addrspace.c index 6f608a517b1..4c127c9b1ec 100644 --- a/contrib/elf2dmp/addrspace.c +++ b/contrib/elf2dmp/addrspace.c @@ -57,7 +57,7 @@ static void pa_block_align(struct pa_block *b) b->paddr += low_align; } -int pa_space_create(struct pa_space *ps, QEMU_Elf *qemu_elf) +void pa_space_create(struct pa_space *ps, QEMU_Elf *qemu_elf) { Elf64_Half phdr_nr = elf_getphdrnum(qemu_elf->map); Elf64_Phdr *phdr = elf64_getphdr(qemu_elf->map); @@ -87,8 +87,6 @@ int pa_space_create(struct pa_space *ps, QEMU_Elf *qemu_elf) } ps->block_nr = block_i; - - return 0; } void pa_space_destroy(struct pa_space *ps) diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c index 86e709e6da3..8a71e2efd28 100644 --- a/contrib/elf2dmp/main.c +++ b/contrib/elf2dmp/main.c @@ -543,10 +543,7 @@ int main(int argc, char *argv[]) return 1; } - if (pa_space_create(&ps, &qemu_elf)) { - eprintf("Failed to initialize physical address space\n"); - goto out_elf; - } + pa_space_create(&ps, &qemu_elf); state = qemu_elf.state[0]; printf("CPU #0 CR3 is 0x%016"PRIx64"\n", state->cr[3]);