From nobody Mon Nov 25 06:54:13 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1716991698; cv=none; d=zohomail.com; s=zohoarc; b=CPvt7ocLgTVfGc/CJ4bLc65/Mvh87DP85FscYHkTrk/QSwoYXpWSNT4sL9a6FG0ChFwZVs02QFcF/lhviv3A+mHmZlHVeN1wz4H331Yzwt3cxo/t8om+Hkfw8Cuo6zgikecm73qEaG4wQSdw9Srf02CyRsI/xTZJKxLPNP7PTJM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716991698; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yfQU3CIk8oi6JUEGcx9QZf/9+B1Oq0qqW+7JWEaNpUQ=; b=TihLbJlpJQaNGwMqLpFORf3LZ8e5CORR6hI1DX3qwdxvzaVi3rBWJWroUrAU64T7lJkf/38wp+UqaO90lE30SMG+gDcAjDKpo539M9fVjEQh9kwyqAcl3KMQpABmM21PZeqarW8o+Jl+g6bc906TlCEvF41JdOWxGzap6445j18= 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 1716991698070206.99559124322616; Wed, 29 May 2024 07:08:18 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.731993.1137788 (Exim 4.92) (envelope-from ) id 1sCJy1-0004iY-AK; Wed, 29 May 2024 14:07:49 +0000 Received: by outflank-mailman (output) from mailman id 731993.1137788; Wed, 29 May 2024 14:07:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sCJy1-0004iR-7G; Wed, 29 May 2024 14:07:49 +0000 Received: by outflank-mailman (input) for mailman id 731993; Wed, 29 May 2024 14:07:48 +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 1sCJy0-0004U5-7I for xen-devel@lists.xenproject.org; Wed, 29 May 2024 14:07:48 +0000 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [2a00:1450:4864:20::136]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d361b662-1dc4-11ef-90a1-e314d9c70b13; Wed, 29 May 2024 16:07:46 +0200 (CEST) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-52b119986f2so710587e87.1 for ; Wed, 29 May 2024 07:07:46 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-529715e57c1sm1333816e87.286.2024.05.29.07.07.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 07:07:44 -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: d361b662-1dc4-11ef-90a1-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716991666; x=1717596466; 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=yfQU3CIk8oi6JUEGcx9QZf/9+B1Oq0qqW+7JWEaNpUQ=; b=QoswkUFCR7FGFb+hWlx6AuRK9tIIKedF4mT5M9Vym6NhCnNt9L/y6LyY6S5NeM6m2F blU/eyXywaU32Ekx8sq4+uh43onH5LCL/KLHJ0Vl+npjWnyTqgh3m8Y9B85h0WHpvBZP 6EkVID6sK79PHiDCm+Fd1JZVnND5UzHJQIRiJF3EmXDXueQhdnYIlveIRaLauEnIYuQE Z1AMBdzpU3IP+eicgW2NZnUEgxxFCS+eXtudP1d3klxg1nF11tix1sccKMSxxCuf8QyY Dx5QW9N7b/k2oUas267tyxGqPBut8wT7IwYDCmsuDiiMhYIAwy3a6p0boky3uvRT5xfO AfPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716991666; x=1717596466; 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=yfQU3CIk8oi6JUEGcx9QZf/9+B1Oq0qqW+7JWEaNpUQ=; b=NFC1lhpBNflk5TRn7V+3ogxm5Z2fWvHdzycE4bvH/w1omJA0EVm+By/fMA2yC+xIBJ tA0tlFFWTy3f9bCXK8RTYHS2iBTlKE+Wk4lcmioNa/js4B1eukApeMYu35pkfFg+Xw0V aXqfMq8L5uyRfKUfdlACL+dUxFGVcodzMgP+eDcGBaEh6qekSXk7zUWlOSpZztwD5quI spOOCPPLNkO63kDA6gdklkKp3mL1q5AH20/+qi3mcfy89t+BTVQ99PKvzrv6nM44XJOr +ewZo3mVuCPCUBxUzQCLysuaB4ZPO/viOKl9ZuVpWX1YUrq+AeLictE2OL+/Y5gDSVyY acLg== X-Forwarded-Encrypted: i=1; AJvYcCXRL1mH+PPVfjDvx2s7bQwGmMrAIoJtlGXDIsGmqDc3mOTT/mPNbmW1zTpuR9rabA57IbSL5TEr70NMzHiAR2ex/YAO0u9JK/qUG+4E8KY= X-Gm-Message-State: AOJu0YwpqxQt5LJDF4CvIgfvJt/8rr6MUeDp+wT9yY/7lezgR3d8QPaa y8w8dHbdcW+TQ2NhqSQfEtn2g+zSlsMAXdzts9Gty8mm1cQfl8D0 X-Google-Smtp-Source: AGHT+IGzkXOYSImMOV6N87l6JZQ270Dpu6VtX1s3RWgHcPsFkFEwPwb1/bHSmEc0ivZv+7V/GBf3hw== X-Received: by 2002:a19:2d48:0:b0:526:92d7:52d4 with SMTP id 2adb3069b0e04-529bea19e84mr2711966e87.61.1716991666190; Wed, 29 May 2024 07:07:46 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: edgar.iglesias@gmail.com, sstabellini@kernel.org, jgross@suse.com, "Edgar E. Iglesias" , David Hildenbrand , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Anthony PERARD , Paul Durrant , xen-devel@lists.xenproject.org Subject: [PATCH v8 3/8] xen: Add xen_mr_is_memory() Date: Wed, 29 May 2024 16:07:34 +0200 Message-Id: <20240529140739.1387692-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240529140739.1387692-1-edgar.iglesias@gmail.com> References: <20240529140739.1387692-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1716991720532100003 From: "Edgar E. Iglesias" Add xen_mr_is_memory() to abstract away tests for the xen_memory MR. No functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Acked-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/xen/xen-hvm-common.c | 10 ++++++++-- include/sysemu/xen.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index 2d1b032121..a0a0252da0 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -12,6 +12,12 @@ =20 MemoryRegion xen_memory; =20 +/* Check for xen memory. */ +bool xen_mr_is_memory(MemoryRegion *mr) +{ + return mr =3D=3D &xen_memory; +} + void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr, Error **errp) { @@ -28,7 +34,7 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, = MemoryRegion *mr, return; } =20 - if (mr =3D=3D &xen_memory) { + if (xen_mr_is_memory(mr)) { return; } =20 @@ -55,7 +61,7 @@ static void xen_set_memory(struct MemoryListener *listene= r, { XenIOState *state =3D container_of(listener, XenIOState, memory_listen= er); =20 - if (section->mr =3D=3D &xen_memory) { + if (xen_mr_is_memory(section->mr)) { return; } else { if (add) { diff --git a/include/sysemu/xen.h b/include/sysemu/xen.h index 754ec2e6cb..3445888e39 100644 --- a/include/sysemu/xen.h +++ b/include/sysemu/xen.h @@ -49,4 +49,5 @@ static inline void xen_ram_alloc(ram_addr_t ram_addr, ram= _addr_t size, =20 #endif /* CONFIG_XEN_IS_POSSIBLE */ =20 +bool xen_mr_is_memory(MemoryRegion *mr); #endif --=20 2.40.1