Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp227743pxb; Mon, 13 Sep 2021 17:44:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5tNBnhqEmeCUpeFXxevgXnFxZrIskbFXgnn/zyoofCUP+Lykm5wbIldft6DC5FUkGlAgC X-Received: by 2002:a05:6e02:214e:: with SMTP id d14mr9429662ilv.142.1631580242105; Mon, 13 Sep 2021 17:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631580242; cv=none; d=google.com; s=arc-20160816; b=0jupPst16gzu4RoG3U64MCM0DeGKACLDiRi8IvcaFKCS3U4Ot5mOmJ5tFsrfulpgkU KOVylII+Ib47Xf50orayiQQ6vDpSdIdB1x+fPql8Zxa1Iz0Z9WJN0rpkU0LZ0L70DoTb QR9WNO458vxhZmzlGgqjYDQ2ZdQA0g4TSbZDpJ9OeEwuT5EQhUerhmqGhP+Pqas2S9SA SxV+p+G5cbZgWVEpjtv6hR88t7nQaEX0IAFPq9LKO7GTM7L1GAUQ3J/+CZRrxSiaamEZ T2GN6YJPxxgum4cxo8wSu/VGyGSQiYzQLaf5aVG2ytEhbAHZnJH/6OiSULjqr4CmyWGZ /+MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3/SIYclYJBA8R/7MLXxAd/hpBEuATYrK81iK2vA0aLI=; b=B3UAisj2qTAwv3aYZlZmyvkV7YADtX3LB9yIlbORGW8ydEoe2svU3D144TxOWWnzwZ zwbiZiPtbyAhS9N98r89+J3PeWomb4N1IQTUA5VulLGtt/inH1uk4kioS8ChGmIzFBsv 2/cxXpcnrL6NRbaOiy1bRn5PP/5YvTSycK00LTIzF72mZ9Kawbp7nB/xh9l9PbPZeEy2 tS5tTA+LT0xvP+wC0rMIAeU0Jy5wqC6LIltO0ZF/0zDmvekRvKQxstVjBGojTdzALxy1 3C5C5dVis6nBIi5fT+XOp+mBGweb9KbrjRKncuJsDvPdPvedPxZDOtViD4k61/r1y1lq ujfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=UaGSj5rF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e16si8749634ilm.91.2021.09.13.17.43.51; Mon, 13 Sep 2021 17:44:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=UaGSj5rF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240407AbhIMQxE (ORCPT + 99 others); Mon, 13 Sep 2021 12:53:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240306AbhIMQxD (ORCPT ); Mon, 13 Sep 2021 12:53:03 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 000ADC061760 for ; Mon, 13 Sep 2021 09:51:47 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id y13so21876146ybi.6 for ; Mon, 13 Sep 2021 09:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3/SIYclYJBA8R/7MLXxAd/hpBEuATYrK81iK2vA0aLI=; b=UaGSj5rF9TV4TbKEczi4abu9Nvmk3QFlrNsZ94RkSIZo5XRGdw1+Yp8wU1bW9ZIKU7 qVYpBNuU+BqPWj1VV0lFT/GWawzyPNcOXttDDmhFRg+yEyIx+9mPVAx48lK+heY3iA3U HfCW9WvnXI6sbmUfIeRc2nkS12QocvHXtxiMMfataHdNLwYk/dbbfasez2yumAPudGYC n/k5QceOvkIZ5XWqkUBFnHcWLXjV0SJXVTJO0j+H5/1iEevGYv+hiF5UfvY0YT6vNala zKfQdTpdroaT4Tu5XUNzVCE60Q3x49dFineIsNw6rXKH899hYBUZPrQ4vrEEBC5tbuni gB4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3/SIYclYJBA8R/7MLXxAd/hpBEuATYrK81iK2vA0aLI=; b=s9ZgBJiRXNGMXgNKh+xywpKsT09IZKogBrC2ClJkEM1kX0KU6hy3qJXa8EkFTuIYU1 qRQHZndEGouTRMnF9FDbiuJ+BWIVJHcMC7+DfzKcN6puZL1lJY8XK0gZCNlGRgw7LBN8 8IYa+87c9cC/MNnd1xxHu+rVQFCjyFbnvWQEBZqgqJs6pB3mxuv1cg6eAF7EYUL0op1+ xq3oyZ4gQJ6ea7rH8AwR5J5Ci20NQwyQ7gYgez1oq3f2AKc3+fOEkpbxhkPc13aXjgjv 066z941b6kIxq2TxhIoJTQy7NZ++yUu4nCvIQe8hOzpqMFbBVv9uln8o0VHYGJsKTfZE Ik7A== X-Gm-Message-State: AOAM532ndKPEj6zBfWdVZxrBYnRqLndtfoP5ttQtYgfkQOUUAlTa0K14 0sULh98df51TNyhKqBPBM6YoF9J5fhzZSTg3w+Q17Q== X-Received: by 2002:a25:50c7:: with SMTP id e190mr17068088ybb.439.1631551907001; Mon, 13 Sep 2021 09:51:47 -0700 (PDT) MIME-Version: 1.0 References: <20210909013818.1191270-1-rananta@google.com> <20210909013818.1191270-10-rananta@google.com> <20210913073512.x774i5hi3s4wmopx@gator.home> In-Reply-To: <20210913073512.x774i5hi3s4wmopx@gator.home> From: Raghavendra Rao Ananta Date: Mon, 13 Sep 2021 09:51:35 -0700 Message-ID: Subject: Re: [PATCH v4 09/18] KVM: arm64: selftests: Add guest support to get the vcpuid To: Andrew Jones Cc: Reiji Watanabe , Paolo Bonzini , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , Peter Shier , Ricardo Koller , Oliver Upton , Jing Zhang , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 13, 2021 at 12:35 AM Andrew Jones wrote: > > On Sun, Sep 12, 2021 at 12:05:22AM -0700, Reiji Watanabe wrote: > > Hi Raghu and all, > > > > On Wed, Sep 8, 2021 at 6:38 PM Raghavendra Rao Ananta > > wrote: > > > > > > At times, such as when in the interrupt handler, the guest wants > > > to get the vcpuid that it's running on. As a result, introduce > > > get_vcpuid() that returns the vcpuid of the calling vcpu. At its > > > backend, the VMM prepares a map of vcpuid and mpidr during VM > > > initialization and exports the map to the guest for it to read. > > > > How about using TPIDR_EL1 to hold the vcpuid ? > > i.e. have aarch64_vcpu_setup() set the register to vcpuid and > > guest_get_vcpuid() simply return a value of the register. > > This would be a simpler solution to implement. > > That is a great suggestion. It's arch-specific, but maybe the > other architectures can mimic it with their own capabilities. > And, in the unlikely event a unit test wants that register for > itself, then it can build its own mpidr-vcpuid map if necessary. > Ship it :-) > Thanks for the suggestion, Reiji. I'll send out a patch soon for this. Regards, Raghavendra > Thanks, > drew >