Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1743692ybn; Thu, 26 Sep 2019 01:19:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkJUrmLoBkvTp11BkoV5xhWjlKjiukJ40jXH/PjjvsSowttkKJR5GBABEjP0pBMKv5sDvv X-Received: by 2002:a05:6402:13cd:: with SMTP id a13mr2219098edx.6.1569485977610; Thu, 26 Sep 2019 01:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569485977; cv=none; d=google.com; s=arc-20160816; b=ZQC1VXcgr/IYkz4QhMeIJsAhUuKBaTrQ3/jZPDXqOUDoarhP34gHd+GbCQaIBaiFiO SjqZOzG1Zyc7XSeoJLetdIKbxtsp7IZsjSeZJEhLYvtcm8gpdanYFfHTSCy2wt7eaK2j v88P++pXqKgYJNEfdazocRDz6FmtEhQ28YrY53hcDN74mnj72RVsKTx9psj1ZN3doQWi 29ZGAEkKq0zDJvWoxZavs5sol1LzM7bEm2QTNotbZM43PcUe8WV8h4SloXEndLkzGFLN oVM1FDHEzg/DImfWA3mmQBlWH+gTnDzz81F3uI97Pot3Vcc5QfTocv6V8fFA/SDyFAOU 6ErQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=K19evHUiUHkaO5FBhqGL5o1nwS7Ou96O0gIFNabO/LE=; b=uGYUweGP+aoG9T8jdGiimK+n0XBU/pbqK/oGRBlxSZvtIweydpOPEPHtlRVXjGSgf5 W12NtIZ4N3tgaAZsb5haim6vwnWRoJBSMHeNKzT9DVUtgaRvXGaMMf+w6GA0npD1jw7/ DKi81H1U+MVKp3p9X/oj3MK10CVdXziYWzYalg+AtOE1Tl0NwQ9O5c7cFEnI55UoPd6k Ywd66bpnvntewSTkG1bTG9x8xLVfMXmjGCGUUuZHJDNP7F1EZ8FU/vN59gGg4Oak09cR jUXdT2ZgNnyX/vIDXulyHTsvUyiI7mmLP+5uvxO319OoOyCJsEDxV/TLLA/oahmK2eC1 V8XQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si616732eja.317.2019.09.26.01.19.14; Thu, 26 Sep 2019 01:19:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731931AbfIXPWV (ORCPT + 99 others); Tue, 24 Sep 2019 11:22:21 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:46512 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727382AbfIXPWV (ORCPT ); Tue, 24 Sep 2019 11:22:21 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 19DE9F71006A9E2A596B; Tue, 24 Sep 2019 23:22:19 +0800 (CST) Received: from linux-Bxxcye.huawei.com (10.175.104.222) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Tue, 24 Sep 2019 23:22:09 +0800 From: Heyi Guo To: , , , , CC: , Heyi Guo , Peter Maydell , Dave Martin , Marc Zyngier , Mark Rutland , James Morse Subject: [RFC PATCH 0/2] Add virtual SDEI support for arm64 Date: Tue, 24 Sep 2019 23:20:52 +0800 Message-ID: <1569338454-26202-1-git-send-email-guoheyi@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.104.222] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As promised, this is the first RFC patch set for arm64 virtual SDEI support. New kvm capability KVM_CAP_FORWARD_HYPERCALL is added to probe if kvm supports forwarding hypercalls, and the capability should be enabled explicitly. PSCI can be set as exception for backward compatibility. We reuse the existing term "hypercall" for SMC/HVC, as well as the hypercall structure in kvm_run to exchange arguments and return values. The definition on arm64 is as below: exit_reason: KVM_EXIT_HYPERCALL Input: nr: the immediate value of SMC/HVC calls; not really used today. args[6]: x0..x5 (This is not fully conform with SMCCC which requires x6 as argument as well, but use space can use GET_ONE_REG ioctl for such rare case). Return: args[0..3]: x0..x3 as defined in SMCCC. We need to extract args[0..3] and write them to x0..x3 when hypercall exit returns. And there is a corresponding patch set for qemu. Please give your comments and suggestions. Thanks, HG Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse Heyi Guo (2): kvm/arm: add capability to forward hypercall to user space kvm/arm64: expose hypercall_forwarding capability arch/arm/include/asm/kvm_host.h | 5 +++++ arch/arm64/include/asm/kvm_host.h | 5 +++++ arch/arm64/kvm/reset.c | 25 +++++++++++++++++++++++++ include/kvm/arm_psci.h | 1 + include/uapi/linux/kvm.h | 3 +++ virt/kvm/arm/arm.c | 2 ++ virt/kvm/arm/psci.c | 30 ++++++++++++++++++++++++++++-- 7 files changed, 69 insertions(+), 2 deletions(-) -- 1.8.3.1