From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D68BCA90AF for ; Wed, 13 May 2020 10:30:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D322206D6 for ; Wed, 13 May 2020 10:30:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="feaPsl6P" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732739AbgEMKat (ORCPT ); Wed, 13 May 2020 06:30:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729731AbgEMKas (ORCPT ); Wed, 13 May 2020 06:30:48 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F261C061A0C for ; Wed, 13 May 2020 03:30:48 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id n5so12975560wmd.0 for ; Wed, 13 May 2020 03:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Bag3tcwUumhERwus8sd0P+tasr8YFyR1BtawoF6Jv0M=; b=feaPsl6PXU124jWtX3dAxdhE+71zs/uCFoegBNTyi5X4xrHvVm195995//fXp+PqCv bZjFrRwdqqAltQjGj+LEGmdB2M4LFIzNJiyL03Jlt8sIMAUlpNoCrt89NruDMkFjSfZD L2ZrhZ5A025g+OZzAClsEJCSgan0edGqEFBtkyb5dwVCwVXw2xbFrsUHhmbT3Cysxmlo j9qXbYdZyW+nxcOP0b8yHQl+bSw65rKtZUp8Rv7Zt5qxoYqpnKDfAmAfHTIe7SyQGKmy gySn77IU+kPf54X9nFVVLRVpCZrGXIN73Igvj0l6ULfFpCSQUhqDQE9EbgBMF5FyLbdS VE/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Bag3tcwUumhERwus8sd0P+tasr8YFyR1BtawoF6Jv0M=; b=hPMe0T+Hvzsj7EgNuD9NB07SeL5Uov6bL2NTuGl+yjklhFfSAXR51grueNgol5Gk7o Oz4lgX+tv7+Wk5MH5eV07wQpx6xIW5cSzcZoplLpCrorjmvHsvjXM+TxPJulrrg9d27F pSy2YCe0CW6JreIjy15RfkT+4zf/gCepqoqgNATil4B8Zcx104hw86B8bngwtRH1yTFM IMBrtzrsDOcNCW2M5RnbgKcvm1LierrfNaGQ7F7zuRW0UCLOVIQ8ZhRe/qpSVCebCFHn ViY33dnXSsSZvWXLmGGQQLXODkjQhhhbhmzjCmLRDfSyO8RgPsUHsFQd4OCz8XNc7GWa u7zQ== X-Gm-Message-State: AOAM530Mw/j0v0OxgY97IKQqq+rypW7nCPwapXwI2u9z+V328bT4flXC AS2s6j2f9mRfkw2iJy3Jr/OkUQ== X-Google-Smtp-Source: ABdhPJwieEag500N253ZjLYIuWDnNCr/RP0yjgHBqAOAFRcDDDnTfLgV5ev2GxXV9li2Vw8U//ZBMQ== X-Received: by 2002:a1c:7407:: with SMTP id p7mr5473936wmc.114.1589365846539; Wed, 13 May 2020 03:30:46 -0700 (PDT) Received: from dbrazdil-macbookpro.roam.corp.google.com ([2a01:4b00:8523:2d03:e021:170a:2079:28ea]) by smtp.gmail.com with ESMTPSA id 60sm3774269wrp.92.2020.05.13.03.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 03:30:43 -0700 (PDT) From: David Brazdil X-Google-Original-From: David Brazdil Date: Wed, 13 May 2020 11:30:41 +0100 To: Quentin Perret Cc: Marc Zyngier , David Brazdil , Catalin Marinas , James Morse , Julien Thierry , Suzuki K Poulose , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/15] arm64: kvm: Unify users of HVC instruction Message-ID: <20200513103041.ktaov2jws72itmag@dbrazdil-macbookpro.roam.corp.google.com> References: <20200430144831.59194-1-dbrazdil@google.com> <20200430144831.59194-2-dbrazdil@google.com> <878si3j13w.wl-maz@kernel.org> <20200507143633.GA169263@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200507143633.GA169263@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 07, 2020 at 03:36:33PM +0100, Quentin Perret wrote: > On Thursday 07 May 2020 at 15:01:07 (+0100), Marc Zyngier wrote: > > > /* > > > - * u64 __kvm_call_hyp(void *hypfn, ...); > > > + * u64 __kvm_call_hyp(unsigned long arg, ...); > > > * > > > * This is not really a variadic function in the classic C-way and care must > > > * be taken when calling this to ensure parameters are passed in registers > > > * only, since the stack will change between the caller and the callee. > > > - * > > > - * Call the function with the first argument containing a pointer to the > > > - * function you wish to call in Hyp mode, and subsequent arguments will be > > > - * passed as x0, x1, and x2 (a maximum of 3 arguments in addition to the > > > - * function pointer can be passed). The function being called must be mapped > > > - * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are > > > - * passed in x0. > > > - * > > > - * A function pointer with a value less than 0xfff has a special meaning, > > > - * and is used to implement hyp stubs in the same way as in > > > - * arch/arm64/kernel/hyp_stub.S. > > > > I don't think any of this becomes obsolete with this patch (apart from > > the reference to 32bit), and only changes with patch #2. Or am I > > misunderstanding something? > > Nope, I think you're right. To be fair, this patch has changed quite > a bit since the first version (which did change that comment a little > later IIRC), but David has done all the hard work on top so I'll let > him answer that one. They have a different meaning in the three different contexts: 1) hyp-stub HVC: hcall ID + 3 args 2) hyp-init HVC: 4 args (no hcall ID) 3) host HVC: function pointer + 3 args The patch was meant to have all three use the same HVC routine, eventually converging on host HVCs also using 'hcall ID + 3 args' in patch 02, but it is a bit forced at this point. I can drop this patch from the series and we can clean this up later if it still makes sense. > > And David, feel free to take the authorship for this patch -- I barely > recognize it (for the better), so it's more than fair if you get the > credit :) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77D6CCA90AF for ; Wed, 13 May 2020 10:30:53 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 0437E206CC for ; Wed, 13 May 2020 10:30:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="feaPsl6P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0437E206CC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 3C5444B259; Wed, 13 May 2020 06:30:52 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dccb2N0JdeS4; Wed, 13 May 2020 06:30:51 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 234AC4B243; Wed, 13 May 2020 06:30:51 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2BC284B241 for ; Wed, 13 May 2020 06:30:49 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Jnl3yuCi+wXp for ; Wed, 13 May 2020 06:30:48 -0400 (EDT) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 06B664B240 for ; Wed, 13 May 2020 06:30:48 -0400 (EDT) Received: by mail-wm1-f68.google.com with SMTP id k12so25934668wmj.3 for ; Wed, 13 May 2020 03:30:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Bag3tcwUumhERwus8sd0P+tasr8YFyR1BtawoF6Jv0M=; b=feaPsl6PXU124jWtX3dAxdhE+71zs/uCFoegBNTyi5X4xrHvVm195995//fXp+PqCv bZjFrRwdqqAltQjGj+LEGmdB2M4LFIzNJiyL03Jlt8sIMAUlpNoCrt89NruDMkFjSfZD L2ZrhZ5A025g+OZzAClsEJCSgan0edGqEFBtkyb5dwVCwVXw2xbFrsUHhmbT3Cysxmlo j9qXbYdZyW+nxcOP0b8yHQl+bSw65rKtZUp8Rv7Zt5qxoYqpnKDfAmAfHTIe7SyQGKmy gySn77IU+kPf54X9nFVVLRVpCZrGXIN73Igvj0l6ULfFpCSQUhqDQE9EbgBMF5FyLbdS VE/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Bag3tcwUumhERwus8sd0P+tasr8YFyR1BtawoF6Jv0M=; b=aAbr/jNItmEHKohBnI20Zq1RGu1wthGl8qxE08QDj814nojL1y/1l7q/bb0jWs2HGx mlNxn7MKial5cu1MqEtRo6iyd3mguYUyxw5RR/9EMc5mAfx1vcXVgRmf+68EoSBCfG4q Ld/1j4orvJC+9I69Ntzs4w1xdtBxoPrQ7jTDOv/5vqSV15yBke5LPx/qghUDYiJ71HTm V+lU97zVpHZITi2sAtm7/YjF3tDt42MO1WxdrqSS87d08ZXO7bKw4Q/p4uzVp1C8N3GQ nSr3+9d8rwBxSHYZ93Ae8aBtURV1cgmCeODjd9veXYKMQmQYnPYORCsygZx2/PnJPNyb g6gA== X-Gm-Message-State: AOAM533C6NehemkctNgoKfjKmlqNT5TF7eSg8hXHU9R17w0RkZQD9ixL D9LhwQpaJmyNAFowLCOAY3EBgw== X-Google-Smtp-Source: ABdhPJwieEag500N253ZjLYIuWDnNCr/RP0yjgHBqAOAFRcDDDnTfLgV5ev2GxXV9li2Vw8U//ZBMQ== X-Received: by 2002:a1c:7407:: with SMTP id p7mr5473936wmc.114.1589365846539; Wed, 13 May 2020 03:30:46 -0700 (PDT) Received: from dbrazdil-macbookpro.roam.corp.google.com ([2a01:4b00:8523:2d03:e021:170a:2079:28ea]) by smtp.gmail.com with ESMTPSA id 60sm3774269wrp.92.2020.05.13.03.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 03:30:43 -0700 (PDT) From: David Brazdil X-Google-Original-From: David Brazdil Date: Wed, 13 May 2020 11:30:41 +0100 To: Quentin Perret Subject: Re: [PATCH 01/15] arm64: kvm: Unify users of HVC instruction Message-ID: <20200513103041.ktaov2jws72itmag@dbrazdil-macbookpro.roam.corp.google.com> References: <20200430144831.59194-1-dbrazdil@google.com> <20200430144831.59194-2-dbrazdil@google.com> <878si3j13w.wl-maz@kernel.org> <20200507143633.GA169263@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200507143633.GA169263@google.com> Cc: Marc Zyngier , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , kvmarm@lists.cs.columbia.edu X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Thu, May 07, 2020 at 03:36:33PM +0100, Quentin Perret wrote: > On Thursday 07 May 2020 at 15:01:07 (+0100), Marc Zyngier wrote: > > > /* > > > - * u64 __kvm_call_hyp(void *hypfn, ...); > > > + * u64 __kvm_call_hyp(unsigned long arg, ...); > > > * > > > * This is not really a variadic function in the classic C-way and care must > > > * be taken when calling this to ensure parameters are passed in registers > > > * only, since the stack will change between the caller and the callee. > > > - * > > > - * Call the function with the first argument containing a pointer to the > > > - * function you wish to call in Hyp mode, and subsequent arguments will be > > > - * passed as x0, x1, and x2 (a maximum of 3 arguments in addition to the > > > - * function pointer can be passed). The function being called must be mapped > > > - * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are > > > - * passed in x0. > > > - * > > > - * A function pointer with a value less than 0xfff has a special meaning, > > > - * and is used to implement hyp stubs in the same way as in > > > - * arch/arm64/kernel/hyp_stub.S. > > > > I don't think any of this becomes obsolete with this patch (apart from > > the reference to 32bit), and only changes with patch #2. Or am I > > misunderstanding something? > > Nope, I think you're right. To be fair, this patch has changed quite > a bit since the first version (which did change that comment a little > later IIRC), but David has done all the hard work on top so I'll let > him answer that one. They have a different meaning in the three different contexts: 1) hyp-stub HVC: hcall ID + 3 args 2) hyp-init HVC: 4 args (no hcall ID) 3) host HVC: function pointer + 3 args The patch was meant to have all three use the same HVC routine, eventually converging on host HVCs also using 'hcall ID + 3 args' in patch 02, but it is a bit forced at this point. I can drop this patch from the series and we can clean this up later if it still makes sense. > > And David, feel free to take the authorship for this patch -- I barely > recognize it (for the better), so it's more than fair if you get the > credit :) _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCDC4C2D0FA for ; Wed, 13 May 2020 10:36:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A1E16206CC for ; Wed, 13 May 2020 10:36:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SfiP0YPF"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="feaPsl6P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1E16206CC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KVufMTrjsk1V0npo4/SoCOA//rh0iBS4UGLl0lSXscc=; b=SfiP0YPFZMj440 WcWInHi6enWpJq5L9RMam7JSy4oAM03aE9BOR19UrHbU0Og6Rpu3gAcv+jqut+RzAOprxsQXx4au6 RmewCWt4OJNE04d3NVquCg9nWPs88mm2jCthE5eRRsAzCpEllnFxMcAieFYUy/BBct8HfZeE1iGtD RTn1X05JZbt8xE73uLrEi1dwTK8sGZiFbn02iJMZQTlZ0q0PbRrWAuVSRraGapDuoOTRkzaO6ps0E eI1CIdpXfcZR68l1GP1fJhZTVPMmmkd3r4p107UvXFeYVKYFu8Uz3Ti3N7MSCRvJV0xMfWxWQ8efK 47mRsdccNzuAuUBj+ZlA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYohd-0007db-Kz; Wed, 13 May 2020 10:33:29 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYof6-0005T5-A1 for linux-arm-kernel@lists.infradead.org; Wed, 13 May 2020 10:30:54 +0000 Received: by mail-wm1-x343.google.com with SMTP id w19so13115439wmc.1 for ; Wed, 13 May 2020 03:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Bag3tcwUumhERwus8sd0P+tasr8YFyR1BtawoF6Jv0M=; b=feaPsl6PXU124jWtX3dAxdhE+71zs/uCFoegBNTyi5X4xrHvVm195995//fXp+PqCv bZjFrRwdqqAltQjGj+LEGmdB2M4LFIzNJiyL03Jlt8sIMAUlpNoCrt89NruDMkFjSfZD L2ZrhZ5A025g+OZzAClsEJCSgan0edGqEFBtkyb5dwVCwVXw2xbFrsUHhmbT3Cysxmlo j9qXbYdZyW+nxcOP0b8yHQl+bSw65rKtZUp8Rv7Zt5qxoYqpnKDfAmAfHTIe7SyQGKmy gySn77IU+kPf54X9nFVVLRVpCZrGXIN73Igvj0l6ULfFpCSQUhqDQE9EbgBMF5FyLbdS VE/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Bag3tcwUumhERwus8sd0P+tasr8YFyR1BtawoF6Jv0M=; b=VnNfik3elx1iWvIvcgpyI8lBkf/UO26iB1SvlLl3D6EkiDLLP65wevqeePZTqU5l+4 NVFuQfcwnrmSExoajDhhiDTKo4YJmNHnvfYjFe8b3w0A00HWPDC7lNRBA2XW14WfW053 L5e/J4lHrh5fo2ubZgP1q14BgpHg3a/XStI9idqxkZXKjw1GTHGHjT4SxGyWeUJYDi94 J6C/8giRFaXZl/f7c7mHqUc0RLbJBi0SRaoydbl/h+AmtHhR4Ng87EjMW8DjiVs7aWb3 tY5w8fDasSb2OOUQ9Obcq9gyPohOvo0pcbCS6NM8inguDFyEeLnZKxpCOFrOfu8Fpl7j b0ew== X-Gm-Message-State: AOAM530PBFIlTG5GV9yrvuTNIVWLGJf/0lKwepghN7oEQBbrCYR+vEYp WQPYxzWcJAkH4kpMANjJnVE5IA== X-Google-Smtp-Source: ABdhPJwieEag500N253ZjLYIuWDnNCr/RP0yjgHBqAOAFRcDDDnTfLgV5ev2GxXV9li2Vw8U//ZBMQ== X-Received: by 2002:a1c:7407:: with SMTP id p7mr5473936wmc.114.1589365846539; Wed, 13 May 2020 03:30:46 -0700 (PDT) Received: from dbrazdil-macbookpro.roam.corp.google.com ([2a01:4b00:8523:2d03:e021:170a:2079:28ea]) by smtp.gmail.com with ESMTPSA id 60sm3774269wrp.92.2020.05.13.03.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 03:30:43 -0700 (PDT) From: David Brazdil X-Google-Original-From: David Brazdil Date: Wed, 13 May 2020 11:30:41 +0100 To: Quentin Perret Subject: Re: [PATCH 01/15] arm64: kvm: Unify users of HVC instruction Message-ID: <20200513103041.ktaov2jws72itmag@dbrazdil-macbookpro.roam.corp.google.com> References: <20200430144831.59194-1-dbrazdil@google.com> <20200430144831.59194-2-dbrazdil@google.com> <878si3j13w.wl-maz@kernel.org> <20200507143633.GA169263@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200507143633.GA169263@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200513_033052_490805_B3473114 X-CRM114-Status: GOOD ( 23.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Suzuki K Poulose , Marc Zyngier , linux-kernel@vger.kernel.org, James Morse , linux-arm-kernel@lists.infradead.org, Catalin Marinas , David Brazdil , Will Deacon , kvmarm@lists.cs.columbia.edu, Julien Thierry Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, May 07, 2020 at 03:36:33PM +0100, Quentin Perret wrote: > On Thursday 07 May 2020 at 15:01:07 (+0100), Marc Zyngier wrote: > > > /* > > > - * u64 __kvm_call_hyp(void *hypfn, ...); > > > + * u64 __kvm_call_hyp(unsigned long arg, ...); > > > * > > > * This is not really a variadic function in the classic C-way and care must > > > * be taken when calling this to ensure parameters are passed in registers > > > * only, since the stack will change between the caller and the callee. > > > - * > > > - * Call the function with the first argument containing a pointer to the > > > - * function you wish to call in Hyp mode, and subsequent arguments will be > > > - * passed as x0, x1, and x2 (a maximum of 3 arguments in addition to the > > > - * function pointer can be passed). The function being called must be mapped > > > - * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are > > > - * passed in x0. > > > - * > > > - * A function pointer with a value less than 0xfff has a special meaning, > > > - * and is used to implement hyp stubs in the same way as in > > > - * arch/arm64/kernel/hyp_stub.S. > > > > I don't think any of this becomes obsolete with this patch (apart from > > the reference to 32bit), and only changes with patch #2. Or am I > > misunderstanding something? > > Nope, I think you're right. To be fair, this patch has changed quite > a bit since the first version (which did change that comment a little > later IIRC), but David has done all the hard work on top so I'll let > him answer that one. They have a different meaning in the three different contexts: 1) hyp-stub HVC: hcall ID + 3 args 2) hyp-init HVC: 4 args (no hcall ID) 3) host HVC: function pointer + 3 args The patch was meant to have all three use the same HVC routine, eventually converging on host HVCs also using 'hcall ID + 3 args' in patch 02, but it is a bit forced at this point. I can drop this patch from the series and we can clean this up later if it still makes sense. > > And David, feel free to take the authorship for this patch -- I barely > recognize it (for the better), so it's more than fair if you get the > credit :) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel