From patchwork Wed Nov 28 16:49:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 152319 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1322060ljp; Wed, 28 Nov 2018 08:53:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/WiFwSig+u5JsW4vpKhymHQX3eRXjZjQX5jcsLp1msSHXTtOjO2UhxUMdcGno0W4FYxqfNd X-Received: by 2002:a25:6602:: with SMTP id a2-v6mr37877120ybc.75.1543423984714; Wed, 28 Nov 2018 08:53:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543423984; cv=none; d=google.com; s=arc-20160816; b=qlILH9B2rDaLk9eMdXupmto+LxHaKNkIoulDy5lYaDNkhHklhBQf6PoIttjoh3l1iK BeTmP+ItmAmtLxcThZdMoHBefxNCi/dTGpeXyYpxoYjiLnnZ6sPltz6jxSFmFrdY7LTV MiQXw7yhmFdyvzs4CCg/m1e9PkuU9vzkMt3FtV15EEF2d0fPchR/jNY29wrl/Jm6HTsr 0sXbrOt75jtLuwDLGF7UX8Fd2E0siesmqE8yA4HTFqzrDBRHzYgrgWhuPaCfJKhsnxJX WymlZrvGPk7HVHzOIRkVATpWniB+cDgOgErLP3ZlhC0GxGFIsLduZskYTINdyruX7LCG pYwQ== 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=UNzfET5nXwjKeiwTTcKeL8GECOzH9JSDdbqhQX35stE=; b=uPBC8LRskWIQmt8pxgKXBaKHwf1bPzkzi8ly5kHo0azliAYTg1Hev+QZIsLl9/RbPn V/g++qjZkoREbQ1K9R3t1eDDalBCJfr3aH4GWp3kuJatwNQ/fQhHngNyrxaAVwxgfOO1 I5uxOvEtF6qSjYI/gduCQ8pBQx5lzCM69leAq76KTxlAmn7wQgzrXXmMonMo4owxIncF yJwjbQUClXqS7/RPuGcGvK3pxxTfnzWxNYQylduSJLcnh9akXVzXuEFeRCOggz96dOs4 ubp0vmf0K1bC3tyW82Kx+antgPf2KFDYbd/ZJLLnHm5JmJH4MH+hOmNxvaxWOve3DVm8 QbZQ== 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 s2-v6si4996341ybf.293.2018.11.28.08.53.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Nov 2018 08:53:04 -0800 (PST) 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 1gS327-0000qj-BD; Wed, 28 Nov 2018 16:49:51 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1gS325-0000qU-SZ for xen-devel@lists.xenproject.org; Wed, 28 Nov 2018 16:49:49 +0000 X-Inumbo-ID: 9e2bc52c-f32d-11e8-9a16-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 9e2bc52c-f32d-11e8-9a16-bc764e045a96; Wed, 28 Nov 2018 16:49:48 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 80BF5382E; Wed, 28 Nov 2018 08:49:48 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 934993F575; Wed, 28 Nov 2018 08:49:47 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 28 Nov 2018 16:49:32 +0000 Message-Id: <20181128164939.8329-2-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181128164939.8329-1-julien.grall@arm.com> References: <20181128164939.8329-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH for-4.12 1/8] xen/arm: Only set necessary flags when initializing HCR_EL2 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: andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Only {A,F,I}MO are necessary to receive interrupts until a guest vCPU is loaded. The rest have no effect on Xen and it is better to avoid setting them. Signed-off-by: Julien Grall Reviewed-by: Andrii Anisov Reviewed-by: Stefano Stabellini --- xen/arch/arm/traps.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 88ffeeb480..1eec966299 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -181,8 +181,12 @@ void init_traps(void) WRITE_SYSREG((HCPTR_CP_MASK & ~(HCPTR_CP(10) | HCPTR_CP(11))) | HCPTR_TTA, CPTR_EL2); - /* Setup hypervisor traps */ - WRITE_SYSREG(get_default_hcr_flags(), HCR_EL2); + /* + * Configure HCR_EL2 with the bareminimum to run Xen until a guest + * is scheduled. {A,I,F}MO bits are set to allow EL2 receiving + * interrupts. + */ + WRITE_SYSREG(HCR_AMO | HCR_FMO | HCR_IMO, HCR_EL2); isb(); }