From patchwork Sun Apr 23 17:08:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9695097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B40BC60245 for ; Sun, 23 Apr 2017 17:17:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A022F26530 for ; Sun, 23 Apr 2017 17:17:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91900267EC; Sun, 23 Apr 2017 17:17:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D017A26530 for ; Sun, 23 Apr 2017 17:17:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=+kmK3uFgqmcQm8KN8Lsc02OkSQkhLCxTOrqB7/Vt1vQ=; b=dxHhwx9DA79hXI3NtAmz5Kr9BP PRUopYYkiyeQqVqBNinHR3jK3OrOtyXQavjNBLZwPB08cwsFogI8K+C9GC2EMAZfg531pO8E0GAZD VMYhJO+5Ysm90s1NTiwh9xvUU+yq7RzmQMn24Zbe5uAiT8/5gGgXTVOgY76vQsGCHrSQC3T9cBV8M 8y3haboqRS5m1CX0LqH9jmCi2nb8ZxvfmMDnKvHl+B5WZGKYBOZckM8aUJDweDcUMfy0dVFelbycJ CMxDZQ1z2X7ELfxEgK17XCfxRHoSGl8w7NgpTeaNfKqQGcekNRlQEaZ6xvZEODMgYgX9Kee4FN2Qy vQcdIh9Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d2L8n-0006eT-Ht; Sun, 23 Apr 2017 17:17:41 +0000 Received: from mail-wm0-f47.google.com ([74.125.82.47]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d2L25-0006Jf-HT for linux-arm-kernel@lists.infradead.org; Sun, 23 Apr 2017 17:10:55 +0000 Received: by mail-wm0-f47.google.com with SMTP id u65so7506197wmu.1 for ; Sun, 23 Apr 2017 10:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2HALoMJg0UCcqHsyQCHI2FpFdlvDmfsaXm3e7+uASK8=; b=Amqkrm108lPbHkY/JNOV9ExufH2+U74Y3nDgXm74P/h5xx8p1pwOkFoD8Az+Tkgvtz 7gbFQ1Hd66M3rPKPxAuE3E64mpuapmjyfMrWZK3xOq3RWBAUaxcpPkLrsq78o3iMEfm+ xtAdgDEAdbxf7NAK6ilK9ZYRDGe9ib4cho8ZQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2HALoMJg0UCcqHsyQCHI2FpFdlvDmfsaXm3e7+uASK8=; b=OIEdnFYH9te6YxxmEEJQqktyCEl5dZCR6wsuwRWJi2rj4Oqzu73orNgJ7ZBF39eyPs rK0YNnaSI/lBtpUkNYz9qgFeaYbjwBWoLA8MGGPwpJoOlKqY55qpXwChPAF9Bjp1dxMr 6okQkR4bvLmSgAwfifpd1FVq9Sr5RDXrBDZd2yb3d2gaquOr/sZYpsHBfKbuEel2cPiU ELh8EMeZ8ifztJu1upEmpSyuQK6Td0yURkKPgxBkeDpuWIJA+buHNu6o0h8CVBnWZXQ3 5XTm7g+tgcrmZ/S8+qsqStaNES7A4kiLrc1VILSRdiGPAxVLw7AKNwRlqxLabPflZnx9 LHiA== X-Gm-Message-State: AN3rC/6ZbtNM6JDbBCW7q2T9HifUCS7YGcr/m2PQsajdihwmRaHWyXV5 IMq1gzh7iwNVWBeY X-Received: by 10.28.60.6 with SMTP id j6mr6466651wma.19.1492967423203; Sun, 23 Apr 2017 10:10:23 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id 58sm2803521edz.2.2017.04.23.10.10.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Apr 2017 10:10:22 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 49/79] ARM: KVM: Convert KVM to use HVC_GET_VECTORS Date: Sun, 23 Apr 2017 19:08:59 +0200 Message-Id: <20170423170929.27334-50-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170423170929.27334-1-cdall@linaro.org> References: <20170423170929.27334-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170423_101046_047713_B0BA4BF3 X-CRM114-Status: GOOD ( 13.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Christoffer Dall , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marc Zyngier The conversion of the HYP stub ABI to something similar to arm64 left the KVM code broken, as it doesn't know about the new stub numbering. Let's move the various #defines to virt.h, and let KVM use HVC_GET_VECTORS. Tested-by: Keerthy Acked-by: Russell King Acked-by: Catalin Marinas Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/include/asm/virt.h | 8 ++++++++ arch/arm/kernel/hyp-stub.S | 4 ---- arch/arm/kvm/hyp/hyp-entry.S | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/arch/arm/include/asm/virt.h b/arch/arm/include/asm/virt.h index 6dae195..4ea16fc 100644 --- a/arch/arm/include/asm/virt.h +++ b/arch/arm/include/asm/virt.h @@ -94,6 +94,14 @@ extern char __hyp_text_start[]; extern char __hyp_text_end[]; #endif +#else + +/* Only assembly code should need those */ + +#define HVC_GET_VECTORS 0 +#define HVC_SET_VECTORS 1 +#define HVC_SOFT_RESTART 2 + #endif /* __ASSEMBLY__ */ #endif /* ! VIRT_H */ diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S index 8291523..8301db9 100644 --- a/arch/arm/kernel/hyp-stub.S +++ b/arch/arm/kernel/hyp-stub.S @@ -22,10 +22,6 @@ #include #include -#define HVC_GET_VECTORS 0 -#define HVC_SET_VECTORS 1 -#define HVC_SOFT_RESTART 2 - #ifndef ZIMAGE /* * For the kernel proper, we need to find out the CPU boot mode long after diff --git a/arch/arm/kvm/hyp/hyp-entry.S b/arch/arm/kvm/hyp/hyp-entry.S index 96beb53..1f8db7d 100644 --- a/arch/arm/kvm/hyp/hyp-entry.S +++ b/arch/arm/kvm/hyp/hyp-entry.S @@ -127,7 +127,7 @@ hyp_hvc: pop {r0, r1, r2} /* Check for __hyp_get_vectors */ - cmp r0, #-1 + cmp r0, #HVC_GET_VECTORS mrceq p15, 4, r0, c12, c0, 0 @ get HVBAR beq 1f