Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp977762pxb; Wed, 1 Sep 2021 14:16:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFpiLUcgj3yURVI57xUQyN0CQUFC28YZpzT4n9r9b/5RMxc2TF1oQHDy+Zefmo5RzfT5VL X-Received: by 2002:a17:906:9401:: with SMTP id q1mr1585483ejx.313.1630530993410; Wed, 01 Sep 2021 14:16:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630530993; cv=none; d=google.com; s=arc-20160816; b=L3cS+N8IyxM0mJfuTgTE9R261LgpXTOdQI+ZWbPOICoDeWQseW9ivgDZTZnpIrMXlw iObKc3U5FXw+dDVbKsQb6YfLdocldtV5/d+5T6yzQe2NGXTtzs9oaKGxPopIZIc339Vv 45XkqGCtqUSxhl35J3hELYMlIE28v4EctQNANvC7zZAM6OAcADi8RH6qMkubKVuc6eIO If4TxHdQKKwTIdjwo5a1ChaW3I66ltWSxyA0sOExELKeHGlho8JSE1uwm9LW57HKyyh+ Quk/lJo2M5JcFzHHKz9He7V57QXbjl9i8zdJWqFHZ2YwOmgY5HgHKf6FKM2LmqwcS0kP ZBUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=Isvx4DjIyZ95UhyLPtghW+KyLIgzd4+t6VBStaNZel4=; b=Zj3QIrliXDxMjlsuwkeju64EyrmthM/ujdcUKciL6E5CMdQi7fkXrqT+BafQfgAoVI GfliG4FoqBkzreRRy0qNtdNQV94TvcBIBifK04VVdUImZWCZbNFWXEdZpLO2GiniCi/c 8hOTpSgnzkskwbQAzIbazCYf+wFlzZ58gYaZ2RDz9is353l4cXP/sJ1qN2Om/Qyu9O1V NuJBvKXUgxP0hJdwgHg3fpE/+Xk6cxSZsh8W7IKebV8JwswrDoK2LfAA7fKuRjweQaWm vcpKNOd4GWPXE/xIcicGRqO8EdFEzhztmMQZS1s4AETTJUhSb9N5AYUW0ovrFvS2rofy CRPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qyxdd1Im; 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 h93si846900edd.376.2021.09.01.14.16.07; Wed, 01 Sep 2021 14:16:33 -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=20161025 header.b=qyxdd1Im; 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 S1343729AbhIAVPb (ORCPT + 99 others); Wed, 1 Sep 2021 17:15:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343708AbhIAVP1 (ORCPT ); Wed, 1 Sep 2021 17:15:27 -0400 Received: from mail-qk1-x74a.google.com (mail-qk1-x74a.google.com [IPv6:2607:f8b0:4864:20::74a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D5D9C061575 for ; Wed, 1 Sep 2021 14:14:28 -0700 (PDT) Received: by mail-qk1-x74a.google.com with SMTP id y185-20020a3764c20000b02903d2c78226ceso890153qkb.6 for ; Wed, 01 Sep 2021 14:14:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=Isvx4DjIyZ95UhyLPtghW+KyLIgzd4+t6VBStaNZel4=; b=qyxdd1Im2YrMFUu2970w/b6BrYgp0K2RtFaSPBbFajB/Z4ILFmH5RtNIhZahtm5Owk aezBt9A1JRyOWIRSYlCyfnap0LuVFZ7p20vC3ErhfaylqfBt3hKgkpE6HkPGooQtsfS2 DI8qbreTIGfFkQ04tVXq7jD6kr9SV0BoxM5RCoRCzxeNpi21SrJ2DUoVDXg/xrRkEeJ0 bXprxLBdvjeVfEFi6WQvG3MoEvTutHilR+thPeWgioFEqV+DY0IcuYzJuK95PjuHGUAR CyVYsF8IsaDRkVxuM2uo4sczHkZ4yguHAb1PkC10Tdr6G6RJxMBQY+tGevXPPcPsVhK5 OlWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=Isvx4DjIyZ95UhyLPtghW+KyLIgzd4+t6VBStaNZel4=; b=WDzxj9Em8Cf78MHS/vnn1P0pgvuUJawNP7YMPJu5hpcAnsW+WkGXsaZ+CqjcJe50kK IUwmJlIUN6Hn9y2WPo7ycbhwxA5A9DXruGRrVlSzBgLO9RdhX4T05dhPAXxOnVnkxSyS DPzdKtIPYxK2QghRohF5GmpfHqi3xIxXCIsV8pWAlWD5EmxYJfnfmw+RI9aE8Vxc9oIk qQP8FAgC+m193fOD9aTeusnAMPMsPFcTBGeBsjwVKFy3Ww1gHDgNewnS2T4sx6J2njDx koUlFT9IHHTrupECK097ALQe1VaEjs2imHQbyKqaZR/VBICeQBvS1qx+1jNOp684jepO MiBg== X-Gm-Message-State: AOAM531sqFCcUkA1OB30Jf30LN/aSbG50PcF624FX0mwMex6deT/gMTv pJYmvTR6KdwYg22o7BvZT4yR4rSqVCKR X-Received: from rananta-virt.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1bcc]) (user=rananta job=sendgmr) by 2002:a0c:9c4d:: with SMTP id w13mr1802546qve.43.1630530867766; Wed, 01 Sep 2021 14:14:27 -0700 (PDT) Date: Wed, 1 Sep 2021 21:14:03 +0000 In-Reply-To: <20210901211412.4171835-1-rananta@google.com> Message-Id: <20210901211412.4171835-4-rananta@google.com> Mime-Version: 1.0 References: <20210901211412.4171835-1-rananta@google.com> X-Mailer: git-send-email 2.33.0.153.gba50c8fa24-goog Subject: [PATCH v3 03/12] KVM: arm64: selftests: Add support for cpu_relax From: Raghavendra Rao Ananta To: Paolo Bonzini , Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose Cc: Catalin Marinas , Will Deacon , Peter Shier , Ricardo Koller , Oliver Upton , Reiji Watanabe , Jing Zhang , Raghavendra Rao Anata , 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 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 --- 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