From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E8A9181334 for ; Wed, 29 May 2024 15:29:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716996566; cv=none; b=OM6mOZFylE0xowRM8fSQbkA4CNGRPMPLJHXz80ep0pE2GpeBNeVOGXpOtlcZaAYAgIe/sTeBCdDB7tN8+Aw+CrsBmO9S1+Tra1jGeTJaNpMfGDK80WeMfWX51zstoA4lpY2HR9N1wfGFb3yTcwm7D8jRQ888ctTHp2jntqyeCCE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716996566; c=relaxed/simple; bh=5EAuE4m6aZKJdT/S8iDYy5RWTfH+qE69UIxaK12MGSw=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=f79zfOvokOesA1gdYD+RyW9rEVYnQIzwmWzUmufS+9RiwPE/x6WduZOnEAOh8PLCL4Li1dAN0zCHlMdT3MKd9A4MKq3oC6JObAEv9o1pLvVgoNdKn1P1ysqVQLxKKWy6MbH1mqbpr889QmBkZG5r6ogeqvXBJbNBjZmraNO/EqU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=IK9Sd7eI; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IK9Sd7eI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716996564; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5EAuE4m6aZKJdT/S8iDYy5RWTfH+qE69UIxaK12MGSw=; b=IK9Sd7eIHCauNVOKbcgW8z2CBclAb5Ky44gSxh1do6Hx+NPlFNdgpINQhDfE9jqKZK13es wJHgCJG7sgfpi1sHTQO8MoeFNsfx5qg/JUaZ+NjHdSfGN1/4KSyXc4RWpZ6LcGH2ENPm8f /zRISdllAAkKRkrxPYKubAsTJn/zzX0= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-672-Zu50P6LOMp-PSABR5aXarA-1; Wed, 29 May 2024 11:29:22 -0400 X-MC-Unique: Zu50P6LOMp-PSABR5aXarA-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-35559d30617so1767348f8f.2 for ; Wed, 29 May 2024 08:29:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716996561; x=1717601361; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5EAuE4m6aZKJdT/S8iDYy5RWTfH+qE69UIxaK12MGSw=; b=lQvQXbiqi+VADko6jPFbXGTAi4RVV3N7unY6yzk7BLKrTs9p9J7lmouYUmfouNdtEH ha/a26Bssedj1C4925+KF7egEc1Jn8j/eQrrwn32AuStcwC7W7ahvh7c6Dz1SkoDBtSb 87irVzYsY7Cb//v2OIYG/mrBDtUa8v6e5v8E2d3qoVu7GSrX3gt9Eo7tAXuAwFtAcGOk SsNn2PELxJBDNL+EIW2hpFl1NVBVqNvTTYfgoeutwdTsH7t9/7UK03omEZ2egJ12V2rF fusZcxnZJoMUr1boO/56rZOTDd5ftwFCMjpLCbBEBzmsQrz+uuR5uZRyuc9zTAGgouSV CLjw== X-Forwarded-Encrypted: i=1; AJvYcCWsxzCNvoAFemixZSQfTxcAL2FfI6pQstkioDQev+uinsDQ4Ayp879rce3kbDtP8ggeR1VmOxfDozazz99jJM2toU2tZRAS X-Gm-Message-State: AOJu0YyO+5h1MbzijPsHW7ygoMfcebY30iabr91PjkgQApOmnGDA1ZSS gpw9ktbEFmoFzSBewJGOb68+ZppNMX9+zV4CYq+4zdpZl9Hmgl0za2mixanBEWwwvmInm6MwSWF /zIn6Uvch5CJpufhn3eL+lZz3ufRE7V6gDiMjXKk6M2EJYlYNIQp39A== X-Received: by 2002:a5d:6991:0:b0:354:f286:4f0c with SMTP id ffacd0b85a97d-3552fe029a0mr12407207f8f.51.1716996561617; Wed, 29 May 2024 08:29:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRJjULm6jx6xOHCCpirutvbUnzT/a6jQusAfJO3XKjkkjlSGtoHgavcGj/S/fqDOvU0+uebQ== X-Received: by 2002:a5d:6991:0:b0:354:f286:4f0c with SMTP id ffacd0b85a97d-3552fe029a0mr12407190f8f.51.1716996561221; Wed, 29 May 2024 08:29:21 -0700 (PDT) Received: from rh (p200300c93f02d1004c157eb0f018dd01.dip0.t-ipconnect.de. [2003:c9:3f02:d100:4c15:7eb0:f018:dd01]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35579d7dd73sm15045365f8f.18.2024.05.29.08.29.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 08:29:20 -0700 (PDT) Date: Wed, 29 May 2024 17:29:19 +0200 (CEST) From: Sebastian Ott To: Eric Auger cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Catalin Marinas , Will Deacon Subject: Re: [PATCH v3 5/6] KVM: arm64: rename functions for invariant sys regs In-Reply-To: Message-ID: <5a00647d-7d33-81a6-c783-2212ff73ca8b@redhat.com> References: <20240514072252.5657-1-sebott@redhat.com> <20240514072252.5657-6-sebott@redhat.com> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII; format=flowed Hej Eric, On Wed, 29 May 2024, Eric Auger wrote: > On 5/14/24 09:22, Sebastian Ott wrote: >> Invariant system id registers are populated with host values >> at initialization time using their .reset function cb. > get_##reg call read_sysreg(). I don't really understand the above > sentence. Please could you elaborate? > struct sys_reg_desc has 2 function pointers (among others): .reset and .get_user . The functions implementing these are usually named accordingly. For invariant registers only .reset is used but set to functions that are called get_* (which is usually used to implement .get_user). E.g.: invariant_sys_regs[0].reset == get_midr_el1 When trying to figure out this code I was confused by this, hence this patch.. Sebastian 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 26B23C27C43 for ; Wed, 29 May 2024 15:30:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:Message-ID:In-Reply-To: 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=MwPBvQeXSOHZpCcFVorRC/3If7T/JBGgKp97s71FchQ=; b=XSDZrCRnt6K2m5qfUsCURfpJF2 gR8kBRNMYpukBI5pLwxe0N0X6bifZlKPmz2h+129cB2Q3pq1hoGYvfbDFncbJaaHwSEtPj4bLQTNP 9HykSO/3PdoWXCuR7zLvPaqxsK+5Txv9xkVrSI7JgOgxzbV49VZpqdomS6aDaklSSHQB5LfQ4MRwk 4Ue7Chv2GNsZhfg4n6W0UBljkNyjnAEKh7454pdqav60uPpCcH01u7hteUbOF7PpbIoEOYJsLfBjB iM9QJ+JoTJNnbKrrbZLZLEO7Ix1TwYYeKHyQYFz6hfCuzjQgYFvgvsjksW5YfsDFOaSVxDfyVWJyC ijnkB2Gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCLG0-00000004hsB-2O69; Wed, 29 May 2024 15:30:28 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCLF2-00000004h5A-2I28 for linux-arm-kernel@lists.infradead.org; Wed, 29 May 2024 15:29:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716996564; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5EAuE4m6aZKJdT/S8iDYy5RWTfH+qE69UIxaK12MGSw=; b=IK9Sd7eIHCauNVOKbcgW8z2CBclAb5Ky44gSxh1do6Hx+NPlFNdgpINQhDfE9jqKZK13es wJHgCJG7sgfpi1sHTQO8MoeFNsfx5qg/JUaZ+NjHdSfGN1/4KSyXc4RWpZ6LcGH2ENPm8f /zRISdllAAkKRkrxPYKubAsTJn/zzX0= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-529-OfeIiK4hMze0carPLG4SBw-1; Wed, 29 May 2024 11:29:22 -0400 X-MC-Unique: OfeIiK4hMze0carPLG4SBw-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-354fc1122baso1821991f8f.0 for ; Wed, 29 May 2024 08:29:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716996561; x=1717601361; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5EAuE4m6aZKJdT/S8iDYy5RWTfH+qE69UIxaK12MGSw=; b=l+nroDeevgznxBdOd8NjyqnPPD4dqH5/EM5bCMa2ikPlAIG8+Ya9w+Oeu/Bbxj4Rr/ VkoOfe563mPnaaiLKfAdSHdxWHBdfXRBetgcc7gL1sblDbFX9AA61dcZwbMmI6ljTcMP J0+zaE7ou/bsVVNiDHNSLDbTKzOo0BLwtIrvPf15h74LHqd3H8Gt4G2oUDwJs/iYUAp+ SoHHB7Gs6x/MdIk8VyQaTB7YnHqDeAQ2AdhV4gJF5fUqzo5YTsN7dglRscvUnoBzkwcF WUYCoE3G/5xr17jIUFSBnxRru5nRG+PBRf0VjOUGyjm81KqmKH88HjAZNg7PwG0RaUyT 4fkg== X-Gm-Message-State: AOJu0Yy5gRSHzpvBMYUBxvcPwmcQZMFgCd1FszYLVMqUiL1K6D8fYcGF Rf7pLUEbbk7/8gBRTUNMem4ghPZM4mYwasLm/3rOWY2MOF+4Jiiu5EHG2qoJyz/0qcLJ1KwS7q2 5Hs6sgOGziWmsPZZTp+z+9uHdS+freAKDjliAws3oeAhQtIz1A6lZmyOkrnSPNSsj0wh5xXx8 X-Received: by 2002:a5d:6991:0:b0:354:f286:4f0c with SMTP id ffacd0b85a97d-3552fe029a0mr12407201f8f.51.1716996561611; Wed, 29 May 2024 08:29:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRJjULm6jx6xOHCCpirutvbUnzT/a6jQusAfJO3XKjkkjlSGtoHgavcGj/S/fqDOvU0+uebQ== X-Received: by 2002:a5d:6991:0:b0:354:f286:4f0c with SMTP id ffacd0b85a97d-3552fe029a0mr12407190f8f.51.1716996561221; Wed, 29 May 2024 08:29:21 -0700 (PDT) Received: from rh (p200300c93f02d1004c157eb0f018dd01.dip0.t-ipconnect.de. [2003:c9:3f02:d100:4c15:7eb0:f018:dd01]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35579d7dd73sm15045365f8f.18.2024.05.29.08.29.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 08:29:20 -0700 (PDT) Date: Wed, 29 May 2024 17:29:19 +0200 (CEST) From: Sebastian Ott To: Eric Auger cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Catalin Marinas , Will Deacon Subject: Re: [PATCH v3 5/6] KVM: arm64: rename functions for invariant sys regs In-Reply-To: Message-ID: <5a00647d-7d33-81a6-c783-2212ff73ca8b@redhat.com> References: <20240514072252.5657-1-sebott@redhat.com> <20240514072252.5657-6-sebott@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240529_082928_836604_B2C2C597 X-CRM114-Status: GOOD ( 10.09 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hej Eric, On Wed, 29 May 2024, Eric Auger wrote: > On 5/14/24 09:22, Sebastian Ott wrote: >> Invariant system id registers are populated with host values >> at initialization time using their .reset function cb. > get_##reg call read_sysreg(). I don't really understand the above > sentence. Please could you elaborate? > struct sys_reg_desc has 2 function pointers (among others): .reset and .get_user . The functions implementing these are usually named accordingly. For invariant registers only .reset is used but set to functions that are called get_* (which is usually used to implement .get_user). E.g.: invariant_sys_regs[0].reset == get_midr_el1 When trying to figure out this code I was confused by this, hence this patch.. Sebastian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel