diff --git a/drivers/iommu/intel/iommu.h b/drivers/iommu/intel/iommu.h index eaef932ad7c93a8c1945efd71c29fb36b358802f..bfce7480ee09509937db9a018fc87312e73250aa 100644 --- a/drivers/iommu/intel/iommu.h +++ b/drivers/iommu/intel/iommu.h @@ -541,7 +541,8 @@ enum { #define pasid_supported(iommu) (sm_supported(iommu) && \ ecap_pasid((iommu)->ecap)) #define ssads_supported(iommu) (sm_supported(iommu) && \ - ecap_slads((iommu)->ecap)) + ecap_slads((iommu)->ecap) && \ + ecap_smpwc(iommu->ecap)) #define nested_supported(iommu) (sm_supported(iommu) && \ ecap_nest((iommu)->ecap)) diff --git a/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.h b/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.h index 93c81bc9228651f86bf6b09fb7d00806e9a45601..3cb79e601af3b3425d745aa4a97f86e6b6557de6 100644 --- a/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.h +++ b/drivers/net/ethernet/huawei/bma/edma_drv/edma_host.h @@ -72,7 +72,7 @@ /* Can contain "struct page" and pure PFN pages */ #define VM_MIXEDMAP 0x10000000 -#define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */ +#define VM_MERGEABLE BIT(31) /* KSM may merge identical pages */ #if defined(CONFIG_X86) /* PAT reserves whole VMA at once (x86) */ diff --git a/include/linux/mm.h b/include/linux/mm.h index 8999dcf606fa2d62e35a8a75c564c1819c2c3518..c0040a2014c45176fe1e9a575f78352e7fc9e6a5 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -320,7 +320,7 @@ extern unsigned int kobjsize(const void *objp); #define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ #define VM_HUGEPAGE 0x20000000 /* MADV_HUGEPAGE marked this vma */ #define VM_NOHUGEPAGE 0x40000000 /* MADV_NOHUGEPAGE marked this vma */ -#define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */ +#define VM_MERGEABLE BIT(31) /* KSM may merge identical pages */ #ifdef CONFIG_GMEM # define VM_PEER_SHARED_BIT 56 /* movable memory between host and device */ diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h index c91a3c24f6070a535c92d8ded5e4d5ecf2aacc78..5416f21918e0472043beedb2c4db4921d87b9121 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -12,8 +12,10 @@ #include #include #include +#include /* `bindgen` gets confused at certain things. */ const size_t BINDINGS_ARCH_SLAB_MINALIGN = ARCH_SLAB_MINALIGN; const gfp_t BINDINGS_GFP_KERNEL = GFP_KERNEL; const gfp_t BINDINGS___GFP_ZERO = __GFP_ZERO; +const vm_flags_t BINDINGS_VM_MERGEABLE = VM_MERGEABLE; diff --git a/rust/bindings/lib.rs b/rust/bindings/lib.rs index 9bcbea04dac305e2dab4c045d6c622052459f0c6..7d9078b94a8f081ec1aa077b70f2b21460e49899 100644 --- a/rust/bindings/lib.rs +++ b/rust/bindings/lib.rs @@ -51,3 +51,4 @@ mod bindings_helper { pub const GFP_KERNEL: gfp_t = BINDINGS_GFP_KERNEL; pub const __GFP_ZERO: gfp_t = BINDINGS___GFP_ZERO; +pub const VM_MERGEABLE: vm_flags_t = BINDINGS_VM_MERGEABLE;