1
1
/*
2
- * Copyright (C) 2022-2024 Intel Corporation
2
+ * Copyright (C) 2022-2025 Intel Corporation
3
3
*
4
4
* SPDX-License-Identifier: MIT
5
5
*
25
25
#include " shared/test/common/mocks/mock_sip.h"
26
26
#include " shared/test/common/mocks/ult_device_factory.h"
27
27
#include " shared/test/common/os_interface/linux/sys_calls_linux_ult.h"
28
+ #include " shared/test/common/test_macros/hw_test.h"
28
29
#include " shared/test/common/test_macros/test.h"
29
30
30
31
#include " level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper.h"
@@ -7882,7 +7883,7 @@ TEST_F(DebugApiRegistersAccessTest, givenReadModeRegisterCalledThenSuccessIsRetu
7882
7883
7883
7884
using DebugApiLinuxMultitileTest = Test<DebugApiLinuxMultiDeviceFixture>;
7884
7885
7885
- TEST_F (DebugApiLinuxMultitileTest, GivenRootDeviceAndTileAttachDisabledWhenDebugSessionInitializedThenEuThreadsAreCreated) {
7886
+ HWTEST2_F (DebugApiLinuxMultitileTest, GivenRootDeviceAndTileAttachDisabledWhenDebugSessionInitializedThenEuThreadsAreCreated, IsAtLeastGen12lp ) {
7886
7887
DebugManagerStateRestore restorer;
7887
7888
NEO::debugManager.flags .ExperimentalEnableTileAttach .set (0 );
7888
7889
@@ -7910,7 +7911,7 @@ TEST_F(DebugApiLinuxMultitileTest, GivenRootDeviceAndTileAttachDisabledWhenDebug
7910
7911
EXPECT_FALSE (session->tileSessionsEnabled );
7911
7912
}
7912
7913
7913
- TEST_F (DebugApiLinuxMultitileTest, GivenRootDeviceAndRootAttachModeWhenDebugSessionInitializedThenEuThreadsAreCreated) {
7914
+ HWTEST2_F (DebugApiLinuxMultitileTest, GivenRootDeviceAndRootAttachModeWhenDebugSessionInitializedThenEuThreadsAreCreated, IsAtLeastGen12lp ) {
7914
7915
zet_debug_config_t config = {};
7915
7916
7916
7917
auto session = std::make_unique<MockDebugSessionLinuxi915>(config, deviceImp, 1 );
@@ -7936,7 +7937,7 @@ TEST_F(DebugApiLinuxMultitileTest, GivenRootDeviceAndRootAttachModeWhenDebugSess
7936
7937
EXPECT_FALSE (session->tileSessionsEnabled );
7937
7938
}
7938
7939
7939
- TEST_F (DebugApiLinuxMultitileTest, GivenRootDeviceWhenDebugAttachCalledThenRootSessionIsCreatedAndTileAttachDisabled) {
7940
+ HWTEST2_F (DebugApiLinuxMultitileTest, GivenRootDeviceWhenDebugAttachCalledThenRootSessionIsCreatedAndTileAttachDisabled, IsAtLeastGen12lp ) {
7940
7941
zet_debug_config_t config = {};
7941
7942
config.pid = 0x1234 ;
7942
7943
zet_debug_session_handle_t debugSession = nullptr ;
@@ -7962,7 +7963,7 @@ TEST_F(DebugApiLinuxMultitileTest, GivenRootDeviceWhenDebugAttachCalledThenRootS
7962
7963
zetDebugDetach (debugSession);
7963
7964
}
7964
7965
7965
- TEST_F (DebugApiLinuxMultitileTest, GivenSubDeviceWhenDebugAttachCalledThenTileSessionsAreCreatedAndRootCannotBeAttached) {
7966
+ HWTEST2_F (DebugApiLinuxMultitileTest, GivenSubDeviceWhenDebugAttachCalledThenTileSessionsAreCreatedAndRootCannotBeAttached, IsAtLeastGen12lp ) {
7966
7967
zet_debug_config_t config = {};
7967
7968
config.pid = 0x1234 ;
7968
7969
zet_debug_session_handle_t debugSession = nullptr ;
@@ -7990,7 +7991,7 @@ TEST_F(DebugApiLinuxMultitileTest, GivenSubDeviceWhenDebugAttachCalledThenTileSe
7990
7991
zetDebugDetach (debugSession);
7991
7992
}
7992
7993
7993
- TEST_F (DebugApiLinuxMultitileTest, GivenMultitileDeviceWhenCallingResumeThenThreadsFromBothTilesAreResumed) {
7994
+ HWTEST2_F (DebugApiLinuxMultitileTest, GivenMultitileDeviceWhenCallingResumeThenThreadsFromBothTilesAreResumed, IsAtLeastGen12lp ) {
7994
7995
zet_debug_config_t config = {};
7995
7996
config.pid = 0x1234 ;
7996
7997
@@ -8036,7 +8037,7 @@ TEST_F(DebugApiLinuxMultitileTest, GivenMultitileDeviceWhenCallingResumeThenThre
8036
8037
EXPECT_EQ (thread.thread , sessionMock->resumedThreads [1 ][0 ].thread );
8037
8038
}
8038
8039
8039
- TEST_F (DebugApiLinuxMultitileTest, givenApiThreadAndMultipleTilesWhenGettingDeviceIndexThenCorrectValueReturned) {
8040
+ HWTEST2_F (DebugApiLinuxMultitileTest, givenApiThreadAndMultipleTilesWhenGettingDeviceIndexThenCorrectValueReturned, IsAtLeastGen12lp ) {
8040
8041
zet_debug_config_t config = {};
8041
8042
config.pid = 0x1234 ;
8042
8043
@@ -8155,7 +8156,7 @@ struct DebugApiLinuxMultiDeviceVmBindFixture : public DebugApiLinuxMultiDeviceFi
8155
8156
8156
8157
using DebugApiLinuxMultiDeviceVmBindTest = Test<DebugApiLinuxMultiDeviceVmBindFixture<false >>;
8157
8158
8158
- TEST_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenHandlingVmBindCreateEventsThenModuleLoadIsTriggeredAfterAllInstancesEventsReceived) {
8159
+ HWTEST2_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenHandlingVmBindCreateEventsThenModuleLoadIsTriggeredAfterAllInstancesEventsReceived, IsAtLeastGen12lp ) {
8159
8160
8160
8161
auto handler = new MockIoctlHandlerI915;
8161
8162
session->ioctlHandler .reset (handler);
@@ -8192,7 +8193,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenHandlingVmBi
8192
8193
EXPECT_EQ (isaGpuVa, event.info .module .load );
8193
8194
}
8194
8195
8195
- TEST_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenHandlingVmBindDestroyEventsThenModuleUnloadIsTriggeredAfterAllInstancesEventsReceived) {
8196
+ HWTEST2_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenHandlingVmBindDestroyEventsThenModuleUnloadIsTriggeredAfterAllInstancesEventsReceived, IsAtLeastGen12lp ) {
8196
8197
auto handler = new MockIoctlHandlerI915;
8197
8198
session->ioctlHandler .reset (handler);
8198
8199
@@ -8237,7 +8238,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenHandlingVmBi
8237
8238
EXPECT_EQ (isaGpuVa, event.info .module .load );
8238
8239
}
8239
8240
8240
- TEST_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaAndZebinModuleWhenHandlingVmBindCreateEventsThenModuleLoadIsTriggeredAfterAllInstancesEventsReceived) {
8241
+ HWTEST2_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaAndZebinModuleWhenHandlingVmBindCreateEventsThenModuleLoadIsTriggeredAfterAllInstancesEventsReceived, IsAtLeastGen12lp ) {
8241
8242
8242
8243
auto handler = new MockIoctlHandlerI915;
8243
8244
session->ioctlHandler .reset (handler);
@@ -8283,13 +8284,13 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaAndZebinModuleWh
8283
8284
EXPECT_EQ (isaGpuVa, event.info .module .load );
8284
8285
}
8285
8286
8286
- TEST_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaAndZebinModuleWhenHandlingVmBindDestroyEventsThenModuleUnloadIsTriggeredAfterAllInstancesEventsReceived) {
8287
+ HWTEST2_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaAndZebinModuleWhenHandlingVmBindDestroyEventsThenModuleUnloadIsTriggeredAfterAllInstancesEventsReceived, IsAtLeastGen12lp ) {
8287
8288
givenTileInstancedIsaAndZebinModuleWhenHandlingVmBindDestroyEventsThenModuleUnloadIsTriggeredAfterAllInstancesEventsReceived ();
8288
8289
}
8289
8290
8290
8291
using DebugLinuxMultiDeviceVmBindBlockOnFenceTest = Test<DebugApiLinuxMultiDeviceVmBindFixture<true >>;
8291
8292
8292
- TEST_F (DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebinModuleWhenHandlingVmBindCreateEventsThenModuleLoadIsTriggeredAfterAllInstancesEventsReceived) {
8293
+ HWTEST2_F (DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebinModuleWhenHandlingVmBindCreateEventsThenModuleLoadIsTriggeredAfterAllInstancesEventsReceived, IsAtLeastGen12lp ) {
8293
8294
8294
8295
auto handler = new MockIoctlHandlerI915;
8295
8296
session->ioctlHandler .reset (handler);
@@ -8333,11 +8334,11 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebi
8333
8334
EXPECT_EQ (isaGpuVa, event.info .module .load );
8334
8335
}
8335
8336
8336
- TEST_F (DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebinModuleWhenHandlingVmBindDestroyEventsThenModuleUnloadIsTriggeredAfterAllInstancesEventsReceived) {
8337
+ HWTEST2_F (DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebinModuleWhenHandlingVmBindDestroyEventsThenModuleUnloadIsTriggeredAfterAllInstancesEventsReceived, IsAtLeastGen12lp ) {
8337
8338
givenTileInstancedIsaAndZebinModuleWhenHandlingVmBindDestroyEventsThenModuleUnloadIsTriggeredAfterAllInstancesEventsReceived ();
8338
8339
}
8339
8340
8340
- TEST_F (DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebinModuleWhenAcknowledgingEventThenModuleFromBothTilesAreAcked) {
8341
+ HWTEST2_F (DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebinModuleWhenAcknowledgingEventThenModuleFromBothTilesAreAcked, IsAtLeastGen12lp ) {
8341
8342
8342
8343
auto handler = new MockIoctlHandlerI915;
8343
8344
session->ioctlHandler .reset (handler);
@@ -8381,7 +8382,7 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebi
8381
8382
EXPECT_EQ (0u , session->clientHandleToConnection [MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule [zebinModuleUUID].ackEvents [1 ].size ());
8382
8383
}
8383
8384
8384
- TEST_F (DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebinModuleWhenModuleUUIDIsNotFoundThenAcknowledgeCallsDebugBreakAndReturnsSuccess) {
8385
+ HWTEST2_F (DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebinModuleWhenModuleUUIDIsNotFoundThenAcknowledgeCallsDebugBreakAndReturnsSuccess, IsAtLeastGen12lp ) {
8385
8386
8386
8387
auto handler = new MockIoctlHandlerI915;
8387
8388
session->ioctlHandler .reset (handler);
@@ -8421,7 +8422,7 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebi
8421
8422
EXPECT_EQ (0u , handler->ackCount );
8422
8423
}
8423
8424
8424
- TEST_F (DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenZebinModuleForTileWithoutAckFlagWhenHandlingVmBindCreateEventsThenModuleLoadIsTriggeredAfterOneTileInstancesEventsReceived) {
8425
+ HWTEST2_F (DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenZebinModuleForTileWithoutAckFlagWhenHandlingVmBindCreateEventsThenModuleLoadIsTriggeredAfterOneTileInstancesEventsReceived, IsAtLeastGen12lp ) {
8425
8426
8426
8427
auto handler = new MockIoctlHandlerI915;
8427
8428
session->ioctlHandler .reset (handler);
@@ -8458,7 +8459,7 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenZebinModuleForTileWitho
8458
8459
EXPECT_EQ (isaGpuVa, event.info .module .load );
8459
8460
}
8460
8461
8461
- TEST_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingAndReadingIsaMemoryThenOnlyWritesAreMirrored) {
8462
+ HWTEST2_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingAndReadingIsaMemoryThenOnlyWritesAreMirrored, IsAtLeastGen12lp ) {
8462
8463
auto handler = new MockIoctlHandlerI915;
8463
8464
session->ioctlHandler .reset (handler);
8464
8465
@@ -8499,7 +8500,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingAndRe
8499
8500
EXPECT_EQ (1 , handler->preadCalled );
8500
8501
}
8501
8502
8502
- TEST_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingMemoryFailsThenErrorIsReturned) {
8503
+ HWTEST2_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingMemoryFailsThenErrorIsReturned, IsAtLeastGen12lp ) {
8503
8504
auto handler = new MockIoctlHandlerI915;
8504
8505
session->ioctlHandler .reset (handler);
8505
8506
@@ -8531,7 +8532,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingMemor
8531
8532
EXPECT_EQ (1 , handler->pwriteCalled );
8532
8533
}
8533
8534
8534
- TEST_F (DebugApiLinuxMultiDeviceVmBindTest, givenSingleIsaWithInvalidVmWhenReadingIsaMemoryThenErrorUninitializedIsReturned) {
8535
+ HWTEST2_F (DebugApiLinuxMultiDeviceVmBindTest, givenSingleIsaWithInvalidVmWhenReadingIsaMemoryThenErrorUninitializedIsReturned, IsAtLeastGen12lp ) {
8535
8536
auto handler = new MockIoctlHandlerI915;
8536
8537
session->ioctlHandler .reset (handler);
8537
8538
@@ -8586,7 +8587,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenSingleIsaWithInvalidVmWhenReadin
8586
8587
EXPECT_EQ (0 , handler->preadCalled );
8587
8588
}
8588
8589
8589
- TEST_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaAndSingleInstanceWhenGettingIsaInfoThenIsaTrueAndErrorUninitializedIsReturned) {
8590
+ HWTEST2_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaAndSingleInstanceWhenGettingIsaInfoThenIsaTrueAndErrorUninitializedIsReturned, IsAtLeastGen12lp ) {
8590
8591
auto handler = new MockIoctlHandlerI915;
8591
8592
session->ioctlHandler .reset (handler);
8592
8593
@@ -8618,7 +8619,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaAndSingleInstanc
8618
8619
EXPECT_EQ (ZE_RESULT_ERROR_UNINITIALIZED, status);
8619
8620
}
8620
8621
8621
- TEST_F (DebugApiLinuxMultiDeviceVmBindTest, givenNoIsaWhenGettingIsaInfoThenFalseReturned) {
8622
+ HWTEST2_F (DebugApiLinuxMultiDeviceVmBindTest, givenNoIsaWhenGettingIsaInfoThenFalseReturned, IsAtLeastGen12lp ) {
8622
8623
uint32_t devices = static_cast <uint32_t >(deviceImp->getNEODevice ()->getDeviceBitfield ().to_ulong ());
8623
8624
8624
8625
zet_debug_memory_space_desc_t desc;
@@ -8633,7 +8634,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenNoIsaWhenGettingIsaInfoThenFalse
8633
8634
EXPECT_EQ (ZE_RESULT_ERROR_UNINITIALIZED, status);
8634
8635
}
8635
8636
8636
- TEST_F (DebugApiLinuxMultiDeviceVmBindTest, givenIsaWhenGettingIsaInfoForWrongAddressThenErrorUninitializedReturned) {
8637
+ HWTEST2_F (DebugApiLinuxMultiDeviceVmBindTest, givenIsaWhenGettingIsaInfoForWrongAddressThenErrorUninitializedReturned, IsAtLeastGen12lp ) {
8637
8638
auto handler = new MockIoctlHandlerI915;
8638
8639
session->ioctlHandler .reset (handler);
8639
8640
@@ -8670,7 +8671,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenIsaWhenGettingIsaInfoForWrongAdd
8670
8671
EXPECT_EQ (ZE_RESULT_ERROR_UNINITIALIZED, status);
8671
8672
}
8672
8673
8673
- TEST_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingAndReadingWrongIsaRangeThenErrorInvalidArgReturned) {
8674
+ HWTEST2_F (DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingAndReadingWrongIsaRangeThenErrorInvalidArgReturned, IsAtLeastGen12lp ) {
8674
8675
auto handler = new MockIoctlHandlerI915;
8675
8676
session->ioctlHandler .reset (handler);
8676
8677
@@ -8707,7 +8708,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingAndRe
8707
8708
EXPECT_EQ (0 , handler->preadCalled );
8708
8709
}
8709
8710
8710
- TEST_F (DebugApiLinuxMultiDeviceVmBindTest, givenSingleMemoryIsaWhenWritingAndReadingThenOnlyOneInstanceIsWrittenAndRead) {
8711
+ HWTEST2_F (DebugApiLinuxMultiDeviceVmBindTest, givenSingleMemoryIsaWhenWritingAndReadingThenOnlyOneInstanceIsWrittenAndRead, IsAtLeastGen12lp ) {
8711
8712
auto handler = new MockIoctlHandlerI915;
8712
8713
session->ioctlHandler .reset (handler);
8713
8714
@@ -8785,7 +8786,7 @@ struct AffinityMaskMultipleSubdevicesLinux : DebugApiLinuxMultiDeviceFixture {
8785
8786
8786
8787
using AffinityMaskMultipleSubdevicesTestLinux = Test<AffinityMaskMultipleSubdevicesLinux>;
8787
8788
8788
- TEST_F (AffinityMaskMultipleSubdevicesTestLinux, GivenEventWithAckFlagAndTileNotWithinBitfieldWhenHandlingEventForISAThenIsaIsNotStoredInMapAndEventIsAcked) {
8789
+ HWTEST2_F (AffinityMaskMultipleSubdevicesTestLinux, GivenEventWithAckFlagAndTileNotWithinBitfieldWhenHandlingEventForISAThenIsaIsNotStoredInMapAndEventIsAcked, IsAtLeastGen12lp ) {
8789
8790
uint64_t isaGpuVa = 0x345000 ;
8790
8791
uint64_t isaSize = 0x2000 ;
8791
8792
uint64_t vmBindIsaData[sizeof (prelim_drm_i915_debug_event_vm_bind) / sizeof (uint64_t ) + 3 * sizeof (typeOfUUID)];
@@ -8819,7 +8820,7 @@ TEST_F(AffinityMaskMultipleSubdevicesTestLinux, GivenEventWithAckFlagAndTileNotW
8819
8820
EXPECT_EQ (vmBindIsa->base .seqno , handler->debugEventAcked .seqno );
8820
8821
}
8821
8822
8822
- TEST_F (AffinityMaskMultipleSubdevicesTestLinux, GivenPfEventForTileNotWithinBitfieldWhenHandlingEventThenEventIsSkipped) {
8823
+ HWTEST2_F (AffinityMaskMultipleSubdevicesTestLinux, GivenPfEventForTileNotWithinBitfieldWhenHandlingEventThenEventIsSkipped, IsAtLeastGen12lp ) {
8823
8824
auto debugSession = std::make_unique<MockDebugSessionLinuxi915>(zet_debug_config_t {1234 }, deviceImp, 10 );
8824
8825
8825
8826
uint64_t ctxHandle = 2 ;
@@ -8850,7 +8851,7 @@ TEST_F(AffinityMaskMultipleSubdevicesTestLinux, GivenPfEventForTileNotWithinBitf
8850
8851
EXPECT_FALSE (debugSession->triggerEvents );
8851
8852
}
8852
8853
8853
- TEST_F (AffinityMaskMultipleSubdevicesTestLinux, GivenAttEventForTileNotWithinBitfieldWhenHandlingEventThenEventIsSkipped) {
8854
+ HWTEST2_F (AffinityMaskMultipleSubdevicesTestLinux, GivenAttEventForTileNotWithinBitfieldWhenHandlingEventThenEventIsSkipped, IsAtLeastGen12lp ) {
8854
8855
auto debugSession = std::make_unique<MockDebugSessionLinuxi915>(zet_debug_config_t {1234 }, deviceImp, 10 );
8855
8856
8856
8857
uint64_t ctxHandle = 2 ;
0 commit comments