From patchwork Fri Jul 12 11:02:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 13731609 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6945DC3DA4A for ; Fri, 12 Jul 2024 11:03:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSE32-00008n-97; Fri, 12 Jul 2024 07:02:44 -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 1sSE2z-0008Uq-SF for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:02:41 -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 1sSE2w-0003ah-6U for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:02:40 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2eeb1ba040aso23297561fa.1 for ; Fri, 12 Jul 2024 04:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720782156; x=1721386956; 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=Dc1eTWi5iZyva3MfQYId5KFBzpR8Jnw4CwD+XxknsHI=; b=igiPwKgHm56hZOm/Flx3nfEonZhq9fA5MXEE3xQdG7OGLhbFVAQF+sejwGFionmptF MD4KnYyyitr0XF0xb+JKs51KOT7q8kywNJBe2Q1HCP1yGn1pK1j9MCBRtdfDwGZtYBvK o6u3GYZjP0QOJ4hCRZ+6zqgWi0vfMWTU/u6gFCPkiDP01Z6jhKnp8Ot61B1k4Iwl3Lgd kLCjV1qahIbAw/TZKFhMSpzVSlyTME/DRT3DeKuYdGdwkMtoZ0aGUg6pcxCPgrqydUUA 1I//g3I/xx80vbrtjunsWyF034cwii4xR9LlmjRHiGAxoQKymTzLFrTpQXbwcvIczw1L 2lkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720782156; x=1721386956; 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=Dc1eTWi5iZyva3MfQYId5KFBzpR8Jnw4CwD+XxknsHI=; b=tGXUqE2Ncz91z4Iz7wB4yf6OC9yZpv1ZL7qhP+6FGlSKdt3uWzMC1KTvSbuwt6VfHG tUASpa5UI4nwtk7oii5Od5Gq88yT1YTKAR73hL8RklniKAWiGZyix2flqPk81+8X0J7S wvIGLNfkgaoLnreA/aY0Hm3WcQsY3tNyfuuD92SPDzUPyRMIvgWm9o81dBmPNg5fQAor wR/ixvFE8OplEQ1SfFXO3IqcVkqZHb4nRqeXndmtun+45S/+IkRJvAW8a9VXSiAjCakp v+FdB0wLdt1fD0K+9OIA4ZXJW5IVSz1YqCWg+St5I7tfHkiqg1wJ4qXGLe7PfUpZTfzy l6kA== X-Gm-Message-State: AOJu0YylMXb3d1L9ilCnCW+Sou1U7JbP2X1FkW/9Ok3hxsv4iQ0F4MB5 /+cFwCHiqtWxHNfT1reCM3K/dChsl0aKzyb3QJhLRyhwIEk7nrthEa3AANN8 X-Google-Smtp-Source: AGHT+IHkWR3puHuo2XOZ/nDlGjWAHbnO9jGh1wexmZx11eY1lI0DYagRvxEN2CVXAlXL/la0QDxqUA== X-Received: by 2002:a2e:6a05:0:b0:2ec:2d75:509c with SMTP id 38308e7fff4ca-2eeb31977c3mr71565311fa.46.1720782155218; Fri, 12 Jul 2024 04:02:35 -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 38308e7fff4ca-2eeb3489029sm10741871fa.104.2024.07.12.04.02.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jul 2024 04:02:34 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, alex.bennee@linaro.org, peter.maydell@linaro.org, richard.henderson@linaro.org, edgar.iglesias@amd.com, Stefano Stabellini Subject: [PULL v1 1/3] MAINTAINERS: add Edgar as Xen maintainer Date: Fri, 12 Jul 2024 13:02:28 +0200 Message-ID: <20240712110230.4098056-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110230.4098056-1-edgar.iglesias@gmail.com> References: <20240712110230.4098056-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=edgar.iglesias@gmail.com; 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, FREEMAIL_FROM=0.001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Stefano Stabellini Add Edgar as Xen subsystem maintainer in QEMU. Edgar has been a QEMU maintainer for years, and has already made key changes to one of the most difficult areas of the Xen subsystem (the mapcache). Edgar volunteered helping us maintain the Xen subsystem in QEMU and we are very happy to welcome him to the team. His knowledge and expertise with QEMU internals will be of great help. Signed-off-by: Stefano Stabellini Reviewed-by: Paul Durrant Acked-by: Anthony PERARD Reviewed-by: Alex Bennée Signed-off-by: Edgar E. Iglesias --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 6725913c8b..63e11095a2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -536,6 +536,7 @@ X86 Xen CPUs M: Stefano Stabellini M: Anthony PERARD M: Paul Durrant +M: Edgar E. Iglesias L: xen-devel@lists.xenproject.org S: Supported F: */xen* From patchwork Fri Jul 12 11:02:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 13731610 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3CC03C3DA4A for ; Fri, 12 Jul 2024 11:03:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSE33-0000Co-8l; Fri, 12 Jul 2024 07:02:45 -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 1sSE30-0008VM-NZ for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:02:42 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sSE2y-0003ax-Sq for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:02:42 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-52e9b9fb3dcso2270514e87.1 for ; Fri, 12 Jul 2024 04:02:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720782158; x=1721386958; 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=fKWnt4ssz7MnpyKuRbBIUzzN45FF59afh9GBgWcO174=; b=aldrw8BfOlQXmbgluuBysNfZOXFTG39l5DJ0IK+pm2drXUdDH1PAEcUuJLTSnZkDnr +nJZH2PXocX2kBWHnE3S0wqEzXhI6OXOoNp/YJdSSVil3gomuykrj3vSXAioL1wCgbuF y7+DWJES1ajUM8ylE2E8rvb5AE/Z0mY/9JWwKcSxwq/RR6DQXRWLJtkNHnsK8OeMnJXf zAvARoFMdsam23JCGds/PkBI2zm+TXywRIss0/LS+IeMKnZdx3stDcSmGVZ5JkhtD3na W9zxqvBfg6NpkH8tmksyKi6ygDQaDZrlD5jPhzyjREtfNSquIK2VxBy85K0AnIreqkgu XPOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720782158; x=1721386958; 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=fKWnt4ssz7MnpyKuRbBIUzzN45FF59afh9GBgWcO174=; b=dIMNpw7jrf5TpeUYiJQQ0HaDptq7TNga+hh0/+Cm7hb/Tb26o/L01l9cfJsTJswhYt lXjjuVrTwCELMIJqymoSM8nc82lUIctd7rD3T8wYPs4ClASn1caSQVfYsFKvbQeyvQ0x X/3FQWps+hbl0E+pnV8rBXGpP4rV5LsvRphw2PXSv8S4jBniS7NePvBHZAQ2UM1gimnD 4Rv8Z15mD+3fzk4wSchxBcHn5jIqqINM93ScfLlRq9H2/13odm325gkn9eRJfEBcTntR oE7H737yTlMKua1natq/8VG52+p+PdaVvLdp5MfWUgNRNKBA9YQlycV0rdwqnYb6okvD K/aw== X-Gm-Message-State: AOJu0Yy0a8rUIPL9wKP+cNlyGJw6iC2kwTBNbW4KmtUmazx5wUjBOVzl +nZQkeCgwAu1fK0wtslYFJG+2ElQy+Az86rWJW8SPPQk8YeWSVg8SCCve8v+ X-Google-Smtp-Source: AGHT+IGOZ+IbhxesDx8p6m1dAos6T8JaI42mOJvjxpfDN/gOvfWbf+1UhmiRI32EsKvzgaPEKTNk0A== X-Received: by 2002:a05:6512:2107:b0:52e:9d6c:4462 with SMTP id 2adb3069b0e04-52eb99978d9mr5526109e87.23.1720782157305; Fri, 12 Jul 2024 04:02:37 -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-52eb9079cbasm1233898e87.309.2024.07.12.04.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jul 2024 04:02:35 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, alex.bennee@linaro.org, peter.maydell@linaro.org, richard.henderson@linaro.org, edgar.iglesias@amd.com, Paolo Bonzini , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL v1 2/3] physmem: Bail out qemu_ram_block_from_host() for invalid ram addrs Date: Fri, 12 Jul 2024 13:02:29 +0200 Message-ID: <20240712110230.4098056-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110230.4098056-1-edgar.iglesias@gmail.com> References: <20240712110230.4098056-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x133.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, FREEMAIL_FROM=0.001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: "Edgar E. Iglesias" Bail out in qemu_ram_block_from_host() when xen_ram_addr_from_mapcache() does not find an existing mapping. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alex Bennée Reviewed-by: Stefano Stabellini --- system/physmem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system/physmem.c b/system/physmem.c index 14aa025d41..2154432cb6 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -2277,6 +2277,10 @@ RAMBlock *qemu_ram_block_from_host(void *ptr, bool round_offset, ram_addr_t ram_addr; RCU_READ_LOCK_GUARD(); ram_addr = xen_ram_addr_from_mapcache(ptr); + if (ram_addr == RAM_ADDR_INVALID) { + return NULL; + } + block = qemu_get_ram_block(ram_addr); if (block) { *offset = ram_addr - block->offset; From patchwork Fri Jul 12 11:02:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 13731607 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17C2EC2BD09 for ; Fri, 12 Jul 2024 11:03:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSE36-0000NK-FB; Fri, 12 Jul 2024 07:02:48 -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 1sSE31-00007v-Vm for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:02:44 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sSE2z-0003b2-AB for qemu-devel@nongnu.org; Fri, 12 Jul 2024 07:02:43 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-52e99060b41so1982023e87.2 for ; Fri, 12 Jul 2024 04:02:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720782159; x=1721386959; 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=87DPAAbyBmLAKm4ynt726DGnnWSE+Fbpy4sTffFQKUw=; b=HqEhfnTAquJF3CqI5KBIEdJRWEv7wLgZI2pP2jfoIoef9AcQTyTxNExmzjjBYCFExM JyJbovX09wdxbtlswPaWm8ulSqh3Q2LsahaJs0AzS3WvLlId+7cbLY0xoG6eL+u1uQxw B5k9gvjLDP+s1bW8vgbdBTtOEkuPqPpGKAtMwtwJ6ozqpUmHhjAwt+ntXeI5lfzk3FQz ALO5ALH18FnqDMouWUgXO0kaWM6ORN0WszgeAF6Mxnx8ZaQMB+dS1evEoRjYXtBBsX6Y wjI/DLB4ypSuo1E0h+6GzNmFqyfPwPsNAxFHI13sD7hC0ZmgUaYXJgnE1BqkTPPHMiYA OdqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720782159; x=1721386959; 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=87DPAAbyBmLAKm4ynt726DGnnWSE+Fbpy4sTffFQKUw=; b=vJuK7y9kZgjVQrTBaLq19BRj+7M9U/vISMTHbGGHkJctlyPR54AwIW/Ba6p+lTMCKf wajkQgZNbqQ/RRy/F6mStVEo96Ec7t28YC0cw0Q5kjYgPm3pzLz6YoqpXIw9SXYDyZcV 909aXlGOFw5h01lGBXOXegtQCWAw50oS6P6n5uZRyUBMd0G2qvRh+sN+9C63EIRu1e0W 470rG7aASRI45IJpd3TRqMEBnU972qmKssqua63vOjufpJtkP7bpMoNI+wA0iAR5uwmM Ub9ZZ0tB7vvOtk+INHHcJua8VQNsVz9aVutT0BvDPvq1HFOdbMwZMQ2SphYDIIuedMNE EIkQ== X-Gm-Message-State: AOJu0Yybw6MIWYMy/ZwQ8uiDeYlzPQSNHSwpL95aCMvhnFpcVnF5M5SP ytgrFFG9fs9a3PggOxIyZQEs3lzZ6oXna2eEkrS3g2HfG0gyepmn08kqfCm4 X-Google-Smtp-Source: AGHT+IHoNb9jo3zc5r2b5ZN1+E6PEQXJq2jaR175xDg5jGcIkz9qmG3zee/NjIb1VzoUbFJp/vxmXw== X-Received: by 2002:ac2:5f99:0:b0:52c:86de:cb61 with SMTP id 2adb3069b0e04-52eb9990fedmr6120031e87.10.1720782158364; Fri, 12 Jul 2024 04:02:38 -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-52eb9077a9asm1235370e87.297.2024.07.12.04.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jul 2024 04:02:37 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, alex.bennee@linaro.org, peter.maydell@linaro.org, richard.henderson@linaro.org, edgar.iglesias@amd.com, Anthony PERARD , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org Subject: [PULL v1 3/3] xen: mapcache: Fix unmapping of first entries in buckets Date: Fri, 12 Jul 2024 13:02:30 +0200 Message-ID: <20240712110230.4098056-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712110230.4098056-1-edgar.iglesias@gmail.com> References: <20240712110230.4098056-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x12f.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, FREEMAIL_FROM=0.001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: "Edgar E. Iglesias" This fixes the clobbering of the entry->next pointer when unmapping the first entry in a bucket of a mapcache. Fixes: 123acd816d ("xen: mapcache: Unmap first entries in buckets") Reported-by: Anthony PERARD Signed-off-by: Edgar E. Iglesias Reviewed-by: Anthony PERARD Reviewed-by: Stefano Stabellini --- hw/xen/xen-mapcache.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/xen/xen-mapcache.c b/hw/xen/xen-mapcache.c index 5f23b0adbe..18ba7b1d8f 100644 --- a/hw/xen/xen-mapcache.c +++ b/hw/xen/xen-mapcache.c @@ -597,7 +597,17 @@ static void xen_invalidate_map_cache_entry_unlocked(MapCache *mc, pentry->next = entry->next; g_free(entry); } else { - memset(entry, 0, sizeof *entry); + /* + * Invalidate mapping but keep entry->next pointing to the rest + * of the list. + * + * Note that lock is already zero here, otherwise we don't unmap. + */ + entry->paddr_index = 0; + entry->vaddr_base = NULL; + entry->valid_mapping = NULL; + entry->flags = 0; + entry->size = 0; } }