From patchwork Sun Jun 19 06:52:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 12886561 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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 693A1C433EF for ; Sun, 19 Jun 2022 06:53:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.352044.578779 (Exim 4.92) (envelope-from ) id 1o2ont-0004mn-Ai; Sun, 19 Jun 2022 06:53:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 352044.578779; Sun, 19 Jun 2022 06:53:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o2ont-0004ma-5a; Sun, 19 Jun 2022 06:53:01 +0000 Received: by outflank-mailman (input) for mailman id 352044; Sun, 19 Jun 2022 06:52:59 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o2onr-0004F8-Np for xen-devel@lists.xenproject.org; Sun, 19 Jun 2022 06:52:59 +0000 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 72c3744e-ef9c-11ec-b725-ed86ccbb4733; Sun, 19 Jun 2022 08:52:56 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 089FE1FD96; Sun, 19 Jun 2022 06:52:56 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BBB2F13427; Sun, 19 Jun 2022 06:52:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UCh0LMfHrmJzXgAAMHmgww (envelope-from ); Sun, 19 Jun 2022 06:52:55 +0000 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: 72c3744e-ef9c-11ec-b725-ed86ccbb4733 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1655621576; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xmLVZAezCgzTgOsivEiAdLkZ5h3o4dxtcy7J5SE1ulo=; b=Nki0XgCrhrAtcSGlsxAi7Igkh5HutNGZ1se7+Qjw1BBYbqM1ZY0J1CSIw1nMGG1OpYVOiY +m6BU7OVZtvEUC25lBZiXcEUIOPKtCqF4yYh9bgSp+xdmgOgyw9/zMQeHmMmN65rC/rJj9 FhKCY+x9DOhzuOKuHa//gpUF4UEX9Mw= From: Juergen Gross To: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org Cc: samuel.thibault@ens-lyon.org, wl@xen.org, Juergen Gross Subject: [PATCH v2 4/4] mini-os: fix bug in ballooning on PVH Date: Sun, 19 Jun 2022 08:52:53 +0200 Message-Id: <20220619065253.19503-5-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220619065253.19503-1-jgross@suse.com> References: <20220619065253.19503-1-jgross@suse.com> MIME-Version: 1.0 There is a subtle bug in ballooning code for PVH: in case ballooning extends above a non-RAM area of the memory map, wrong pages will be used. Signed-off-by: Juergen Gross Reviewed-by: Samuel Thibault --- V2: - new patch --- balloon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/balloon.c b/balloon.c index 6ad07644..55be8141 100644 --- a/balloon.c +++ b/balloon.c @@ -124,7 +124,7 @@ int balloon_up(unsigned long n_pages) for ( pfn = 0; pfn < rc; pfn++ ) { arch_pfn_add(start_pfn + pfn, balloon_frames[pfn]); - free_page(pfn_to_virt(nr_mem_pages + pfn)); + free_page(pfn_to_virt(start_pfn + pfn)); } nr_mem_pages += rc;