From patchwork Tue Nov 14 16:31:18 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: 743792 Delivered-To: patch@linaro.org Received: by 2002:a5d:67cf:0:b0:32d:baff:b0ca with SMTP id n15csp2267967wrw; Tue, 14 Nov 2023 08:32:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbCND7XIqUzFlTeSeYlHta41gjILEstAMcRDYXtv28CGw22e5uHdtFC6JfFp7PpY7qwWaV X-Received: by 2002:a05:6830:7192:b0:6cf:6837:e4aa with SMTP id el18-20020a056830719200b006cf6837e4aamr3332448otb.27.1699979533063; Tue, 14 Nov 2023 08:32:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699979533; cv=none; d=google.com; s=arc-20160816; b=ol7Ypc+Hx/D2UZtJvkRtjL3nhThWCBCDPgV01w6tMDRAyy87G8lrrrA710/17b2Igs eszdRHx5EeuZiXfclr6CiuTEL7/yRSOx3g1O4+Y5wrGLBMlgsW1Obr6XWDjFuooBd5WP PKGOYQQtHMZqjgo77R8OOYuZaiwanlCRKAHDWhYMD+UBAo2cbYdM6n1kbcTs5WvoYWc6 jZbv4i2y8umXt9FX28sev46lKJ3Wc5G4n85UCYPnkj9Fw+RpG7zjkC4KYkO5uwDiSP3v fs+J4LwNRtlDCKiMCDBzLXhZVthwM9WlAWFJ72WFJ8sv1bL1ctcjfa6Y63AhK/UBBwTF JJGQ== 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=hRnzgqjbzRTGqJ5jrYQJxW1BmP5r27YtuyDu1IVzHFA=; fh=5lvcVWWZfEaW1el3BGyMdrws/7nl4pTH0ES2/FGtlZo=; b=q5yIdInMj+3VL3WoVHGyJdnLtnsGBNyMHSB0rdxmmpqEIXNXoUmOsgRkkcIQxF71Sb xpYwueh+r7YjTp3Q+RK6XAMmBy1y7NAdVPUR2NOak7l7XzSQjeiKT7paKFAhDK9Kamr2 /WcHYO/5zPL5+KQNgcAcQ/hLbLU09Q7GfVNZycnt0VoN/uYyFzenu14pSeLVDlABBQhG 63TVYnoyUL5LDhlW7aqD/aexCJOfpJvPrV3zAcIJSFb6bwGOxjy8JQn5Bv5bvp6k3SuR XuDVJvuBJGjW5gx5FwSDY3YmUwVcBTTYsK09tH8XT8CHpHl0thY5WkVRmbNhCqGrC56d nMlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zlbIMCcs; 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 er4-20020a056214190400b0064f68c194a6si6821879qvb.73.2023.11.14.08.32.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Nov 2023 08:32:13 -0800 (PST) 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=zlbIMCcs; 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 1r2wKS-00034Y-GI; Tue, 14 Nov 2023 11:31:56 -0500 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 1r2wKR-00033m-BR for qemu-devel@nongnu.org; Tue, 14 Nov 2023 11:31:55 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2wKP-0006Wn-O4 for qemu-devel@nongnu.org; Tue, 14 Nov 2023 11:31:55 -0500 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-53e08e439c7so9510582a12.0 for ; Tue, 14 Nov 2023 08:31:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699979512; x=1700584312; 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=hRnzgqjbzRTGqJ5jrYQJxW1BmP5r27YtuyDu1IVzHFA=; b=zlbIMCcsH3CK7EKk2fIxJKaNewLV20JmOwIGdJ3tS1Zm688KZ0Qwu1P7tsjLlXE9/S r8mmqpIwu5RJDC29yEdqTQspp4lA8jgcKAwXsrYECR18voio9U+Uk6QLz9b+QZT+FZe9 rpdVsSZ7CLVIcLrrjjpZ8jRSkApecJsbz71I7tnEnc96oL6qnz2XHUATRxBNb0j7W96l tPOQ/sV76vjOBA1e9uNLE/jWBdbVgatqiCCv8yx9b7cie+U70ihCm9F/3mN1Ny+KynKM RGXhk4YGbfIPwalI4kQonj6NTpAwwNd3By4ayVoiS4XsdalBMmiQJhpKM6O5jgUo9e5U fU3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699979512; x=1700584312; 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=hRnzgqjbzRTGqJ5jrYQJxW1BmP5r27YtuyDu1IVzHFA=; b=iLNf2RZh+D+TR2dy0OcH+4SYIpSMx6VFBzPpYpn29FGIYDCEirgyfpq2X2JQ5uNM0P dOqmRUlpvtdMxjywAFwJpOjH0Mj0Hhv0g3VhXLUNmoKGo7PyUou5cOAxXZ4S/CKgG7bo vmAIG6QqWYSsp/GIbIA8FkGas+S5nxYKgLy9Tv5yFcbYgQXvcIw/9lqvk4u1K+2+Hg4V bOs2d9kGQBWWtjEAcZ/W/pshyUTQH8zB4/WNWSPjFxvimRoYGNQSisId+SPO7l+hAc4U rSKamzd6Ebvr30qiKa9g5p/6RRM+yU1rA7W5JVDih7kbm3trQBdpiOKXcG27eViGfxNL TQXA== X-Gm-Message-State: AOJu0YxrA1uC5dHyVQhvrJNCTdF1zPapYU5tCi0k//DtWy9YeSGwctTv 9l0XHY4HYMXfxjH+EpwNUGDem0hbU6pw5gLbICY= X-Received: by 2002:a05:6402:3cf:b0:543:70c2:aa8d with SMTP id t15-20020a05640203cf00b0054370c2aa8dmr7379909edw.15.1699979511911; Tue, 14 Nov 2023 08:31:51 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id d17-20020aa7c1d1000000b0052febc781bfsm5327156edp.36.2023.11.14.08.31.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 08:31:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Anthony Perard , Paul Durrant , David Woodhouse , Thomas Huth , qemu-arm@nongnu.org, Stefano Stabellini , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , xen-devel@lists.xenproject.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , "Michael S. Tsirkin" , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost Subject: [PATCH-for-9.0 4/9] hw/xen/hvm: Expose xen_memory_listener declaration Date: Tue, 14 Nov 2023 17:31:18 +0100 Message-ID: <20231114163123.74888-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114163123.74888-1-philmd@linaro.org> References: <20231114163123.74888-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=philmd@linaro.org; helo=mail-ed1-x531.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=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 There can only be a single xen_memory_listener definition in a qemu-system binary. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis --- include/hw/xen/xen-hvm-common.h | 1 + hw/arm/xen_arm.c | 2 +- hw/i386/xen/xen-hvm.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/hw/xen/xen-hvm-common.h b/include/hw/xen/xen-hvm-common.h index 83ed16f425..0fed15ed04 100644 --- a/include/hw/xen/xen-hvm-common.h +++ b/include/hw/xen/xen-hvm-common.h @@ -18,6 +18,7 @@ extern MemoryRegion xen_memory; extern MemoryListener xen_io_listener; extern DeviceListener xen_device_listener; +extern const MemoryListener xen_memory_listener; //#define DEBUG_XEN_HVM diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index b478d74ea0..39dcd74d07 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -38,7 +38,7 @@ #define TYPE_XEN_ARM MACHINE_TYPE_NAME("xenpvh") OBJECT_DECLARE_SIMPLE_TYPE(XenArmState, XEN_ARM) -static const MemoryListener xen_memory_listener = { +const MemoryListener xen_memory_listener = { .region_add = xen_region_add, .region_del = xen_region_del, .log_start = NULL, diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index b64204ea94..a65a96f0de 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -469,7 +469,7 @@ static void xen_log_global_stop(MemoryListener *listener) xen_in_migration = false; } -static const MemoryListener xen_memory_listener = { +const MemoryListener xen_memory_listener = { .name = "xen-memory", .region_add = xen_region_add, .region_del = xen_region_del, From patchwork Tue Nov 14 16:31:23 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: 743793 Delivered-To: patch@linaro.org Received: by 2002:a5d:67cf:0:b0:32d:baff:b0ca with SMTP id n15csp2268668wrw; Tue, 14 Nov 2023 08:33:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmtvXYi1hMflQWYErkt2KXmHHRDLCMyzdUVQnSB7BMqZxk8ewr4AQ7tTLSUoEHez28MaNf X-Received: by 2002:a05:620a:478c:b0:77a:955:9461 with SMTP id dt12-20020a05620a478c00b0077a09559461mr3232018qkb.14.1699979614483; Tue, 14 Nov 2023 08:33:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699979614; cv=none; d=google.com; s=arc-20160816; b=KP10jubAOTvS24An3VxzIae1WtNDg2xW4TQqWlNuHTrvZPe07Lb5IRqdDpqg7J59sD XF2fYjb+S4JWvGAsjrqW2Q+bklhUsHgvMxGktYZoGDhOtVqX7G42zgFIuw9mP0d4btYD ZPdIvDbVJWSiEWoglLPc+OQIqpqUKCWTP4WyJ0vd/5M9D7L+fVtCDIibluXWeNQMV+PQ zCHSSS+jRJ++T6fOc320UqIk73/1olyL9iKXGB8SdtFTEJnGPryQ1wlgu2c40e155ijT lucZ5NyZ0mBhcLNdznVWhYq9ClNRsiIWuRBvj/H5C/BIHZSMEvppxwL86SaMOrgASlzY dddA== 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=htjkOQmTZcMenhXqLaaInIEhXImv4mUPxpJWcjUwWD8=; fh=9pdq7NpBxJPnvyNu1sJsWepRx2HfUbiacvC5FeL2cfI=; b=J8ewZdyY1A/wuSz14NNy4vZyZb4cioMz+StR54J3R/5eWAfuU/jGrI68CzqkZkF3vn k9MDYLhlg2QR+bdpfNXvpiinhugQ8pK3jfJ9vBaiN/tcmCRyddm6FTbuvxPPT4XAJI1H 5PzvdQsqf+Bttk8rEHhxjK/utwXVnfPDA78PNAydgATv+D6fVDAixoDTARCp58JfgiHR 9QgCY0j3XxPOWCsTb9d73E7BBtWPzKRB7Owa5Bs/9SDSTPMuuNIf+3wQUwzG2lwFS0jq rgqLU/oJJ4KLejr0vMADb72Dep49pZlGRMZeKi3t1ImmyU+GRhc0SugdFn7DOhvaSmf9 +FkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qXUpAG5U; 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 bn44-20020a05620a2aec00b0077758455319si6905587qkb.764.2023.11.14.08.33.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Nov 2023 08:33:34 -0800 (PST) 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=qXUpAG5U; 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 1r2wLO-000486-54; Tue, 14 Nov 2023 11:32:54 -0500 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 1r2wKy-0003KW-5i for qemu-devel@nongnu.org; Tue, 14 Nov 2023 11:32:32 -0500 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2wKt-0006eG-Uf for qemu-devel@nongnu.org; Tue, 14 Nov 2023 11:32:25 -0500 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-9e62f903e88so645816366b.2 for ; Tue, 14 Nov 2023 08:32:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699979542; x=1700584342; 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=htjkOQmTZcMenhXqLaaInIEhXImv4mUPxpJWcjUwWD8=; b=qXUpAG5U7kUwBh7IMiLEJsYIq5hU3iSNPyp6nnd/GvrOCa+JwebR/jRbvB+C1i6COH lhngntDiU+SVMBI5qXxB6MQ9fnGFtPyrZTd1Vv9bN29WF/PYYaFU+H2S30vjNaahQAqZ tXdLcXV3bluM5jc9mYWibcXKEq401pZGfXhhUzX4TJb4Gj5XqorNsc520tXs8oiePSW6 k/YzjHfvd+0zfIEMCkSqrCfribLuBNnTswYAQeV8Yg1YfQ7VXo1elCmNRUf9TkCFHYz5 fgXmSz71MbLORvFAosRuFr2GuaEhCf7KknGxnkRn52snJmHsiT5K3t0dfWqq0m9jFhge vAyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699979542; x=1700584342; 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=htjkOQmTZcMenhXqLaaInIEhXImv4mUPxpJWcjUwWD8=; b=vQXgQ/52JAtVpAbitspi7qvrOM+ipuqiSYhcqHKdA8SJxnHxCFFuSMOlmqKBCyMfGS i0oedCBHVB8bMIaYpETJB8jxtRzhyN3inQHhWzwfP0sssqFGzF48FEF71GC/Cdbeudtj KpuS0FUS3O/4YToyF7rhYCDejJpuZxdRrJYbNgAvyT3tHBBEKOqHaq/14yrvxunE8dp4 1b9xDcyzD1ET2dqPJypfJszaJdAGZfeGr7tpBieztfyKHLWC+klUwHe9/YFhOLFXWXAH W1y9clZlA75dSqu5QOcaFTWQTpr66ELH0Jr3vWdnVSxQYYwYU/6PSLD2MGzQYBIiBdRE xK6Q== X-Gm-Message-State: AOJu0YwRQvKdvA80DlKfVBzTGT2tMvUj3Waq+BWkXJTK1mQ9Kx56P2LB Hz/gAengCku+o8zcSxblfteKy9m/iYG3rlgnWRY= X-Received: by 2002:a17:906:7943:b0:9d3:e48f:30d3 with SMTP id l3-20020a170906794300b009d3e48f30d3mr9901673ejo.31.1699979542369; Tue, 14 Nov 2023 08:32:22 -0800 (PST) Received: from m1x-phil.lan (cac94-h02-176-184-25-155.dsl.sta.abo.bbox.fr. [176.184.25.155]) by smtp.gmail.com with ESMTPSA id c26-20020a17090603da00b009adce1c97ccsm5731084eja.53.2023.11.14.08.32.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Nov 2023 08:32:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Anthony Perard , Paul Durrant , David Woodhouse , Thomas Huth , qemu-arm@nongnu.org, Stefano Stabellini , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , xen-devel@lists.xenproject.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0 9/9] hw/xen/hvm: Inline xen_arch_set_memory() Date: Tue, 14 Nov 2023 17:31:23 +0100 Message-ID: <20231114163123.74888-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231114163123.74888-1-philmd@linaro.org> References: <20231114163123.74888-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.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=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 xen_arch_set_memory() is not arch-specific anymore. Being called once, inline it in xen_set_memory(). Signed-off-by: Philippe Mathieu-Daudé --- include/hw/xen/xen-hvm-common.h | 3 - hw/xen/xen-hvm-common.c | 104 ++++++++++++++++---------------- 2 files changed, 51 insertions(+), 56 deletions(-) diff --git a/include/hw/xen/xen-hvm-common.h b/include/hw/xen/xen-hvm-common.h index 536712dc83..a1b8a2783b 100644 --- a/include/hw/xen/xen-hvm-common.h +++ b/include/hw/xen/xen-hvm-common.h @@ -99,8 +99,5 @@ void cpu_ioreq_pio(ioreq_t *req); void xen_read_physmap(XenIOState *state); void xen_arch_handle_ioreq(XenIOState *state, ioreq_t *req); -void xen_arch_set_memory(XenIOState *state, - MemoryRegionSection *section, - bool add); #endif /* HW_XEN_HVM_COMMON_H */ diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index 50ce45effc..789c6b4b7a 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -426,50 +426,6 @@ void qmp_xen_set_global_dirty_log(bool enable, Error **errp) } } -void xen_arch_set_memory(XenIOState *state, MemoryRegionSection *section, - bool add) -{ - unsigned target_page_bits = qemu_target_page_bits(); - int page_size = qemu_target_page_size(); - int page_mask = -page_size; - hwaddr start_addr = section->offset_within_address_space; - ram_addr_t size = int128_get64(section->size); - bool log_dirty = memory_region_is_logging(section->mr, DIRTY_MEMORY_VGA); - hvmmem_type_t mem_type; - - if (!memory_region_is_ram(section->mr)) { - return; - } - - if (log_dirty != add) { - return; - } - - trace_xen_client_set_memory(start_addr, size, log_dirty); - - start_addr &= page_mask; - size = ROUND_UP(size, page_size); - - if (add) { - if (!memory_region_is_rom(section->mr)) { - xen_add_to_physmap(state, start_addr, size, - section->mr, section->offset_within_region); - } else { - mem_type = HVMMEM_ram_ro; - if (xen_set_mem_type(xen_domid, mem_type, - start_addr >> target_page_bits, - size >> target_page_bits)) { - DPRINTF("xen_set_mem_type error, addr: "HWADDR_FMT_plx"\n", - start_addr); - } - } - } else { - if (xen_remove_from_physmap(state, start_addr, size) < 0) { - DPRINTF("physmapping does not exist at "HWADDR_FMT_plx"\n", start_addr); - } - } -} - void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr, Error **errp) { @@ -512,20 +468,62 @@ static void xen_set_memory(struct MemoryListener *listener, bool add) { XenIOState *state = container_of(listener, XenIOState, memory_listener); + unsigned target_page_bits = qemu_target_page_bits(); + int page_size = qemu_target_page_size(); + int page_mask = -page_size; + hwaddr start_addr; + ram_addr_t size; + bool log_dirty; + hvmmem_type_t mem_type; + if (section->mr == &xen_memory) { return; - } else { - if (add) { - xen_map_memory_section(xen_domid, state->ioservid, - section); - } else { - xen_unmap_memory_section(xen_domid, state->ioservid, - section); - } } - xen_arch_set_memory(state, section, add); + if (add) { + xen_map_memory_section(xen_domid, state->ioservid, + section); + } else { + xen_unmap_memory_section(xen_domid, state->ioservid, + section); + } + + if (!memory_region_is_ram(section->mr)) { + return; + } + + log_dirty = memory_region_is_logging(section->mr, DIRTY_MEMORY_VGA); + + if (log_dirty != add) { + return; + } + + start_addr = section->offset_within_address_space; + size = int128_get64(section->size); + trace_xen_client_set_memory(start_addr, size, log_dirty); + + start_addr &= page_mask; + size = ROUND_UP(size, page_size); + + if (add) { + if (!memory_region_is_rom(section->mr)) { + xen_add_to_physmap(state, start_addr, size, + section->mr, section->offset_within_region); + } else { + mem_type = HVMMEM_ram_ro; + if (xen_set_mem_type(xen_domid, mem_type, + start_addr >> target_page_bits, + size >> target_page_bits)) { + DPRINTF("xen_set_mem_type error, addr: "HWADDR_FMT_plx"\n", + start_addr); + } + } + } else { + if (xen_remove_from_physmap(state, start_addr, size) < 0) { + DPRINTF("physmapping does not exist at "HWADDR_FMT_plx"\n", start_addr); + } + } } void xen_region_add(MemoryListener *listener,