From nobody Thu Nov 21 15:01:50 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=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1731596323; cv=none; d=zohomail.com; s=zohoarc; b=fuCbRFWcMaQXiW36L0Xruv1Rh3p+aTd3Cs2b+RvANX0Se12Zku6TCEaaYOkRpzdTemWk7eMxRL826tmyjgq8aD4v+g0k/NJJe8EI6eElgallrRC5pJv2aSKSI1SwUIqDj4hZLC8blNuEU2u9IK5Ph6d43ublc8YQNwNhXqAB2r0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731596323; 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=tXR4cctauxXAgvzXe72aJg/wf4uD+JeIO0+1UeL6XbI=; b=RNyU5q9+UX3NpaX8IcXlaznD3FDvpizgSL8f2dT8q+ZfckLg0J62V0gvJFHdeZ82aHiCxV6K5MpDCZZGrTI2I8XFW7JxwTjNq4v5N24km9exElqXScUKzOcahIIceHMRrN7Nw22k2V09tpc/xVkO7/3DgjHv7uF0Uyqvd5fg/1Q= 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=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1731596323234308.6200096478076; Thu, 14 Nov 2024 06:58:43 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.836527.1252447 (Exim 4.92) (envelope-from ) id 1tBbIa-00080w-G0; Thu, 14 Nov 2024 14:58:20 +0000 Received: by outflank-mailman (output) from mailman id 836527.1252447; Thu, 14 Nov 2024 14:58:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tBbIa-00080i-Ap; Thu, 14 Nov 2024 14:58:20 +0000 Received: by outflank-mailman (input) for mailman id 836527; Thu, 14 Nov 2024 14:58:19 +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 1tBbIZ-0007K7-PK for xen-devel@lists.xenproject.org; Thu, 14 Nov 2024 14:58:19 +0000 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [2a00:1450:4864:20::634]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e0ecac41-a298-11ef-a0c7-8be0dac302b0; Thu, 14 Nov 2024 15:58:16 +0100 (CET) Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-aa20944ce8cso158622466b.0 for ; Thu, 14 Nov 2024 06:58:16 -0800 (PST) Received: from localhost ([213.195.123.63]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa20e08617esm71581366b.182.2024.11.14.06.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 06:58:15 -0800 (PST) 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: e0ecac41-a298-11ef-a0c7-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDA6MTQ1MDo0ODY0OjIwOjo2MzQiLCJoZWxvIjoibWFpbC1lajEteDYzNC5nb29nbGUuY29tIn0= X-Custom-Transaction: eyJpZCI6ImUwZWNhYzQxLWEyOTgtMTFlZi1hMGM3LThiZTBkYWMzMDJiMCIsInRzIjoxNzMxNTk2Mjk2LjU5ODI0Niwic2VuZGVyIjoicm9nZXIucGF1QGNsb3VkLmNvbSIsInJlY2lwaWVudCI6Inhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyJ9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1731596296; x=1732201096; 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=tXR4cctauxXAgvzXe72aJg/wf4uD+JeIO0+1UeL6XbI=; b=uF09amAJXlqVYrgoAWLuUBYzKfcIc45iT0ezUuDADzGua0wyqEdMZkOKb/ABIUl8kc jAJmMVOTHB+fJk/urct8yo9tEcxNamIwXYBXTcHSECNeNB89KfbdhuNHnqnRrJGOdxci Mgvf0381fXjpVvVjvX6GMWCSNLK7cMciAcZAY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731596296; x=1732201096; 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=tXR4cctauxXAgvzXe72aJg/wf4uD+JeIO0+1UeL6XbI=; b=tBsijn9hFeZraqfDFQf9GpjZlyzR6Yiy21YqHsOpJ7eVsFmIiweeBvufXucr8dknth TrD4Svsg5n7YTJPHjRFtLB3/OH9d5jNH0NL+I5EipUs81whdEnJ0DGJ7N/nYZcjQxLLO oImT/wY7nz0vqp0UFBuDPRWnLMcT812/os/SxsuLN1OEfISE4Sbh4zN/yMvVFrpQbDdj N/sh3nQQOkorjXgQana4AB34Ekou0kZgS42Szw5FRU2zl1c7QctpvtsxK2v0jKiYPmjY iKyfbl+CT0HXJOnsM37I9J7E0lp3ybOTglpMGhYDmzrNAhQQhKkGPN6oSp24Af1fgR26 PWKQ== X-Gm-Message-State: AOJu0YyhhazsqtuHJLngsDLpwAMAJDeQGWFSRqwxo6sVvCEKbB3Fz0VE V9doXqQ5kU8nc6FQ3Rr87I7rvkkxBp5aHaBxw3BbRsDQ+iPF37cjk9t0bOtZfTK/p3iCtobW288 0 X-Google-Smtp-Source: AGHT+IELVxnRGrnCdIZBOFpbty878I4Sr+GUKmoDscJGaVSHTdvBbe+YWejESTrHfW/xUoW/c+B2XA== X-Received: by 2002:a17:907:1ca2:b0:a9a:cea7:1294 with SMTP id a640c23a62f3a-aa2077daa13mr300791866b.21.1731596295726; Thu, 14 Nov 2024 06:58:15 -0800 (PST) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v3 3/4] x86/setup: remove bootstrap_map_addr() usage of destroy_xen_mappings() Date: Thu, 14 Nov 2024 15:57:14 +0100 Message-ID: <20241114145715.59777-4-roger.pau@citrix.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241114145715.59777-1-roger.pau@citrix.com> References: <20241114145715.59777-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1731596323691116600 bootstrap_map_addr() needs to be careful to not remove existing page-table structures when tearing down mappings, as such pagetable structures might be needed to fulfill subsequent mappings requests. The comment ahead of the function already notes that pagetable memory shouldn't be allocated. Fix this by using map_pages_to_xen(), which does zap the page-table entries, but does not free page-table structures even when empty. Fixes: 4376c05c3113 ('x86-64: use 1GB pages in 1:1 mapping if available') Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Jan Beulich --- Changes since v1: - Adjust commit message. --- xen/arch/x86/setup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 4feef9f2e05a..5da1c6a34519 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -462,7 +462,9 @@ static void *__init bootstrap_map_addr(paddr_t start, p= addr_t end) =20 if ( !end ) { - destroy_xen_mappings(BOOTSTRAP_MAP_BASE, BOOTSTRAP_MAP_LIMIT); + map_pages_to_xen(BOOTSTRAP_MAP_BASE, INVALID_MFN, + PFN_DOWN(map_cur - BOOTSTRAP_MAP_BASE), + _PAGE_NONE); map_cur =3D BOOTSTRAP_MAP_BASE; return NULL; } --=20 2.46.0