From patchwork Tue Sep 5 12:21:40 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: 720119 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp2089693wrh; Tue, 5 Sep 2023 05:22:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEneeeZ23kqxEHm5PwbaDAXd59aqKYJw28X6Aywm2cZXkoj/dYOQrx+NpNnApAWQvjUYmmk X-Received: by 2002:a0c:cb14:0:b0:648:190c:bdd5 with SMTP id o20-20020a0ccb14000000b00648190cbdd5mr16232602qvk.9.1693916563980; Tue, 05 Sep 2023 05:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693916563; cv=none; d=google.com; s=arc-20160816; b=UxQHNthW3vN5AXx7vJBTyMCdb3TWKpYVbHmqzfkkUCcW7LjTd+Sk6Q2LNdg3CuOZEc FMiBaEXbQ7UWXgPLkIVR55xk8+nuYU74wFoUUZdcgyHoKHUYcxKS3WJYTPXtVZZZ2hPl yAFpPRX5aOcT3LuiD/U/XsNO1KOCCfInmqM6P8hUHYT1+SfXLaAaaRaryCsQAdZV0Dhr a1gkB5p20w+NrmL6n0bj0N+HmGu30qids+/DWGQl6/j+TuDvBnxZXRBAZOFz3v2viBDf mNnsrOX0XgkFczYia+muVsz0HtRYmsepOJmtbadM07x2EKTENpcbHWb9nxkys2xsC0Xa OuvQ== 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=fom2vgYtrw2N7/lqmr4BnBWCA2ps570z0kqcY4sB1MA=; fh=IPxTRbSALOGxZ8pZ7w3ok1186C//pbWjFc+O7pLAROI=; b=mUyA8TZ67Ogjr3zIM1N3xqB/twjZqlBN5vXcfi+XZFQ+CrdorEh+TLXyb7VYnhDN1f izSRhIaqR/gZCOYd4l4dyhMFhxX3ZDJJan2ITekM4NvA1VshKNyM3PeaPo6NTOgvFbOb r8Yn1K23ACxDocc5kWTXWdHfvSbp9Uo5RT8Zf58gTEIyT7j9Um5+259cdMRLg9jHoJWq kcI+6mqvF4RuGhbUa6jFWkTb8q65w0wSRn/MTEv9pmub3oaEXKDn8NS1ZTlUE/0Td71r jYOhKmcSymSkPm3stwMlUAtGEe54+lcWWl56R/M6MwZr8P4e0VuWfTi6eDdGfa6RfE5t 8zMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cHDpqXUP; 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 c12-20020a0cf2cc000000b006540955c7e5si5643265qvm.494.2023.09.05.05.22.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Sep 2023 05:22:43 -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=cHDpqXUP; 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 1qdV4X-0003XU-E0; Tue, 05 Sep 2023 08:22:22 -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 1qdV46-0003Ph-0V for qemu-devel@nongnu.org; Tue, 05 Sep 2023 08:21:56 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qdV43-0000ow-KR for qemu-devel@nongnu.org; Tue, 05 Sep 2023 08:21:53 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b974031aeaso39986071fa.0 for ; Tue, 05 Sep 2023 05:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693916509; x=1694521309; 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=fom2vgYtrw2N7/lqmr4BnBWCA2ps570z0kqcY4sB1MA=; b=cHDpqXUPyr+Q5wrDdjumlIBWyv18b1CTKyLENihgkQNWEeFsAydztskW5r/vmOeyPk qZiVwwuY8I5l0OxGkslhg3iQkoSPzNOQgkv1VsDvB+1r2+W6c6NhvkA6e/Edlig+1R1W OdSaWCvHVaeBSJ+qnaT/fjzLI3rfGiZPt36JQIt9fj0Z4QBIWzWf1mht8FHuS3ExZHvr Vxtkvvhqgp8dvcoRYYGK0m6dFKdFrIxXE9VyNgX2hi8zHRSyr6zZzCgbmI3NHi2RTtlg amfObPcHkK9x0ZUhU+Bi2fP68Ma44HsdHSY4gXuXJymhp2CUaBc9OUONMAjLx8BP4u3h VQUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693916509; x=1694521309; 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=fom2vgYtrw2N7/lqmr4BnBWCA2ps570z0kqcY4sB1MA=; b=hPKF2Hn22fdOmOtNNw201Iv1uLImEddw1FVAS3HX7VBdB6YPu0q++QAQYAejnReFtc nMLa/sZeq1MffQH/KcwzkdfSqdhKWS+QrYnj5zxG4VypiK/ueM3EtcZoepJBhCED86Lw 8uTU1T5Ar5tZEiKcOOMvfdNN+7CUDzjykz0fRtlGnTri/YvW76wlWRsFtRnUaXTo5bOo tZEJtx5vIZ0lQkm7Abqj9RUJ5YHF+h7wrEfsrx38Fd67cBKVnEkPqL+D/TtRGloxYXcl 9WtCS4FjCY0Ze7rkGt79i3Xht2fRiOmAbz8d/iOSMbBXYY/ojbKeh26rPoRA2GOcyKQQ snrQ== X-Gm-Message-State: AOJu0YzDQIxFoa8NlgS/N8c8xwa5kV3XIpVqNH+f+k/UQq8xU+zEsVTb y0uiElIUsZKmVrpafnFlzAV95qymKzBTj52d3qE= X-Received: by 2002:a2e:b045:0:b0:2bc:df55:eec7 with SMTP id d5-20020a2eb045000000b002bcdf55eec7mr9131145ljl.40.1693916509654; Tue, 05 Sep 2023 05:21:49 -0700 (PDT) Received: from localhost.localdomain ([37.69.27.38]) by smtp.gmail.com with ESMTPSA id j22-20020a05600c1c1600b00402be2666bcsm12497901wms.6.2023.09.05.05.21.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Sep 2023 05:21:49 -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?= Subject: [PATCH 1/3] sysemu/xen: Remove unuseful CONFIG_USER_ONLY header guard Date: Tue, 5 Sep 2023 14:21:40 +0200 Message-ID: <20230905122142.5939-2-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::235; envelope-from=philmd@linaro.org; helo=mail-lj1-x235.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 In commit da278d58a0 ("accel: Move Xen accelerator code under accel/xen/") we used include/sysemu/kvm.h as a template for include/sysemu/xen.h, using the CONFIG_USER_ONLY header guard. In retrospective, it is not used / useful, so remove it. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/xen.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/sysemu/xen.h b/include/sysemu/xen.h index bc13ad5692..9b2d0b21ff 100644 --- a/include/sysemu/xen.h +++ b/include/sysemu/xen.h @@ -26,16 +26,14 @@ extern bool xen_allowed; #define xen_enabled() (xen_allowed) -#ifndef CONFIG_USER_ONLY 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); -#endif #else /* !CONFIG_XEN_IS_POSSIBLE */ #define xen_enabled() 0 -#ifndef CONFIG_USER_ONLY + static inline void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) { /* nothing */ @@ -45,7 +43,6 @@ static inline void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, { g_assert_not_reached(); } -#endif #endif /* CONFIG_XEN_IS_POSSIBLE */ 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 From patchwork Tue Sep 5 12:21:42 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: 720117 Delivered-To: patch@linaro.org Received: by 2002:adf:d08b:0:b0:31d:da82:a3b4 with SMTP id y11csp2089624wrh; Tue, 5 Sep 2023 05:22:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHs7Xco5wyXlE/XnQ4pX1T85BxGN+vm3PLXdM1CLjbdXbMjd8XTWnFNkK8eEd2fWs7COPF4 X-Received: by 2002:ac8:5787:0:b0:400:97c6:b40b with SMTP id v7-20020ac85787000000b0040097c6b40bmr18884988qta.48.1693916555352; Tue, 05 Sep 2023 05:22:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693916555; cv=none; d=google.com; s=arc-20160816; b=Q1Zbo/XRUKJl3QSxvzf7VYv2Iz1HfzmXzdnEyni1LGB8ADwg07VnuJuhF1KnA0tKqY z/hEuepO/ZdwEUnFdpKoLHkzsEON7I6e0sh90p3JWSI9qEOxa18EZQptyXM53eOSVrfM VYlx3WRnO35ZVPFmleV3wqHL6uhjsQnKFuBKiLNPGXn0JX2EsvcHPLz2iVykn432m/EG hSXkG9M4Z2QlbmpOSLNgiLInDIXJSwGpNvz95wJeP+c5pIzcgX0xVGD0F3IbDHua6Bs6 I3XC4lf0ZkcboY5jEdAHE+1xj6YWge+t4axhe4nYg81ND1etRoTx7l7BkqerI4cBo2Mj 5Cxg== 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=sB86fzFOmVDgMvea5i3OluWg93+WlVCOeLM0GI/SSvo=; fh=HEfF63zxTP/8VRz7fdJRxkhsW8sjIFlsgEHIq3hxBQo=; b=ojG+qCvozvXoH91KNln1kJoxJqnzaJdSTtjmP9WWMTe3NX/s30/0jmJcamFjlbGOlg MKDkePfv1KXDjFgiSmckV2Js2ThDwNzxzxRE0X3zyYFZE2riqQ47vPJb/ktBL2/9RRyH uIDOA5Q4YSZZO55iiGWihtxj51hQAoYu8s1jQOEPOnkUMzaRFoTLVycvB/MXtF7OkTAz yxSdGkGxL1KBUF/gFQUzJPJChaMyti9I6PSLBcFmA9Di6xhXJQfzkD9H/pC0HzZb2lWw x6koiNc6hZvKxAwl44sV1Kh6aBWjJ6jjdYpWXaPzFLzQmCVbXsOXKAoTjjQpBGhvIxbs DdkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I34CpIIu; 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 d10-20020ac85d8a000000b0041215aa1b15si7623705qtx.793.2023.09.05.05.22.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Sep 2023 05:22:35 -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=I34CpIIu; 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-0003f4-6U; 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 1qdV4G-0003UY-T6 for qemu-devel@nongnu.org; Tue, 05 Sep 2023 08:22:08 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qdV4E-0000pO-Ln for qemu-devel@nongnu.org; Tue, 05 Sep 2023 08:22:04 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-31c3726cc45so2171391f8f.0 for ; Tue, 05 Sep 2023 05:22:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693916520; x=1694521320; 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=sB86fzFOmVDgMvea5i3OluWg93+WlVCOeLM0GI/SSvo=; b=I34CpIIuMOae5ko9w2U8XPSel/qy3c/rGoz1G10z8i2trWkHnTgeESlxQBF+y3DH1h tvzYkTOB2/gIaw3dcQqsffM3/dUqM7m4PkaYrnEd1V+ZkwkQscE1VvIidXquFqJjDUxs F59OUUsM/9PCp9esiBEnw/z6lPRT7SuJW8d/zoY2Bgl+rm/II0OKXDXbYZXqMFQgz13Z qBrdT2qgQiNoAUvQcVTm7x4ativZjla2tE/2ElRzvEKLZKzUmkBm7VeBw6v79Ffw5HP/ 70fsF7LN0ADeg7+RlbXKJLTrTiiLKbJ3GczuPtdqEFewEeiQIJSsmlU9dQdF6U0Vjin+ RoHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693916520; x=1694521320; 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=sB86fzFOmVDgMvea5i3OluWg93+WlVCOeLM0GI/SSvo=; b=BzT9h7MFrW6mowLY/yKw/x0Dv6ZXjQNZl/PDiXZ8/L7PbkF2bcp3LmjPm0ATqChSZI lH63VDRLwgYxEjrvunXDV+9Rrbb6vAlwbUk7cmlIvcYlfLwi429Bx2/ymN22dGIeeFSc wUxwEv1g8WBtzn5JV/MQCursWDuEvhYGHptaScfTPDdyOVyGYJk+26jSkGbGc769Eefs 7COkFpwO8Q2/v9ZipBmu6wza25Orc3HuICN3xjOYudElAaMy4lW6cYJoOJlLDRQg5F/A n++bWCyk5JJOjeZRf4udpKjDcBn4Xv7OBXm3RzuufSBuTP8R5d2z2f36gh1It/aZLgzb j3KA== X-Gm-Message-State: AOJu0Yz8O2/SQ4BaMBMjwJ+qdylkMJvfe6b20TcxIpXQnEslh1a23wrF 4YjcTIeu9hb3V76B1qCWAvCncJ9XHgq3ZjIM52A= X-Received: by 2002:a5d:5510:0:b0:319:6fff:f2c1 with SMTP id b16-20020a5d5510000000b003196ffff2c1mr8841138wrv.38.1693916519881; Tue, 05 Sep 2023 05:21:59 -0700 (PDT) Received: from localhost.localdomain ([37.69.27.38]) by smtp.gmail.com with ESMTPSA id n9-20020a05600c294900b003feff926fc5sm16775933wmd.17.2023.09.05.05.21.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Sep 2023 05:21:59 -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 , Peter Xu , David Hildenbrand Subject: [PATCH 3/3] sysemu/xen: Allow elision of xen_hvm_modified_memory() Date: Tue, 5 Sep 2023 14:21:42 +0200 Message-ID: <20230905122142.5939-4-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::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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 Call xen_enabled() before xen_hvm_modified_memory() to let the compiler elide its call. Have xen_enabled() return a boolean to match its declaration in the CONFIG_XEN_IS_POSSIBLE case. Suggested-by: Daniel Henrique Barboza Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Hildenbrand --- include/exec/ram_addr.h | 8 ++++++-- include/sysemu/xen.h | 15 ++------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index 9f2e3893f5..66e849ac4e 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -330,7 +330,9 @@ static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start, } } - xen_hvm_modified_memory(start, length); + if (xen_enabled()) { + xen_hvm_modified_memory(start, length); + } } #if !defined(_WIN32) @@ -406,7 +408,9 @@ uint64_t cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, } } - xen_hvm_modified_memory(start, pages << TARGET_PAGE_BITS); + if (xen_enabled()) { + xen_hvm_modified_memory(start, pages << TARGET_PAGE_BITS); + } } else { uint8_t clients = tcg_enabled() ? DIRTY_CLIENTS_ALL : DIRTY_CLIENTS_NOCODE; diff --git a/include/sysemu/xen.h b/include/sysemu/xen.h index 1f797a9abe..d84a5f3551 100644 --- a/include/sysemu/xen.h +++ b/include/sysemu/xen.h @@ -21,24 +21,13 @@ #endif #ifdef CONFIG_XEN_IS_POSSIBLE - extern bool xen_allowed; - #define xen_enabled() (xen_allowed) - -void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length); - #else /* !CONFIG_XEN_IS_POSSIBLE */ - -#define xen_enabled() 0 - -static inline void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) -{ - /* nothing */ -} - +#define xen_enabled() false #endif /* CONFIG_XEN_IS_POSSIBLE */ +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);