From patchwork Thu Oct 31 15:09:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 178193 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp2980246ill; Thu, 31 Oct 2019 08:11:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCUxbObPrTAZIFofBc+HM+uMa19zmK0ckLyft+e3m4I1qRjfLbP16n9W9ld+8OMFxk1YUf X-Received: by 2002:a05:6602:1cc:: with SMTP id w12mr5874378iot.133.1572534681184; Thu, 31 Oct 2019 08:11:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572534681; cv=none; d=google.com; s=arc-20160816; b=BhFMOSVEXywgwUibBzx//6MmGshv0Ob91A9rUi7OFYf/GZJfj05nDTA4P7Rm/3BkJh ZiiBsj57G3yjdm4gCB80ZUvBBr3aIP32l6Y5poAlyFk8T4RzAyeK//4na2BBGtZ7qP7v uOjqSbIRLgV+s1e0v31k3133eDHBEeCrkB2EKSs1bBiOyE97AHQOfcTX8sl5BdW73fsx cdKzTaAYAevWCIzA1+yCCRMHxxH0MFvhdIIPTZ3T25YFZa52HUrx19OzeEhsRlTTlgX7 /ewJWyFqPWOXiVrYMWDCUw0PfbUA8H5juqFNPnbduqprppM69NVClnX9xcIc7/T8CVo6 p5cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=maQt4+Rk+LxVkDdVWYTA1t4P2OA3YnEIn0xCqM8D6EE=; b=hX8YPotrrqFOjE9msRuR13/FFPVOUqE85R64eghBZ3wTuY5PsWQZM0S+qPliuIX98Q Eo60bOqzgQzZ5RPnQvJJREBOVNNz/mcbNAFhaBjHEjP/K/1i5ACeuNdB0gh358BMNaDD OO1r3PLXcOZPM6P6quAy9IuMNoMIZShWmj7I0TEXvYA6EPuHxtHIQ3jPreDvvahQxXlS AsPbsKjvxhGD2ijBdbWh/oI+wFzYRjEuAf9j4Ni1p+m3ELmAeHOneXL0Ui4hCozMjxnQ YsgmZhDEVocYYg6l4noAPic3u+bsTlUCkbDAIRntY45Wspv4p7t5r73x8UTt9VMVyFxI qMBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id d3si7840080jab.22.2019.10.31.08.11.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Oct 2019 08:11:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iQC5c-0007cy-VV; Thu, 31 Oct 2019 15:10:20 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iQC5c-0007cL-BL for xen-devel@lists.xenproject.org; Thu, 31 Oct 2019 15:10:20 +0000 X-Inumbo-ID: 7c48a022-fbf0-11e9-954c-12813bfff9fa Received: from foss.arm.com (unknown [217.140.110.172]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 7c48a022-fbf0-11e9-954c-12813bfff9fa; Thu, 31 Oct 2019 15:09:50 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9E2457A7; Thu, 31 Oct 2019 08:09:50 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (unknown [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 652183F71E; Thu, 31 Oct 2019 08:09:49 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 31 Oct 2019 15:09:17 +0000 Message-Id: <20191031150922.22938-15-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191031150922.22938-1-julien.grall@arm.com> References: <20191031150922.22938-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH for-4.13 v4 14/19] xen/arm: Move ARCH_PATCH_INSN_SIZE out of the header livepatch.h X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: jgross@suse.com, Stefano Stabellini , Julien Grall , Konrad Rzeszutek Wilk , Ross Lagerwall , Julien Grall , Volodymyr Babchuk MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" At the moment, ARCH_PATCH_INSN_SIZE is defined in the header livepatch.h. However, this is also used in the alternative code. Rather than including livepatch.h just for using the define, move it in the header insn.h which seems more suitable. Signed-off-by: Julien Grall Reviewed-by: Volodymyr Babchuk Reviewed-by: Ross Lagerwall Acked-by: Stefano Stabellini --- Changes in v2: - Add Ross's reviewed-by - Add Stefano's acked-by - Add Volodymyr's reviewed-by --- xen/arch/arm/alternative.c | 2 -- xen/include/asm-arm/insn.h | 3 +++ xen/include/asm-arm/livepatch.h | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/alternative.c b/xen/arch/arm/alternative.c index 52ed7edf69..237c4e5642 100644 --- a/xen/arch/arm/alternative.c +++ b/xen/arch/arm/alternative.c @@ -30,8 +30,6 @@ #include #include #include -/* XXX: Move ARCH_PATCH_INSN_SIZE out of livepatch.h */ -#include #include /* Override macros from asm/page.h to make them work with mfn_t */ diff --git a/xen/include/asm-arm/insn.h b/xen/include/asm-arm/insn.h index 3489179826..19277212e1 100644 --- a/xen/include/asm-arm/insn.h +++ b/xen/include/asm-arm/insn.h @@ -11,6 +11,9 @@ # error "unknown ARM variant" #endif +/* On ARM32,64 instructions are always 4 bytes long. */ +#define ARCH_PATCH_INSN_SIZE 4 + #endif /* !__ARCH_ARM_INSN */ /* * Local variables: diff --git a/xen/include/asm-arm/livepatch.h b/xen/include/asm-arm/livepatch.h index 6bca79deb9..026af5e7dc 100644 --- a/xen/include/asm-arm/livepatch.h +++ b/xen/include/asm-arm/livepatch.h @@ -7,9 +7,7 @@ #define __XEN_ARM_LIVEPATCH_H__ #include /* For SZ_* macros. */ - -/* On ARM32,64 instructions are always 4 bytes long. */ -#define ARCH_PATCH_INSN_SIZE 4 +#include /* * The va of the hypervisor .text region. We need this as the