Skip to content

Commit 38f547f

Browse files
committed
Merge remote-tracking branch 'nvidia/550' into 550.90.07-p2p
2 parents 2785522 + e45d91d commit 38f547f

281 files changed

Lines changed: 70732 additions & 59449 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
## Release 550 Entries
44

5+
### [550.90.07] 2024-06-04
6+
7+
### [550.78] 2024-04-25
8+
9+
### [550.76] 2024-04-17
10+
11+
### [550.67] 2024-03-19
12+
513
### [550.54.15] 2024-03-18
614

715
### [550.54.14] 2024-02-23

kernel-open/Kbuild

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ EXTRA_CFLAGS += -I$(src)/common/inc
7272
EXTRA_CFLAGS += -I$(src)
7373
EXTRA_CFLAGS += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-format-extra-args
7474
EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DNVRM
75-
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"550.54.15\"
75+
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"550.90.07\"
7676

7777
ifneq ($(SYSSRCHOST1X),)
7878
EXTRA_CFLAGS += -I$(SYSSRCHOST1X)
@@ -170,6 +170,8 @@ NV_CONFTEST_CMD := /bin/sh $(NV_CONFTEST_SCRIPT) \
170170
NV_CFLAGS_FROM_CONFTEST := $(shell $(NV_CONFTEST_CMD) build_cflags)
171171

172172
NV_CONFTEST_CFLAGS = $(NV_CFLAGS_FROM_CONFTEST) $(EXTRA_CFLAGS) -fno-pie
173+
NV_CONFTEST_CFLAGS += $(call cc-disable-warning,pointer-sign)
174+
NV_CONFTEST_CFLAGS += $(call cc-option,-fshort-wchar,)
173175
NV_CONFTEST_CFLAGS += -Wno-error
174176

175177
NV_CONFTEST_COMPILE_TEST_HEADERS := $(obj)/conftest/macros.h

kernel-open/common/inc/nv-hypervisor.h

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@ typedef enum _HYPERVISOR_TYPE
3737
OS_HYPERVISOR_UNKNOWN
3838
} HYPERVISOR_TYPE;
3939

40-
#define CMD_VGPU_VFIO_WAKE_WAIT_QUEUE 0
41-
#define CMD_VGPU_VFIO_INJECT_INTERRUPT 1
42-
#define CMD_VGPU_VFIO_REGISTER_MDEV 2
43-
#define CMD_VGPU_VFIO_PRESENT 3
44-
#define CMD_VFIO_PCI_CORE_PRESENT 4
40+
#define CMD_VFIO_WAKE_REMOVE_GPU 1
41+
#define CMD_VGPU_VFIO_PRESENT 2
42+
#define CMD_VFIO_PCI_CORE_PRESENT 3
4543

46-
#define MAX_VF_COUNT_PER_GPU 64
44+
#define MAX_VF_COUNT_PER_GPU 64
4745

4846
typedef enum _VGPU_TYPE_INFO
4947
{
@@ -54,17 +52,11 @@ typedef enum _VGPU_TYPE_INFO
5452

5553
typedef struct
5654
{
57-
void *vgpuVfioRef;
58-
void *waitQueue;
5955
void *nv;
60-
NvU32 *vgpuTypeIds;
61-
NvU8 **vgpuNames;
62-
NvU32 numVgpuTypes;
63-
NvU32 domain;
64-
NvU8 bus;
65-
NvU8 slot;
66-
NvU8 function;
67-
NvBool is_virtfn;
56+
NvU32 domain;
57+
NvU32 bus;
58+
NvU32 device;
59+
NvU32 return_status;
6860
} vgpu_vfio_info;
6961

7062
typedef struct

kernel-open/common/inc/nv-linux.h

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2001-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
* SPDX-FileCopyrightText: Copyright (c) 2001-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: MIT
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -1614,6 +1614,10 @@ typedef struct nv_linux_state_s {
16141614
nv_kthread_q_t open_q;
16151615
NvBool is_accepting_opens;
16161616
struct semaphore open_q_lock;
1617+
#if defined(NV_VGPU_KVM_BUILD)
1618+
wait_queue_head_t wait;
1619+
NvS32 return_status;
1620+
#endif
16171621
} nv_linux_state_t;
16181622

16191623
extern nv_linux_state_t *nv_linux_devices;
@@ -1989,31 +1993,6 @@ static inline NvBool nv_platform_use_auto_online(nv_linux_state_t *nvl)
19891993
return nvl->numa_info.use_auto_online;
19901994
}
19911995

1992-
typedef struct {
1993-
NvU64 base;
1994-
NvU64 size;
1995-
NvU32 nodeId;
1996-
int ret;
1997-
} remove_numa_memory_info_t;
1998-
1999-
static void offline_numa_memory_callback
2000-
(
2001-
void *args
2002-
)
2003-
{
2004-
#ifdef NV_OFFLINE_AND_REMOVE_MEMORY_PRESENT
2005-
remove_numa_memory_info_t *pNumaInfo = (remove_numa_memory_info_t *)args;
2006-
#ifdef NV_REMOVE_MEMORY_HAS_NID_ARG
2007-
pNumaInfo->ret = offline_and_remove_memory(pNumaInfo->nodeId,
2008-
pNumaInfo->base,
2009-
pNumaInfo->size);
2010-
#else
2011-
pNumaInfo->ret = offline_and_remove_memory(pNumaInfo->base,
2012-
pNumaInfo->size);
2013-
#endif
2014-
#endif
2015-
}
2016-
20171996
typedef enum
20181997
{
20191998
NV_NUMA_STATUS_DISABLED = 0,

kernel-open/common/inc/nv.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,13 +1041,12 @@ NV_STATUS NV_API_CALL nv_vgpu_create_request(nvidia_stack_t *, nv_state_t *, c
10411041
NV_STATUS NV_API_CALL nv_vgpu_delete(nvidia_stack_t *, const NvU8 *, NvU16);
10421042
NV_STATUS NV_API_CALL nv_vgpu_get_type_ids(nvidia_stack_t *, nv_state_t *, NvU32 *, NvU32 *, NvBool, NvU8, NvBool);
10431043
NV_STATUS NV_API_CALL nv_vgpu_get_type_info(nvidia_stack_t *, nv_state_t *, NvU32, char *, int, NvU8);
1044-
NV_STATUS NV_API_CALL nv_vgpu_get_bar_info(nvidia_stack_t *, nv_state_t *, const NvU8 *, NvU64 *, NvU32, void *, NvBool *);
1044+
NV_STATUS NV_API_CALL nv_vgpu_get_bar_info(nvidia_stack_t *, nv_state_t *, const NvU8 *, NvU64 *,
1045+
NvU64 *, NvU64 *, NvU32 *, NvBool *, NvU8 *);
10451046
NV_STATUS NV_API_CALL nv_vgpu_get_hbm_info(nvidia_stack_t *, nv_state_t *, const NvU8 *, NvU64 *, NvU64 *);
1046-
NV_STATUS NV_API_CALL nv_vgpu_start(nvidia_stack_t *, const NvU8 *, void *, NvS32 *, NvU8 *, NvU32);
1047-
NV_STATUS NV_API_CALL nv_vgpu_get_sparse_mmap(nvidia_stack_t *, nv_state_t *, const NvU8 *, NvU64 **, NvU64 **, NvU32 *);
10481047
NV_STATUS NV_API_CALL nv_vgpu_process_vf_info(nvidia_stack_t *, nv_state_t *, NvU8, NvU32, NvU8, NvU8, NvU8, NvBool, void *);
1049-
NV_STATUS NV_API_CALL nv_vgpu_update_request(nvidia_stack_t *, const NvU8 *, NvU32, NvU64 *, NvU64 *, const char *);
10501048
NV_STATUS NV_API_CALL nv_gpu_bind_event(nvidia_stack_t *);
1049+
NV_STATUS NV_API_CALL nv_gpu_unbind_event(nvidia_stack_t *, NvU32, NvBool *);
10511050

10521051
NV_STATUS NV_API_CALL nv_get_usermap_access_params(nv_state_t*, nv_usermap_access_params_t*);
10531052
nv_soc_irq_type_t NV_API_CALL nv_get_current_irq_type(nv_state_t*);

kernel-open/common/inc/nv_uvm_interface.h

Lines changed: 72 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2013-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
* SPDX-FileCopyrightText: Copyright (c) 2013-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: MIT
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -1505,41 +1505,49 @@ NV_STATUS nvUvmInterfaceCslInitContext(UvmCslContext *uvmCslContext,
15051505
void nvUvmInterfaceDeinitCslContext(UvmCslContext *uvmCslContext);
15061506

15071507
/*******************************************************************************
1508-
nvUvmInterfaceCslUpdateContext
1508+
nvUvmInterfaceCslRotateKey
15091509
1510-
Updates a context after a key rotation event and can only be called once per
1511-
key rotation event. Following a key rotation event, and before
1512-
nvUvmInterfaceCslUpdateContext is called, data encrypted by the GPU with the
1513-
previous key can be decrypted with nvUvmInterfaceCslDecrypt.
1510+
Disables channels and rotates keys.
15141511
1515-
Locking: This function acquires an API lock.
1516-
Memory : This function does not dynamically allocate memory.
1512+
This function disables channels and rotates associated keys. The channels
1513+
associated with the given CSL contexts must be idled before this function is
1514+
called. To trigger key rotation all allocated channels for a given key must
1515+
be present in the list. If the function returns successfully then the CSL
1516+
contexts have been updated with the new key.
15171517
1518-
Arguments:
1519-
uvmCslContext[IN] - The CSL context associated with a channel.
1518+
Locking: This function attempts to acquire the GPU lock. In case of failure
1519+
to acquire the return code is NV_ERR_STATE_IN_USE. The caller must
1520+
guarantee that no CSL function, including this one, is invoked
1521+
concurrently with the CSL contexts in contextList.
1522+
Memory : This function dynamically allocates memory.
15201523
1524+
Arguments:
1525+
contextList[IN/OUT] - An array of pointers to CSL contexts.
1526+
contextListCount[IN] - Number of CSL contexts in contextList. Its value
1527+
must be greater than 0.
15211528
Error codes:
1522-
NV_ERR_INVALID_ARGUMENT - The CSL context is not associated with a channel.
1529+
NV_ERR_INVALID_ARGUMENT - contextList is NULL or contextListCount is 0.
1530+
NV_ERR_STATE_IN_USE - Unable to acquire lock / resource. Caller
1531+
can retry at a later time.
1532+
NV_ERR_GENERIC - A failure other than _STATE_IN_USE occurred
1533+
when attempting to acquire a lock.
15231534
*/
1524-
NV_STATUS nvUvmInterfaceCslUpdateContext(UvmCslContext *uvmCslContext);
1535+
NV_STATUS nvUvmInterfaceCslRotateKey(UvmCslContext *contextList[],
1536+
NvU32 contextListCount);
15251537

15261538
/*******************************************************************************
15271539
nvUvmInterfaceCslRotateIv
15281540
15291541
Rotates the IV for a given channel and operation.
15301542
15311543
This function will rotate the IV on both the CPU and the GPU.
1532-
Outstanding messages that have been encrypted by the GPU should first be
1533-
decrypted before calling this function with operation equal to
1534-
UVM_CSL_OPERATION_DECRYPT. Similarly, outstanding messages that have been
1535-
encrypted by the CPU should first be decrypted before calling this function
1536-
with operation equal to UVM_CSL_OPERATION_ENCRYPT. For a given operation
1537-
the channel must be idle before calling this function. This function can be
1538-
called regardless of the value of the IV's message counter.
1539-
1540-
Locking: This function attempts to acquire the GPU lock.
1541-
In case of failure to acquire the return code
1542-
is NV_ERR_STATE_IN_USE.
1544+
For a given operation the channel must be idle before calling this function.
1545+
This function can be called regardless of the value of the IV's message counter.
1546+
1547+
Locking: This function attempts to acquire the GPU lock. In case of failure to
1548+
acquire the return code is NV_ERR_STATE_IN_USE. The caller must guarantee
1549+
that no CSL function, including this one, is invoked concurrently with
1550+
the same CSL context.
15431551
Memory : This function does not dynamically allocate memory.
15441552
15451553
Arguments:
@@ -1573,8 +1581,8 @@ NV_STATUS nvUvmInterfaceCslRotateIv(UvmCslContext *uvmCslContext,
15731581
However, it is optional. If it is NULL, the next IV in line will be used.
15741582
15751583
Locking: This function does not acquire an API or GPU lock.
1576-
If called concurrently in different threads with the same UvmCslContext
1577-
the caller must guarantee exclusion.
1584+
The caller must guarantee that no CSL function, including this one,
1585+
is invoked concurrently with the same CSL context.
15781586
Memory : This function does not dynamically allocate memory.
15791587
15801588
Arguments:
@@ -1610,9 +1618,14 @@ NV_STATUS nvUvmInterfaceCslEncrypt(UvmCslContext *uvmCslContext,
16101618
maximized when the input and output buffers are 16-byte aligned. This is
16111619
natural alignment for AES block.
16121620
1621+
During a key rotation event the previous key is stored in the CSL context.
1622+
This allows data encrypted by the GPU to be decrypted with the previous key.
1623+
The keyRotationId parameter identifies which key is used. The first key rotation
1624+
ID has a value of 0 that increments by one for each key rotation event.
1625+
16131626
Locking: This function does not acquire an API or GPU lock.
1614-
If called concurrently in different threads with the same UvmCslContext
1615-
the caller must guarantee exclusion.
1627+
The caller must guarantee that no CSL function, including this one,
1628+
is invoked concurrently with the same CSL context.
16161629
Memory : This function does not dynamically allocate memory.
16171630
16181631
Arguments:
@@ -1622,6 +1635,8 @@ NV_STATUS nvUvmInterfaceCslEncrypt(UvmCslContext *uvmCslContext,
16221635
decryptIv[IN] - IV used to decrypt the ciphertext. Its value can either be given by
16231636
nvUvmInterfaceCslIncrementIv, or, if NULL, the CSL context's
16241637
internal counter is used.
1638+
keyRotationId[IN] - Specifies the key that is used for decryption.
1639+
A value of NV_U32_MAX specifies the current key.
16251640
inputBuffer[IN] - Address of ciphertext input buffer.
16261641
outputBuffer[OUT] - Address of plaintext output buffer.
16271642
addAuthData[IN] - Address of the plaintext additional authenticated data used to
@@ -1642,6 +1657,7 @@ NV_STATUS nvUvmInterfaceCslDecrypt(UvmCslContext *uvmCslContext,
16421657
NvU32 bufferSize,
16431658
NvU8 const *inputBuffer,
16441659
UvmCslIv const *decryptIv,
1660+
NvU32 keyRotationId,
16451661
NvU8 *outputBuffer,
16461662
NvU8 const *addAuthData,
16471663
NvU32 addAuthDataSize,
@@ -1656,8 +1672,8 @@ NV_STATUS nvUvmInterfaceCslDecrypt(UvmCslContext *uvmCslContext,
16561672
undefined behavior.
16571673
16581674
Locking: This function does not acquire an API or GPU lock.
1659-
If called concurrently in different threads with the same UvmCslContext
1660-
the caller must guarantee exclusion.
1675+
The caller must guarantee that no CSL function, including this one,
1676+
is invoked concurrently with the same CSL context.
16611677
Memory : This function does not dynamically allocate memory.
16621678
16631679
Arguments:
@@ -1685,8 +1701,8 @@ NV_STATUS nvUvmInterfaceCslSign(UvmCslContext *uvmCslContext,
16851701
16861702
Locking: This function does not acquire an API or GPU lock.
16871703
Memory : This function does not dynamically allocate memory.
1688-
If called concurrently in different threads with the same UvmCslContext
1689-
the caller must guarantee exclusion.
1704+
The caller must guarantee that no CSL function, including this one,
1705+
is invoked concurrently with the same CSL context.
16901706
16911707
Arguments:
16921708
uvmCslContext[IN/OUT] - The CSL context.
@@ -1711,8 +1727,8 @@ NV_STATUS nvUvmInterfaceCslQueryMessagePool(UvmCslContext *uvmCslContext,
17111727
the returned IV can be used in nvUvmInterfaceCslDecrypt.
17121728
17131729
Locking: This function does not acquire an API or GPU lock.
1714-
If called concurrently in different threads with the same UvmCslContext
1715-
the caller must guarantee exclusion.
1730+
The caller must guarantee that no CSL function, including this one,
1731+
is invoked concurrently with the same CSL context.
17161732
Memory : This function does not dynamically allocate memory.
17171733
17181734
Arguments:
@@ -1734,28 +1750,41 @@ NV_STATUS nvUvmInterfaceCslIncrementIv(UvmCslContext *uvmCslContext,
17341750
UvmCslIv *iv);
17351751

17361752
/*******************************************************************************
1737-
nvUvmInterfaceCslLogExternalEncryption
1753+
nvUvmInterfaceCslLogEncryption
1754+
1755+
Checks and logs information about encryptions associated with the given
1756+
CSL context.
17381757
1739-
Checks and logs information about non-CSL encryptions, such as those that
1740-
originate from the GPU.
1758+
For contexts associated with channels, this function does not modify elements of
1759+
the UvmCslContext, and must be called for every CPU/GPU encryption.
17411760
1742-
This function does not modify elements of the UvmCslContext.
1761+
For the context associated with fault buffers, bufferSize can encompass multiple
1762+
encryption invocations, and the UvmCslContext will be updated following a key
1763+
rotation event.
1764+
1765+
In either case the IV remains unmodified after this function is called.
17431766
17441767
Locking: This function does not acquire an API or GPU lock.
17451768
Memory : This function does not dynamically allocate memory.
1746-
If called concurrently in different threads with the same UvmCslContext
1747-
the caller must guarantee exclusion.
1769+
The caller must guarantee that no CSL function, including this one,
1770+
is invoked concurrently with the same CSL context.
17481771
17491772
Arguments:
17501773
uvmCslContext[IN/OUT] - The CSL context.
1751-
bufferSize[OUT] - The size of the buffer encrypted by the
1774+
operation[IN] - If the CSL context is associated with a fault
1775+
buffer, this argument is ignored. If it is
1776+
associated with a channel, it must be either
1777+
- UVM_CSL_OPERATION_ENCRYPT
1778+
- UVM_CSL_OPERATION_DECRYPT
1779+
bufferSize[IN] - The size of the buffer(s) encrypted by the
17521780
external entity in units of bytes.
17531781
17541782
Error codes:
1755-
NV_ERR_INSUFFICIENT_RESOURCES - The device encryption would cause a counter
1783+
NV_ERR_INSUFFICIENT_RESOURCES - The encryption would cause a counter
17561784
to overflow.
17571785
*/
1758-
NV_STATUS nvUvmInterfaceCslLogExternalEncryption(UvmCslContext *uvmCslContext,
1759-
NvU32 bufferSize);
1786+
NV_STATUS nvUvmInterfaceCslLogEncryption(UvmCslContext *uvmCslContext,
1787+
UvmCslOperation operation,
1788+
NvU32 bufferSize);
17601789

17611790
#endif // _NV_UVM_INTERFACE_H_

0 commit comments

Comments
 (0)