From patchwork Mon Oct 2 14:38:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 728552 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp1696583wrt; Mon, 2 Oct 2023 07:40:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUamnoiPm2CT0bKrONnC2tZiZU3W04tHfSDQrucmeqJd5tcYew93/DASpnQRAfvDfTHhAz X-Received: by 2002:a05:6358:52c3:b0:143:5383:af8b with SMTP id z3-20020a05635852c300b001435383af8bmr13935616rwz.11.1696257603607; Mon, 02 Oct 2023 07:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696257603; cv=none; d=google.com; s=arc-20160816; b=e5ZaDLKHx35uv+MCP4Zw/V4wdS72i6QTO4X0IvC6HMADLHWbniDErQlgW4TmH8aNgV NfuuMAtolGGUt2gWtJpph9P8ml1/SghfPS0aa8rj8A6Lnm0y7YzT1hsm/2rhDdOI/qvS 4+9VSqM7P6Gmm396BhFuSBUk5RvUJARPun5QDWAdY0QiWwzClQpSD/UIve7O0T8JQbeg ff/s4gH9R2DwVxXiSusORCPWbNCoA1dG2qXyEq+AAaJbmDacU8US/3yfO+3jHEGo1jTm fHh4ZBKDBF5wSbuhULaYQNEMLZYo10V0RnLr8Ajs2kVQ1rTb7wy13czTBepiu1lxG+1H IuOA== 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:cc:to :from:dkim-signature; bh=omsG/Ra9+rfhsWhAh93SFQCufEzYS0VuVJVZ9wRmIqE=; fh=bhLjEczjNDWf+xDs9FPR7/N1Vo49SFnn35dyotb6ST8=; b=NLoEqfW53cWuh/dOdMQmvtJYloDHQXkY7MjyPqr4eq7qSmmLOeXxvraZ0r9GV2Og4L rlVOcJQhWySrdUfjpcw5LnIlTg4CE41oQShF83TfyZSpEHB/nvY7XULBiK5yLFC4eV4k Pm317K/a1pBIExy+Invs8jOwMgiQpgHTnpBGVVHDA4lofJ/MPJ3E2zteL7xRrUYkrFGW TnIkD4AXTIWQaM6y+px9j3l1NaUi4qmozi33+pZWygjdrIlqVk7YJSi6dUJr9kVYuPrL ZPKtgzu4uMa1eZKZ++Vdaytz3R8UvuL9Y6oW/EmJHM3I6wTQkXnUG59rtp4qTEzy/sj5 AFgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rxvg6srb; 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 s15-20020ac85ccf000000b0041773edb414si1293928qta.655.2023.10.02.07.40.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Oct 2023 07:40:03 -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=Rxvg6srb; 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 1qnK59-00044t-Cj; Mon, 02 Oct 2023 10:39:35 -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 1qnK4v-0003w6-R0 for qemu-devel@nongnu.org; Mon, 02 Oct 2023 10:39:24 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qnK4u-0000VU-A3 for qemu-devel@nongnu.org; Mon, 02 Oct 2023 10:39:21 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3231df054c4so12398882f8f.0 for ; Mon, 02 Oct 2023 07:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696257550; x=1696862350; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=omsG/Ra9+rfhsWhAh93SFQCufEzYS0VuVJVZ9wRmIqE=; b=Rxvg6srbW/yoBzlYuGc3JvjWWIwwOcA1ok+QdKg/P68Povy+9whPFNmTl9buZG7Afs L1xbaadO7VjtF5iAOsfDhSdAMciBhZKcz5/wNKN0LAW1E0gHmU8hV6OAuhEYEkzMFWM2 U+MMg77UmtRiCeir3OL+v4g/dILPRU9GZ2kvVGOjL+N50Qev2thhCvw6OU9Ot2u5DhqC Qx52XjVZNZPE3YdhU+8rQQb7cFlyeJNvzd7XdXEjDsbnDNJ3qvMebzhaYyRMO81j7HR2 6ljWnCIuY3nDRR7J3NFCJBDbUuDNtiqIYe/3vIJJvS7jK+s4wulh4hyubjLWY6d9gu70 RYTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696257550; x=1696862350; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=omsG/Ra9+rfhsWhAh93SFQCufEzYS0VuVJVZ9wRmIqE=; b=S4ius3TanJ0k+6NWxPC9ZS001mpM6TnPAc1AL83y8ovavYCgC3PjiZNQQ6yKpsk/j4 3wTQ9EEwV4mWGyxJjJ6ZHsnjEYBgnweb56+YfI2qkID7INrGQCWGvfNjFgLbmwQCUmeh 0wlvj56PvIcfRka2V+y+NVkhagqCkEbFTW8j7gIjqlekJZJLOm7v/vyf4lC9GsbfwxmP 2A5HxkMU5S+XajDEuIrZAuuSI9IZBIBjJuFWFf+ixEJwbPitBJAL6yB3k/tWgI946vI7 InVDnT7Qe55fp+0OU/yLMpJGaPJe4H2iGvCDMlHnm6Kw3NPzpUu3cGObKVFeM1CyWvU8 BilQ== X-Gm-Message-State: AOJu0YywlFxl4nzZQsTHpA0XApDzu3wjGniqmcYpr+S3OjBStlVYeAAI bHzBVEEn+Hq/jAglN8wQx3jPyoLVqrW3Qne3uTCgMQ== X-Received: by 2002:a5d:68cf:0:b0:31f:e761:d47c with SMTP id p15-20020a5d68cf000000b0031fe761d47cmr9599047wrw.32.1696257550370; Mon, 02 Oct 2023 07:39:10 -0700 (PDT) Received: from m1x-phil.lan (sto93-h06-176-172-7-203.dsl.sta.abo.bbox.fr. [176.172.7.203]) by smtp.gmail.com with ESMTPSA id k10-20020adfd22a000000b0032320a9b010sm20411236wrh.28.2023.10.02.07.39.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 02 Oct 2023 07:39:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, Daniel Henrique Barboza , David Gibson , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Harsh Prateek Bora , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 2/4] hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_prepare/commit Date: Mon, 2 Oct 2023 16:38:52 +0200 Message-ID: <20231002143855.50978-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231002143855.50978-1-philmd@linaro.org> References: <20231002143855.50978-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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 autolearn=unavailable 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 Check tcg_enabled() before calling softmmu_resize_hpt_prepare() and softmmu_resize_hpt_commit() to allow the compiler to elide their calls. The stubs are then unnecessary, remove them. Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/spapr_hcall.c | 12 ++++++++---- target/ppc/tcg-stub.c | 15 --------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 522a2396c7..a860c626b7 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -124,9 +124,11 @@ static target_ulong h_resize_hpt_prepare(PowerPCCPU *cpu, if (kvm_enabled()) { return H_HARDWARE; + } else if (tcg_enabled()) { + return softmmu_resize_hpt_prepare(cpu, spapr, shift); + } else { + g_assert_not_reached(); } - - return softmmu_resize_hpt_prepare(cpu, spapr, shift); } static void do_push_sregs_to_kvm_pr(CPUState *cs, run_on_cpu_data data) @@ -192,9 +194,11 @@ static target_ulong h_resize_hpt_commit(PowerPCCPU *cpu, if (kvm_enabled()) { return H_HARDWARE; + } else if (tcg_enabled()) { + return softmmu_resize_hpt_commit(cpu, spapr, flags, shift); + } else { + g_assert_not_reached(); } - - return softmmu_resize_hpt_commit(cpu, spapr, flags, shift); } diff --git a/target/ppc/tcg-stub.c b/target/ppc/tcg-stub.c index aadcf59d26..740d796b98 100644 --- a/target/ppc/tcg-stub.c +++ b/target/ppc/tcg-stub.c @@ -28,18 +28,3 @@ void create_ppc_opcodes(PowerPCCPU *cpu, Error **errp) void destroy_ppc_opcodes(PowerPCCPU *cpu) { } - -target_ulong softmmu_resize_hpt_prepare(PowerPCCPU *cpu, - SpaprMachineState *spapr, - target_ulong shift) -{ - g_assert_not_reached(); -} - -target_ulong softmmu_resize_hpt_commit(PowerPCCPU *cpu, - SpaprMachineState *spapr, - target_ulong flags, - target_ulong shift) -{ - g_assert_not_reached(); -}