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=unavailable 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 8762AC433E0 for ; Mon, 1 Feb 2021 17:42:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 4446D64E8F for ; Mon, 1 Feb 2021 17:42:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4446D64E8F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=45nHXTl+EF55Lr/h+zMvxOEPgZvHz0Ck9fXBRuibieU=; b=CO6jDYXMHeZyegkj5ujwP8j1q TIAB0IcYb7Ak6nrwsZoKmrKDn8EvNvVGbxBwfUTou95W4NEpSZwf3ZJwdJOa1qxwM1246d74eLvpe TUztMAClcsXltfrBm9/zMKb6U+Z7XquoSjKSQYkAwU1bMqqBvtS/WTnGSynVczD1iwUbC4s3ke4LA QxhGW3o7KNkXwU6WthBSOeHL7y4Kkf6+SuiolXJo6JO2bnbnyChcBIs3YdLS+sT0EZobeiNJltpcY HYm0VPWW8iGHj4Ut+Uex0+BZ3/jIu8J6i2da3jcmpPWkGsDOOQTLKG37jyAlGLIM+pYrtyeqsSDry 3rBccWq3A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6dCD-0007yZ-8q; Mon, 01 Feb 2021 17:41:05 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6dCB-0007xq-By for linux-arm-kernel@lists.infradead.org; Mon, 01 Feb 2021 17:41:04 +0000 Received: by mail-wr1-x429.google.com with SMTP id c12so17543137wrc.7 for ; Mon, 01 Feb 2021 09:41:00 -0800 (PST) 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=NecD4Lj2Pit6+zWdziXlW+Wn9lKyelFLyjZNsi277Ko=; b=saZ8e5FdXuzKn/wEQOBBdHmpMeHPCpDbAv/xRAxSPOf23fsZYMdk8Yk22lsNT8n+FL svRxqoOqTKJjnuSSRyZ+qRx+Efu4w8zHaWLl+bSl/ojmyvBk5bvUIkcHW+jPkaRxjPKN AuYSYNzxd18rPUOdsf6Txex3i+Vh3AtUKjJGo1Ow2zHCOx3wA+tdweA4Y3kmSV52XQ2a F1I0mbphY6MnUwjZH6PqH8XWbY3tOU4tPce17NCIV/4I7dwNeuNs39OD0g/CRKmBMrJI gGZ/tUgRP+6B/DdP59LjGHj87qRLEduw7FMO7hwxvY088FTQz9Qdt46slGB/Tx6BSOG9 YIDg== 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=NecD4Lj2Pit6+zWdziXlW+Wn9lKyelFLyjZNsi277Ko=; b=Yirq8bXstNvv9RmHDf72FguLBYiWR502qBDBI03B139T+vMJ/AfH2uTDus7rgpaFOD dt6Na9DwROYvnZnnCyOMT6dLe31A9oAhutv8/0T5bhMKpS+hMGl5GChrAYPFsUYSBdSh z0JLtaTFOH9UYjwsgh4YY+bnAQ9OBtwHZ3S5PyvElxWBLJbL/AnLyv37ahRoWl5vPoHh cdDvWDo6/8CqmpIdigjKLjSaCGrUlz7fSfqvcFSjLDuOKWPms2fvv+ziTYrJXAiyP5zw r1t+Jaory20I4jXyEn/F797MyYmgq29ZNpQrqX9z8SWcz97414EuYyMlmDzvUlP15YTD c8Ng== X-Gm-Message-State: AOAM530zmq99hmowQM/ynkubYXD0O0qOqXDt5IpCaTXkNtB1HRXsuRaF dej7oMfkKzDnfa6FYuGFs/aORg== X-Google-Smtp-Source: ABdhPJyVjTMobOwpzGXZWG3t6ZHVDL2R31hio+NCbOHokYHgLSzOJpH3gDsceNyauEudNIluLfZ9+g== X-Received: by 2002:a5d:458a:: with SMTP id p10mr19485759wrq.168.1612201259731; Mon, 01 Feb 2021 09:40:59 -0800 (PST) Received: from google.com (230.69.233.35.bc.googleusercontent.com. [35.233.69.230]) by smtp.gmail.com with ESMTPSA id r25sm29850479wrr.64.2021.02.01.09.40.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Feb 2021 09:40:59 -0800 (PST) Date: Mon, 1 Feb 2021 17:40:56 +0000 From: Quentin Perret To: Will Deacon Subject: Re: [RFC PATCH v2 03/26] arm64: kvm: Add standalone ticket spinlock implementation for use at hyp Message-ID: References: <20210108121524.656872-1-qperret@google.com> <20210108121524.656872-4-qperret@google.com> <20210201172833.GA15632@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210201172833.GA15632@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210201_124103_518521_8C7CE259 X-CRM114-Status: GOOD ( 26.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, kernel-team@android.com, Suzuki K Poulose , android-kvm@google.com, Catalin Marinas , Fuad Tabba , linux-kernel@vger.kernel.org, Rob Herring , James Morse , linux-arm-kernel@lists.infradead.org, Marc Zyngier , David Brazdil , Frank Rowand , kvmarm@lists.cs.columbia.edu, Julien Thierry 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 Monday 01 Feb 2021 at 17:28:34 (+0000), Will Deacon wrote: > On Fri, Jan 08, 2021 at 12:15:01PM +0000, Quentin Perret wrote: > > From: Will Deacon > > > > We will soon need to synchronise multiple CPUs in the hyp text at EL2. > > The qspinlock-based locking used by the host is overkill for this purpose > > and relies on the kernel's "percpu" implementation for the MCS nodes. > > > > Implement a simple ticket locking scheme based heavily on the code removed > > by commit c11090474d70 ("arm64: locking: Replace ticket lock implementation > > with qspinlock"). > > > > Signed-off-by: Will Deacon > > Signed-off-by: Quentin Perret > > --- > > arch/arm64/kvm/hyp/include/nvhe/spinlock.h | 92 ++++++++++++++++++++++ > > 1 file changed, 92 insertions(+) > > create mode 100644 arch/arm64/kvm/hyp/include/nvhe/spinlock.h > > > > diff --git a/arch/arm64/kvm/hyp/include/nvhe/spinlock.h b/arch/arm64/kvm/hyp/include/nvhe/spinlock.h > > new file mode 100644 > > index 000000000000..7584c397bbac > > --- /dev/null > > +++ b/arch/arm64/kvm/hyp/include/nvhe/spinlock.h > > @@ -0,0 +1,92 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > +/* > > + * A stand-alone ticket spinlock implementation for use by the non-VHE > > + * KVM hypervisor code running at EL2. > > + * > > + * Copyright (C) 2020 Google LLC > > + * Author: Will Deacon > > + * > > + * Heavily based on the implementation removed by c11090474d70 which was: > > + * Copyright (C) 2012 ARM Ltd. > > + */ > > + > > +#ifndef __ARM64_KVM_NVHE_SPINLOCK_H__ > > +#define __ARM64_KVM_NVHE_SPINLOCK_H__ > > + > > +#include > > +#include > > + > > +typedef union hyp_spinlock { > > + u32 __val; > > + struct { > > +#ifdef __AARCH64EB__ > > + u16 next, owner; > > +#else > > + u16 owner, next; > > + }; > > +#endif > > Looks like I put this #endif in the wrong place; probably needs to be a line > higher. Uh oh, missed that too. Fix now merged locally, thanks. Quentin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel