From patchwork Wed Oct 19 08:31:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5476 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp332981wrs; Wed, 19 Oct 2022 06:40:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6LbdfEbpvvnNtYer6xNpVKVknaW5FljMW6D7o55KO+WD4l6s1K7uoRd5O9pWwaknY5Z7ZU X-Received: by 2002:a05:6402:1356:b0:459:3c9e:81d4 with SMTP id y22-20020a056402135600b004593c9e81d4mr7688934edw.148.1666186800225; Wed, 19 Oct 2022 06:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666186800; cv=none; d=google.com; s=arc-20160816; b=Ivzwxt2zIPnLlkyIObhgaSNhJ6ajtoU+bkfZWM6TxIK3hGk0hkW7IxQJI06UWWkVRh ikja/vcdSH9+PUjyeNJmbuk8k96I91EeJ8iXVBasKIT/bJkEvjs85Xx13BW63W1212CW Pl45uY1v0+U5Igor8byR5Fk3s3D6lS/I8Q4eN5uO5E+wBy846NbbQ7Yrhwq7JrxoYCft itUqcioiNWK+A1pZ++rL8PiaZi26cS0ET1tMEKp58baHoHrFh1YX/PLMzgN55EwNBxpg 2SoYDGN++hxrs1qLhvLpsyyKAnMG1PDZiCtT1suFOJYZbo8TU/IEG+KLcyVfiFfEfpMq Wl+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JIUr8lToSg4jzYVjpGz92+PcFqeYWgm/NzrJxiZxgo4=; b=gn6PuAzDANDX55j9dGNh9c1lP9S2fT/J56PNPNYS3omRbWk3n5W6rW/tVlvD2hTVDv 9EiIptm0FEsfvZIZmwvFb9Dnv6qRXthe9Zk/dGfox2p14N8R/7FU8/o5RQ+7a4tip6IG KDMOE1Iu9mkmPJLIMyWRPa1SYh9Z+RdW4YXq002i5by8T3I3fC3kdmuOM2fg5P3mBHVc zVRGO1aFlDx9CiYD1YE0oznpxFi3bxgjdmu4GQJsVJXiLYG7RjGiSh26Os8Sl0n9h2lc wcn5B7L7OuPJ8xpIC7Ubxd1Out099yglNviMImrM5B102ptxM5Z8M8rIIUF0hr/PqIl8 uYwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RZuaasvp; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a170906370b00b007818378f560si10845125ejc.383.2022.10.19.06.39.34; Wed, 19 Oct 2022 06:40:00 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=RZuaasvp; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231213AbiJSNgs (ORCPT + 99 others); Wed, 19 Oct 2022 09:36:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232220AbiJSNgN (ORCPT ); Wed, 19 Oct 2022 09:36:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C81865A5; Wed, 19 Oct 2022 06:25:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3FA1EB82478; Wed, 19 Oct 2022 09:05:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0387C433D6; Wed, 19 Oct 2022 09:05:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170354; bh=oN1q5+EkQodGSpeSvWON/bvXRv29YUR6xT4ss1Sevw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RZuaasvp38/ChNUy+M6JPlfJ+CQSshkiptKOlBXt++ZBljZKfqsZtJhsRXMd99Qjf jqddsDM5WlMI3rE4STz9QDgp1ZIahGf+VRzXGGGPtfGzBkNFXWR2/XGXcYSZtjqMm7 p5r+7WGcZN1JtRoxutK4iLb/EuKoY0rUgoQKWhWw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Lynch , Haren Myneni , Michael Ellerman , Sasha Levin Subject: [PATCH 6.0 623/862] powerpc/pseries/vas: Pass hw_cpu_id to node associativity HCALL Date: Wed, 19 Oct 2022 10:31:50 +0200 Message-Id: <20221019083317.464743711@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747123490265172565?= X-GMAIL-MSGID: =?utf-8?q?1747123490265172565?= From: Haren Myneni [ Upstream commit f3e5d9e53e74d77e711a2c90a91a8b0836a9e0b3 ] Generally the hypervisor decides to allocate a window on different VAS instances. But if user space wishes to allocate on the current VAS instance where the process is executing, the kernel has to pass associativity domain IDs to allocate VAS window HCALL. To determine the associativity domain IDs for the current CPU, smp_processor_id() is passed to node associativity HCALL which may return H_P2 (-55) error during DLPAR CPU event. This is because Linux CPU numbers (smp_processor_id()) are not the same as the hypervisor's view of CPU numbers. Fix the issue by passing hard_smp_processor_id() with VPHN_FLAG_VCPU flag (PAPR 14.11.6.1 H_HOME_NODE_ASSOCIATIVITY). Fixes: b22f2d88e435 ("powerpc/pseries/vas: Integrate API with open/close windows") Reviewed-by: Nathan Lynch Signed-off-by: Haren Myneni [mpe: Update change log to mention Linux vs HV CPU numbers] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/55380253ea0c11341824cd4c0fc6bbcfc5752689.camel@linux.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/platforms/pseries/vas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/vas.c b/arch/powerpc/platforms/pseries/vas.c index 7e6e6dd2e33e..1a2cbc156e8f 100644 --- a/arch/powerpc/platforms/pseries/vas.c +++ b/arch/powerpc/platforms/pseries/vas.c @@ -333,7 +333,7 @@ static struct vas_window *vas_allocate_window(int vas_id, u64 flags, * So no unpacking needs to be done. */ rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, domain, - VPHN_FLAG_VCPU, smp_processor_id()); + VPHN_FLAG_VCPU, hard_smp_processor_id()); if (rc != H_SUCCESS) { pr_err("H_HOME_NODE_ASSOCIATIVITY error: %d\n", rc); goto out;