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 BAB24C433FE for ; Tue, 18 Oct 2022 16:46:41 +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=Od0EvJpM2FLR0/9yRult56hPBht0llwVa58DXJtLgaM=; b=XyR/xkvLN/OiSK 76U5AU1TJAq5DZn2LrI5rNICk7cVTqIMz+q79+B9o6icCUGQd4Y9zlbKbovwcyMT/F/DXrP1jo2IQ 6RMHFYpBKgq7VYUZbxs2hFF+3uspVcNb5H/NRiUvly1RA2QQLyuu+alh/QHkWL7o0y1vl86Gl19H1 Px2ZEtUHD/7qP0P2QnhbybgEEnBVQ1BlLYP1SHo8ASS7e7lKOj0gfeRYQpAJo4QKfLOUKUlMKcsfl PXqKtLLMnS2SVLFyOe606xDBeJPR1gSpzww8BhZT70prkTjyyJYbPnq7WDk9/RKZQOzxuwqrtoIeG c56DHsxo/8H3E73DbhSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1okpih-0092CP-Pp; Tue, 18 Oct 2022 16:45:35 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1okpif-0092B6-OJ for linux-arm-kernel@lists.infradead.org; Tue, 18 Oct 2022 16:45:34 +0000 Received: by mail-ed1-x529.google.com with SMTP id g27so21345985edf.11 for ; Tue, 18 Oct 2022 09:45:31 -0700 (PDT) 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=OCJsHqR3fQYSgnggViyn3fMnrEwEtr4DogQg4RXYXfU=; b=OTRdidlgd4M+FwW6O5/QmVZjVoFUteHzrGjxAXNpavm6P0/bJ2oKKpVtri2Z7qkcWS 5JWQYnY7afyOrgZhzZHFjmw9efVV2gjkQeFaMP+fmwcjwuS82qAivOdVz5DIm0te1MzR Pwchuxk3ooNK3QdvuAjNh9l1YqcgHyan06709W1zjjCD+KSz3zjOVbT3bqFpQ2yp4hIC qbJxL5Oy7NcTMET5jxqyahqZNxTVKcYbOiWxUa0zcvNgixzWyb14gNlz2O+9P7yC8xtY EREtg4jooDmz6U6w/mtou9+3RUms1DMcQaOFJyWn+75HCVGcEWNWxCPIirthBvftBJoq VGaw== 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=OCJsHqR3fQYSgnggViyn3fMnrEwEtr4DogQg4RXYXfU=; b=Fri19Gf0/ARUGf6FHBWC0Kasjymor/crm3hLjrGynfhH4d9VqPI2Ysvdh7Sj+WIZKP pQ0JeQ7AcZib6+xWDciC6vHC+8b01/eZY4AYAnr1eT1RRKZeE/zRiu9Kls0FXRuvEyl6 SEGIUD5U3IAAdjQweGuC0lvbdBMho4WBPAFl7NnAIvNeszqVHPFYuGbsZeHDM0WKmbj/ 28YqS6S6kK4oLID7btA+E7ckm4AVSufPTJt1l9StpZS+bPZRWesmNotFD0rk+yMa0wIG oyUpJEnutQ3s83rN+2snBdhAYgmjBJoQssV1PFQ74habSVUHLGNW4tbEDjc1fiAeSrka DWHQ== X-Gm-Message-State: ACrzQf0eKsybLwsfYs5J3obei1bAEcuBQjQws749H0CVM2p4kWgj61bE zvWeteWKXy7pXYXQpXxPTcn1sA== X-Google-Smtp-Source: AMsMyM6I0P0S9DziDRNVM+YYRXKEEihJKzfSjWKlLw6I00yhLT/182go6gfMS7BANtRyQPharE/Otw== X-Received: by 2002:a05:6402:909:b0:435:a8b:5232 with SMTP id g9-20020a056402090900b004350a8b5232mr3457453edz.240.1666111529948; Tue, 18 Oct 2022 09:45:29 -0700 (PDT) Received: from google.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id hx15-20020a170906846f00b0074134543f82sm7856285ejc.90.2022.10.18.09.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 09:45:29 -0700 (PDT) Date: Tue, 18 Oct 2022 16:45:26 +0000 From: Quentin Perret To: Will Deacon Cc: kvmarm@lists.linux.dev, Sean Christopherson , Vincent Donnefort , Alexandru Elisei , Catalin Marinas , James Morse , Chao Peng , Suzuki K Poulose , Mark Rutland , Fuad Tabba , Oliver Upton , Marc Zyngier , kernel-team@android.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 12/25] KVM: arm64: Add infrastructure to create and track pKVM instances at EL2 Message-ID: References: <20221017115209.2099-1-will@kernel.org> <20221017115209.2099-13-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221017115209.2099-13-will@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221018_094533_809104_F647C120 X-CRM114-Status: GOOD ( 15.21 ) 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 On Monday 17 Oct 2022 at 12:51:56 (+0100), Will Deacon wrote: > +static int find_free_vm_table_entry(struct kvm *host_kvm) > +{ > + int i, ret = -ENOMEM; > + > + for (i = 0; i < KVM_MAX_PVMS; ++i) { > + struct pkvm_hyp_vm *vm = vm_table[i]; > + > + if (!vm) { > + if (ret < 0) > + ret = i; > + continue; > + } > + > + if (unlikely(vm->host_kvm == host_kvm)) { > + ret = -EEXIST; > + break; > + } That would be funny if the host passed the same struct twice, but do we care? If the host wants to shoot itself in the foot, it's not our problem I guess :) ? Also, we don't do the same check for vCPUs so ... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel