Re: [Xen-devel] [PATCH for-4.9 v3 1/3] xsm: fix clang 3.5 build after c47d1d
Hi Roger, On 10/04/17 14:34, Roger Pau Monne wrote: The changes introduced on c47d1d broke the clang build due to undefined references to __xsm_action_mismatch_detected, because clang hasn't optimized the code properly. The following patch allows the clang build to work again, while keeping the same functionality. Signed-off-by: Roger Pau MonnéTested-by: Julien Grall Can someone commit this patch today? I'd like to cut an RC as soon as osstest pushed to staging. Cheers, --- Cc: Daniel De Graaf Cc: Julien Grall Cc: Tamas K Lengyel --- Changes since v2: - Use an "if" like v1. Changes since v1: - Remove unused "break". - Remove if condition. NB: this fixes travis build: https://travis-ci.org/royger/xen/builds/219697038 --- xen/include/xsm/dummy.h | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index 56a8814d82..62fcea6f04 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -557,25 +557,21 @@ static XSM_INLINE int xsm_hvm_param_altp2mhvm(XSM_DEFAULT_ARG struct domain *d) static XSM_INLINE int xsm_hvm_altp2mhvm_op(XSM_DEFAULT_ARG struct domain *d, uint64_t mode, uint32_t op) { -xsm_default_t a; XSM_ASSERT_ACTION(XSM_OTHER); switch ( mode ) { case XEN_ALTP2M_mixed: -a = XSM_TARGET; -break; +return xsm_default_action(XSM_TARGET, current->domain, d); case XEN_ALTP2M_external: -a = XSM_DM_PRIV; -break; +return xsm_default_action(XSM_DM_PRIV, current->domain, d); case XEN_ALTP2M_limited: -a = (HVMOP_altp2m_vcpu_enable_notify == op) ? XSM_TARGET : XSM_DM_PRIV; -break; +if ( HVMOP_altp2m_vcpu_enable_notify == op ) +return xsm_default_action(XSM_TARGET, current->domain, d); +return xsm_default_action(XSM_DM_PRIV, current->domain, d); default: return -EPERM; -}; - -return xsm_default_action(a, current->domain, d); +} } static XSM_INLINE int xsm_vm_event_control(XSM_DEFAULT_ARG struct domain *d, int mode, int op) -- Julien Grall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH for-4.9 v3 1/3] xsm: fix clang 3.5 build after c47d1d
On 04/10/2017 09:34 AM, Roger Pau Monne wrote: The changes introduced on c47d1d broke the clang build due to undefined references to __xsm_action_mismatch_detected, because clang hasn't optimized the code properly. The following patch allows the clang build to work again, while keeping the same functionality. Signed-off-by: Roger Pau MonnéAcked-by: Daniel De Graaf ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH for-4.9 v3 1/3] xsm: fix clang 3.5 build after c47d1d
The changes introduced on c47d1d broke the clang build due to undefined references to __xsm_action_mismatch_detected, because clang hasn't optimized the code properly. The following patch allows the clang build to work again, while keeping the same functionality. Signed-off-by: Roger Pau Monné--- Cc: Daniel De Graaf Cc: Julien Grall Cc: Tamas K Lengyel --- Changes since v2: - Use an "if" like v1. Changes since v1: - Remove unused "break". - Remove if condition. NB: this fixes travis build: https://travis-ci.org/royger/xen/builds/219697038 --- xen/include/xsm/dummy.h | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index 56a8814d82..62fcea6f04 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -557,25 +557,21 @@ static XSM_INLINE int xsm_hvm_param_altp2mhvm(XSM_DEFAULT_ARG struct domain *d) static XSM_INLINE int xsm_hvm_altp2mhvm_op(XSM_DEFAULT_ARG struct domain *d, uint64_t mode, uint32_t op) { -xsm_default_t a; XSM_ASSERT_ACTION(XSM_OTHER); switch ( mode ) { case XEN_ALTP2M_mixed: -a = XSM_TARGET; -break; +return xsm_default_action(XSM_TARGET, current->domain, d); case XEN_ALTP2M_external: -a = XSM_DM_PRIV; -break; +return xsm_default_action(XSM_DM_PRIV, current->domain, d); case XEN_ALTP2M_limited: -a = (HVMOP_altp2m_vcpu_enable_notify == op) ? XSM_TARGET : XSM_DM_PRIV; -break; +if ( HVMOP_altp2m_vcpu_enable_notify == op ) +return xsm_default_action(XSM_TARGET, current->domain, d); +return xsm_default_action(XSM_DM_PRIV, current->domain, d); default: return -EPERM; -}; - -return xsm_default_action(a, current->domain, d); +} } static XSM_INLINE int xsm_vm_event_control(XSM_DEFAULT_ARG struct domain *d, int mode, int op) -- 2.11.0 (Apple Git-81) ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel