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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 08025C636CD for ; Tue, 7 Feb 2023 13:28:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5g9IF+OMTDpAI3CvDHTZpWGMCTGcsI5vLjA7B0eOVbM=; b=4FQudunMKCcZ0g VLL7JERjTaj8Pe0Vihw1MvskSM35C4lfREQK89qWqnV+EMpg/0dI48F4bEB/10CM1iiwcxhJoEI7r 1CsNTcgKRVCdP8iiRtTFru/eAIS0kQPLfA0S6eMn3m0jK9qyNRE8MAMVm9p9mGtazmSLFYp2PL+v3 zL8yE3DB3kgFGPRcycHUQzDMBvA/4xxTzmMxgBRTfS2jd900e7IH0tClFhkt9JH4KyCz/E9r9LIag KOgZvceTrFhLeXS9QS2OZE2sMawZORm6cKwzh/UTw5pzdbNAvQcuG1FFBLOxewl1ypKKrJxuU/JSi ulmyL8IRXT10DLz6T9xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPO0V-00CHeA-3n; Tue, 07 Feb 2023 13:27:35 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPO0S-00CHdZ-EX for linux-arm-kernel@lists.infradead.org; Tue, 07 Feb 2023 13:27:33 +0000 Received: by mail-wm1-x330.google.com with SMTP id l37-20020a05600c1d2500b003dfe46a9801so9968946wms.0 for ; Tue, 07 Feb 2023 05:27:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=rJhiytKh63a2Q0Ih/4MzbnKZt6RxQbWjkc5IfouOZfs=; b=gZUl/q/IrBjT4+NNchJGC/9j7661ODQsEWoiN8mcIxVQ3uohgT9u5CQ6fj9ozdYkfX JFe6f+J3YeuYcIipg9phiWfhMw619XikEztoTe8mpR5vj3asxEGhlKDMyNUfG2W7M3By 8rNcNWKpZ1L104qpU/w8d3KH5gkjiPctLJPAgv4ckR7iHY/LZ8FjxBTE1H5Ak/4pXpL9 DktyE6nufnd1OcCl4IHgUNdGkSfKjDPZUrnPblZ7qaXAOpCst8y4BP2GnHilpYEEI+Qq pd6FxVP6WpcmPVNWZr0IdTOcAOuz6R8G36iH2QpNhtp0cFjE+SU74qtLMbh/llwuReMN bl2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rJhiytKh63a2Q0Ih/4MzbnKZt6RxQbWjkc5IfouOZfs=; b=rZIdleY5WV3CzHJjmytNxMKFxfjZr2nH8GhsxuXPPxfnU9JILIzrupztCVf03g5Hpm GDDbsEwire3N4qZ5uCdyVFagHwUG+FQAosjPs1VsaBiuFVMIWVkzMHumbsye20Dr76t+ 0ZZksH18XoaDD14MYCB+xUZW8FFYZKM9Dnz22OtbSoVTLtdzuxe18O786FikRMvh5tbD PfLLpShtSuN5uhxD/fPNDNYGldN0wsDQ7aXWKPQYP1GvOzNzjtT7pVAPwiq9w7Aym1KG bchVtaWg5nnu2TvX97eyJcFEI/++KXBqBbrRKM5zDpl+459HWWazusvpQXK4NULfqz6C 6ULw== X-Gm-Message-State: AO0yUKVk11CBmytrWcbGTiYw4t4Y1F2PpXw4SNNLEN3NRJpnuMlk41BC g9FtXdTQbAHmKn8bGt8Lo9w5aQ== X-Google-Smtp-Source: AK7set8ux4cP2Ybn/abiqHyZixmvKGdmZmX8C0T1Add8hEO97JsvL2S408J4ak5lR1f6nCjluGyEqQ== X-Received: by 2002:a05:600c:3b93:b0:3df:f3cb:e8ce with SMTP id n19-20020a05600c3b9300b003dff3cbe8cemr126692wms.7.1675776450905; Tue, 07 Feb 2023 05:27:30 -0800 (PST) Received: from google.com (44.232.78.34.bc.googleusercontent.com. [34.78.232.44]) by smtp.gmail.com with ESMTPSA id n9-20020a5d5989000000b002bc7fcf08ddsm11695324wri.103.2023.02.07.05.27.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Feb 2023 05:27:30 -0800 (PST) Date: Tue, 7 Feb 2023 13:27:17 +0000 From: Mostafa Saleh To: Jean-Philippe Brucker Cc: maz@kernel.org, catalin.marinas@arm.com, will@kernel.org, joro@8bytes.org, robin.murphy@arm.com, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, dbrazdil@google.com, ryan.roberts@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, iommu@lists.linux.dev Subject: Re: [RFC PATCH 42/45] KVM: arm64: pkvm: Support SCMI power domain Message-ID: References: <20230201125328.2186498-1-jean-philippe@linaro.org> <20230201125328.2186498-43-jean-philippe@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230201125328.2186498-43-jean-philippe@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230207_052732_511204_9DD30E9A X-CRM114-Status: GOOD ( 14.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Jean, > +bool kvm_host_scmi_handler(struct kvm_cpu_context *host_ctxt) > +{ > + DECLARE_REG(u64, func_id, host_ctxt, 0); > + > + if (!scmi_channel.shmem || func_id != scmi_channel.smc_id) > + return false; /* Unhandled */ > + > + /* > + * Prevent the host from modifying the request while it is in flight. > + * One page is enough, SCMI messages are smaller than that. > + * > + * FIXME: the host is allowed to poll the shmem while the request is in > + * flight, or read shmem when receiving the SCMI interrupt. Although > + * it's unlikely with the SMC-based transport, this too requires some > + * tightening in the spec. > + */ > + if (WARN_ON(__pkvm_host_add_remove_page(scmi_channel.shmem_pfn, true))) > + return true; > + > + __kvm_host_scmi_handler(host_ctxt); > + > + WARN_ON(__pkvm_host_add_remove_page(scmi_channel.shmem_pfn, false)); > + return true; /* Handled */ > +} I am not sure what a typical SCMI channel shmem_size would be. But would map/unmap be more performant than memcpy(hyp_local_copy,scmi_channel.pfn,scmi_channel.shmem_size ); ? Thank, Mostafa _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel