mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge tag 's390-7.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Vasily Gorbik: - Add support for CONFIG_PAGE_TABLE_CHECK and enable it in debug_defconfig. s390 can only tell user from kernel PTEs via the mm, so mm_struct is now passed into pxx_user_accessible_page() callbacks - Expose the PCI function UID as an arch-specific slot attribute in sysfs so a function can be identified by its user-defined id while still in standby. Introduces a generic ARCH_PCI_SLOT_GROUPS hook in drivers/pci/slot.c - Refresh s390 PCI documentation to reflect current behavior and cover previously undocumented sysfs attributes - zcrypt device driver cleanup series: consistent field types, clearer variable naming, a kernel-doc warning fix, and a comment explaining the intentional synchronize_rcu() in pkey_handler_register() - Provide an s390 arch_raw_cpu_ptr() that avoids the detour via get_lowcore() using alternatives, shrinking defconfig by ~27 kB - Guard identity-base randomization with kaslr_enabled() so nokaslr keeps the identity mapping at 0 even with RANDOMIZE_IDENTITY_BASE=y - Build S390_MODULES_SANITY_TEST as a module only by requiring KUNIT && m, since built-in would not exercise module loading - Remove the permanently commented-out HMCDRV_DEV_CLASS create_class() code in the hmcdrv driver - Drop stale ident_map_size extern conflicting with asm/page.h * tag 's390-7.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/zcrypt: Fix warning about wrong kernel doc comment PCI: s390: Expose the UID as an arch specific PCI slot attribute docs: s390/pci: Improve and update PCI documentation s390/pkey: Add comment about synchronize_rcu() to pkey base s390/hmcdrv: Remove commented out code s390/zcrypt: Slight rework on the agent_id field s390/zcrypt: Explicitly use a card variable in _zcrypt_send_cprb s390/zcrypt: Rework MKVP fields and handling s390/zcrypt: Make apfs a real unsigned int field s390/zcrypt: Rework domain processing within zcrypt device driver s390/zcrypt: Move inline function rng_type6cprb_msgx from header to code s390/percpu: Provide arch_raw_cpu_ptr() s390: Enable page table check for debug_defconfig s390/pgtable: Add s390 support for page table check s390/pgtable: Use set_pmd_bit() to invalidate PMD entry mm/page_table_check: Pass mm_struct to pxx_user_accessible_page() s390/boot: Respect kaslr_enabled() for identity randomization s390/Kconfig: Make modules sanity test a module-only option s390/setup: Drop stale ident_map_size declaration
This commit is contained in:
+104
-47
@@ -6,6 +6,7 @@ S/390 PCI
|
||||
|
||||
Authors:
|
||||
- Pierre Morel
|
||||
- Niklas Schnelle
|
||||
|
||||
Copyright, IBM Corp. 2020
|
||||
|
||||
@@ -27,14 +28,16 @@ Command line parameters
|
||||
debugfs entries
|
||||
---------------
|
||||
|
||||
The S/390 debug feature (s390dbf) generates views to hold various debug results in sysfs directories of the form:
|
||||
The S/390 debug feature (s390dbf) generates views to hold various debug results
|
||||
in sysfs directories of the form:
|
||||
|
||||
* /sys/kernel/debug/s390dbf/pci_*/
|
||||
|
||||
For example:
|
||||
|
||||
- /sys/kernel/debug/s390dbf/pci_msg/sprintf
|
||||
Holds messages from the processing of PCI events, like machine check handling
|
||||
|
||||
holds messages from the processing of PCI events, like machine check handling
|
||||
and setting of global functionality, like UID checking.
|
||||
|
||||
Change the level of logging to be more or less verbose by piping
|
||||
@@ -47,87 +50,141 @@ Sysfs entries
|
||||
|
||||
Entries specific to zPCI functions and entries that hold zPCI information.
|
||||
|
||||
* /sys/bus/pci/slots/XXXXXXXX
|
||||
* /sys/bus/pci/slots/XXXXXXXX:
|
||||
|
||||
The slot entries are set up using the function identifier (FID) of the
|
||||
PCI function. The format depicted as XXXXXXXX above is 8 hexadecimal digits
|
||||
with 0 padding and lower case hexadecimal digits.
|
||||
The slot entries are set up using the function identifier (FID) of the PCI
|
||||
function as slot name. The format depicted as XXXXXXXX above is 8 hexadecimal
|
||||
digits with 0 padding and lower case hexadecimal digits.
|
||||
|
||||
- /sys/bus/pci/slots/XXXXXXXX/power
|
||||
|
||||
In addition to using the FID as the name of the slot, the slot directory
|
||||
also contains the following s390-specific slot attributes.
|
||||
|
||||
- uid:
|
||||
The User-defined identifier (UID) of the function which may be configured
|
||||
by this slot. See also the corresponding attribute of the device.
|
||||
|
||||
A physical function that currently supports a virtual function cannot be
|
||||
powered off until all virtual functions are removed with:
|
||||
echo 0 > /sys/bus/pci/devices/XXXX:XX:XX.X/sriov_numvf
|
||||
echo 0 > /sys/bus/pci/devices/DDDD:BB:dd.f/sriov_numvf
|
||||
|
||||
* /sys/bus/pci/devices/XXXX:XX:XX.X/
|
||||
* /sys/bus/pci/devices/DDDD:BB:dd.f/:
|
||||
|
||||
- function_id
|
||||
A zPCI function identifier that uniquely identifies the function in the Z server.
|
||||
- function_id:
|
||||
The zPCI function identifier (FID) is a 32-bit hexadecimal value that
|
||||
uniquely identifies the PCI function. Unless the hypervisor provides
|
||||
a virtual FID e.g. on KVM this identifier is unique across the machine even
|
||||
between different partitions.
|
||||
|
||||
- function_handle
|
||||
Low-level identifier used for a configured PCI function.
|
||||
It might be useful for debugging.
|
||||
- function_handle:
|
||||
This 32-bit hexadecimal value is a low-level identifier used for a PCI
|
||||
function. Note that the function handle may be changed and become invalid
|
||||
on PCI events and when enabling/disabling the PCI function.
|
||||
|
||||
- pchid
|
||||
Model-dependent location of the I/O adapter.
|
||||
- pchid:
|
||||
This 16-bit hexadecimal value encodes a model-dependent location for
|
||||
the PCI function.
|
||||
|
||||
- pfgid
|
||||
PCI function group ID, functions that share identical functionality
|
||||
- pfgid:
|
||||
PCI function group ID; functions that share identical functionality
|
||||
use a common identifier.
|
||||
A PCI group defines interrupts, IOMMU, IOTLB, and DMA specifics.
|
||||
|
||||
- vfn
|
||||
- vfn:
|
||||
The virtual function number, from 1 to N for virtual functions,
|
||||
0 for physical functions.
|
||||
|
||||
- pft
|
||||
The PCI function type
|
||||
- pft:
|
||||
The PCI function type is an s390-specific type attribute. It indicates
|
||||
a more general, usage oriented, type than PCI Specification
|
||||
class/vendor/device identifiers. That is PCI functions with the same pft
|
||||
value may be backed by different hardware implementations. At the same time
|
||||
apart from unclassified functions (pft is 0x00) the same pft value
|
||||
generally implies a similar usage model. At the same time the same
|
||||
PCI hardware device may appear with different pft values when in a
|
||||
different usage model. For example NETD and NETH VFs may be implemented
|
||||
by the same PCI hardware device but in NETD the parent Physical Function
|
||||
is user managed while with NETH it is platform managed.
|
||||
|
||||
- port
|
||||
The port corresponds to the physical port the function is attached to.
|
||||
It also gives an indication of the physical function a virtual function
|
||||
is attached to.
|
||||
Currently the following PFT values are defined:
|
||||
|
||||
- uid
|
||||
The user identifier (UID) may be defined as part of the machine
|
||||
configuration or the z/VM or KVM guest configuration. If the accompanying
|
||||
uid_is_unique attribute is 1 the platform guarantees that the UID is unique
|
||||
within that instance and no devices with the same UID can be attached
|
||||
during the lifetime of the system.
|
||||
- 0x00 (UNC): Unclassified
|
||||
- 0x02 (ROCE): RoCE Express
|
||||
- 0x05 (ISM): Internal Shared Memory
|
||||
- 0x0a (ROC2): RoCE Express 2
|
||||
- 0x0b (NVMe): NVMe
|
||||
- 0x0c (NETH): Network Express hybrid
|
||||
- 0x0d (CNW): Cloud Network Adapter
|
||||
- 0x0f (NETD): Network Express direct
|
||||
|
||||
- uid_is_unique
|
||||
Indicates whether the user identifier (UID) is guaranteed to be and remain
|
||||
unique within this Linux instance.
|
||||
- port:
|
||||
The port is a decimal value corresponding to the physical port the function
|
||||
is attached to. Virtual Functions (VFs) share the port with their parent
|
||||
Physical Function (PF). A value of 0 indicates that the port attribute is
|
||||
not applicable for that PCI function type.
|
||||
|
||||
- pfip/segmentX
|
||||
- uid:
|
||||
The user-defined identifier (UID) for a PCI function is a 32-bit
|
||||
hexadecimal value. It is defined on a per instance basis as part of the
|
||||
partition, KVM guest, or z/VM guest configuration. If UID Checking is
|
||||
enabled the platform ensures that the UID is unique within that instance
|
||||
and no two PCI functions with the same UID will be visible to the instance.
|
||||
|
||||
Independent of this guarantee and unlike the function ID (FID) the UID may
|
||||
be the same in different partitions within the same machine. This allows to
|
||||
create PCI configurations in multiple partitions to be identical in the
|
||||
UID-namespace.
|
||||
|
||||
- uid_is_unique:
|
||||
A 0 or 1 flag indicating whether the user-defined identifier (UID) is
|
||||
guaranteed to be and remain unique within this Linux instance. This
|
||||
platform feature is called UID Checking.
|
||||
|
||||
- pfip/segmentX:
|
||||
The segments determine the isolation of a function.
|
||||
They correspond to the physical path to the function.
|
||||
The more the segments are different, the more the functions are isolated.
|
||||
|
||||
- fidparm:
|
||||
Contains an 8-bit-per-PCI function parameter field in hexadecimal provided
|
||||
by the platform. The meaning of this field is PCI function type specific.
|
||||
For NETH VFs a value of 0x01 indicates that the function supports
|
||||
promiscuous mode.
|
||||
|
||||
* /sys/firmware/clp/uid_checking:
|
||||
|
||||
In addition to the per-device uid_is_unique attribute this presents a
|
||||
global indication of whether UID Checking is enabled. This allows users
|
||||
to check for UID Checking even when no PCI functions are configured.
|
||||
|
||||
Enumeration and hotplug
|
||||
=======================
|
||||
|
||||
The PCI address consists of four parts: domain, bus, device and function,
|
||||
and is of this form: DDDD:BB:dd.f
|
||||
and is of this form: DDDD:BB:dd.f.
|
||||
|
||||
* When not using multi-functions (norid is set, or the firmware does not
|
||||
support multi-functions):
|
||||
* For a PCI function for which the platform does not expose the RID, the
|
||||
pci=norid kernel parameter is used, or a so-called isolated Virtual Function
|
||||
which does have RID information but is used without its parent Physical
|
||||
Function being part of the same PCI configuration:
|
||||
|
||||
- There is only one function per domain.
|
||||
|
||||
- The domain is set from the zPCI function's UID as defined during the
|
||||
LPAR creation.
|
||||
- The domain is set from the zPCI function's UID if UID Checking is on;
|
||||
otherwise the domain ID is generated dynamically and is not stable
|
||||
across reboots or hot plug.
|
||||
|
||||
* When using multi-functions (norid parameter is not set),
|
||||
zPCI functions are addressed differently:
|
||||
* For a PCI function for which the platform exposes the RID and which
|
||||
is not an Isolated Virtual Function:
|
||||
|
||||
- There is still only one bus per domain.
|
||||
|
||||
- There can be up to 256 functions per bus.
|
||||
- There can be up to 256 PCI functions per bus.
|
||||
|
||||
- The domain part of the address of all functions for
|
||||
a multi-Function device is set from the zPCI function's UID as defined
|
||||
in the LPAR creation for the function zero.
|
||||
- The domain part of the address of all functions within the same topology is
|
||||
that of the configured PCI function with the lowest devfn within that
|
||||
topology.
|
||||
|
||||
- New functions will only be ready for use after the function zero
|
||||
(the function with devfn 0) has been enumerated.
|
||||
- Virtual Functions generated by an SR-IOV capable Physical Function only
|
||||
become visible once SR-IOV is enabled.
|
||||
|
||||
@@ -1276,17 +1276,17 @@ static inline int pmdp_set_access_flags(struct vm_area_struct *vma,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PAGE_TABLE_CHECK
|
||||
static inline bool pte_user_accessible_page(pte_t pte, unsigned long addr)
|
||||
static inline bool pte_user_accessible_page(struct mm_struct *mm, unsigned long addr, pte_t pte)
|
||||
{
|
||||
return pte_valid(pte) && (pte_user(pte) || pte_user_exec(pte));
|
||||
}
|
||||
|
||||
static inline bool pmd_user_accessible_page(pmd_t pmd, unsigned long addr)
|
||||
static inline bool pmd_user_accessible_page(struct mm_struct *mm, unsigned long addr, pmd_t pmd)
|
||||
{
|
||||
return pmd_valid(pmd) && !pmd_table(pmd) && (pmd_user(pmd) || pmd_user_exec(pmd));
|
||||
}
|
||||
|
||||
static inline bool pud_user_accessible_page(pud_t pud, unsigned long addr)
|
||||
static inline bool pud_user_accessible_page(struct mm_struct *mm, unsigned long addr, pud_t pud)
|
||||
{
|
||||
return pud_valid(pud) && !pud_table(pud) && (pud_user(pud) || pud_user_exec(pud));
|
||||
}
|
||||
|
||||
@@ -438,7 +438,7 @@ static inline bool pte_access_permitted(pte_t pte, bool write)
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool pte_user_accessible_page(pte_t pte, unsigned long addr)
|
||||
static inline bool pte_user_accessible_page(struct mm_struct *mm, unsigned long addr, pte_t pte)
|
||||
{
|
||||
return pte_present(pte) && !is_kernel_addr(addr);
|
||||
}
|
||||
|
||||
@@ -549,7 +549,7 @@ static inline bool pte_access_permitted(pte_t pte, bool write)
|
||||
return arch_pte_access_permitted(pte_val(pte), write, 0);
|
||||
}
|
||||
|
||||
static inline bool pte_user_accessible_page(pte_t pte, unsigned long addr)
|
||||
static inline bool pte_user_accessible_page(struct mm_struct *mm, unsigned long addr, pte_t pte)
|
||||
{
|
||||
return pte_present(pte) && pte_user(pte);
|
||||
}
|
||||
@@ -925,9 +925,9 @@ static inline bool pud_access_permitted(pud_t pud, bool write)
|
||||
}
|
||||
|
||||
#define pud_user_accessible_page pud_user_accessible_page
|
||||
static inline bool pud_user_accessible_page(pud_t pud, unsigned long addr)
|
||||
static inline bool pud_user_accessible_page(struct mm_struct *mm, unsigned long addr, pud_t pud)
|
||||
{
|
||||
return pud_leaf(pud) && pte_user_accessible_page(pud_pte(pud), addr);
|
||||
return pud_leaf(pud) && pte_user_accessible_page(mm, addr, pud_pte(pud));
|
||||
}
|
||||
|
||||
#define __p4d_raw(x) ((p4d_t) { __pgd_raw(x) })
|
||||
@@ -1096,9 +1096,9 @@ static inline bool pmd_access_permitted(pmd_t pmd, bool write)
|
||||
}
|
||||
|
||||
#define pmd_user_accessible_page pmd_user_accessible_page
|
||||
static inline bool pmd_user_accessible_page(pmd_t pmd, unsigned long addr)
|
||||
static inline bool pmd_user_accessible_page(struct mm_struct *mm, unsigned long addr, pmd_t pmd)
|
||||
{
|
||||
return pmd_leaf(pmd) && pte_user_accessible_page(pmd_pte(pmd), addr);
|
||||
return pmd_leaf(pmd) && pte_user_accessible_page(mm, addr, pmd_pte(pmd));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
||||
|
||||
@@ -249,7 +249,7 @@ static inline bool pte_access_permitted(pte_t pte, bool write)
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool pte_user_accessible_page(pte_t pte, unsigned long addr)
|
||||
static inline bool pte_user_accessible_page(struct mm_struct *mm, unsigned long addr, pte_t pte)
|
||||
{
|
||||
return pte_present(pte) && !is_kernel_addr(addr);
|
||||
}
|
||||
|
||||
@@ -213,11 +213,11 @@ static inline bool arch_supports_memmap_on_memory(unsigned long vmemmap_size)
|
||||
#endif /* CONFIG_PPC64 */
|
||||
|
||||
#ifndef pmd_user_accessible_page
|
||||
#define pmd_user_accessible_page(pmd, addr) false
|
||||
#define pmd_user_accessible_page(mm, addr, pmd) false
|
||||
#endif
|
||||
|
||||
#ifndef pud_user_accessible_page
|
||||
#define pud_user_accessible_page(pud, addr) false
|
||||
#define pud_user_accessible_page(mm, addr, pud) false
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
@@ -984,17 +984,17 @@ static inline void set_pud_at(struct mm_struct *mm, unsigned long addr,
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PAGE_TABLE_CHECK
|
||||
static inline bool pte_user_accessible_page(pte_t pte, unsigned long addr)
|
||||
static inline bool pte_user_accessible_page(struct mm_struct *mm, unsigned long addr, pte_t pte)
|
||||
{
|
||||
return pte_present(pte) && pte_user(pte);
|
||||
}
|
||||
|
||||
static inline bool pmd_user_accessible_page(pmd_t pmd, unsigned long addr)
|
||||
static inline bool pmd_user_accessible_page(struct mm_struct *mm, unsigned long addr, pmd_t pmd)
|
||||
{
|
||||
return pmd_leaf(pmd) && pmd_user(pmd);
|
||||
}
|
||||
|
||||
static inline bool pud_user_accessible_page(pud_t pud, unsigned long addr)
|
||||
static inline bool pud_user_accessible_page(struct mm_struct *mm, unsigned long addr, pud_t pud)
|
||||
{
|
||||
return pud_leaf(pud) && pud_user(pud);
|
||||
}
|
||||
|
||||
+2
-1
@@ -152,6 +152,7 @@ config S390
|
||||
select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && CC_IS_CLANG
|
||||
select ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
|
||||
select ARCH_SUPPORTS_NUMA_BALANCING
|
||||
select ARCH_SUPPORTS_PAGE_TABLE_CHECK
|
||||
select ARCH_SUPPORTS_PER_VMA_LOCK
|
||||
select ARCH_USE_BUILTIN_BSWAP
|
||||
select ARCH_USE_CMPXCHG_LOCKREF
|
||||
@@ -1023,7 +1024,7 @@ config S390_KPROBES_SANITY_TEST
|
||||
|
||||
config S390_MODULES_SANITY_TEST
|
||||
def_tristate n
|
||||
depends on KUNIT
|
||||
depends on KUNIT && m
|
||||
default KUNIT_ALL_TESTS
|
||||
prompt "Enable s390 specific modules tests"
|
||||
select S390_MODULES_SANITY_TEST_HELPERS
|
||||
|
||||
@@ -440,7 +440,8 @@ static unsigned long setup_kernel_memory_layout(unsigned long kernel_size)
|
||||
max_mappable = max(ident_map_size, MAX_DCSS_ADDR);
|
||||
max_mappable = min(max_mappable, vmemmap_start);
|
||||
#ifdef CONFIG_RANDOMIZE_IDENTITY_BASE
|
||||
__identity_base = round_down(vmemmap_start - max_mappable, rte_size);
|
||||
if (kaslr_enabled())
|
||||
__identity_base = round_down(vmemmap_start - max_mappable, rte_size);
|
||||
#endif
|
||||
boot_debug("identity map: 0x%016lx-0x%016lx\n", __identity_base,
|
||||
__identity_base + ident_map_size);
|
||||
|
||||
@@ -925,3 +925,5 @@ CONFIG_PERCPU_TEST=m
|
||||
CONFIG_ATOMIC64_SELFTEST=y
|
||||
CONFIG_TEST_BITOPS=m
|
||||
CONFIG_TEST_BPF=m
|
||||
CONFIG_PAGE_TABLE_CHECK=y
|
||||
CONFIG_PAGE_TABLE_CHECK_ENFORCED=y
|
||||
|
||||
@@ -208,6 +208,10 @@ extern const struct attribute_group zpci_ident_attr_group;
|
||||
&pfip_attr_group, \
|
||||
&zpci_ident_attr_group,
|
||||
|
||||
extern const struct attribute_group zpci_slot_attr_group;
|
||||
|
||||
#define ARCH_PCI_SLOT_GROUPS (&zpci_slot_attr_group)
|
||||
|
||||
extern unsigned int s390_pci_force_floating __initdata;
|
||||
extern unsigned int s390_pci_no_rid;
|
||||
|
||||
|
||||
@@ -12,6 +12,24 @@
|
||||
*/
|
||||
#define __my_cpu_offset get_lowcore()->percpu_offset
|
||||
|
||||
#define arch_raw_cpu_ptr(_ptr) \
|
||||
({ \
|
||||
unsigned long lc_percpu, tcp_ptr__; \
|
||||
\
|
||||
tcp_ptr__ = (__force unsigned long)(_ptr); \
|
||||
lc_percpu = offsetof(struct lowcore, percpu_offset); \
|
||||
asm_inline volatile( \
|
||||
ALTERNATIVE("ag %[__ptr__],%[offzero](%%r0)\n", \
|
||||
"ag %[__ptr__],%[offalt](%%r0)\n", \
|
||||
ALT_FEATURE(MFEATURE_LOWCORE)) \
|
||||
: [__ptr__] "+d" (tcp_ptr__) \
|
||||
: [offzero] "i" (lc_percpu), \
|
||||
[offalt] "i" (lc_percpu + LOWCORE_ALT_ADDRESS), \
|
||||
"m" (((struct lowcore *)0)->percpu_offset) \
|
||||
: "cc"); \
|
||||
(TYPEOF_UNQUAL(*(_ptr)) __force __kernel *)tcp_ptr__; \
|
||||
})
|
||||
|
||||
/*
|
||||
* We use a compare-and-swap loop since that uses less cpu cycles than
|
||||
* disabling and enabling interrupts like the generic variant would do.
|
||||
|
||||
@@ -16,8 +16,10 @@
|
||||
#include <linux/mm_types.h>
|
||||
#include <linux/cpufeature.h>
|
||||
#include <linux/page-flags.h>
|
||||
#include <linux/page_table_check.h>
|
||||
#include <linux/radix-tree.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/mmap_lock.h>
|
||||
#include <asm/ctlreg.h>
|
||||
#include <asm/bug.h>
|
||||
#include <asm/page.h>
|
||||
@@ -1190,6 +1192,7 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
|
||||
/* At this point the reference through the mapping is still present */
|
||||
if (mm_is_protected(mm) && pte_present(res))
|
||||
WARN_ON_ONCE(uv_convert_from_secure_pte(res));
|
||||
page_table_check_pte_clear(mm, addr, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1208,6 +1211,7 @@ static inline pte_t ptep_clear_flush(struct vm_area_struct *vma,
|
||||
/* At this point the reference through the mapping is still present */
|
||||
if (mm_is_protected(vma->vm_mm) && pte_present(res))
|
||||
WARN_ON_ONCE(uv_convert_from_secure_pte(res));
|
||||
page_table_check_pte_clear(vma->vm_mm, addr, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1231,6 +1235,9 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm,
|
||||
} else {
|
||||
res = ptep_xchg_lazy(mm, addr, ptep, __pte(_PAGE_INVALID));
|
||||
}
|
||||
|
||||
page_table_check_pte_clear(mm, addr, res);
|
||||
|
||||
/* Nothing to do */
|
||||
if (!mm_is_protected(mm) || !pte_present(res))
|
||||
return res;
|
||||
@@ -1327,6 +1334,7 @@ static inline void set_ptes(struct mm_struct *mm, unsigned long addr,
|
||||
{
|
||||
if (pte_present(entry))
|
||||
entry = clear_pte_bit(entry, __pgprot(_PAGE_UNUSED));
|
||||
page_table_check_ptes_set(mm, addr, ptep, entry, nr);
|
||||
for (;;) {
|
||||
set_pte(ptep, entry);
|
||||
if (--nr == 0)
|
||||
@@ -1703,6 +1711,7 @@ static inline bool pmdp_clear_flush_young(struct vm_area_struct *vma,
|
||||
static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
|
||||
pmd_t *pmdp, pmd_t entry)
|
||||
{
|
||||
page_table_check_pmd_set(mm, addr, pmdp, entry);
|
||||
set_pmd(pmdp, entry);
|
||||
}
|
||||
|
||||
@@ -1717,7 +1726,11 @@ static inline pmd_t pmd_mkhuge(pmd_t pmd)
|
||||
static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
|
||||
unsigned long addr, pmd_t *pmdp)
|
||||
{
|
||||
return pmdp_xchg_direct(mm, addr, pmdp, __pmd(_SEGMENT_ENTRY_EMPTY));
|
||||
pmd_t pmd;
|
||||
|
||||
pmd = pmdp_xchg_direct(mm, addr, pmdp, __pmd(_SEGMENT_ENTRY_EMPTY));
|
||||
page_table_check_pmd_clear(mm, addr, pmd);
|
||||
return pmd;
|
||||
}
|
||||
|
||||
#define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR_FULL
|
||||
@@ -1725,12 +1738,17 @@ static inline pmd_t pmdp_huge_get_and_clear_full(struct vm_area_struct *vma,
|
||||
unsigned long addr,
|
||||
pmd_t *pmdp, int full)
|
||||
{
|
||||
pmd_t pmd;
|
||||
|
||||
if (full) {
|
||||
pmd_t pmd = *pmdp;
|
||||
pmd = *pmdp;
|
||||
set_pmd(pmdp, __pmd(_SEGMENT_ENTRY_EMPTY));
|
||||
page_table_check_pmd_clear(vma->vm_mm, addr, pmd);
|
||||
return pmd;
|
||||
}
|
||||
return pmdp_xchg_lazy(vma->vm_mm, addr, pmdp, __pmd(_SEGMENT_ENTRY_EMPTY));
|
||||
pmd = pmdp_xchg_lazy(vma->vm_mm, addr, pmdp, __pmd(_SEGMENT_ENTRY_EMPTY));
|
||||
page_table_check_pmd_clear(vma->vm_mm, addr, pmd);
|
||||
return pmd;
|
||||
}
|
||||
|
||||
#define __HAVE_ARCH_PMDP_HUGE_CLEAR_FLUSH
|
||||
@@ -1744,11 +1762,16 @@ static inline pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma,
|
||||
static inline pmd_t pmdp_invalidate(struct vm_area_struct *vma,
|
||||
unsigned long addr, pmd_t *pmdp)
|
||||
{
|
||||
pmd_t pmd;
|
||||
pmd_t pmd = *pmdp;
|
||||
|
||||
VM_WARN_ON_ONCE(!pmd_present(*pmdp));
|
||||
pmd = __pmd(pmd_val(*pmdp) | _SEGMENT_ENTRY_INVALID);
|
||||
return pmdp_xchg_direct(vma->vm_mm, addr, pmdp, pmd);
|
||||
VM_WARN_ON_ONCE(!pmd_present(pmd));
|
||||
pmd = set_pmd_bit(pmd, __pgprot(_SEGMENT_ENTRY_INVALID));
|
||||
#ifdef CONFIG_PAGE_TABLE_CHECK
|
||||
pmd = clear_pmd_bit(pmd, __pgprot(_SEGMENT_ENTRY_READ));
|
||||
#endif
|
||||
page_table_check_pmd_set(vma->vm_mm, addr, pmdp, pmd);
|
||||
pmd = pmdp_xchg_direct(vma->vm_mm, addr, pmdp, pmd);
|
||||
return pmd;
|
||||
}
|
||||
|
||||
#define __HAVE_ARCH_PMDP_SET_WRPROTECT
|
||||
@@ -1783,6 +1806,29 @@ static inline int has_transparent_hugepage(void)
|
||||
}
|
||||
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
|
||||
|
||||
#ifdef CONFIG_PAGE_TABLE_CHECK
|
||||
static inline bool pte_user_accessible_page(struct mm_struct *mm, unsigned long addr, pte_t pte)
|
||||
{
|
||||
VM_BUG_ON(mm == &init_mm);
|
||||
|
||||
return pte_present(pte);
|
||||
}
|
||||
|
||||
static inline bool pmd_user_accessible_page(struct mm_struct *mm, unsigned long addr, pmd_t pmd)
|
||||
{
|
||||
VM_BUG_ON(mm == &init_mm);
|
||||
|
||||
return pmd_leaf(pmd) && (pmd_val(pmd) & _SEGMENT_ENTRY_READ);
|
||||
}
|
||||
|
||||
static inline bool pud_user_accessible_page(struct mm_struct *mm, unsigned long addr, pud_t pud)
|
||||
{
|
||||
VM_BUG_ON(mm == &init_mm);
|
||||
|
||||
return pud_leaf(pud);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 64 bit swap entry format:
|
||||
* A page-table entry has some bits we have to treat in a special way.
|
||||
|
||||
@@ -52,7 +52,6 @@ extern unsigned int zlib_dfltcc_support;
|
||||
#define ZLIB_DFLTCC_INFLATE_ONLY 3
|
||||
#define ZLIB_DFLTCC_FULL_DEBUG 4
|
||||
|
||||
extern unsigned long ident_map_size;
|
||||
extern unsigned long max_mappable;
|
||||
|
||||
/* The Write Back bit position in the physaddr is given by the SLPC PCI */
|
||||
|
||||
@@ -187,6 +187,17 @@ static ssize_t index_show(struct device *dev,
|
||||
}
|
||||
static DEVICE_ATTR_RO(index);
|
||||
|
||||
static ssize_t zpci_uid_slot_show(struct pci_slot *slot, char *buf)
|
||||
{
|
||||
struct zpci_dev *zdev = container_of(slot->hotplug, struct zpci_dev,
|
||||
hotplug_slot);
|
||||
|
||||
return sysfs_emit(buf, "0x%x\n", zdev->uid);
|
||||
}
|
||||
|
||||
static struct pci_slot_attribute zpci_slot_attr_uid =
|
||||
__ATTR(uid, 0444, zpci_uid_slot_show, NULL);
|
||||
|
||||
static umode_t zpci_index_is_visible(struct kobject *kobj,
|
||||
struct attribute *attr, int n)
|
||||
{
|
||||
@@ -243,6 +254,15 @@ const struct attribute_group pfip_attr_group = {
|
||||
.attrs = pfip_attrs,
|
||||
};
|
||||
|
||||
static struct attribute *zpci_slot_attrs[] = {
|
||||
&zpci_slot_attr_uid.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
const struct attribute_group zpci_slot_attr_group = {
|
||||
.attrs = zpci_slot_attrs,
|
||||
};
|
||||
|
||||
static struct attribute *clp_fw_attrs[] = {
|
||||
&uid_checking_attr.attr,
|
||||
NULL,
|
||||
|
||||
@@ -1672,17 +1672,17 @@ static inline bool arch_has_hw_nonleaf_pmd_young(void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PAGE_TABLE_CHECK
|
||||
static inline bool pte_user_accessible_page(pte_t pte, unsigned long addr)
|
||||
static inline bool pte_user_accessible_page(struct mm_struct *mm, unsigned long addr, pte_t pte)
|
||||
{
|
||||
return (pte_val(pte) & _PAGE_PRESENT) && (pte_val(pte) & _PAGE_USER);
|
||||
}
|
||||
|
||||
static inline bool pmd_user_accessible_page(pmd_t pmd, unsigned long addr)
|
||||
static inline bool pmd_user_accessible_page(struct mm_struct *mm, unsigned long addr, pmd_t pmd)
|
||||
{
|
||||
return pmd_leaf(pmd) && (pmd_val(pmd) & _PAGE_PRESENT) && (pmd_val(pmd) & _PAGE_USER);
|
||||
}
|
||||
|
||||
static inline bool pud_user_accessible_page(pud_t pud, unsigned long addr)
|
||||
static inline bool pud_user_accessible_page(struct mm_struct *mm, unsigned long addr, pud_t pud)
|
||||
{
|
||||
return pud_leaf(pud) && (pud_val(pud) & _PAGE_PRESENT) && (pud_val(pud) & _PAGE_USER);
|
||||
}
|
||||
|
||||
+12
-1
@@ -106,7 +106,18 @@ static struct attribute *pci_slot_default_attrs[] = {
|
||||
&pci_slot_attr_cur_speed.attr,
|
||||
NULL,
|
||||
};
|
||||
ATTRIBUTE_GROUPS(pci_slot_default);
|
||||
|
||||
static const struct attribute_group pci_slot_default_group = {
|
||||
.attrs = pci_slot_default_attrs,
|
||||
};
|
||||
|
||||
static const struct attribute_group *pci_slot_default_groups[] = {
|
||||
&pci_slot_default_group,
|
||||
#ifdef ARCH_PCI_SLOT_GROUPS
|
||||
ARCH_PCI_SLOT_GROUPS,
|
||||
#endif
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct kobj_type pci_slot_ktype = {
|
||||
.sysfs_ops = &pci_slot_sysfs_ops,
|
||||
|
||||
@@ -30,26 +30,12 @@
|
||||
#include "hmcdrv_dev.h"
|
||||
#include "hmcdrv_ftp.h"
|
||||
|
||||
/* If the following macro is defined, then the HMC device creates it's own
|
||||
* separated device class (and dynamically assigns a major number). If not
|
||||
* defined then the HMC device is assigned to the "misc" class devices.
|
||||
*
|
||||
#define HMCDRV_DEV_CLASS "hmcftp"
|
||||
*/
|
||||
|
||||
#define HMCDRV_DEV_NAME "hmcdrv"
|
||||
#define HMCDRV_DEV_BUSY_DELAY 500 /* delay between -EBUSY trials in ms */
|
||||
#define HMCDRV_DEV_BUSY_RETRIES 3 /* number of retries on -EBUSY */
|
||||
|
||||
struct hmcdrv_dev_node {
|
||||
|
||||
#ifdef HMCDRV_DEV_CLASS
|
||||
struct cdev dev; /* character device structure */
|
||||
umode_t mode; /* mode of device node (unused, zero) */
|
||||
#else
|
||||
struct miscdevice dev; /* "misc" device structure */
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
static int hmcdrv_dev_open(struct inode *inode, struct file *fp);
|
||||
@@ -75,38 +61,6 @@ static const struct file_operations hmcdrv_dev_fops = {
|
||||
|
||||
static struct hmcdrv_dev_node hmcdrv_dev; /* HMC device struct (static) */
|
||||
|
||||
#ifdef HMCDRV_DEV_CLASS
|
||||
|
||||
static struct class *hmcdrv_dev_class; /* device class pointer */
|
||||
static dev_t hmcdrv_dev_no; /* device number (major/minor) */
|
||||
|
||||
/**
|
||||
* hmcdrv_dev_name() - provides a naming hint for a device node in /dev
|
||||
* @dev: device for which the naming/mode hint is
|
||||
* @mode: file mode for device node created in /dev
|
||||
*
|
||||
* See: devtmpfs.c, function devtmpfs_create_node()
|
||||
*
|
||||
* Return: recommended device file name in /dev
|
||||
*/
|
||||
static char *hmcdrv_dev_name(const struct device *dev, umode_t *mode)
|
||||
{
|
||||
char *nodename = NULL;
|
||||
const char *devname = dev_name(dev); /* kernel device name */
|
||||
|
||||
if (devname)
|
||||
nodename = kasprintf(GFP_KERNEL, "%s", devname);
|
||||
|
||||
/* on device destroy (rmmod) the mode pointer may be NULL
|
||||
*/
|
||||
if (mode)
|
||||
*mode = hmcdrv_dev.mode;
|
||||
|
||||
return nodename;
|
||||
}
|
||||
|
||||
#endif /* HMCDRV_DEV_CLASS */
|
||||
|
||||
/*
|
||||
* open()
|
||||
*/
|
||||
@@ -276,67 +230,11 @@ static ssize_t hmcdrv_dev_write(struct file *fp, const char __user *ubuf,
|
||||
*/
|
||||
int hmcdrv_dev_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
#ifdef HMCDRV_DEV_CLASS
|
||||
struct device *dev;
|
||||
|
||||
rc = alloc_chrdev_region(&hmcdrv_dev_no, 0, 1, HMCDRV_DEV_NAME);
|
||||
|
||||
if (rc)
|
||||
goto out_err;
|
||||
|
||||
cdev_init(&hmcdrv_dev.dev, &hmcdrv_dev_fops);
|
||||
hmcdrv_dev.dev.owner = THIS_MODULE;
|
||||
rc = cdev_add(&hmcdrv_dev.dev, hmcdrv_dev_no, 1);
|
||||
|
||||
if (rc)
|
||||
goto out_unreg;
|
||||
|
||||
/* At this point the character device exists in the kernel (see
|
||||
* /proc/devices), but not under /dev nor /sys/devices/virtual. So
|
||||
* we have to create an associated class (see /sys/class).
|
||||
*/
|
||||
hmcdrv_dev_class = class_create(HMCDRV_DEV_CLASS);
|
||||
|
||||
if (IS_ERR(hmcdrv_dev_class)) {
|
||||
rc = PTR_ERR(hmcdrv_dev_class);
|
||||
goto out_devdel;
|
||||
}
|
||||
|
||||
/* Finally a device node in /dev has to be established (as 'mkdev'
|
||||
* does from the command line). Notice that assignment of a device
|
||||
* node name/mode function is optional (only for mode != 0600).
|
||||
*/
|
||||
hmcdrv_dev.mode = 0; /* "unset" */
|
||||
hmcdrv_dev_class->devnode = hmcdrv_dev_name;
|
||||
|
||||
dev = device_create(hmcdrv_dev_class, NULL, hmcdrv_dev_no, NULL,
|
||||
"%s", HMCDRV_DEV_NAME);
|
||||
if (!IS_ERR(dev))
|
||||
return 0;
|
||||
|
||||
rc = PTR_ERR(dev);
|
||||
class_destroy(hmcdrv_dev_class);
|
||||
hmcdrv_dev_class = NULL;
|
||||
|
||||
out_devdel:
|
||||
cdev_del(&hmcdrv_dev.dev);
|
||||
|
||||
out_unreg:
|
||||
unregister_chrdev_region(hmcdrv_dev_no, 1);
|
||||
|
||||
out_err:
|
||||
|
||||
#else /* !HMCDRV_DEV_CLASS */
|
||||
hmcdrv_dev.dev.minor = MISC_DYNAMIC_MINOR;
|
||||
hmcdrv_dev.dev.name = HMCDRV_DEV_NAME;
|
||||
hmcdrv_dev.dev.fops = &hmcdrv_dev_fops;
|
||||
hmcdrv_dev.dev.mode = 0; /* finally produces 0600 */
|
||||
rc = misc_register(&hmcdrv_dev.dev);
|
||||
#endif /* HMCDRV_DEV_CLASS */
|
||||
|
||||
return rc;
|
||||
return misc_register(&hmcdrv_dev.dev);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -344,15 +242,5 @@ out_err:
|
||||
*/
|
||||
void hmcdrv_dev_exit(void)
|
||||
{
|
||||
#ifdef HMCDRV_DEV_CLASS
|
||||
if (!IS_ERR_OR_NULL(hmcdrv_dev_class)) {
|
||||
device_destroy(hmcdrv_dev_class, hmcdrv_dev_no);
|
||||
class_destroy(hmcdrv_dev_class);
|
||||
}
|
||||
|
||||
cdev_del(&hmcdrv_dev.dev);
|
||||
unregister_chrdev_region(hmcdrv_dev_no, 1);
|
||||
#else /* !HMCDRV_DEV_CLASS */
|
||||
misc_deregister(&hmcdrv_dev.dev);
|
||||
#endif /* HMCDRV_DEV_CLASS */
|
||||
}
|
||||
|
||||
@@ -60,6 +60,13 @@ int pkey_handler_register(struct pkey_handler *handler)
|
||||
|
||||
list_add_rcu(&handler->list, &handler_list);
|
||||
spin_unlock(&handler_list_write_lock);
|
||||
/*
|
||||
* Fast path to push the info about the updated list to the other
|
||||
* CPUs. If removed, the other CPUs may get the updated list when the
|
||||
* RCU context is synched. As this code is in general not performance
|
||||
* critical and the list update mostly only occurs at the early time in
|
||||
* system startup the focus is on concurrency versus performance.
|
||||
*/
|
||||
synchronize_rcu();
|
||||
|
||||
module_put(handler->module);
|
||||
|
||||
@@ -87,50 +87,52 @@ static int cca_apqns4key(const u8 *key, u32 keylen, u32 flags,
|
||||
zcrypt_wait_api_operational();
|
||||
|
||||
if (hdr->type == TOKTYPE_CCA_INTERNAL) {
|
||||
u64 cur_mkvp = 0, old_mkvp = 0;
|
||||
const u8 *ptr_cur_mkvp = NULL;
|
||||
const u8 *ptr_old_mkvp = NULL;
|
||||
int minhwtype = ZCRYPT_CEX3C;
|
||||
|
||||
if (hdr->version == TOKVER_CCA_AES) {
|
||||
struct secaeskeytoken *t = (struct secaeskeytoken *)key;
|
||||
|
||||
if (flags & PKEY_FLAGS_MATCH_CUR_MKVP)
|
||||
cur_mkvp = t->mkvp;
|
||||
ptr_cur_mkvp = t->mkvp;
|
||||
if (flags & PKEY_FLAGS_MATCH_ALT_MKVP)
|
||||
old_mkvp = t->mkvp;
|
||||
ptr_old_mkvp = t->mkvp;
|
||||
} else if (hdr->version == TOKVER_CCA_VLSC) {
|
||||
struct cipherkeytoken *t = (struct cipherkeytoken *)key;
|
||||
|
||||
minhwtype = ZCRYPT_CEX6;
|
||||
if (flags & PKEY_FLAGS_MATCH_CUR_MKVP)
|
||||
cur_mkvp = t->mkvp0;
|
||||
ptr_cur_mkvp = t->mkvp0;
|
||||
if (flags & PKEY_FLAGS_MATCH_ALT_MKVP)
|
||||
old_mkvp = t->mkvp0;
|
||||
ptr_old_mkvp = t->mkvp0;
|
||||
} else {
|
||||
/* unknown CCA internal token type */
|
||||
return -EINVAL;
|
||||
}
|
||||
rc = cca_findcard2(_apqns, &_nr_apqns, 0xFFFF, 0xFFFF,
|
||||
minhwtype, AES_MK_SET,
|
||||
cur_mkvp, old_mkvp, xflags);
|
||||
ptr_cur_mkvp, ptr_old_mkvp, xflags);
|
||||
if (rc)
|
||||
goto out;
|
||||
|
||||
} else if (hdr->type == TOKTYPE_CCA_INTERNAL_PKA) {
|
||||
struct eccprivkeytoken *t = (struct eccprivkeytoken *)key;
|
||||
u64 cur_mkvp = 0, old_mkvp = 0;
|
||||
const u8 *ptr_cur_mkvp = NULL;
|
||||
const u8 *ptr_old_mkvp = NULL;
|
||||
|
||||
if (t->secid == 0x20) {
|
||||
if (flags & PKEY_FLAGS_MATCH_CUR_MKVP)
|
||||
cur_mkvp = t->mkvp;
|
||||
ptr_cur_mkvp = t->mkvp;
|
||||
if (flags & PKEY_FLAGS_MATCH_ALT_MKVP)
|
||||
old_mkvp = t->mkvp;
|
||||
ptr_old_mkvp = t->mkvp;
|
||||
} else {
|
||||
/* unknown CCA internal 2 token type */
|
||||
return -EINVAL;
|
||||
}
|
||||
rc = cca_findcard2(_apqns, &_nr_apqns, 0xFFFF, 0xFFFF,
|
||||
ZCRYPT_CEX7, APKA_MK_SET,
|
||||
cur_mkvp, old_mkvp, xflags);
|
||||
ptr_cur_mkvp, ptr_old_mkvp, xflags);
|
||||
if (rc)
|
||||
goto out;
|
||||
|
||||
@@ -167,31 +169,33 @@ static int cca_apqns4type(enum pkey_key_type ktype,
|
||||
zcrypt_wait_api_operational();
|
||||
|
||||
if (ktype == PKEY_TYPE_CCA_DATA || ktype == PKEY_TYPE_CCA_CIPHER) {
|
||||
u64 cur_mkvp = 0, old_mkvp = 0;
|
||||
const u8 *ptr_cur_mkvp = NULL;
|
||||
const u8 *ptr_old_mkvp = NULL;
|
||||
int minhwtype = ZCRYPT_CEX3C;
|
||||
|
||||
if (flags & PKEY_FLAGS_MATCH_CUR_MKVP)
|
||||
cur_mkvp = *((u64 *)cur_mkvp);
|
||||
ptr_cur_mkvp = cur_mkvp;
|
||||
if (flags & PKEY_FLAGS_MATCH_ALT_MKVP)
|
||||
old_mkvp = *((u64 *)alt_mkvp);
|
||||
ptr_old_mkvp = alt_mkvp;
|
||||
if (ktype == PKEY_TYPE_CCA_CIPHER)
|
||||
minhwtype = ZCRYPT_CEX6;
|
||||
rc = cca_findcard2(_apqns, &_nr_apqns, 0xFFFF, 0xFFFF,
|
||||
minhwtype, AES_MK_SET,
|
||||
cur_mkvp, old_mkvp, xflags);
|
||||
ptr_cur_mkvp, ptr_old_mkvp, xflags);
|
||||
if (rc)
|
||||
goto out;
|
||||
|
||||
} else if (ktype == PKEY_TYPE_CCA_ECC) {
|
||||
u64 cur_mkvp = 0, old_mkvp = 0;
|
||||
const u8 *ptr_cur_mkvp = NULL;
|
||||
const u8 *ptr_old_mkvp = NULL;
|
||||
|
||||
if (flags & PKEY_FLAGS_MATCH_CUR_MKVP)
|
||||
cur_mkvp = *((u64 *)cur_mkvp);
|
||||
ptr_cur_mkvp = cur_mkvp;
|
||||
if (flags & PKEY_FLAGS_MATCH_ALT_MKVP)
|
||||
old_mkvp = *((u64 *)alt_mkvp);
|
||||
ptr_old_mkvp = alt_mkvp;
|
||||
rc = cca_findcard2(_apqns, &_nr_apqns, 0xFFFF, 0xFFFF,
|
||||
ZCRYPT_CEX7, APKA_MK_SET,
|
||||
cur_mkvp, old_mkvp, xflags);
|
||||
ptr_cur_mkvp, ptr_old_mkvp, xflags);
|
||||
if (rc)
|
||||
goto out;
|
||||
|
||||
@@ -487,14 +491,14 @@ static int cca_verifykey(const u8 *key, u32 keylen,
|
||||
*keybitsize = t->bitsize;
|
||||
rc = cca_findcard2(apqns, &nr_apqns, *card, *dom,
|
||||
ZCRYPT_CEX3C, AES_MK_SET,
|
||||
t->mkvp, 0, xflags);
|
||||
t->mkvp, NULL, xflags);
|
||||
if (!rc)
|
||||
*flags = PKEY_FLAGS_MATCH_CUR_MKVP;
|
||||
if (rc == -ENODEV) {
|
||||
nr_apqns = ARRAY_SIZE(apqns);
|
||||
rc = cca_findcard2(apqns, &nr_apqns, *card, *dom,
|
||||
ZCRYPT_CEX3C, AES_MK_SET,
|
||||
0, t->mkvp, xflags);
|
||||
NULL, t->mkvp, xflags);
|
||||
if (!rc)
|
||||
*flags = PKEY_FLAGS_MATCH_ALT_MKVP;
|
||||
}
|
||||
@@ -521,14 +525,14 @@ static int cca_verifykey(const u8 *key, u32 keylen,
|
||||
*keybitsize = PKEY_SIZE_AES_256;
|
||||
rc = cca_findcard2(apqns, &nr_apqns, *card, *dom,
|
||||
ZCRYPT_CEX6, AES_MK_SET,
|
||||
t->mkvp0, 0, xflags);
|
||||
t->mkvp0, NULL, xflags);
|
||||
if (!rc)
|
||||
*flags = PKEY_FLAGS_MATCH_CUR_MKVP;
|
||||
if (rc == -ENODEV) {
|
||||
nr_apqns = ARRAY_SIZE(apqns);
|
||||
rc = cca_findcard2(apqns, &nr_apqns, *card, *dom,
|
||||
ZCRYPT_CEX6, AES_MK_SET,
|
||||
0, t->mkvp0, xflags);
|
||||
NULL, t->mkvp0, xflags);
|
||||
if (!rc)
|
||||
*flags = PKEY_FLAGS_MATCH_ALT_MKVP;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user