Skip to content
Snippets Groups Projects
  • Peter Maydell's avatar
    4cdd146d
    hw/arm/smmuv3: Advertise SMMUv3.1-XNX feature · 4cdd146d
    Peter Maydell authored
    
    The SMMUv3.1-XNX feature is mandatory for an SMMUv3.1 if S2P is
    supported, so we should theoretically have implemented it as part of
    the recent S2P work.  Fortunately, for us the implementation is a
    no-op.
    
    This feature is about interpretation of the stage 2 page table
    descriptor XN bits, which control execute permissions.
    
    For QEMU, the permission bits passed to an IOMMU (via MemTxAttrs and
    IOMMUAccessFlags) only indicate read and write; we do not distinguish
    data reads from instruction reads outside the CPU proper.  In the
    SMMU architecture's terms, our interconnect between the client device
    and the SMMU doesn't have the ability to convey the INST attribute,
    and we therefore use the default value of "data" for this attribute.
    
    We also do not support the bits in the Stream Table Entry that can
    override the on-the-bus transaction attribute permissions (we do not
    set SMMU_IDR1.ATTR_PERMS_OVR=1).
    
    These two things together mean that for our implementation, it never
    has to deal with transactions with the INST attribute, and so it can
    correctly ignore the XN bits entirely.  So we already implement
    FEAT_XNX's "XN field is now 2 bits, not 1" behaviour to the extent
    that we need to.
    
    Advertise the presence of the feature in SMMU_IDR3.XNX.
    
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
    Reviewed-by: default avatarMostafa Saleh <smostafa@google.com>
    Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
    Message-id: 20230914145705.1648377-4-peter.maydell@linaro.org
    4cdd146d
    History
    hw/arm/smmuv3: Advertise SMMUv3.1-XNX feature
    Peter Maydell authored
    
    The SMMUv3.1-XNX feature is mandatory for an SMMUv3.1 if S2P is
    supported, so we should theoretically have implemented it as part of
    the recent S2P work.  Fortunately, for us the implementation is a
    no-op.
    
    This feature is about interpretation of the stage 2 page table
    descriptor XN bits, which control execute permissions.
    
    For QEMU, the permission bits passed to an IOMMU (via MemTxAttrs and
    IOMMUAccessFlags) only indicate read and write; we do not distinguish
    data reads from instruction reads outside the CPU proper.  In the
    SMMU architecture's terms, our interconnect between the client device
    and the SMMU doesn't have the ability to convey the INST attribute,
    and we therefore use the default value of "data" for this attribute.
    
    We also do not support the bits in the Stream Table Entry that can
    override the on-the-bus transaction attribute permissions (we do not
    set SMMU_IDR1.ATTR_PERMS_OVR=1).
    
    These two things together mean that for our implementation, it never
    has to deal with transactions with the INST attribute, and so it can
    correctly ignore the XN bits entirely.  So we already implement
    FEAT_XNX's "XN field is now 2 bits, not 1" behaviour to the extent
    that we need to.
    
    Advertise the presence of the feature in SMMU_IDR3.XNX.
    
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
    Reviewed-by: default avatarMostafa Saleh <smostafa@google.com>
    Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
    Message-id: 20230914145705.1648377-4-peter.maydell@linaro.org
smmuv3.c 57.40 KiB