Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2224248rwb; Mon, 7 Nov 2022 10:36:49 -0800 (PST) X-Google-Smtp-Source: AMsMyM6vOGKg3kxSCy3Y1IlXg1SeUEOy0jkaJj407xFptPUKFHYDsQMKpkOgb44H85eymD5swSGF X-Received: by 2002:a05:6a00:2409:b0:54e:a3ad:d32d with SMTP id z9-20020a056a00240900b0054ea3add32dmr51642017pfh.70.1667846209194; Mon, 07 Nov 2022 10:36:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667846209; cv=none; d=google.com; s=arc-20160816; b=i7mmAONFkQeCi0p5jGZaIOIoMWDmQzfSWThbX0qCWMumYGy3mfNRheR8yOp5pMq4TC ezMu1xa4x6Hi4OLINYWh/sdQhhbXqJJpr0aVKPjewU1+cP4mPy/PWXkLcSVGBrxoPTsW 35vf5pFOSsUEme0wGWYHhVX8UP8ZAoGut4giDWcNz/qN1amBaFwjvQmUsvpb1y/plHrW Nt2ZtyqhSO/S2MaTF5uEewPAj11Wz6wtGm+V8DUOPS1DFWC327G10hgjbWlfV1UcE0jw 96fDeiBNuXn3RGIqNudw2jioD62zOIrkNEk0TrUiY5J+XP2Cg+gzdmZFFatbDhC6STxz pm8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Iyemd4HvK+DGYoF1NoBJb/8v7rlPpLIo+qNtTJ7A0Ww=; b=YHeJpGLvK+OeY3haPZ01zO1yKqUv9nh1g/NHs+W8sI6NhMziumttZ7qTlz5TOfVpj3 i0nXdBgJ1uNvUzhUjUdupDAvhWUWIT2x2G51pCqDIH8ZcOLhF9DnBN1CvICkvutYj8Tp du33ADJx2ujb1BigLhQ3QXRCN33xdH8S1cM6TzwgN0yVW8m0baX0/C85GFvtj/Yl79Q7 FJLQKauXyem/7tKUSUuyrvEeB/aiimxj7ZQ5rcGVaSszGv5UOhCLl26J9iRetSD+02HT zTmji13oKbQFSAJTaeHG6k1f3If7hpqjrBW75E+Brx2kM0QLKwWBU1QekOpf4hu/Wp3C 1KDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="BZYjDsn/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 34-20020a631462000000b0046edc0aba77si11494360pgu.345.2022.11.07.10.36.35; Mon, 07 Nov 2022 10:36:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="BZYjDsn/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232607AbiKGSLU (ORCPT + 92 others); Mon, 7 Nov 2022 13:11:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233100AbiKGSK7 (ORCPT ); Mon, 7 Nov 2022 13:10:59 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EC872A701 for ; Mon, 7 Nov 2022 10:08:49 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id i132-20020a1c3b8a000000b003cfa97c05cdso168378wma.4 for ; Mon, 07 Nov 2022 10:08:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Iyemd4HvK+DGYoF1NoBJb/8v7rlPpLIo+qNtTJ7A0Ww=; b=BZYjDsn/5DylRVSBVwNfJ49v8b0I/sVskWuhe3YR71vQtj5NDJzzp3iI6/QEi20uYL FfZ9yZ5wd4+4/poDHpX42prieA/ABkyC9CMQCh8Kecv0rC8XTeq3E1iJZPH8TjytnPdm 2KlApBArF0MjvFn6tfAVN1Px/03htSrzGTSD/rZimuCZerxfr5UZaOjlok3me3++Tac1 K28jTJyoLWZDWNcVKYmtEPRMBcnpqfotxiVKufkl0BqNoMln9J5KDjPL/ZHqGFGRkhzA cC0F9ou2jlvBM4qjHfFw/yQsFEv8QxoEYMTpdr5v19/00tG9yoLn+OiUMjV1ySZYM1SP 3mjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Iyemd4HvK+DGYoF1NoBJb/8v7rlPpLIo+qNtTJ7A0Ww=; b=eN/gBwSaNCf7rVajNf1xtp2AylNunwCjQuhckud1UZrJsVyr5zZf3gLx0rEhiAZlsl U/wKGT9ELyzzSs2jycJ+1XAVhN2shvsJ8MKj8KbcbqhIfBTPjzv4cSSdCXsOKyHThx4Z LU4b5YPD3atkPuRKICMf2INUjSk50tPrElefzfVuJ1jzmQQpVQHLg0jl6bRHWc4x/pso 6SsTrlYRmQ82eGJv6o00gWdbvs6e1E8f6SHYPk3KKeSlqodv0fo4dYQ3NTsfiT2P4Icp f398KVLM2+iseAF/jZZRTNwjiGSolW+BgqiWqhfRDzOYKohSuAXzugIhZftYUFUDjvIW Qofw== X-Gm-Message-State: ACrzQf0uD+GB1gp/fhTKMRki2qMVQqth1IJoOoPCipzIdkMmUw8jApyH yxFDlTGkV6MgSTJEYSwL1PfH0w== X-Received: by 2002:a05:600c:1609:b0:3cf:4dc4:5a99 with SMTP id m9-20020a05600c160900b003cf4dc45a99mr34442575wmn.67.1667844527658; Mon, 07 Nov 2022 10:08:47 -0800 (PST) Received: from ?IPV6:2a02:6b6a:b4d7:0:ebf7:de38:f6bc:8fe8? ([2a02:6b6a:b4d7:0:ebf7:de38:f6bc:8fe8]) by smtp.gmail.com with ESMTPSA id l21-20020a05600c4f1500b003b4fdbb6319sm13186914wmq.21.2022.11.07.10.08.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Nov 2022 10:08:46 -0800 (PST) Message-ID: <71a41442-b1eb-d02e-53fe-c35dbcfc8416@bytedance.com> Date: Mon, 7 Nov 2022 18:08:45 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [v2 2/6] KVM: arm64: Add SMCCC paravirtualised lock calls Content-Language: en-US To: Punit Agrawal Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-doc@vger.kernel.org, virtualization@lists.linux-foundation.org, linux@armlinux.org.uk, yezengruan@huawei.com, catalin.marinas@arm.com, will@kernel.org, maz@kernel.org, steven.price@arm.com, mark.rutland@arm.com, bagasdotme@gmail.com, fam.zheng@bytedance.com, liangma@liangbit.com References: <20221104062105.4119003-1-usama.arif@bytedance.com> <20221104062105.4119003-3-usama.arif@bytedance.com> <87cz9y3avq.fsf@stealth> From: Usama Arif In-Reply-To: <87cz9y3avq.fsf@stealth> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/11/2022 17:58, Punit Agrawal wrote: > Usama Arif writes: > >> Add a new SMCCC compatible hypercalls for PV lock features: >> ARM_SMCCC_KVM_FUNC_PV_LOCK: 0xC6000002 >> >> Also add the header file which defines the ABI for the paravirtualized >> lock features we're about to add. >> >> Signed-off-by: Zengruan Ye >> Signed-off-by: Usama Arif >> --- >> arch/arm64/include/asm/pvlock-abi.h | 17 +++++++++++++++++ >> include/linux/arm-smccc.h | 8 ++++++++ >> tools/include/linux/arm-smccc.h | 8 ++++++++ >> 3 files changed, 33 insertions(+) >> create mode 100644 arch/arm64/include/asm/pvlock-abi.h >> >> diff --git a/arch/arm64/include/asm/pvlock-abi.h b/arch/arm64/include/asm/pvlock-abi.h >> new file mode 100644 >> index 000000000000..3f4574071679 >> --- /dev/null >> +++ b/arch/arm64/include/asm/pvlock-abi.h >> @@ -0,0 +1,17 @@ >> +/* SPDX-License-Identifier: GPL-2.0 */ >> +/* >> + * Copyright(c) 2019 Huawei Technologies Co., Ltd >> + * Author: Zengruan Ye >> + * Usama Arif >> + */ >> + >> +#ifndef __ASM_PVLOCK_ABI_H >> +#define __ASM_PVLOCK_ABI_H >> + >> +struct pvlock_vcpu_state { >> + __le64 preempted; >> + /* Structure must be 64 byte aligned, pad to that size */ >> + u8 padding[56]; >> +} __packed; > > For structure alignment, I'd have expected to see the use of "aligned" > attribute. Is there any benefit in using padding to achieve alignment? > Just made it consistent with pvclock-abi.h. If its more appropriate, can change to aligned in next patchset: diff --git a/arch/arm64/include/asm/pvlock-abi.h b/arch/arm64/include/asm/pvlock-abi.h index 3f4574071679..bacec4cb927a 100644 --- a/arch/arm64/include/asm/pvlock-abi.h +++ b/arch/arm64/include/asm/pvlock-abi.h @@ -11,7 +11,6 @@ struct pvlock_vcpu_state { __le64 preempted; /* Structure must be 64 byte aligned, pad to that size */ - u8 padding[56]; -} __packed; +} __attribute__((aligned(64))); > [...]