From nobody Sun May 12 01:14:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693916529; cv=none; d=zohomail.com; s=zohoarc; b=fSLrl15P+u6OS5YjHz2ly/CGlr9thddkz8W/6FwDD6/J3JgeaN4v8H0uGaAZ8f0WHDI5EmdLa7+u3wkhYmoYYm36qJ6c3uJvVujXUfzldFblIo0BFlsIHrh10xLBFDHnwappHopeByDxDH22hR+GYcgBvRCGq3HPFT0DfDfQ4M8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693916529; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fom2vgYtrw2N7/lqmr4BnBWCA2ps570z0kqcY4sB1MA=; b=jKnsP3M+DQwc1zitsVRxVfPIqfVtvVDPboG7n7hAiiDX0Gir6OeP+Gm0Nc+LH7ay5NY9iXC3gKCx+/PKiB78GHdfbRmUADrDbhuSYlAJacaGVX62xrVX/Eyivaqn0cJ56TVipPwZQZI3PZ7+ujxL+02fyO08uYylH6iY9rhyXlw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1693916529852182.77092120567522; Tue, 5 Sep 2023 05:22:09 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.595653.929250 (Exim 4.92) (envelope-from ) id 1qdV44-0001gJ-TV; Tue, 05 Sep 2023 12:21:52 +0000 Received: by outflank-mailman (output) from mailman id 595653.929250; Tue, 05 Sep 2023 12:21:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qdV44-0001gC-QQ; Tue, 05 Sep 2023 12:21:52 +0000 Received: by outflank-mailman (input) for mailman id 595653; Tue, 05 Sep 2023 12:21:50 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qdV42-0000wD-Ql for xen-devel@lists.xenproject.org; Tue, 05 Sep 2023 12:21:50 +0000 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [2a00:1450:4864:20::229]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ca0faf5e-4be6-11ee-8783-cb3800f73035; Tue, 05 Sep 2023 14:21:50 +0200 (CEST) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2bd0d19a304so39825711fa.1 for ; Tue, 05 Sep 2023 05:21:50 -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) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ca0faf5e-4be6-11ee-8783-cb3800f73035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693916509; x=1694521309; darn=lists.xenproject.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=ck71Hs7ixqPkjiOaa5EbuK0QCCHF4QhJSwo9WilH9lHmaF1lYw/xBMtSVCUjL/cCaO P3fetjDX/IHfff5XGA3kHj+7LrZqt+eCYg5++FKtc8va80toaDlsJfiACJJXno1cGE9F mCfCQxql0/M1kfar9Y6alPvB281YaNgJPGF96/lirYh5eCIVKoBalkcUbOrNcYUeWyl9 9ekGwpodTLjhYAJEzzLbvCplEMueresgzXeuxMOVVzVazodIdfe58DdQSW32Nc6m2csh DrR0NI2d8NPOdysJa/l3JegKOVwA3NaGlLqN8704IN8gXRg+dyfIFGS96alpjTYqbBum yRtA== 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=YP2pxZbAMfg7fIT7Uo8IRJfrOXVMG47LYrjLLLq8C7T5eRY3aoGZ9aWZPlFJe2q2Ny sTWAz+LeB5+ykCMDLTnRwAycls0JUjYWqGsdB9aONrvpiS8cKj/Oj1/MzvQly5DKoTZD gy1dMc2NqWg1J7NjTD5k3PAQIPZKcQiACo2v95QF8ueTWEelncdovFUy6Ocz7Dn5i8ra lHTZX8b8YxecTnxGMUW5cRbGnWA47PD7kFPJBrt6cJJRKolsHILKc+mLwVOBjpiWU0kG cKBRuVkcGnK+D4ge+MKRu4o056WbqAagEMx2MoS8zSt80Wu+KfsuDEvknwe8Q7z6mXlQ vYvQ== X-Gm-Message-State: AOJu0YxRqbgVEiy0g8RgKP3s39yCwARNU3XB0A0TFoUC5CbGqjyKNssU Lo5nKIS9ou3Ei+K5Xx952gFKJw== X-Google-Smtp-Source: AGHT+IGMdsgf/s9WMe8CesBc8Ve0lvCwfg45DPh1IToTH7tHvHwDiyDho3ZmRnkrYkRDDX1PPf9pqQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-Daud=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693916531590100001 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=C3=A9 --- 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; =20 #define xen_enabled() (xen_allowed) =20 -#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 =20 #else /* !CONFIG_XEN_IS_POSSIBLE */ =20 #define xen_enabled() 0 -#ifndef CONFIG_USER_ONLY + static inline void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t le= ngth) { /* 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 =20 #endif /* CONFIG_XEN_IS_POSSIBLE */ =20 --=20 2.41.0 From nobody Sun May 12 01:14:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693916542; cv=none; d=zohomail.com; s=zohoarc; b=TbXZi9AK87zXNFYepXMgIgovP3KxTXHWYqvwfu7zu6rp58AcO5L8uAPlHqabCI8Bgpf3Xif8nVLr/RNOjAgjeQmtt4n7tkrnE3gsqa8rAmlILF6B+Tr339Qu95XL7p4VK4yyZKcjTdjk8NAdF2icKmj9lgi7VnC7DvnXAz3vL/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693916542; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gzxK/xbqt7oVpzvsNE0mB2t8RXiKOYU8OLm+TL14vNw=; b=jOhAkiF6P5PyFnIAq86nTQGjB46NY3r6WBfhBod63pOzRV/OOm02wJBv1Eko3lBIouuV32LnDnNvYFC/sVHlMUfIaBmcbiM9oIJGQuKPpTiP+228JOsnHbRwRQCwhnbEpMRAIALw0o6DpCF38dinHpcFzi1KHiy/0+Y2DNJzR6U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 169391654247498.12268095975935; Tue, 5 Sep 2023 05:22:22 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.595655.929260 (Exim 4.92) (envelope-from ) id 1qdV4C-00024J-8g; Tue, 05 Sep 2023 12:22:00 +0000 Received: by outflank-mailman (output) from mailman id 595655.929260; Tue, 05 Sep 2023 12:22:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qdV4C-00024A-5F; Tue, 05 Sep 2023 12:22:00 +0000 Received: by outflank-mailman (input) for mailman id 595655; Tue, 05 Sep 2023 12:21:58 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qdV4A-0000wD-S1 for xen-devel@lists.xenproject.org; Tue, 05 Sep 2023 12:21:58 +0000 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [2a00:1450:4864:20::42f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id cef0c38c-4be6-11ee-8783-cb3800f73035; Tue, 05 Sep 2023 14:21:58 +0200 (CEST) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-31c479ede21so2167621f8f.2 for ; Tue, 05 Sep 2023 05:21:58 -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) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: cef0c38c-4be6-11ee-8783-cb3800f73035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693916515; x=1694521315; darn=lists.xenproject.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=N0i0yfEEbsmUkpTa1E44uiuVksl9e1A5b3rfK08X6RqLTI1DAMpnVrubYQ/bMRTB0D cDAWp5dOpl5vN/F3YqOMbwmKZwylLMcDCxBNBKQFKU1O8W6lXbadZtUZDva3HW9JhEOE oDxtlsdbQKjQmBOoN063yXcmAnEgY2qVPqoMNXZDsINvutuHLla0cZPw7nzbs7WYCx8d RV7Jo1XqRjP/Uk+qofjPPnbfpJUdUmKTFNJ9uQAuuAsPPXeDtNY1jr3B1eH0t1VD0IxL iDlaS0SGNpAjSNF+yx2FAKJ5WQi51v62FCAMr1lZsdhKT9Xd84cdBDh+rIOvL5zQ7PP/ UXjA== 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=dsvI0rCzwAdmEonBLHJd0LvrcxI48i+tr/SB2BYgiIxVqjhkdOv008zjGUkUN9v9xV qOJObH/c9t5drY+q5pZIjToPTgtw1G0xErJ68QQ8OWEGciBH0VIVzEbUhCbiUASH0eeT Nnjb4lj4Mxr91hBLf8hvAKcoe7j0eAEhJ7asKeH2pEW7c+bcr1DX7MLAj23tmvbC2O+c T4XOIP4paKBAZX6lbYyDDJ8WQLT8oAPN0+JaAybxldsQ7k1WIKFh/GBcA4kPrdn2/sgk wYEcX1UDmRj77gy9GLjOancq0q2EtlH2GphOvtng+BfN5k0xLSc2sr40E8HIjXycRjUc UGPg== X-Gm-Message-State: AOJu0YzfccbpI8+iJtKGK1P851Lm0AQaeLTHyYP6BihrZEXOsi6amwaO vXAQRENa/y+G7BaKZ9rTk0ai8g== X-Google-Smtp-Source: AGHT+IHbz5YkYNFi6ne5hl8VA0Ok/qvzggQRihAZp+7XxeX9TpfDtJE/W1Zlywnx0kt8k7q4Mg47Ow== 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) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-Daud=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693916542821100001 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=C3=A9 --- 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) =20 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); =20 #else /* !CONFIG_XEN_IS_POSSIBLE */ =20 @@ -38,12 +36,10 @@ static inline void xen_hvm_modified_memory(ram_addr_t s= tart, 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(); -} =20 #endif /* CONFIG_XEN_IS_POSSIBLE */ =20 +void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, + struct MemoryRegion *mr, Error **errp); + #endif --=20 2.41.0 From nobody Sun May 12 01:14:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1693916545; cv=none; d=zohomail.com; s=zohoarc; b=NGjgO8HCilr5Q2PZqkuaXuCVWFVaoZcGw38IGoj/X3IwdOQzy/j1visLiNzUODGn69bw0qWW9KsxuxQ1YDp87NDtVNm7s5zaLqxkuiyFIZprmaCdSiXkdPbmtfgvprwo3+lQrqOg2lDYHG3VpPKR/xwQcNbPav0TR/EW6vpgpq8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693916545; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sB86fzFOmVDgMvea5i3OluWg93+WlVCOeLM0GI/SSvo=; b=Ebi+diIgnafkqv5poQAaz8YvYiAkhibrTFfDEkT4ObUXwSOaJYzDH9MwtVvGHtQtcKiq9G1J5jPftTwu7j+cPAKcrdNDwGVD8zjNpstjZeKsUnHjYFWQTLtgKWzHUZAobO17FOY108c2h7chdpI3CSNYOzr94+CG4ff+7h+zy20= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 16939165451655.243212153353511; Tue, 5 Sep 2023 05:22:25 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.595656.929269 (Exim 4.92) (envelope-from ) id 1qdV4F-0002NH-Fm; Tue, 05 Sep 2023 12:22:03 +0000 Received: by outflank-mailman (output) from mailman id 595656.929269; Tue, 05 Sep 2023 12:22:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qdV4F-0002N7-Cr; Tue, 05 Sep 2023 12:22:03 +0000 Received: by outflank-mailman (input) for mailman id 595656; Tue, 05 Sep 2023 12:22:02 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qdV4E-0002LV-97 for xen-devel@lists.xenproject.org; Tue, 05 Sep 2023 12:22:02 +0000 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [2a00:1450:4864:20::42f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d026ab34-4be6-11ee-9b0d-b553b5be7939; Tue, 05 Sep 2023 14:22:00 +0200 (CEST) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-31c3726cc45so2171385f8f.0 for ; Tue, 05 Sep 2023 05:22:00 -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) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d026ab34-4be6-11ee-9b0d-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693916520; x=1694521320; darn=lists.xenproject.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=CFSys+oEQ1mwFgJd9akO2EGuY4ZT651m0Qx6NOmtc1Hcnpz2p1IuFxWNkK2mLZmDo8 Q7SMn4UIXPbILk6yNA05CDAMaw5TShzBY3UF3qUbDP1RJpHS9iWTH3+2fnZmFdoqHUJS SHXqiJzxMz0mBZ5PgsZeyNLb+SHXSvGpf790BizG/sbcKcxOuPmYUhjc7Xsfuc6sHuf2 1XiYzKCBNHd0okpWfPCwkdddGK2BquRdjFKrfJ4ZgXoCtVFpd+WdEKE/DmhIGPdxNPbV /BuAkdxDXjD7tEE/FX5xWi+eApmWz5Eu/EKYzz0Iv13BtD0OWaunFPldw7Wc7WiB1PhB Ohqw== 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=gPWjyHgy5uBnNw08EQL05E4HVwaf86N7pioQ/GmMpzjduS0tpkRc7bRMVls8LE7WY0 BwXxac/7vaM/oO8p5f5XgCkZs/4ODU2u5GKD9bsWJfUOlRNNTZSsIiekWssHe/FOntML Potd0WQLjWj109VSAY0cT1CCiD5SWM52U/xMU96aXBhSzgxUEG5XG9DLBl4ogShrHnv1 tOdBKHKzkd9v7VDwerXrrRsuLkh4UnMVwIq28iEJBTdkFlAE2oLXPPFe1h/jTXcUiSNA 5AqmEJ3AW8/4nbycPCjQ0FFnsi5Kdys4AdUBIVgUw9GXo3ipxgiWT7vvz+GjWIEYaquM HS/Q== X-Gm-Message-State: AOJu0YzvMwqld4inTSc2/Ju4SS2X8Oju9Zau2LcxbqIVeiiZf0ltryE6 6js8LIx6noCsno4zWKePEGUSUg== X-Google-Smtp-Source: AGHT+IGMv++IXwOb16f2+PfK5YVZCa7H80s2i/rxCKRU0mJ1BiJzgJBBclvgdAZjwKfes8Lh0/ctrQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-Daud=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1693916547223100001 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=C3=A9 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, } } =20 - xen_hvm_modified_memory(start, length); + if (xen_enabled()) { + xen_hvm_modified_memory(start, length); + } } =20 #if !defined(_WIN32) @@ -406,7 +408,9 @@ uint64_t cpu_physical_memory_set_dirty_lebitmap(unsigne= d long *bitmap, } } =20 - 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 =3D tcg_enabled() ? DIRTY_CLIENTS_ALL : DIRTY_CLIE= NTS_NOCODE; =20 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 =20 #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 le= ngth) -{ - /* nothing */ -} - +#define xen_enabled() false #endif /* CONFIG_XEN_IS_POSSIBLE */ =20 +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); =20 --=20 2.41.0