public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Yian Chen <yian.chen@intel.com>
Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-ia64@vger.kernel.org, David Woodhouse <dwmw2@infradead.org>,
	Ashok Raj <ashok.raj@intel.com>,
	Sohil Mehta <sohil.mehta@intel.com>,
	Tony Luck <tony.luck@intel.com>
Subject: Re: [PATCH] iommu/vt-d: Check VT-d RMRR region in BIOS is reported as reserved
Date: Wed, 16 Oct 2019 09:51:21 +0200	[thread overview]
Message-ID: <20191016075120.GB32232@8bytes.org> (raw)
In-Reply-To: <20191015164932.18185-1-yian.chen@intel.com>

Hi,

On Tue, Oct 15, 2019 at 09:49:32AM -0700, Yian Chen wrote:
> VT-d RMRR (Reserved Memory Region Reporting) regions are reserved
> for device use only and should not be part of allocable memory pool of OS.
> 
> BIOS e820_table reports complete memory map to OS, including OS usable
> memory ranges and BIOS reserved memory ranges etc.
> 
> x86 BIOS may not be trusted to include RMRR regions as reserved type
> of memory in its e820 memory map, hence validate every RMRR entry
> with the e820 memory map to make sure the RMRR regions will not be
> used by OS for any other purposes.

Are there real systems in the wild where this is a problem?

> +static inline int __init
> +arch_rmrr_sanity_check(struct acpi_dmar_reserved_memory *rmrr)
> +{
> +	u64 start = rmrr->base_address;
> +	u64 end = rmrr->end_address + 1;
> +
> +	if (e820__mapped_all(start, end, E820_TYPE_RESERVED))
> +		return 0;
> +
> +	pr_err(FW_BUG "No firmware reserved region can cover this RMRR [%#018Lx-%#018Lx], contact BIOS vendor for fixes\n",
> +	       start, end - 1);
> +	return -EFAULT;
> +}

Why -EFAULT, there is no fault involved? Usibg -EINVAL seems to be a better choice.


  parent reply	other threads:[~2019-10-16  7:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 16:49 [PATCH] iommu/vt-d: Check VT-d RMRR region in BIOS is reported as reserved Yian Chen
2019-10-16  0:25 ` Lu Baolu
2019-10-16  7:51 ` Joerg Roedel [this message]
2019-10-16 17:21   ` Chen, Yian
2020-02-18  8:28 ` NOMURA JUNICHI(野村 淳一)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191016075120.GB32232@8bytes.org \
    --to=joro@8bytes.org \
    --cc=ashok.raj@intel.com \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sohil.mehta@intel.com \
    --cc=tony.luck@intel.com \
    --cc=yian.chen@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox