Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp840015pxb; Sun, 12 Sep 2021 00:17:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvop9z3ErB4hk2nkRrN7Ht9LDTGAzlOIyxfQhpIZwILgFXd3DXQqmc6j1AGEVxGYzjtxMj X-Received: by 2002:aa7:d99a:: with SMTP id u26mr6634649eds.320.1631431054037; Sun, 12 Sep 2021 00:17:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631431054; cv=none; d=google.com; s=arc-20160816; b=ow1XYBG/tv4HHX3a9Hf18KC4iNeArfo/7rwzQ4FTI+pBOANzCS0eVNW81j2lFMEIka PQ3MWIRvxl3ysRLJxPdIWEURQ2owgXHz670np+LEvXQdgb3wfuM5SF2Hr1umHVVaMSO+ XMFk0fTyasiDtz7HLx0IpWhqVzXcYoEFqLawKG0euSIVhDvPKuCPtav55p3A0+5JIybp /ciR6yQgfgIF22pteAk2j84HZjX/QyDICpelUUFI2BwPuDT0atrGdr8W6PV923hSqy+e A5CZ7/5oh9RsbkXByI5JtSI0UUzGGXzRvZh9kPMZCHvH/asMcn9hanX70OSa7tWo6DTf 30TQ== 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=QNpLnODXD3KMtIbZW9KjXBpb07wZf63uyRmwVpvp6IQ=; b=X4AplPfpGLblaIwECczTX70UI/SGQO6KTjftao4hVuHhg/rGzFirLKNf2vdT/B2/tS Im7Qx7RIqrvRAwedje/r9NW/Yfw0ijeUMxecn6qh9uaIBSa3XJA+XLw+z099iXLehFWN 2Ii+5Xb7aLiTWGBoWvqDJOE7LzsbjlpCSgMRjSxfu4G18sOg6L0OdvdeCxCfyDEkC8ac N2D6YMinF/ZxzmUfWF3VNal2UseIDwX9FMitaW2NwohOUu+cHBgJsoFcSqsWMSE6PMfd dbgbQQv0tBQIsMb2R395nd3TspS3DrjWeyScOfVJ3GMoaoS5sYOmjaCHQI//eT96zzPq szUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=KS9b8sBM; 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 by9si3929712edb.468.2021.09.12.00.16.43; Sun, 12 Sep 2021 00:17:34 -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=KS9b8sBM; 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 S230421AbhILHGx (ORCPT + 99 others); Sun, 12 Sep 2021 03:06:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229540AbhILHGw (ORCPT ); Sun, 12 Sep 2021 03:06:52 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06B55C061757 for ; Sun, 12 Sep 2021 00:05:38 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id t20so4126056pju.5 for ; Sun, 12 Sep 2021 00:05:38 -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=QNpLnODXD3KMtIbZW9KjXBpb07wZf63uyRmwVpvp6IQ=; b=KS9b8sBMavB5IM/KGnAEWQlq7rcYa7fBiZ5xKnoY5Mef+At1q0wBN1hS5AW3dW2KDO ltQOtyijdPz/7V6QMRljKwGSuEFjsbpJMI6YxmWvpOAves6kHDJWe21DjFj3blFFVBBE NcAhkl+fdkP1Ww5MHqA9WYZ/SF6fwCG5QXN8cmxHVvPgFGWRWHivy4WoHgh54LuOrNo3 RSwPItRUJ7XTMyUztTyG/md/pUYZ/siRmme/3DH8RLknVR7UfxtItclIvSa+P6X7KNu3 n9A0utp4LeyUrBdIQIBFpsm3QKkjqS5IdCUiD4LyoFRHpwUsJQsAmJDslrNJ0et7xf9T SUQg== 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=QNpLnODXD3KMtIbZW9KjXBpb07wZf63uyRmwVpvp6IQ=; b=L+lYL/zoBUiXNStb0jfUq32DuS6c5tto7aqCxcSgUagpiaNVK6Nlub78Otvd79gwm6 u++K2ETL+QpDjq5IFZVj58OM1wW3d5Cu8h75sRj9edhvlEQOuibUrJL8lF++kQ0nkxKz ha7OYsy5cwVU+tXaSfx/SVC3i/PG3g5Wf6fmPYCe14fLIY6gxTh2K1GJFm0PiP/hMRPQ aOKEnfbLtND2Ae6HHhvNmmN5emXBisk2qgfj+7sNjkLSEAhM5kFvlvKH5UubNVk+E8xo HXAJ8tl8sCeG/0rm/p5XCkllN9ppmGv/sl02B1i1zYBdEcRW04XoG9mzlcgO4XDw4W29 sqfQ== X-Gm-Message-State: AOAM533YO96METeCWW9pX8xURue9WWYIUAlVYKxSCT26GYfEuBLt/250 ZAUBegmUgSkElZGAyn2Qu2pI1eLsHsoZeplnajLUbQ== X-Received: by 2002:a17:902:654c:b0:13a:5661:3d33 with SMTP id d12-20020a170902654c00b0013a56613d33mr5222572pln.40.1631430338122; Sun, 12 Sep 2021 00:05:38 -0700 (PDT) MIME-Version: 1.0 References: <20210909013818.1191270-1-rananta@google.com> <20210909013818.1191270-10-rananta@google.com> In-Reply-To: <20210909013818.1191270-10-rananta@google.com> From: Reiji Watanabe Date: Sun, 12 Sep 2021 00:05:22 -0700 Message-ID: Subject: Re: [PATCH v4 09/18] KVM: arm64: selftests: Add guest support to get the vcpuid To: Raghavendra Rao Ananta Cc: Paolo Bonzini , Marc Zyngier , Andrew Jones , 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 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. Thanks, Reiji