From patchwork Tue Sep 5 12:21:41 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: 720118 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp2089687wrh; Tue, 5 Sep 2023 05:22:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1+AhaibII2X5DodvUlh54DdfUnD7Ny5ESVbZlBBy6KBBGiYDin7UX7hf/KVnvX+352Ifx X-Received: by 2002:a05:6214:224b:b0:63c:913f:2b18 with SMTP id c11-20020a056214224b00b0063c913f2b18mr22265549qvc.2.1693916562640; Tue, 05 Sep 2023 05:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693916562; cv=none; d=google.com; s=arc-20160816; b=YN+65tTRJRFrm0vJ8oza8RsSsqqRWKWTqQvEvuNYaxyhTA93cxifVfqPIgVs+OlUJw Xh9vxWovD4zBZxz9UKWcYUGx9+iZVucqdZW48LDj287ly5XnXynksEK8eM/rs6VCEKMf KBtHsTqEyrtODOMetTyX0biQonVfToaRumvw2YN/77HUAtzhpk1sbtYBWBXfkoTQ/0ia I3Yw5j7EU774Ne0zJxJzQrQwd36LXmbFSu1vtMRj1jInl/AAOZfWsGWqXYRnnAupALq8 4DLhZu/fR0XP7BFz9YZCqHFz4PexACMC3XgGvNqfcG6VMuD/TdEP4cz7ia775FenUpy/ 2ZTg== 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=gzxK/xbqt7oVpzvsNE0mB2t8RXiKOYU8OLm+TL14vNw=; fh=FEpqIR+67c1FcCRdM9+EkJ2xKCsOqgIiMJsvuKxwOiw=; b=ziudv6O5uOLGhNkfX59sWdrB/gVlQ3sxBkXWnOIO0JM6pMd3cWe3SWbT5CElDBv1iq Cp8dbWelksnF4Y2SwNW54GiAmvgll/lJ+SzZUwTJoOJ5kFB+xPqBEa7+v3bEKg+VYG8c /Id30BxE7aonypiojMTTLB2R6ZnB3VcrbJ2txxsJYBoiRCPRxMUgC5G1YwI5GiJ6AKWm bKPeylmi+Kk1/ljsYMNnmp1C8kZb440PdpmDd7+1KtCBdvxkDcfUGENWmvHRRy6XyWAS O2WlF5I3fBZJcQ4h1Jd282uhuwWafVxg+AqhB2JcFpXqqHrUQ2N+IlQjcKwbtJUNnlSp qR6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VRSFKpPk; 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 u26-20020a0cb41a000000b0065170e19e88si8073451qve.191.2023.09.05.05.22.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Sep 2023 05:22:42 -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=VRSFKpPk; 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 1qdV4b-0003jG-UW; Tue, 05 Sep 2023 08:22:25 -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 1qdV4E-0003Tm-Sb for qemu-devel@nongnu.org; Tue, 05 Sep 2023 08:22:04 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qdV49-0000pC-Nc for qemu-devel@nongnu.org; Tue, 05 Sep 2023 08:21:59 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-401da71b85eso23975685e9.1 for ; Tue, 05 Sep 2023 05:21:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693916515; x=1694521315; 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=gzxK/xbqt7oVpzvsNE0mB2t8RXiKOYU8OLm+TL14vNw=; b=VRSFKpPkpoAHefW8vIXHqEINvVaKm2dlEBiGmRheqcapLPFE4iPR8axW4TTUmXTdMh dEABrrCCkd5TAlzOy45ZmDeZHSh8TME7f4jsYdqRFC3uP1mbdKPEEmxQui321491KTCS QCnMGcHE+YbArGVpOCw6ODvjb7Ob9mGR4/zorlDyMXrYUTekWhD8Nvk/NWeTuJLiykum LdokdgEYBj3vO5ccKUAPBhpiqtyQSO9bJSdgaF0MKLeEZVVry2Vn8RG08HUodjslp4ei XCLzictG+mOf+vVlphwR4hMhfH/PUvYcPwrichtW5CRIiffsF6q4g2/UdDu/nyQF9iFZ 4g9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693916515; x=1694521315; 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=gzxK/xbqt7oVpzvsNE0mB2t8RXiKOYU8OLm+TL14vNw=; b=PsjJ8rS23Ch2jMJltRgDm+Mz+ykuSdvEt5mYEJbN+DYF780w7NYSv4XvI9DNS1/OAE J0WsuWLTJOpMJ6LGlnxvYnPljCwdsMUJRT3qKdTSIn7h+omGk8g2SQ/zn7zxOog9awBP h+Ha5nozqQoCuyljPU/wKXz7wmxlqoB8E2+s9vGizCZHwGSuPJsPypuDl15vfYLo1G2F Qaciq3gLEBfAJT4Usye6ACiWFEf2D94EfKwAxMKLiVETKCueVREo3OVqtzgDyqrtIjLk 0iEvaA5RoDAk3IEy8+bu78uYg+prRCBfS3XCKu2bleBjCxQBKHHYqHKYdyJip8fy41rp p2sQ== X-Gm-Message-State: AOJu0YwL52Y9Uxa36wRi/19BK3BIN4hhauVNaIaOWoSCQSjxijMGuFTR sSDue/N3DlQ53s7B8C6SKvdgyq/gIrSY/QsyruY= X-Received: by 2002:a5d:56c7:0:b0:314:3a3d:5d1f with SMTP id m7-20020a5d56c7000000b003143a3d5d1fmr9789209wrw.19.1693916514769; Tue, 05 Sep 2023 05:21:54 -0700 (PDT) Received: from localhost.localdomain ([37.69.27.38]) by smtp.gmail.com with ESMTPSA id bp5-20020a5d5a85000000b0031f07d1edbcsm14680949wrb.77.2023.09.05.05.21.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Sep 2023 05:21:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paul Durrant , Paolo Bonzini , Stefano Stabellini , xen-devel@lists.xenproject.org, Anthony Perard , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Daniel Henrique Barboza Subject: [PATCH 2/3] sysemu/xen: Remove unreachable xen_ram_alloc() code Date: Tue, 5 Sep 2023 14:21:41 +0200 Message-ID: <20230905122142.5939-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230905122142.5939-1-philmd@linaro.org> References: <20230905122142.5939-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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=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 The xen_ram_alloc() call in softmmu/physmem.c is guarded by checking for xen_enabled(), which evaluate to 'false' when XEN is not built in. The compiler elide the function call, and thus the inlined function is not used. Remove it. Inspired-by: Daniel Henrique Barboza Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/xen.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/sysemu/xen.h b/include/sysemu/xen.h index 9b2d0b21ff..1f797a9abe 100644 --- a/include/sysemu/xen.h +++ b/include/sysemu/xen.h @@ -27,8 +27,6 @@ extern bool xen_allowed; #define xen_enabled() (xen_allowed) 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); #else /* !CONFIG_XEN_IS_POSSIBLE */ @@ -38,12 +36,10 @@ static inline void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) { /* nothing */ } -static inline void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, - MemoryRegion *mr, Error **errp) -{ - g_assert_not_reached(); -} #endif /* CONFIG_XEN_IS_POSSIBLE */ +void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, + struct MemoryRegion *mr, Error **errp); + #endif