All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	oxjo@proton.me
Subject: Regression with xhci console (was: [PATCH 1/4] amd-vi: fix IVMD memory type checks)
Date: Mon, 11 Mar 2024 03:18:58 +0100	[thread overview]
Message-ID: <Ze5qE9yBLG0chLm2@mail-itl> (raw)
In-Reply-To: <20240201170159.66330-2-roger.pau@citrix.com>

[-- Attachment #1: Type: text/plain, Size: 1661 bytes --]

On Thu, Feb 01, 2024 at 06:01:56PM +0100, Roger Pau Monne wrote:
> The current code that parses the IVMD blocks is relaxed with regard to the
> restriction that such unity regions should always fall into memory ranges
> marked as reserved in the memory map.
> 
> However the type checks for the IVMD addresses are inverted, and as a result
> IVMD ranges falling into RAM areas are accepted.  Note that having such ranges
> in the first place is a firmware bug, as IVMD should always fall into reserved
> ranges.
> 
> Fixes: ed6c77ebf0c1 ('AMD/IOMMU: check / convert IVMD ranges for being / to be reserved')
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

FYI Xen 4.17.3 with this patch (but not others in the series) causes
panic on boot on Framework 14 AMD laptop:

    (XEN)  [0000000044570000, 000000005077efff] (usable)
    ...
    (XEN) AMD-Vi: Warning: IVMD: [4f83f000,4f880000) is not (entirely) in reserved memory
    (XEN) AMD-Vi: Error: IVMD: page at 4f83f000 can't be converted
    ...
    (XEN) Xen BUG at drivers/passthrough/amd/iommu_init.c:1386

Full boot log at https://github.com/QubesOS/qubes-issues/issues/9030
4.17.2 worked fine.
I'll try the whole series (and the follow up one), but I don't expect
any difference.

This looks to be related to XHCI console, which does use the same API to
allow device to DMA into relevant buffers even when the rest of XHCI is
used by dom0 (or even other domain if 'share=yes' is used):
https://gitlab.com/xen-project/xen/-/blob/staging/xen/drivers/char/xhci-dbc.c?ref_type=heads#L1421-1424

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2024-03-11  2:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 17:01 [PATCH 0/4] iommu/x86: fixes/improvements for unity range checks Roger Pau Monne
2024-02-01 17:01 ` [PATCH 1/4] amd-vi: fix IVMD memory type checks Roger Pau Monne
2024-02-03  6:51   ` oxjo
2024-02-06 10:16   ` Jan Beulich
2024-03-11  2:18   ` Marek Marczykowski-Górecki [this message]
2024-03-11  7:58     ` Regression with xhci console Jan Beulich
2024-02-01 17:01 ` [PATCH 2/4] iommu/x86: introduce a generic IVMD/RMRR range validity helper Roger Pau Monne
2024-02-06 11:17   ` Jan Beulich
2024-02-07  8:37     ` Roger Pau Monné
2024-02-01 17:01 ` [PATCH 3/4] iommu/vt-d: switch to common RMRR checker Roger Pau Monne
2024-02-06 11:28   ` Jan Beulich
2024-02-07  9:01     ` Roger Pau Monné
2024-02-07 10:33       ` Jan Beulich
2024-02-01 17:01 ` [PATCH 4/4] iommu/x86: make unity range checking more strict Roger Pau Monne
2024-02-06 11:49   ` Jan Beulich
2024-02-07  9:14     ` Roger Pau Monné
2024-02-07 10:42       ` Jan Beulich

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=Ze5qE9yBLG0chLm2@mail-itl \
    --to=marmarek@invisiblethingslab.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=oxjo@proton.me \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.