Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Soham Purkait" <soham.purkait@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/xe/ras: Use RAS config command for USP AER downgrade in passthrough
Date: Thu, 03 Dec 2026 19:06:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-248463@kernel.org> (raw)
In-Reply-To: <20261203174452.1398280-6-soham.purkait@intel.com>

Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [High] drm/xe/ras: undefined xe_debug() call in ras_config() breaks
  compilation
- [Medium] drm/xe/ras: CONFIG_PCIEAER guard skips sysctrl mailbox USP
  AER downgrade
- [Medium] drm/xe/ras: xe_run_as_guest() misses non-x86 and hidden x86
  guests
--

commit b3d3f6b24b0c7ca07f4fe595f8fab5a93f21a954
Author: Soham Purkait <soham.purkait@intel.com>

drm/xe/ras: Use RAS config command for USP AER downgrade in passthrough

This commit detects guest execution in ras_usp_aer_init() and routes the
Upstream Switch Port (USP) AER Uncorrectable Internal Error downgrade
through the system controller mailbox instead of programming USP AER
registers directly.

> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> index d2141a2fc8262..cc6ff7bd002ba 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c

[ ... ]

> @@ -533,35 +537,55 @@ static int ras_config(struct xe_device *xe, enum xe_ras_config config,
>  	}
>  
>  	if (response.size)
> -		xe_dbg(xe, "[RAS]: %s config %u, data (%u bytes): %*ph\n",
> -		       action_to_str(response.action), response.config, response.size,
> -		       (int)min(response.size, sizeof(response.data)), response.data);
> +		xe_debug(xe, "[RAS]: %s config %u, data (%u bytes): %*ph\n",
> +			 action_to_str(response.action), response.config, response.size,
> +			 (int)min(response.size, sizeof(response.data)), response.data);
>  
>  	return 0;
>  }

[Severity: High]
Does xe_debug() exist?  drivers/gpu/drm/xe/xe_printk.h only defines
xe_dbg() and xe_dbg_ratelimited(), so this breaks compilation whenever
CONFIG_DRM_XE is enabled.

>  
> +static bool xe_run_as_guest(void)
> +{
> +#if IS_ENABLED(CONFIG_X86)
> +	return !hypervisor_is_type(X86_HYPER_NATIVE);
> +#else
> +	return false;
> +#endif
> +}

[Severity: Medium]
Can xe_run_as_guest() miss passthrough guests on non-x86 architectures or
on x86 when CONFIG_HYPERVISOR_GUEST is disabled or hypervisor CPUID is
hidden?

When it returns false in passthrough, xe_pci_get_usp_dev() returns NULL
behind a virtual root bus or single root port, leaving the physical USP
error fatal and able to trigger a Secondary Bus Reset.  Behind two
virtual bridges, AER writes hit an emulated bridge instead.

Conversely, on x86 Xen Dom0, !hypervisor_is_type(X86_HYPER_NATIVE)
evaluates to true and misclassifies the host as a guest.

[ ... ]

>  static void ras_usp_aer_init(struct xe_device *xe)
>  {
>  	struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
> -	enum xe_ras_config config;
>  	struct pci_dev *usp;
>  	u16 aer_cap;
>  	u32 status;
> -	int ret;
> +
> +	if (xe_run_as_guest()) {
> +		xe_info(xe, "[RAS]: running as guest, using sysctrl mailbox\n");
> +		ras_usp_aer_config_mailbox(xe);
> +		return;
> +	}

[Severity: Medium]
Will xe_ras_init() skip this sysctrl mailbox path when CONFIG_PCIEAER is
disabled?

xe_ras_init() only calls ras_usp_aer_init() when
IS_ENABLED(CONFIG_PCIEAER) is true, even though CONFIG_DRM_XE does not
select CONFIG_PCIEAER and guest kernels often omit it.  When disabled,
the downgrade is never sent and the physical USP error stays fatal.

Since include/linux/aer.h stubs pcie_aer_is_native() to return 0 when
CONFIG_PCIEAER is disabled, dropping the IS_ENABLED(CONFIG_PCIEAER)
guard in xe_ras_init() lets both passthrough guests and non-native hosts
use the sysctrl mailbox.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203174452.1398280-4-soham.purkait@intel.com?part=2

  reply	other threads:[~2026-12-03 19:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 17:44 [PATCH 0/2] drm/xe/ras: Configure USP AER via system controller mailbox Soham Purkait
2026-12-03 17:44 ` [PATCH 1/2] drm/xe/ras: Add RAS config command to downgrade AER uncorrectable internal error Soham Purkait
2026-12-03 18:46   ` sashiko-bot
2026-12-03 17:44 ` [PATCH 2/2] drm/xe/ras: Use RAS config command for USP AER downgrade in passthrough Soham Purkait
2026-12-03 19:06   ` sashiko-bot [this message]
2026-12-03 18:10 ` ✗ CI.KUnit: failure for drm/xe/ras: Configure USP AER via system controller mailbox Patchwork

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=sashiko-outbox-248463@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=soham.purkait@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