From nobody Mon Apr 29 11:18:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1659025367; cv=none; d=zohomail.com; s=zohoarc; b=hDuUGpLV1x7maOPeK3sE16maCkXAbLuyiuXcSniofC12wYPV7l406fTOwZdlEcGVmikhMRww96Y6KTxLqly6E0wVpvC7NTGTnA3QzwN8tVUqrf3QH7aRLeNVoI4GO211mbHzLPQ+HxxplPJ7+l49d6YOrxlVhxCJmrRHXL2gyDw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659025367; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=XJz3FE30CMUZxePR5Hul4ldsrorD4RAPiwG0AXEy62g=; b=Z8Ph6PDOi6Yv/nujvMSqZ0UQ2h9a4+JJbrDwcdNBgmbFhRk3maOsIbY9vdRUENp0RDyEfCXJCcLSk3CXN0CoRrKbVsDdqvsfaZjWP29ovNhN7UrC6Oh9Fj6Q4+03rVDC/ToKFnfdg6oxRf/+4zXX1eP1CcQWzwT9KOSfZiNX4yo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1659025367472854.7963862934132; Thu, 28 Jul 2022 09:22:47 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.376951.610013 (Exim 4.92) (envelope-from ) id 1oH6Gt-0007tH-Nm; Thu, 28 Jul 2022 16:21:59 +0000 Received: by outflank-mailman (output) from mailman id 376951.610013; Thu, 28 Jul 2022 16:21:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oH6Gt-0007tA-Jv; Thu, 28 Jul 2022 16:21:59 +0000 Received: by outflank-mailman (input) for mailman id 376951; Thu, 28 Jul 2022 16:21:58 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oH6Gs-0007t1-FP for xen-devel@lists.xenproject.org; Thu, 28 Jul 2022 16:21:58 +0000 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [2a00:1450:4864:20::52c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 665d558e-0e91-11ed-bd2d-47488cf2e6aa; Thu, 28 Jul 2022 18:21:57 +0200 (CEST) Received: by mail-ed1-x52c.google.com with SMTP id f15so2821842edc.4 for ; Thu, 28 Jul 2022 09:21:57 -0700 (PDT) Received: from uni.router.wind (adsl-93.176.58.224.tellas.gr. [176.58.224.93]) by smtp.googlemail.com with ESMTPSA id dk15-20020a0564021d8f00b0043cedad30a5sm997092edb.21.2022.07.28.09.21.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jul 2022 09:21:55 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 665d558e-0e91-11ed-bd2d-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XJz3FE30CMUZxePR5Hul4ldsrorD4RAPiwG0AXEy62g=; b=l8wAFe4tR4icpFOjTC76vG2xM9yosMH8ldGOfAtBcJDInee7i5GcJ9s5lRaH1a/WR6 IJlyEl05jXAGvyuZHX/DNyn/9K/eqJimV10lCxHRyrXqD347GmfvUw6LGLfpJU7zQLX+ vYs9cKtjmOvIvlgGGpNMBdpVSrohyVf2G2In+LBd0HE/HsF9Mf00XE3uECWMDLnjU3Fg RzAqzyWa4nX/k+vby3v2uXvtq3FvvsNzcFuhQVhTVcwYRkU1gzA9wXg54dPYhZ/otokl G3N1HV7+VBBVjcb3s8fKUhmdXKg/WQkyHySMH+aABk4HE1Os3TSSHxZaet3iePlE8RgK THfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XJz3FE30CMUZxePR5Hul4ldsrorD4RAPiwG0AXEy62g=; b=E+U8TtapYtl1CRPMUEXc0t1/bB6j8vvLwSDFWb25ZeQd19u76GpVY7tjrlgv3P35bo JcuBBm+ne+yOLPl5d1RlTEdtSs9DLZl7f0gAlS5HfL34BB4KDKEyZDojnDDKoJZnu3Ld ItqcLlPfHjDc1yY86VopW8KX2nCXuY7cY63EkYQRvSDSeD4x6rIv8uWlWsRHtdyuksjU mISeIwz8TsnwMb9IWthxTqMe485tV/7jSPfnT8QK3fVuav4Ahq0MkgC7jPesfmcxhlTS hBPByhcGM4KExxlEyc07rRNCdfqwf5S2q1JfhRuBDZD7cqPdTuxyal34niccWmNyM7wX rWew== X-Gm-Message-State: AJIora9Qo25pJuH/fsFw+OOcHJ0PB1ywjVAnFZRxR3kPniPZQx/Bs7Oc NFKR3xPch818zz1mIKlYhIlcAeyvRnY= X-Google-Smtp-Source: AGRyM1txPcvTQtajiZSTmJEhcDTSocrmT/k2OKxHh/gPQ0D2fFfEcjxHo/86ZWcdncxhRl5CCx8dsg== X-Received: by 2002:a05:6402:35c4:b0:43b:fee5:2653 with SMTP id z4-20020a05640235c400b0043bfee52653mr20588266edc.415.1659025315949; Thu, 28 Jul 2022 09:21:55 -0700 (PDT) From: Xenia Ragiadakou To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v3] xen/arm: domain: Fix MISRA C 2012 Rule 8.7 violation Date: Thu, 28 Jul 2022 19:21:51 +0300 Message-Id: <20220728162151.1228747-1-burzalodowa@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1659025368949100001 Content-Type: text/plain; charset="utf-8" The function idle_loop() is referenced only in domain.c. Change its linkage from external to internal by adding the storage-class specifier static to its definitions. Add the function as a 'fake' input operand to the inline assembly statement, to make the compiler aware that the function is used. Fake means that the function is not actually used as an operand by the asm = code. That is because there is not a suitable gcc arm32 asm constraint for labels. Declare return_to_new_vcpu32() and return_to_new_vcpu64() that are also referenced by this inline asm statement. Also, this patch resolves indirectly a MISRA C 2012 Rule 8.4 violation warn= ing. Signed-off-by: Xenia Ragiadakou Reviewed-by: Bertrand Marquis Reviewed-by: Jan Beulich --- Changes in v2: - remove the 'used' attribute and pass the function as input operand to the inline asm statement - declare return_to_new_vcpu32() and return_to_new_vcpu64() Changes in v3: - remove the declarations of return_to_new_vcpu32() and return_to_new_vcpu6= 4() from asm/current.h because this is not the appropriate header - place them in arm/domain.c to restrict their visibilty to this particular= file - declare them as noreturn xen/arch/arm/domain.c | 5 ++++- xen/arch/arm/include/asm/current.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 2f8eaab7b5..ce1089f0c6 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -63,7 +63,7 @@ static void do_idle(void) rcu_idle_exit(cpu); } =20 -void idle_loop(void) +static void idle_loop(void) { unsigned int cpu =3D smp_processor_id(); =20 @@ -331,6 +331,9 @@ static void schedule_tail(struct vcpu *prev) update_vcpu_system_time(current); } =20 +extern void noreturn return_to_new_vcpu32(void); +extern void noreturn return_to_new_vcpu64(void); + static void continue_new_vcpu(struct vcpu *prev) { current->arch.actlr =3D READ_SYSREG(ACTLR_EL1); diff --git a/xen/arch/arm/include/asm/current.h b/xen/arch/arm/include/asm/= current.h index 73e81458e5..6973eeb1d1 100644 --- a/xen/arch/arm/include/asm/current.h +++ b/xen/arch/arm/include/asm/current.h @@ -45,7 +45,7 @@ static inline struct cpu_info *get_cpu_info(void) #define guest_cpu_user_regs() (&get_cpu_info()->guest_cpu_user_regs) =20 #define switch_stack_and_jump(stack, fn) do { \ - asm volatile ("mov sp,%0; b " STR(fn) : : "r" (stack) : "memory" ); \ + asm volatile ("mov sp,%0; b " STR(fn) : : "r" (stack), "X" (fn) : "mem= ory" ); \ unreachable(); \ } while ( false ) =20 --=20 2.34.1