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=-13.3 required=3.0 tests=BAYES_00,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 921F0C43219 for ; Mon, 13 Sep 2021 16:51:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F0C560F36 for ; Mon, 13 Sep 2021 16:51:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240427AbhIMQxF (ORCPT ); Mon, 13 Sep 2021 12:53:05 -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-Google-Smtp-Source: ABdhPJxF0MJAT41gnQOnRX7DjWFM0GLtwxdoVZIW+Gw+fILuc0cKnD6bHktwWwOauF6yqJrWs2OzSb/bX+FogXn7Y8c= 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 >