From nobody Mon Feb 9 17:37:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563264888; cv=none; d=zoho.com; s=zohoarc; b=kMdGVfdjKOyHRHqCtFH513XyX144wBrSDqSKHbFzUHWib82m1MxCPSqMoR4tZCO2zDPVwrN6ihlu/om5c5rrC6BShnKya8kpL7G0RtCAJf1IrrgcKmkrp3Lx6Fwlic4rmNSuL1S4Bx6mXdrBmAP9jfiT9twcdowkyUHGzBPbSzo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563264888; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=8Qfy8a0GAVN3cZj53fYSGM9mBcfsB1yLOHRsBKNqTiU=; b=B9bVAH0OobOrWuS6xlSwCWRH475IF0QuawHLYmPCieNA+t8S+xW+U8HmcOIi3A+NZ+KKu+vQvV0iQ8vnPHqX82NZJdOSMBBwQfT8AumDh1FiaF2dzDHuZmbqdfbHN83FnBj+qc+i6yXGlMv1XqPzT0+s5jsItJ+fOBUAWn5pclg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1563264888018728.3293037795675; Tue, 16 Jul 2019 01:14:48 -0700 (PDT) Received: from localhost ([::1]:46222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnIbl-0004mu-B1 for importer@patchew.org; Tue, 16 Jul 2019 04:14:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60105) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnIYk-0000IZ-AE for qemu-devel@nongnu.org; Tue, 16 Jul 2019 04:11:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hnIYi-0003Ls-GX for qemu-devel@nongnu.org; Tue, 16 Jul 2019 04:11:38 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:38900) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hnIYi-0003Kl-8f for qemu-devel@nongnu.org; Tue, 16 Jul 2019 04:11:36 -0400 Received: by mail-wm1-x344.google.com with SMTP id s15so17666721wmj.3 for ; Tue, 16 Jul 2019 01:11:36 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id c1sm37723879wrh.1.2019.07.16.01.11.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 01:11:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=8Qfy8a0GAVN3cZj53fYSGM9mBcfsB1yLOHRsBKNqTiU=; b=uLP6Nq5R+E+B5kGnDaycxGgK6koWwtR7zCMbDFrQp+hz/diqzJ3Vd3/3x6u5Npfs61 y0eO2GwyMBvri266zyD6YavIVgzWasl6n+5ZenTjJvTExrMRgHeFN0LQo7Y+NyxornfB GfuSID8nymaniWexvBomqdLYbZ3AWUwutevRdgx0R6yMw9Z3i5xyQe9Qqyl98m1RPYfc v74uo0s4egHPiiW3Dk3thmoKiUWvHTSb6NF8ZSDiIyuRYnJwxpFzOVOt/JCFfMmNdp9g yt4iCjFl3vSAiV7r8TOIccxveiWfKruweGIUnrFbDAMnyafKR0tH/T3YimeAjD7MoH4e 29BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=8Qfy8a0GAVN3cZj53fYSGM9mBcfsB1yLOHRsBKNqTiU=; b=d2qs/9oSU1S75MyqhZWFm8jP7VaF/dZ0lJ8i1o11e7EkJ6vatKPw1itPINSHK+zpgA 5OatpDllWVBXr1SY0f7vw95RU3n2AvxVwpmZQaB9MkCOzxlaV9wIOVh7WFY73S8OssDy 5zfXL63p4ohVl9PB+ZpMCTHGl4iCuBXouCfsXGadV1DAunXgJ+Qvz1+UQ50I0krrMzO5 AKr4H9sVYCpX9d4N68CPmwIGa9Yi/LHDB7ZbsAl/3XhQKWsrh4mvRuUcSTFLFAIFVB44 yH6FQdxutReVs9JmMRSJc3qDtZ8q4Qmnwk8FUokp7yyM7NX450TA5tT32e8VTI+QRSMp WVgg== X-Gm-Message-State: APjAAAWidZl8sBLGhUecUYypGtx0RH06ddkn6mnY8VcI9yY1i01m+IVH pC3BTAoDoQr1GEjlAXKiE28p2zE/Geo= X-Google-Smtp-Source: APXvYqz6oZIlQl9LCX+0+0LTUTSf5jMUydYg88xTmfhY/l2MmjknCsaWw03bdPVPD8yxCmwqNYhpug== X-Received: by 2002:a1c:20c3:: with SMTP id g186mr17436015wmg.15.1563264694251; Tue, 16 Jul 2019 01:11:34 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 16 Jul 2019 10:11:12 +0200 Message-Id: <1563264677-39718-15-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1563264677-39718-1-git-send-email-pbonzini@redhat.com> References: <1563264677-39718-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PULL 14/19] target/i386: sev: Do not unpin ram device memory region X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson , Brijesh Singh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alex Williamson The commit referenced below skipped pinning ram device memory when ram blocks are added, we need to do the same when they're removed. Cc: Brijesh Singh Cc: Paolo Bonzini Fixes: cedc0ad539af ("target/i386: sev: Do not pin the ram device memory re= gion") Signed-off-by: Alex Williamson Message-Id: <156320087103.2556.10983987500488190423.stgit@gimli.home> Reviewed-by: Singh, Brijesh Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target/i386/sev.c b/target/i386/sev.c index 6dbdc3c..5ba1384 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -161,6 +161,17 @@ sev_ram_block_removed(RAMBlockNotifier *n, void *host,= size_t size) { int r; struct kvm_enc_region range; + ram_addr_t offset; + MemoryRegion *mr; + + /* + * The RAM device presents a memory region that should be treated + * as IO region and should not have been pinned. + */ + mr =3D memory_region_from_host(host, &offset); + if (mr && memory_region_is_ram_device(mr)) { + return; + } =20 range.addr =3D (__u64)(unsigned long)host; range.size =3D size; --=20 1.8.3.1