From nobody Sat Nov 23 00:53:19 2024 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75F471E522 for ; Fri, 15 Nov 2024 01:21:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731633709; cv=none; b=CjUegeYJqXpV0oe5/onY/slf6fKSYqlMCHC4R1cb/cv2HmjydGrQrCYieCSGJozQDalcQutSwiwYPpqkU9x3LQiY157CHcq22zKx/xvdqt9LYJlqG+pOoV4BaGwK5rrp+C02nyVo73yC6UMuCT14vj1UswgJiHxbj2Ex12GyLfM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731633709; c=relaxed/simple; bh=uDcZIIbz0+WPEIzGh1sdc3TfrrracFPlsupkkxm6rvo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=jdR1VIZcgfXvyvEVB8epcwrypWwOEQJxCSn+eokWZGRpHqkSnGzZDSNbCuIFInnx+hCaTo2tPzMYZpt/eiRwwgSzdQVJXJxjfEsQ5Wxfo4iNdAStJJihkx/4R0GlfMTg5NCSRFOnMLWjMWe0TOSPXk0c9f8k9hCNLWurEgxF33Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=E2yLqftE; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="E2yLqftE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731633706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nBAI7kp1alNZNqlSIDUgviK0JRdKueloTz4aSb5nzkc=; b=E2yLqftETaqMn1yb87r8yga3jFsH8D7dy/gQTPGtLkhegk0MI7upZA/v1qAHBZzfK2C9lK oauA45tEHkmt3lm0l0o+KKhSC06L0rwVxQ+ANR771CZJVcd6AM4eGXeY5dbbIuv7s2G8m6 yjTcmh11cGqOlyeZPgs2LHwiFOD4q5s= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-101-OLExu5N6Nu2yr4lDK_DhfA-1; Thu, 14 Nov 2024 20:21:44 -0500 X-MC-Unique: OLExu5N6Nu2yr4lDK_DhfA-1 X-Mimecast-MFC-AGG-ID: OLExu5N6Nu2yr4lDK_DhfA Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 512441955F69; Fri, 15 Nov 2024 01:21:43 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.112.16]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2A63E3003B71; Fri, 15 Nov 2024 01:21:39 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org, bp@alien8.de Cc: x86@kernel.org, thomas.lendacky@amd.com, Baoquan He Subject: [PATCH 1/3] x86/ioremap: introduce helper to check if physical address is in setup_data Date: Fri, 15 Nov 2024 09:21:29 +0800 Message-ID: <20241115012131.509226-2-bhe@redhat.com> In-Reply-To: <20241115012131.509226-1-bhe@redhat.com> References: <20241115012131.509226-1-bhe@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Type: text/plain; charset="utf-8" Functions memremap_is_setup_data() and early_memremap_is_setup_data() share completely the same process and handling, except of the different memremap/unmap invocations. Add helper __memremap_is_setup_data() to extract the common part, parameter 'early' is used to decide what kind of memremap/unmap APIs are called. Signed-off-by: Baoquan He --- arch/x86/mm/ioremap.c | 81 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 8d29163568a7..5ef6182db630 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -628,6 +628,87 @@ static bool memremap_is_efi_data(resource_size_t phys_= addr, return false; } =20 +#define SD_SIZE sizeof(struct setup_data) +/* + * Examine the physical address to determine if it is boot data by checking + * it against the boot params setup_data chain. + */ +static bool __init __memremap_is_setup_data(resource_size_t phys_addr, + bool early) +{ + struct setup_indirect *indirect; + struct setup_data *data; + u64 paddr, paddr_next; + + paddr =3D boot_params.hdr.setup_data; + while (paddr) { + unsigned int len, size; + + if (phys_addr =3D=3D paddr) + return true; + + if (early) + data =3D early_memremap_decrypted(paddr, SD_SIZE); + else + data =3D memremap(paddr, SD_SIZE, + MEMREMAP_WB | MEMREMAP_DEC); + if (!data) { + pr_warn("failed to memremap setup_data entry\n"); + return false; + } + + size =3D SD_SIZE; + + paddr_next =3D data->next; + len =3D data->len; + + if ((phys_addr > paddr) && + (phys_addr < (paddr + SD_SIZE + len))) { + if (early) + early_memunmap(data, SD_SIZE); + else + memunmap(data); + return true; + } + + if (data->type =3D=3D SETUP_INDIRECT) { + size +=3D len; + if (early) { + early_memunmap(data, SD_SIZE); + data =3D early_memremap_decrypted(paddr, size); + } else { + memunmap(data); + data =3D memremap(paddr, size, + MEMREMAP_WB | MEMREMAP_DEC); + } + if (!data) { + pr_warn("failed to memremap indirect setup_data\n"); + return false; + } + + indirect =3D (struct setup_indirect *)data->data; + + if (indirect->type !=3D SETUP_INDIRECT) { + paddr =3D indirect->addr; + len =3D indirect->len; + } + } + + if (early) + early_memunmap(data, size); + else + memunmap(data); + + if ((phys_addr > paddr) && (phys_addr < (paddr + len))) + return true; + + paddr =3D paddr_next; + } + + return false; +} +#undef SD_SIZE + /* * Examine the physical address to determine if it is boot data by checking * it against the boot params setup_data chain. --=20 2.41.0 From nobody Sat Nov 23 00:53:19 2024 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A44351E522 for ; Fri, 15 Nov 2024 01:21:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731633714; cv=none; b=eDxZksHoKtMGDqSUPmqG2WR4vQZ9yUd+g/gUFmafSW6lTuk35WIcW9R2rGL/gfPJPPWc7tlCUW6mpWia/+d0gZYrMfK4eUGYBVhH89H2Ew5lRMoeRUBH239GOnPYgIvsmHS9CIBrcv4pipAXILm3MFx55KlsMB4O47wMGmtJSMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731633714; c=relaxed/simple; bh=rx6rKoISxTQ2TqVk5jocBzk88C5SjCsg+QLtNmT7Tm8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=OF+cEmXZxCII6rhCaQ0O6V1m6ueO8EdawuxUfHkG0lwfoZlPhhmqO6ExbuxC6vEbWZoGEOsztcdqVF5cRbaDe60dYlk60Q7Odu8nxUAlJ69xrq4Ma3kG1c0GLPCCo8q6jcFfJOlFu62hsB5oxFJbOZ6/YaJjEfl+wDv3jVYViyE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=GY+DQUNA; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GY+DQUNA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731633711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lNrA0Y0eLxm5pkvtcUoqqFPIPW27ZMWIeXhHj6rouCw=; b=GY+DQUNA03U3gifRz4NDbL/PYiuChd1jEbmhK1eq8AlWM/pUWpnTgLbFqhxqNg2DHRfuuk 7WmVNo6FOofesu9FLWodH+ogiEYXNsid22kxWfsYfj16MQsKo5sRhpBw60n63Zfj5pUeZX 7aljxIMIBp/7NvGJ7oTRHJcHzqT1qHg= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-369-JMB7O4c0P4OVNieUVkie5g-1; Thu, 14 Nov 2024 20:21:48 -0500 X-MC-Unique: JMB7O4c0P4OVNieUVkie5g-1 X-Mimecast-MFC-AGG-ID: JMB7O4c0P4OVNieUVkie5g Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7C5FE19560BE; Fri, 15 Nov 2024 01:21:47 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.112.16]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 238463003B71; Fri, 15 Nov 2024 01:21:43 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org, bp@alien8.de Cc: x86@kernel.org, thomas.lendacky@amd.com, Baoquan He Subject: [PATCH 2/3] x86/ioremap: use helper to implement xxx_is_setup_data() Date: Fri, 15 Nov 2024 09:21:30 +0800 Message-ID: <20241115012131.509226-3-bhe@redhat.com> In-Reply-To: <20241115012131.509226-1-bhe@redhat.com> References: <20241115012131.509226-1-bhe@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Type: text/plain; charset="utf-8" This simplifies codes a lot by removing the duplicated code handling. And also remove the similar code comment above of them. While at it, add __ref to memremap_is_setup_data() to avoid the section mismatch warning: WARNING: modpost: vmlinux: section mismatch in reference: arch_memremap_can= _ram_remap.cold+0x6 (section: .text.unlikely) -> __memremap_is_setup_data (= section: .init.text) Signed-off-by: Baoquan He --- arch/x86/mm/ioremap.c | 119 ++---------------------------------------- 1 file changed, 3 insertions(+), 116 deletions(-) diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 5ef6182db630..5d1b5e4a8756 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -709,129 +709,16 @@ static bool __init __memremap_is_setup_data(resource= _size_t phys_addr, } #undef SD_SIZE =20 -/* - * Examine the physical address to determine if it is boot data by checking - * it against the boot params setup_data chain. - */ -static bool memremap_is_setup_data(resource_size_t phys_addr, +static bool __ref memremap_is_setup_data(resource_size_t phys_addr, unsigned long size) { - struct setup_indirect *indirect; - struct setup_data *data; - u64 paddr, paddr_next; - - paddr =3D boot_params.hdr.setup_data; - while (paddr) { - unsigned int len; - - if (phys_addr =3D=3D paddr) - return true; - - data =3D memremap(paddr, sizeof(*data), - MEMREMAP_WB | MEMREMAP_DEC); - if (!data) { - pr_warn("failed to memremap setup_data entry\n"); - return false; - } - - paddr_next =3D data->next; - len =3D data->len; - - if ((phys_addr > paddr) && - (phys_addr < (paddr + sizeof(struct setup_data) + len))) { - memunmap(data); - return true; - } - - if (data->type =3D=3D SETUP_INDIRECT) { - memunmap(data); - data =3D memremap(paddr, sizeof(*data) + len, - MEMREMAP_WB | MEMREMAP_DEC); - if (!data) { - pr_warn("failed to memremap indirect setup_data\n"); - return false; - } - - indirect =3D (struct setup_indirect *)data->data; - - if (indirect->type !=3D SETUP_INDIRECT) { - paddr =3D indirect->addr; - len =3D indirect->len; - } - } - - memunmap(data); - - if ((phys_addr > paddr) && (phys_addr < (paddr + len))) - return true; - - paddr =3D paddr_next; - } - - return false; + return __memremap_is_setup_data(phys_addr, false); } =20 -/* - * Examine the physical address to determine if it is boot data by checking - * it against the boot params setup_data chain (early boot version). - */ static bool __init early_memremap_is_setup_data(resource_size_t phys_addr, unsigned long size) { - struct setup_indirect *indirect; - struct setup_data *data; - u64 paddr, paddr_next; - - paddr =3D boot_params.hdr.setup_data; - while (paddr) { - unsigned int len, size; - - if (phys_addr =3D=3D paddr) - return true; - - data =3D early_memremap_decrypted(paddr, sizeof(*data)); - if (!data) { - pr_warn("failed to early memremap setup_data entry\n"); - return false; - } - - size =3D sizeof(*data); - - paddr_next =3D data->next; - len =3D data->len; - - if ((phys_addr > paddr) && - (phys_addr < (paddr + sizeof(struct setup_data) + len))) { - early_memunmap(data, sizeof(*data)); - return true; - } - - if (data->type =3D=3D SETUP_INDIRECT) { - size +=3D len; - early_memunmap(data, sizeof(*data)); - data =3D early_memremap_decrypted(paddr, size); - if (!data) { - pr_warn("failed to early memremap indirect setup_data\n"); - return false; - } - - indirect =3D (struct setup_indirect *)data->data; - - if (indirect->type !=3D SETUP_INDIRECT) { - paddr =3D indirect->addr; - len =3D indirect->len; - } - } - - early_memunmap(data, size); - - if ((phys_addr > paddr) && (phys_addr < (paddr + len))) - return true; - - paddr =3D paddr_next; - } - - return false; + return __memremap_is_setup_data(phys_addr, true); } =20 /* --=20 2.41.0 From nobody Sat Nov 23 00:53:19 2024 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AAFCD14A4FF for ; Fri, 15 Nov 2024 01:21:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731633718; cv=none; b=lhAymBCRYMrYGJ0VoG6tYySRWGtiSAaXFbuThu785KvBVU/P9OkKxE9woPPyw0BN4T4+MIiLqugi8GSrS3sG14SCE06a6BSXeaXPdzxS5CXl6zS5hsWszh3cU2Yq/jSX+GHdjU0gHB4KJhKHE5P8k9mz5spCYyYLjVw33Oqfnls= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731633718; c=relaxed/simple; bh=Epzqu6Gp+71wWEolEIdEuva8cFbESZtGGGK9glHCG+s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=iHtLQvdsic4rXHs9lnnVFhym61InblTuBEagfuP6okFc561SIQD3ySYQMgFN7zkNefeA6YT9+0QQyyLwySkEFSnpowwaFkjVdgi8YD9KPocuE0pnhplbCD+7sjuMaPFDOrwMjx+srKVFtgzPb8JNt60s5k6+/AqpUcW406nMJ18= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=hMDit7rQ; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hMDit7rQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731633715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yNFaxOngUrH/H+a3peOD/o/2VYRIzGn5AfsekXcACs0=; b=hMDit7rQ929FLZ0YdJBKLIKRRHg6lxxayyaDSe3yEwmLEniHFLRPtULeBvQ8rBq6SDBWZo FpD3LyBNla1fetfDELdsnZTgVTstZzrfloctzqPLM0HyeVXTb4oY9s05hJ/0asFnvl2Opq 1q5/GF8ULZ5Q0rr+F7jX32x8rjWR9sc= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-187-ruwQ4RPbNYGJyM4Iu1R9pQ-1; Thu, 14 Nov 2024 20:21:52 -0500 X-MC-Unique: ruwQ4RPbNYGJyM4Iu1R9pQ-1 X-Mimecast-MFC-AGG-ID: ruwQ4RPbNYGJyM4Iu1R9pQ Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5D09119560B4; Fri, 15 Nov 2024 01:21:51 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.112.16]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 31EB43003B71; Fri, 15 Nov 2024 01:21:47 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org, bp@alien8.de Cc: x86@kernel.org, thomas.lendacky@amd.com, Baoquan He Subject: [PATCH 3/3] x86/mm: clean up unused parameters of functions Date: Fri, 15 Nov 2024 09:21:31 +0800 Message-ID: <20241115012131.509226-4-bhe@redhat.com> In-Reply-To: <20241115012131.509226-1-bhe@redhat.com> References: <20241115012131.509226-1-bhe@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Type: text/plain; charset="utf-8" For functions memremap_is_efi_data(), memremap_is_setup_data and early_memremap_is_setup_data(), their parameter 'size' is not used and sometime cause confusion. Remove it now. Signed-off-by: Baoquan He Reviewed-by: Tom Lendacky --- arch/x86/mm/ioremap.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 5d1b5e4a8756..71b282e5a4a0 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -593,8 +593,7 @@ static bool memremap_should_map_decrypted(resource_size= _t phys_addr, * Examine the physical address to determine if it is EFI data. Check * it against the boot params structure and EFI tables and memory types. */ -static bool memremap_is_efi_data(resource_size_t phys_addr, - unsigned long size) +static bool memremap_is_efi_data(resource_size_t phys_addr) { u64 paddr; =20 @@ -709,14 +708,12 @@ static bool __init __memremap_is_setup_data(resource_= size_t phys_addr, } #undef SD_SIZE =20 -static bool __ref memremap_is_setup_data(resource_size_t phys_addr, - unsigned long size) +static bool __ref memremap_is_setup_data(resource_size_t phys_addr) { return __memremap_is_setup_data(phys_addr, false); } =20 -static bool __init early_memremap_is_setup_data(resource_size_t phys_addr, - unsigned long size) +static bool __init early_memremap_is_setup_data(resource_size_t phys_addr) { return __memremap_is_setup_data(phys_addr, true); } @@ -739,8 +736,8 @@ bool arch_memremap_can_ram_remap(resource_size_t phys_a= ddr, unsigned long size, return false; =20 if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT)) { - if (memremap_is_setup_data(phys_addr, size) || - memremap_is_efi_data(phys_addr, size)) + if (memremap_is_setup_data(phys_addr) || + memremap_is_efi_data(phys_addr)) return false; } =20 @@ -765,8 +762,8 @@ pgprot_t __init early_memremap_pgprot_adjust(resource_s= ize_t phys_addr, encrypted_prot =3D true; =20 if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT)) { - if (early_memremap_is_setup_data(phys_addr, size) || - memremap_is_efi_data(phys_addr, size)) + if (early_memremap_is_setup_data(phys_addr) || + memremap_is_efi_data(phys_addr)) encrypted_prot =3D false; } =20 --=20 2.41.0