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.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 D7A36C432BE for ; Wed, 1 Sep 2021 21:29:49 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 4F56861054 for ; Wed, 1 Sep 2021 21:29:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4F56861054 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id D634C4B129; Wed, 1 Sep 2021 17:29:48 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ouwsWKX5LETO; Wed, 1 Sep 2021 17:29:45 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 07F4E4B134; Wed, 1 Sep 2021 17:29:45 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 240D44B12F for ; Wed, 1 Sep 2021 17:29:44 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EOz3qXNsjaTq for ; Wed, 1 Sep 2021 17:29:43 -0400 (EDT) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 3F9614B129 for ; Wed, 1 Sep 2021 17:29:43 -0400 (EDT) Received: by mail-io1-f42.google.com with SMTP id g9so976454ioq.11 for ; Wed, 01 Sep 2021 14:29:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KGjRFCzfFxSnSrNaojtITxfWpjAOQrO+uEsac7dWTTA=; b=qjLS/Lwo+l0y/xWgb9Yqx3gwHHIqKU/h+4CZY2e91pjpHo2fM2km+R+Aq1kPhbzrnZ 9qQlZ6aVuw/V8/m7LWoa9oAT13KmdbzLWMNmSSSK1j+h8xUuBVM3U75RfhDXnSCLx56l e50E1QwY4UL8edEAGNbUGfdr70SvdMu3IPDdZkNiQHr+/mypm6nHNYFwljYmDPTznfY6 CAdSB9tO3n2qGOn4DB8Zi0LQ1+0R1iPSeFN/+weC7GkYwQede6i4CDzK8ATXfeahkA/b 7rKQEF2qEPrKFEaL6vftzbbGLeCOo2drtmjnuxEOup5KXei3+jcr/OWCRJCHnHicLRIJ Rzyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KGjRFCzfFxSnSrNaojtITxfWpjAOQrO+uEsac7dWTTA=; b=Tgo2M5pWSWa4LrwObzYQKLYLkWlUGjpwI0bocsqF6B9ut+pKOgDpH5XDj0CkBm8lCO 6MJAij094FHuwM70WxyHWM7a3jTAxmKmcCqercqxtoC6Q/QaPX9NKsjTIooeYnNIQybx mrFOgDZJ8p1wBrpUiYlN9YdNPNCbX9oN2WIessVIheBZZDuXsGjqoFSwTDel32n2HMSf 6WYTft+QwRpW/b3zsS5HhknlJxU3aZRooJA5oLtxl3AGkH4u9joNlSd7D9WEhbP8DMX9 w0bVoQly+6qunes12SPUG3QjagmmmD1ZzkYjMr0jCYBscj4dbIQx2IUyRw/qAXH0zed+ ZZig== X-Gm-Message-State: AOAM533XEghJELEbFEhQEi222XoUtU/TuzX6nGZzuPTPHZNsbPzZKJUu n28S1RI0QjL2vvRwoaTiGh36vQ== X-Google-Smtp-Source: ABdhPJwpRXLaA5TjrnDxM/2gBhOTGH/MNrIduQT/kt54RpISuyy9Ge37m9qgVMQ0ILHqKPUEOUwsTw== X-Received: by 2002:a02:908a:: with SMTP id x10mr1409251jaf.30.1630531782445; Wed, 01 Sep 2021 14:29:42 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id g12sm416700iok.32.2021.09.01.14.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 14:29:41 -0700 (PDT) Date: Wed, 1 Sep 2021 21:29:38 +0000 From: Oliver Upton To: Raghavendra Rao Ananta Subject: Re: [PATCH v3 03/12] KVM: arm64: selftests: Add support for cpu_relax Message-ID: References: <20210901211412.4171835-1-rananta@google.com> <20210901211412.4171835-4-rananta@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210901211412.4171835-4-rananta@google.com> Cc: kvm@vger.kernel.org, Will Deacon , Catalin Marinas , Peter Shier , linux-kernel@vger.kernel.org, Marc Zyngier , Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Wed, Sep 01, 2021 at 09:14:03PM +0000, Raghavendra Rao Ananta wrote: > Implement the guest helper routine, cpu_relax(), to yield > the processor to other tasks. > > The function was derived from > arch/arm64/include/asm/vdso/processor.h. > > Signed-off-by: Raghavendra Rao Ananta Reviewed-by: Oliver Upton > --- > tools/testing/selftests/kvm/include/aarch64/processor.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/tools/testing/selftests/kvm/include/aarch64/processor.h b/tools/testing/selftests/kvm/include/aarch64/processor.h > index 082cc97ad8d3..78df059dc974 100644 > --- a/tools/testing/selftests/kvm/include/aarch64/processor.h > +++ b/tools/testing/selftests/kvm/include/aarch64/processor.h > @@ -191,6 +191,11 @@ asm( > val; \ > }) > > +static inline void cpu_relax(void) > +{ > + asm volatile("yield" ::: "memory"); > +} > + > #define isb() asm volatile("isb" : : : "memory") > #define dsb(opt) asm volatile("dsb " #opt : : : "memory") > #define dmb(opt) asm volatile("dmb " #opt : : : "memory") > -- > 2.33.0.153.gba50c8fa24-goog > _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 B4CCAC432BE for ; Wed, 1 Sep 2021 21:32:15 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7A54160FDC for ; Wed, 1 Sep 2021 21:32:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7A54160FDC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=kSryKOVWL6mM3aKKaSz0CYrxuqenKfE0920ZZrKDMtY=; b=2orJZ7SugLklcH N4JV+26IM6yj/I11T8uaZfMg/jMq0UIWVcb3HmJSTMN1C5jiSqm7rcFI8Qr+VzmgxL0N5RkoB3kAe Svbw2m/tzaIBILM0DcQn0WWbVZaZKOZMoCnmpXN7Msj3c6A45UoTf/EUYk/qtpK3ySmw/LnjE0LpX xi6OvjGAgF65iyWcWg5hwANyBQ+hVjZHF5Gx3pdNAbrZ0u9B3J4Uqyn5JfBRzySebcxakri2bBqU6 qBKDMMzoggPVY32eKmV9GL3TnGTD/K532oTXjaB8AUzbJuSIWVBMWPg15JHkJKBUdNtyLQjxR0TdA lAVa1AHiD59NBVjZo3kg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLXns-007XUK-G4; Wed, 01 Sep 2021 21:29:52 +0000 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLXnj-007XSL-C5 for linux-arm-kernel@lists.infradead.org; Wed, 01 Sep 2021 21:29:44 +0000 Received: by mail-io1-xd31.google.com with SMTP id f6so1085829iox.0 for ; Wed, 01 Sep 2021 14:29:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KGjRFCzfFxSnSrNaojtITxfWpjAOQrO+uEsac7dWTTA=; b=qjLS/Lwo+l0y/xWgb9Yqx3gwHHIqKU/h+4CZY2e91pjpHo2fM2km+R+Aq1kPhbzrnZ 9qQlZ6aVuw/V8/m7LWoa9oAT13KmdbzLWMNmSSSK1j+h8xUuBVM3U75RfhDXnSCLx56l e50E1QwY4UL8edEAGNbUGfdr70SvdMu3IPDdZkNiQHr+/mypm6nHNYFwljYmDPTznfY6 CAdSB9tO3n2qGOn4DB8Zi0LQ1+0R1iPSeFN/+weC7GkYwQede6i4CDzK8ATXfeahkA/b 7rKQEF2qEPrKFEaL6vftzbbGLeCOo2drtmjnuxEOup5KXei3+jcr/OWCRJCHnHicLRIJ Rzyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KGjRFCzfFxSnSrNaojtITxfWpjAOQrO+uEsac7dWTTA=; b=ZTmRJWFPbgcdFIVZcmPqU+aeDolF+vauF+d2vTWnEAoprGkMadQsQd2+aXkDB2WO4p 8A6NUEERJrlYNdAFxy+aywLKTa2MwOvDQcgC7qSYY5ZWruv7LdIkyvCWjxgTMGkkGxxT iOHcOLpiuDwukcBjxqfUOv7ZxFmWcali0W8NxYV37OJbC2VOYHX3gbKtftWZvRtg7XDl ZTe6Odk4vFq+q3JitHB9+9S0Sc2UWrNy9f+t3oxeG5X92AsEkEt1KfJDoN4g7GHCvBVx q3Qg4nWW8CdC63Zf00aJPLiPsM3NbVowLzhBAei4Nz4cH/UyAel6oW5ylsdv4C38C/1S tRew== X-Gm-Message-State: AOAM530q/m9bJmAPGemSc1AfRGXRx6QFknQzx6UyPK3p30kTugGVWSo+ YgSL06yWURItwIknLNzVeunExg== X-Google-Smtp-Source: ABdhPJwpRXLaA5TjrnDxM/2gBhOTGH/MNrIduQT/kt54RpISuyy9Ge37m9qgVMQ0ILHqKPUEOUwsTw== X-Received: by 2002:a02:908a:: with SMTP id x10mr1409251jaf.30.1630531782445; Wed, 01 Sep 2021 14:29:42 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id g12sm416700iok.32.2021.09.01.14.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 14:29:41 -0700 (PDT) Date: Wed, 1 Sep 2021 21:29:38 +0000 From: Oliver Upton To: Raghavendra Rao Ananta Cc: Paolo Bonzini , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , Peter Shier , Ricardo Koller , Reiji Watanabe , Jing Zhang , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v3 03/12] KVM: arm64: selftests: Add support for cpu_relax Message-ID: References: <20210901211412.4171835-1-rananta@google.com> <20210901211412.4171835-4-rananta@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210901211412.4171835-4-rananta@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210901_142943_471773_95E1EC64 X-CRM114-Status: GOOD ( 17.27 ) 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 Wed, Sep 01, 2021 at 09:14:03PM +0000, Raghavendra Rao Ananta wrote: > Implement the guest helper routine, cpu_relax(), to yield > the processor to other tasks. > > The function was derived from > arch/arm64/include/asm/vdso/processor.h. > > Signed-off-by: Raghavendra Rao Ananta Reviewed-by: Oliver Upton > --- > tools/testing/selftests/kvm/include/aarch64/processor.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/tools/testing/selftests/kvm/include/aarch64/processor.h b/tools/testing/selftests/kvm/include/aarch64/processor.h > index 082cc97ad8d3..78df059dc974 100644 > --- a/tools/testing/selftests/kvm/include/aarch64/processor.h > +++ b/tools/testing/selftests/kvm/include/aarch64/processor.h > @@ -191,6 +191,11 @@ asm( > val; \ > }) > > +static inline void cpu_relax(void) > +{ > + asm volatile("yield" ::: "memory"); > +} > + > #define isb() asm volatile("isb" : : : "memory") > #define dsb(opt) asm volatile("dsb " #opt : : : "memory") > #define dmb(opt) asm volatile("dmb " #opt : : : "memory") > -- > 2.33.0.153.gba50c8fa24-goog > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=ham 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 EBEEFC432BE for ; Wed, 1 Sep 2021 21:29:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD20261054 for ; Wed, 1 Sep 2021 21:29:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344804AbhIAVal (ORCPT ); Wed, 1 Sep 2021 17:30:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343833AbhIAVak (ORCPT ); Wed, 1 Sep 2021 17:30:40 -0400 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44C2FC061757 for ; Wed, 1 Sep 2021 14:29:43 -0700 (PDT) Received: by mail-io1-xd2a.google.com with SMTP id a13so1002911iol.5 for ; Wed, 01 Sep 2021 14:29:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KGjRFCzfFxSnSrNaojtITxfWpjAOQrO+uEsac7dWTTA=; b=qjLS/Lwo+l0y/xWgb9Yqx3gwHHIqKU/h+4CZY2e91pjpHo2fM2km+R+Aq1kPhbzrnZ 9qQlZ6aVuw/V8/m7LWoa9oAT13KmdbzLWMNmSSSK1j+h8xUuBVM3U75RfhDXnSCLx56l e50E1QwY4UL8edEAGNbUGfdr70SvdMu3IPDdZkNiQHr+/mypm6nHNYFwljYmDPTznfY6 CAdSB9tO3n2qGOn4DB8Zi0LQ1+0R1iPSeFN/+weC7GkYwQede6i4CDzK8ATXfeahkA/b 7rKQEF2qEPrKFEaL6vftzbbGLeCOo2drtmjnuxEOup5KXei3+jcr/OWCRJCHnHicLRIJ Rzyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KGjRFCzfFxSnSrNaojtITxfWpjAOQrO+uEsac7dWTTA=; b=nps462ynfcd8L8D8ffN5L2tcvf5ArkSc7/m2hW3lPLiWNx+upSAYV9fF3qLG92KZHd RiWDJIS5Tpg7cqraSF6WGvaUaju1Mvd8B8HKI/6I4EDFoHhmTgiiW9bvmSPOpkZIsnvl +cWp4XMsCRysHS4Hf5no5SbuDZjVAwZt3ujXLo1XcTnORQihKzEWj60Gnc7Dnf5jrbWn Tors/GtyIkBO52Iqw0zyhH/oRyG68MdvqCV09xeZqPdQSOfkCtRmank917Fm5apHHUBg JYex3Ja8r5i7apfMjt/BN8fDoKStLwnzQI4vhD/6J5QUe4P2xdWDZJlASICMdXvgeJkd y87g== X-Gm-Message-State: AOAM531yQK4tfEsyokDOViQUTYg8GroAQ7k8BmapcHE1nWdz2SGNQzQa C43iZC7TVTxowxwwcwzEsq0L1g== X-Google-Smtp-Source: ABdhPJwpRXLaA5TjrnDxM/2gBhOTGH/MNrIduQT/kt54RpISuyy9Ge37m9qgVMQ0ILHqKPUEOUwsTw== X-Received: by 2002:a02:908a:: with SMTP id x10mr1409251jaf.30.1630531782445; Wed, 01 Sep 2021 14:29:42 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id g12sm416700iok.32.2021.09.01.14.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 14:29:41 -0700 (PDT) Date: Wed, 1 Sep 2021 21:29:38 +0000 From: Oliver Upton To: Raghavendra Rao Ananta Cc: Paolo Bonzini , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , Peter Shier , Ricardo Koller , Reiji Watanabe , Jing Zhang , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v3 03/12] KVM: arm64: selftests: Add support for cpu_relax Message-ID: References: <20210901211412.4171835-1-rananta@google.com> <20210901211412.4171835-4-rananta@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210901211412.4171835-4-rananta@google.com> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, Sep 01, 2021 at 09:14:03PM +0000, Raghavendra Rao Ananta wrote: > Implement the guest helper routine, cpu_relax(), to yield > the processor to other tasks. > > The function was derived from > arch/arm64/include/asm/vdso/processor.h. > > Signed-off-by: Raghavendra Rao Ananta Reviewed-by: Oliver Upton > --- > tools/testing/selftests/kvm/include/aarch64/processor.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/tools/testing/selftests/kvm/include/aarch64/processor.h b/tools/testing/selftests/kvm/include/aarch64/processor.h > index 082cc97ad8d3..78df059dc974 100644 > --- a/tools/testing/selftests/kvm/include/aarch64/processor.h > +++ b/tools/testing/selftests/kvm/include/aarch64/processor.h > @@ -191,6 +191,11 @@ asm( > val; \ > }) > > +static inline void cpu_relax(void) > +{ > + asm volatile("yield" ::: "memory"); > +} > + > #define isb() asm volatile("isb" : : : "memory") > #define dsb(opt) asm volatile("dsb " #opt : : : "memory") > #define dmb(opt) asm volatile("dmb " #opt : : : "memory") > -- > 2.33.0.153.gba50c8fa24-goog >