Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: "Lis, Tomasz" <tomasz.lis@intel.com>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Cc: "Winiarski, Michal" <michal.winiarski@intel.com>,
	"Piorkowski, Piotr" <Piotr.Piorkowski@intel.com>,
	"Brost, Matthew" <matthew.brost@intel.com>,
	"K V P, Satyanarayana" <Satyanarayana.K.V.P@intel.com>
Subject: Re: [PATCH v4 3/4] drm/xe: Assert that VF will never use fixed placement of BOs
Date: Tue, 21 Oct 2025 17:04:28 +0200	[thread overview]
Message-ID: <e90a6fcc-ac9d-4707-ab10-6e57ed6a554d@intel.com> (raw)
In-Reply-To: <f4e2aaf2-a4e5-497a-8b35-7044b29dc48a@intel.com>



On 10/21/2025 12:48 AM, Lis, Tomasz wrote:
> 
> On 10/20/2025 11:59 PM, Wajdeczko, Michal wrote:
>>
>> On 10/20/2025 10:58 PM, Tomasz Lis wrote:
>>> Most BOs do not care at which offset they will be accessed within
>>> GGTT or PPGTT. The few which do care, should be only created
>>> on PF, and mapped within GGTT. On VFs, mapping at fixed offset
>>> would be problematic, as each VF is granted access to a range of
>>> GGTT address space.
>> it's not a matter of being "problematic" but this is just prohibited
>> as there is no assumption which GGTT range will be assigned to the VF
> will update to "prohibited". though that's a simplification. Fixed is not the same as constant.
>>> So, since fixed addresses of GGTT mapping can only be used on PF,
>>> we can add an assert which makes sure no attempt of fixed placement
>>> will happen for a driver probed on a VF.
>>>
>>> The assert will also ensure that VF migration can be properly
>>> performed without a need for special handling of the fixed placement
>>> addresses.
>> this last sentence can be dropped
> will drop, though I can't say I agree.
>>
>>> Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
>>> ---
>>>   drivers/gpu/drm/xe/xe_bo.c | 6 ++++++
>>>   1 file changed, 6 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
>>> index 7b6502081873..8e826a4aa574 100644
>>> --- a/drivers/gpu/drm/xe/xe_bo.c
>>> +++ b/drivers/gpu/drm/xe/xe_bo.c
>>> @@ -2259,6 +2259,12 @@ static int __xe_bo_fixed_placement(struct xe_device *xe,
>>>       struct ttm_place *place = bo->placements;
>>>       u32 vram_flag, vram_stolen_flags;
>>>   +    /*
>>> +     * to allow fixed placement in GGTT of a VF, post-migration fixups
>>> +     * would have to include shifting the page ranges
>> it's not about implementation of fixups, this is just not allowed
> 
> "not allowed" is not an explanation. That is clear from the assert itself. The comment is here to tell why.
> 
> Having only a range of addresses is not enough of an explanation, as then we could still have fixed offset which was computed so that it conforms to the range limits. Fixed does not mean hard-coded. For such computed fixed offsets, the explanation in comment is correct.

any of your "valid computed placement" will have to take into account the VF's base/size anyway

and since this "base" cannot be guaranteed to be stable across the VF life, those computations that expects or use this absolute "fixed" final placement are illegal regardless of any missing "migration-fixups" implementation

OTOH the relative offset of one BO to other BO, will be satisfied after migration without any special work

so still I'm not sure how above comment might help

> 
> -Tomasz
> 
>>
>>> +     */
>>> +    xe_assert(xe, !IS_SRIOV_VF(xe) || !(bo->flags & XE_BO_FLAG_GGTT));
>> but the assert is fine, so with commit/comment updated,
>>
>> Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>>
>>> +
>>>       if (flags & (XE_BO_FLAG_USER | XE_BO_FLAG_SYSTEM))
>>>           return -EINVAL;
>>>   


  reply	other threads:[~2025-10-21 15:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-20 20:58 [PATCH v4 0/4] drm/xe/vf: Minor fixes to post-migration recovery Tomasz Lis
2025-10-20 20:58 ` [PATCH v4 1/4] drm/xe/vf: Helper for telling whether CCS migration BBs are needed Tomasz Lis
2025-10-20 20:58 ` [PATCH v4 2/4] drm/xe/vf: Fix GuC FW check for VF migration support Tomasz Lis
2025-10-20 22:17   ` Michal Wajdeczko
2025-10-20 23:46     ` Lis, Tomasz
2025-10-20 20:58 ` [PATCH v4 3/4] drm/xe: Assert that VF will never use fixed placement of BOs Tomasz Lis
2025-10-20 21:59   ` Michal Wajdeczko
2025-10-20 22:48     ` Lis, Tomasz
2025-10-21 15:04       ` Michal Wajdeczko [this message]
2025-10-21 17:20         ` Lis, Tomasz
2025-10-20 20:58 ` [PATCH v4 4/4] drm/xe/vf: Do not disable VF migration on ATS-M Tomasz Lis
2025-10-20 21:53   ` Michal Wajdeczko
2025-10-21 10:51 ` ✓ CI.KUnit: success for drm/xe/vf: Minor fixes to post-migration recovery (rev4) Patchwork
2025-10-21 12:41 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-21 13:38 ` ✓ Xe.CI.Full: " 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=e90a6fcc-ac9d-4707-ab10-6e57ed6a554d@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=Piotr.Piorkowski@intel.com \
    --cc=Satyanarayana.K.V.P@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=michal.winiarski@intel.com \
    --cc=tomasz.lis@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