From patchwork Tue Jul 18 16:58:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jintack Lim X-Patchwork-Id: 9849139 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 E3844600CC for ; Tue, 18 Jul 2017 17:12:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C659D285BA for ; Tue, 18 Jul 2017 17:12:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9EB3285E2; Tue, 18 Jul 2017 17:12:15 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D697285BA for ; Tue, 18 Jul 2017 17:12:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751969AbdGRQ7r (ORCPT ); Tue, 18 Jul 2017 12:59:47 -0400 Received: from mail-it0-f48.google.com ([209.85.214.48]:37493 "EHLO mail-it0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751557AbdGRQ7n (ORCPT ); Tue, 18 Jul 2017 12:59:43 -0400 Received: by mail-it0-f48.google.com with SMTP id v127so6938745itd.0 for ; Tue, 18 Jul 2017 09:59:43 -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=+m5y/Wd5Rco9GT4iaOG3yHTn/eMhdoJikTUfbpTHXHo=; b=HuTsSxhGzInTtiQvYliXxXvhGgFh17twIY61+CA7ZJxETfMpqcY5SPfjj8lfQ9wHwE Z9y+7iaaUVG03AUKRRUdEE+sItPpPCP6fP1dz1y6W8Kx37iZAjhIVAsxLwsyCNlvmGv9 wNJ8gurhDwi00BzYpbd5Q5umXJdCOXmWCbE0Y= 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=+m5y/Wd5Rco9GT4iaOG3yHTn/eMhdoJikTUfbpTHXHo=; b=o8q2DyVIyfa6b9BZ4OotHZ4smAp/7Yg6zOyonLAjS/v5sjQfKCXQcmogwaHINzb4xs Tdr12bEYuVWSmX83KX3hXYigwe1djmx+KDDbQQQTmidkgq85R9jTrFY2qwxjB6OBmjWh sc3IVUjO7IfaeWrFgMJpXnMY07Hhqfe6WkTproi0k5ohXZmg2+oqy6TJSjWKgu0egMcg BmeWYiEuG6/rlAc/aZTpHlDh9cT1zg3Z5rfdhdHcFnDPJ+k8wJxHMN96vEi9pAstRj2B /aFreWELNhleAIhjYY22cZ0c1v8+5E493JHtd1clZUwSxGuWUyGHQVbszHiavHhcWliZ JXmA== X-Gm-Message-State: AIVw111v0oxg3HWwS7zfLLg8IRdhqAXvL0qj7mSV3FRXfExlckAkZ21Z XZHkoazXokmX07vy X-Received: by 10.36.204.9 with SMTP id x9mr3193748itf.5.1500397182705; Tue, 18 Jul 2017 09:59:42 -0700 (PDT) Received: from node.jintackl-qv26972.kvmarm-pg0.wisc.cloudlab.us (c220g1-030822.wisc.cloudlab.us. [128.104.222.82]) by smtp.gmail.com with ESMTPSA id j96sm1413075ioo.49.2017.07.18.09.59.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Jul 2017 09:59:42 -0700 (PDT) From: Jintack Lim To: kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com Cc: corbet@lwn.net, pbonzini@redhat.com, rkrcmar@redhat.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, akpm@linux-foundation.org, mchehab@kernel.org, cov@codeaurora.org, daniel.lezcano@linaro.org, david.daney@cavium.com, mark.rutland@arm.com, suzuki.poulose@arm.com, stefan@hello-penguin.com, andy.gross@linaro.org, wcohen@redhat.com, ard.biesheuvel@linaro.org, shankerd@codeaurora.org, vladimir.murzin@arm.com, james.morse@arm.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH v2 05/38] KVM: arm64: Allow userspace to set PSR_MODE_EL2x Date: Tue, 18 Jul 2017 11:58:31 -0500 Message-Id: <1500397144-16232-6-git-send-email-jintack.lim@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500397144-16232-1-git-send-email-jintack.lim@linaro.org> References: <1500397144-16232-1-git-send-email-jintack.lim@linaro.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Christoffer Dall We were not allowing userspace to set a more privileged mode for the VCPU than EL1, but now that we support nesting with a virtual EL2 mode, do allow this! Signed-off-by: Christoffer Dall --- arch/arm64/kvm/guest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index 5c7f657..5e673ae 100644 --- a/arch/arm64/kvm/guest.c +++ b/arch/arm64/kvm/guest.c @@ -117,6 +117,8 @@ static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) case PSR_MODE_EL0t: case PSR_MODE_EL1t: case PSR_MODE_EL1h: + case PSR_MODE_EL2h: + case PSR_MODE_EL2t: break; default: err = -EINVAL;