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 DCB8EC3DA7F for ; Sat, 3 Aug 2024 01:23:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xMBNT0EM8eGZf7BSfCt8eBnkVGPYNvww8epbZVbys40=; b=HpqHp4ykAziDdlZKMtpru7y2mQ fEdxHEzYEwYaYkBVLIf33uIPnnhJjV1BQbZOoi2VNDqXytgUsqsQfT6CLHOp7na1d+/pw5pSpK2Uq T4hdI09KIzWPrgql/WOmNPlRqVRtdNd71kgGQSsn58uf7+CNM9k8TVzBqx9txnoYuwE9mzDr4ts1M ffa/gHdY1z11sxkXje2NQhJUFXELl2owC8dDVfjiuyzWKzdRbdmHTTS3SJlQ0kuvjIRBoHSaV0b3y OrHxbetvnlZAt0EP00PiydAC9HvqJD/vybKPvKkO/fDb5Ti6S4s2F9SCbFUXkgWmzz1acwAW+TPDH JQucVgNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sa3U8-0000000AVj9-12Y1; Sat, 03 Aug 2024 01:23:04 +0000 Received: from mail-pf1-f180.google.com ([209.85.210.180]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sa3T1-0000000AVGc-0Aa5 for linux-arm-kernel@lists.infradead.org; Sat, 03 Aug 2024 01:21:56 +0000 Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-7107b16be12so600182b3a.3 for ; Fri, 02 Aug 2024 18:21:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722648114; x=1723252914; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xMBNT0EM8eGZf7BSfCt8eBnkVGPYNvww8epbZVbys40=; b=AeHsoja3MPf3+io/aqQ71vVezDAHT2Fg5zMO1RTFDmN4uLwBd5f/7pugTYcUQond7d EGB/7px8UZc3+N2SE7dBm5ItUX7mJCLNQiB1plzXKCrsOh8Ap7nlOK3VqlMg+MuBukEO RkC3vl5U+SFw9iNYeroAnJwrH6iRVdQRo4jz3f+eYtsi03ldBka7nKWx9/CC1rxm50fQ y2GL4GibMsSLDxHrrKd1yhj5Vj0QtVRK76NuZyyECR3gGFsvEV9wl6U/IM16qoFeiU1T ICtjI3X4MveZep+U04lFm+DAYStBEZSTIhz7316DXGnE+vNkgxoQI6pJgdnso1Tc4huy aUfQ== X-Forwarded-Encrypted: i=1; AJvYcCWUJWY6M9aej0Fgs/kUdEtO9hHD3If259MCgo/UBY0yc0SVn9BbFf9gQl8yPSm+CDBOC8VIX+zDI4yQefdU8Tp2lYzq1pwTPNFiO1Yr4PAA48x4Azs= X-Gm-Message-State: AOJu0YyuOYjkt2g9E+U00QOtSoE2ySFLMZw+anA7DMoVdVJwiY254AdD vXB9Oh5TZUxmZrJ5iPn87i0l5kzfoUuvjc4BTFTc0HEx34vzvYwb X-Google-Smtp-Source: AGHT+IGdA9x5DOJmhpwToasI08wQCO4Mq8GF39dZxj2+15+CMJh5IgxzUG4t/6AZuEXRjGJjtJLWvw== X-Received: by 2002:a05:6a20:1588:b0:1c4:214c:cc0d with SMTP id adf61e73a8af0-1c69962418amr7570586637.36.1722648114087; Fri, 02 Aug 2024 18:21:54 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([20.69.120.36]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2cffb098329sm2402194a91.23.2024.08.02.18.21.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 18:21:53 -0700 (PDT) Date: Sat, 3 Aug 2024 01:21:52 +0000 From: Wei Liu To: Roman Kisel Cc: arnd@arndb.de, bhelgaas@google.com, bp@alien8.de, catalin.marinas@arm.com, dave.hansen@linux.intel.com, decui@microsoft.com, haiyangz@microsoft.com, hpa@zytor.com, kw@linux.com, kys@microsoft.com, lenb@kernel.org, lpieralisi@kernel.org, mingo@redhat.com, rafael@kernel.org, robh@kernel.org, tglx@linutronix.de, wei.liu@kernel.org, will@kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org, apais@microsoft.com, benhill@microsoft.com, ssengar@microsoft.com, sunilmut@microsoft.com, vdso@hexbites.dev, ssengar@linux.microsoft.com Subject: Re: [PATCH v3 3/7] Drivers: hv: Provide arch-neutral implementation of get_vtl() Message-ID: References: <20240726225910.1912537-1-romank@linux.microsoft.com> <20240726225910.1912537-4-romank@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240726225910.1912537-4-romank@linux.microsoft.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240802_182155_098365_1823E3FF X-CRM114-Status: GOOD ( 18.55 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jul 26, 2024 at 03:59:06PM -0700, Roman Kisel wrote: > To run in the VTL mode, Hyper-V drivers have to know what > VTL the system boots in, and the arm64/hyperv code does not > have the means to compute that. > > Refactor the code to hoist the function that detects VTL, > make it arch-neutral to be able to employ it to get the VTL > on arm64. Fix the hypercall output address in `get_vtl(void)` > not to overlap with the hypercall input area to adhere to > the Hyper-V TLFS. Can you split the fix out? That potentially can be backported. > > Signed-off-by: Roman Kisel > --- > + > +#if IS_ENABLED(CONFIG_HYPERV_VTL_MODE) > +u8 __init get_vtl(void) > +{ > + u64 control = HV_HYPERCALL_REP_COMP_1 | HVCALL_GET_VP_REGISTERS; > + struct hv_get_vp_registers_input *input; > + struct hv_get_vp_registers_output *output; > + unsigned long flags; > + u64 ret; > + > + local_irq_save(flags); > + input = *this_cpu_ptr(hyperv_pcpu_input_arg); > + output = *this_cpu_ptr(hyperv_pcpu_output_arg); Hmm... I don't remember why the old code didn't use hyperv_pcpu_output_arg but instead reused input+OFFSET as output. Saurabh, can you comment on this? Thanks, Wei.