From patchwork Tue Jun 4 09:55:58 2024 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: 801394 Delivered-To: patch@linaro.org Received: by 2002:a5d:65c4:0:b0:35b:5a80:51b4 with SMTP id e4csp2312974wrw; Tue, 4 Jun 2024 02:59:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVZpgZd3KoRfWxEXvz4SsHd6KJGVUu3UPz7zEV/66/FHgrxW/2gyo298I5U/Du9YBSJR6U51kKp4Sj0cL3l3cTG X-Google-Smtp-Source: AGHT+IEIFY9dKZU+I1+67+vn1vMT0KnAn8lJW4QdX6dyAawNw+D7rMKatYCsOT3fVJG0tngx0Brl X-Received: by 2002:a05:620a:4691:b0:794:f6ad:3cd2 with SMTP id af79cd13be357-794f6ad3f9bmr1408391085a.55.1717495158332; Tue, 04 Jun 2024 02:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717495158; cv=none; d=google.com; s=arc-20160816; b=n/xEbL33/5kawfwATm3KRpJeMUmHqK+Jc+CZTevGZyIal4xuxmD9eEJ50kQEpysb7D 3Ucxz+Ju+dkbj5h1OeIRJcoSd1buTvEdonwZMgWBc1pI5k4RQsGogh4gvUoOHL23GM5m DFjhPggXye1JBYu363gtE6PEASqugs21OvD5tJ6ttjK3Ajhnc8aFU0IovxTqYzA7iOZt Di0lLKOT2AxM1VAbg6J0X7QelM6hN3OiE1/4gMtjL9nZQfuBOb6GU8g4C0Cqj9+DsUvj NrZEczweXzwAwg9JQStRRUt/vpt6snf9+rmLuajhY8/I8NpjFAZuh/EyuzUmvWJDS2YJ Np5Q== 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=SNllFIjXNz5GjqDOBbChwyL7SF1oO9qoS6VeKoJgVQQ=; fh=zTr0rAGweEb0EHWiTTjSvV3xEc3sI22TPSmktQnMYJI=; b=he+pAv48VmR/CBhMcpA0/mspcsBiOOXGDAXBOGm+IemJpD0sOWAek/WpU0wJuyJIV8 Tg81ibiwQdAnU0fBE/oyBDSBO+VkyHm7/O++6CG9rxwRuPyQX/WqimNq3ssnahvoVc+y eVn1n8mwU16WMiQEKWEmKp5UC6tNTF/dzokTA/py6IdMEiif13y/bjYjKkR66bE+P5f3 Ahj6vaySzslBkMzE3cU1+AadBUiFU94oAZQHV8uU4wznMzGIuHm3er6w6XzHVHR/1GBM nTiZSf3+QMwg0FwTAgiShKdggzFU08AHng0WSabUUpX2jPTgJf0lwq9Nr8L8PRICCwN9 E+bA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LBkGYM+J; 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 af79cd13be357-795173a08d5si128601885a.340.2024.06.04.02.59.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Jun 2024 02:59:18 -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=LBkGYM+J; 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 1sEQvo-0002yo-O1; Tue, 04 Jun 2024 05:58:16 -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 1sEQvm-0002kB-Qm for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:14 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQvl-0002J2-0m for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:14 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-42121d27861so8664055e9.0 for ; Tue, 04 Jun 2024 02:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495091; x=1718099891; 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=SNllFIjXNz5GjqDOBbChwyL7SF1oO9qoS6VeKoJgVQQ=; b=LBkGYM+JHguc/GC/OWjs783zYXQr4eU9T4Y5XiSqleBFQ4RF6tvcB5oLiFLeblmK7b IO6IDTIyou6e1zgnE2TWOFX36SNmBT2C8UX4wJ4UzvF34Zgg5p2zF22LE9mPmQiLUoUn Nvt5T6EJ5a3myhYEhwP004Hq0iz8ubsiNT6OkbUVzzH8sLwGGhPkhQ9THnKkP0xL6LU3 znb1UNi7Nco/3RjOhfQmxdoUrNhVTzBU4BlPJIM5oe5kEXvH0AqrNxct9t60bGdpI6// g1KoxYIgFC+VV/azRNlcMCY77rgvMXhOvTpnjMS0MBTtYPU3dk5+EfODDIFYn/Kk+9ER N4uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495091; x=1718099891; 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=SNllFIjXNz5GjqDOBbChwyL7SF1oO9qoS6VeKoJgVQQ=; b=r/aDWcf0+ZlLigFkGEC6gG075pfgXujvWkNX+Jf2va+44SiZcOUwDhkh4eKSsfUan+ rF9Bqk21U2LWjpW6Fma+GUjXFq+2pC/28Bm0RH45a+EpXEaBT1NCmTYR4EwEunLfcI+g l2MoegZH87w93sx89pNqG3TNgNuenPUFXkwzSDLeDY8zaWE1fC6BzJsNIV2auNH4/reP NwpciR0MzBb25gSsTp8QW7TAgSazPezhGajk1A8BVoXu0AMxupy8mEclcnCjmXSDXjha 50OA4YEx4cXxugGFMXVybEK3D4WH/5XndWm/75tvu1T80UrI5zGCeSGY2c3ZW23cycz6 ZarQ== X-Gm-Message-State: AOJu0YyWy7pu/O7ed+4DoqM+vahHQBQAC+XXqzUxT4rZ4uaGvhU7sn1E KiKTCSevTokoAGQlt7RudiQv2HanFERjpVY/jygVCmryP3UtrPdcW9lG5zx6TG49habRVGd+x4E / X-Received: by 2002:a05:600c:4f13:b0:421:418d:8f7 with SMTP id 5b1f17b1804b1-421418d0be6mr28047945e9.12.1717495090999; Tue, 04 Jun 2024 02:58:10 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4212b8a5598sm147525575e9.38.2024.06.04.02.58.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:58:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Stefano Stabellini , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 22/32] physmem: Replace check for RAMBlock offset 0 with xen_mr_is_memory Date: Tue, 4 Jun 2024 11:55:58 +0200 Message-ID: <20240604095609.12285-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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=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 From: "Edgar E. Iglesias" For xen, when checking for the first RAM (xen_memory), use xen_mr_is_memory() rather than checking for a RAMBlock with offset 0. All Xen machines create xen_memory first so this has no functional change for existing machines. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Reviewed-by: David Hildenbrand Message-ID: <20240529140739.1387692-6-edgar.iglesias@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- system/physmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/physmem.c b/system/physmem.c index 5e6257ef65..b7847db1a2 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -2229,7 +2229,7 @@ static void *qemu_ram_ptr_length(RAMBlock *block, ram_addr_t addr, * because we don't want to map the entire memory in QEMU. * In that case just map the requested area. */ - if (block->offset == 0) { + if (xen_mr_is_memory(block->mr)) { return xen_map_cache(block->mr, block->offset + addr, len, lock, lock, is_write);