Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C53D6C77B7D for ; Thu, 18 May 2023 09:09:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229911AbjERJJE convert rfc822-to-8bit (ORCPT ); Thu, 18 May 2023 05:09:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbjERJJD (ORCPT ); Thu, 18 May 2023 05:09:03 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7C161FD8 for ; Thu, 18 May 2023 02:08:52 -0700 (PDT) Received: from kwepemm600008.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4QMPJ01xSDzLmMn; Thu, 18 May 2023 17:07:28 +0800 (CST) Received: from lhrpeml500001.china.huawei.com (7.191.163.213) by kwepemm600008.china.huawei.com (7.193.23.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 18 May 2023 17:08:49 +0800 Received: from lhrpeml500001.china.huawei.com ([7.191.163.213]) by lhrpeml500001.china.huawei.com ([7.191.163.213]) with mapi id 15.01.2507.023; Thu, 18 May 2023 10:08:47 +0100 From: Salil Mehta To: Marc Zyngier , Oliver Upton CC: "kvmarm@lists.linux.dev" , "kvm@vger.kernel.org" , Paolo Bonzini , James Morse , Suzuki K Poulose , yuzenghui , Sean Christopherson Subject: RE: [PATCH v3 08/13] KVM: arm64: Add support for KVM_EXIT_HYPERCALL Thread-Topic: [PATCH v3 08/13] KVM: arm64: Add support for KVM_EXIT_HYPERCALL Thread-Index: AQHZZwvyoTfThYxWf0yKNVt4c9uQr68cQ2uAgABJ1QCAQm5ckIAAAwIAgADh0gCAAB5bIA== Date: Thu, 18 May 2023 09:08:46 +0000 Message-ID: <30eae0208b55463bb644c6700951d4b8@huawei.com> References: <20230404154050.2270077-1-oliver.upton@linux.dev> <20230404154050.2270077-9-oliver.upton@linux.dev> <87o7o26aty.wl-maz@kernel.org> <86pm8iv8tj.wl-maz@kernel.org> <86ilcqkqrf.wl-maz@kernel.org> In-Reply-To: <86ilcqkqrf.wl-maz@kernel.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.48.154.240] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Marc, > From: Marc Zyngier > Sent: Thursday, May 18, 2023 9:06 AM > To: Oliver Upton > Cc: Salil Mehta ; kvmarm@lists.linux.dev; > kvm@vger.kernel.org; Paolo Bonzini ; James Morse > ; Suzuki K Poulose ; yuzenghui > ; Sean Christopherson > Subject: Re: [PATCH v3 08/13] KVM: arm64: Add support for > KVM_EXIT_HYPERCALL > > On Wed, 17 May 2023 19:38:14 +0100, > Oliver Upton wrote: > > > > Hi Salil, > > > > On Wed, May 17, 2023 at 06:00:18PM +0000, Salil Mehta wrote: > > > > [...] > > > > > > > Should we expose the ESR, or at least ESR_EL2.IL as an additional > > > > > flag? > > > > > > > > > I think we would need "Immediate value" of the ESR_EL2 register in the > > > user-space/VMM to be able to construct the syndrome value. I cannot see > > > where it is being sent? > > > > The immediate value is not exposed to userspace, although by definition > > the immediate value must be zero. The SMCCC spec requires all compliant > > calls to use an immediate of zero (DEN0028E 2.9). > > > > Is there a legitimate use case for hypercalls with a nonzero immediate? > > They would no longer be considered SMCCC calls at that point, so they > > wouldn't work with the new UAPI. > > I agree. The use of non-zero immediate has long been deprecated. I > guess we should actually reject non-zero immediate for HVC just like > we do for SMC. Ok. Maybe I will hard code Immediate value as 0 to create a syndrome value at the VMM/Qemu and will also put a note stating non-zero immediate for HVC/SVC are not supported/deprecated. > If there is an actual need for a non-zero immediate to be propagated > to userspace (want to emulate Xen's infamous 'HVC #0xEA1'?), then this > should be an extension to the current API. Oh ok, then perhaps this new extension change should be simultaneously committed to avoid breaking Xen? Thanks Salil