Message ID | 20230127113932.166089-25-suzuki.poulose@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp787771wrn; Fri, 27 Jan 2023 03:45:20 -0800 (PST) X-Google-Smtp-Source: AK7set/OYuPSDlc/TP+Mhp2aRVB8Lo0MwFaXyzorZ1PzvcLqKk750BmFqsJNVPNFRFs9eyXPhzc5 X-Received: by 2002:a05:6a20:6985:b0:bb:a0a2:c37a with SMTP id t5-20020a056a20698500b000bba0a2c37amr18272102pzk.33.1674819920146; Fri, 27 Jan 2023 03:45:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674819920; cv=none; d=google.com; s=arc-20160816; b=VsZ9RYocwPw2PMZY3InU9oIU3RQhNihpvUgewJh4UR6xMxYHJjFNIJMKmpIq1SYDT6 WBf48zlZ/wFyFZnQcpMbC3WZGEPW3+7G9aO0zFOY/N+G1ivBj1Wyj47rdaH0/fRv0kYr kTTOrmE6dUz7rosBcb3BYZT0RXvR68eXCGh2v2Iq+KxnPtYxxpRxe9sTF9xI+eKmW0zf +PoaZ2Sa2FcPNFTULC1PujuaEGsiAGtyVFl5e8HldZI/+WKR6wfg+ilviwSCOl3yR77h rXuK9475txQUh8tbFn39a9/Ytm3ZqvZMMjaYKOF9N/JwR9/34+RGSWWqLBOXhDmf3yOe OP9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8cm6MleZ69lmQ7FeZNj6PGM0Ua1vGF08LWBV7bp3DOk=; b=iB+TTcLfEM8cYJMgZYsh1o5BbQ2i57NzlHGqx2CNdHz8yddBbz4e9THjkflumGrBRB cCCyihYU//2gYFhuye0iEnjDvOYWY5CUIHI9ZcTFZyjPw4LwHG8CFyMoj2L4xovV8/U6 qPP0fBzC3qJCdi6Tdoe58uVGZHnnmwLC3stlLkC3MFa+p4MeOq/MJYPlfhD5x/59U50f i/qqobS93nX29bnuQz4kMv33ndTSoy3lqitvJMdomTjQNLzwnJbDU4cTKKhUI8/Z6oz1 aHc28B7ei+Whj/UzWvUANrbVfT+2uJ9+6S8HOB5INEx9ux39APZEkZhAwQGS/iaY2s/j OmDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k27-20020aa7973b000000b0058d9266a507si4304167pfg.376.2023.01.27.03.45.07; Fri, 27 Jan 2023 03:45:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231663AbjA0Lm2 (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Fri, 27 Jan 2023 06:42:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233825AbjA0Llp (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 27 Jan 2023 06:41:45 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 00A527AE7F; Fri, 27 Jan 2023 03:41:10 -0800 (PST) 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 4B9CB1762; Fri, 27 Jan 2023 03:41:39 -0800 (PST) Received: from ewhatever.cambridge.arm.com (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B8BF43F8D6; Fri, 27 Jan 2023 03:40:54 -0800 (PST) From: Suzuki K Poulose <suzuki.poulose@arm.com> To: kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: suzuki.poulose@arm.com, Alexandru Elisei <alexandru.elisei@arm.com>, Andrew Jones <andrew.jones@linux.dev>, Christoffer Dall <christoffer.dall@arm.com>, Fuad Tabba <tabba@google.com>, Jean-Philippe Brucker <jean-philippe@linaro.org>, Joey Gouly <Joey.Gouly@arm.com>, Marc Zyngier <maz@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Oliver Upton <oliver.upton@linux.dev>, Paolo Bonzini <pbonzini@redhat.com>, Quentin Perret <qperret@google.com>, Steven Price <steven.price@arm.com>, Thomas Huth <thuth@redhat.com>, Will Deacon <will@kernel.org>, Zenghui Yu <yuzenghui@huawei.com>, linux-coco@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFC kvmtool 24/31] arm64: Don't try to debug a realm Date: Fri, 27 Jan 2023 11:39:25 +0000 Message-Id: <20230127113932.166089-25-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230127113932.166089-1-suzuki.poulose@arm.com> References: <20230127112248.136810-1-suzuki.poulose@arm.com> <20230127113932.166089-1-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756175972719225429?= X-GMAIL-MSGID: =?utf-8?q?1756175972719225429?= |
Series |
arm64: Support for Arm Confidential Compute Architecture
|
|
Commit Message
Suzuki K Poulose
Jan. 27, 2023, 11:39 a.m. UTC
From: Alexandru Elisei <alexandru.elisei@arm.com> Don't read the register values for a running realm, because they don't reflect the actual hardware state of a realm. And don't try to read realm memory, because that will promptly lead to kvmtool being killed. Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> --- arm/aarch64/kvm-cpu.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arm/aarch64/kvm-cpu.c b/arm/aarch64/kvm-cpu.c index 32fa7609..a29a3413 100644 --- a/arm/aarch64/kvm-cpu.c +++ b/arm/aarch64/kvm-cpu.c @@ -250,6 +250,9 @@ void kvm_cpu__show_code(struct kvm_cpu *vcpu) reg.addr = (u64)&data; + if (vcpu->kvm->cfg.arch.is_realm) + return; + dprintf(debug_fd, "\n*pc:\n"); reg.id = ARM64_CORE_REG(regs.pc); if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, ®) < 0) @@ -274,6 +277,11 @@ void kvm_cpu__show_registers(struct kvm_cpu *vcpu) reg.addr = (u64)&data; dprintf(debug_fd, "\n Registers:\n"); + if (vcpu->kvm->cfg.arch.is_realm) { + dprintf(debug_fd, " UNACCESSIBLE\n"); + return; + } + reg.id = ARM64_CORE_REG(regs.pc); if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, ®) < 0) die("KVM_GET_ONE_REG failed (pc)");