From nobody Mon Feb 9 16:47:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1569339469; cv=none; d=zoho.com; s=zohoarc; b=PzyUw/xL93V5ixrbBPWAkSfYdz/R5digLhjCvH2ybmj2lGOhQJik24no0qQiE7FXjXcPespXuTaNu4qnWNSRlCAfdzU+oVEztH/F7wnSsdfSXzwyO9gnDmcwUg0P/BXoVLsfVTStTWCRFaUEKEMebF18FJmhwlSsvSdxss9GLY4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569339469; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=LMemZ/ho25Nyia6mX05qF81h1XJ6AkNPpi5zAW4ZYEM=; b=kv6ViEarGWMTgUf2+qfR8iI8EmtJ9KhtEtX7wsPLRQw8Irh6n9AmDFlVp8CxTdzt2+kSQiTFjtmGkeaLgUZORpM6IWDuUNaCGkms6uSRp43aLhEVAnEyjyVvXSM68KdCfWGKPoeQWQ4If4ZfiEJ16jo2jK/5O+ugdkBRNnmhnj0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569339469368412.7366421332472; Tue, 24 Sep 2019 08:37:49 -0700 (PDT) Received: from localhost ([::1]:47248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCmsr-0005jL-HT for importer@patchew.org; Tue, 24 Sep 2019 11:37:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48381) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCmfE-0001QJ-6H for qemu-devel@nongnu.org; Tue, 24 Sep 2019 11:23:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCmfC-0006o6-KC for qemu-devel@nongnu.org; Tue, 24 Sep 2019 11:23:39 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2176 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCmf4-0006hX-Hg; Tue, 24 Sep 2019 11:23:30 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 89D0CC4FB6F9F57E2490; Tue, 24 Sep 2019 23:23:27 +0800 (CST) Received: from linux-Bxxcye.huawei.com (10.175.104.222) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Tue, 24 Sep 2019 23:23:20 +0800 From: Heyi Guo To: , , , Subject: [RFC PATCH 09/12] linux-headers/kvm.h: add capability to forward hypercall Date: Tue, 24 Sep 2019 23:21:48 +0800 Message-ID: <1569338511-3572-10-git-send-email-guoheyi@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1569338511-3572-1-git-send-email-guoheyi@huawei.com> References: <1569338511-3572-1-git-send-email-guoheyi@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.104.222] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 45.249.212.190 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Peter Maydell , "Michael S. Tsirkin" , Marc Zyngier , Cornelia Huck , James Morse , Paolo Bonzini , Heyi Guo , wanghaibin.wang@huawei.com, Dave Martin Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" To keep backward compatibility, we add new KVM capability "KVM_CAP_FORWARD_HYPERCALL" to probe whether KVM supports forwarding hypercall to userspace. The capability should be enabled explicitly, for we don't want user space application to deal with unexpected hypercall exits. We also use an additional argument to pass exception bit mask, to request KVM to forward all hypercalls except the classes specified in the bit mask. Currently only PSCI can be set as exception, so that we can still keep consistent with the original PSCI processing flow. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: James Morse Cc: "Michael S. Tsirkin" Cc: Cornelia Huck Cc: Paolo Bonzini --- linux-headers/linux/kvm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 18892d6..20e8a68 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -711,6 +711,8 @@ struct kvm_enable_cap { __u8 pad[64]; }; =20 +#define KVM_CAP_FORWARD_HYPERCALL_EXCL_PSCI (1 << 0) + /* for KVM_PPC_GET_PVINFO */ =20 #define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0) @@ -995,6 +997,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_ARM_SVE 170 #define KVM_CAP_ARM_PTRAUTH_ADDRESS 171 #define KVM_CAP_ARM_PTRAUTH_GENERIC 172 +#define KVM_CAP_FORWARD_HYPERCALL 174 =20 #ifdef KVM_CAP_IRQ_ROUTING =20 --=20 1.8.3.1