Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp193733rwl; Tue, 4 Apr 2023 22:02:10 -0700 (PDT) X-Google-Smtp-Source: AKy350ZYrItFBTMeExLU0PhE55Alajb/MJoqM3wV9rg0K4OMvLbmW+JjgmJ9AdhX7uddmbQuMmQg X-Received: by 2002:a05:6402:544:b0:500:2a15:f86b with SMTP id i4-20020a056402054400b005002a15f86bmr673747edx.42.1680670930557; Tue, 04 Apr 2023 22:02:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680670930; cv=none; d=google.com; s=arc-20160816; b=JLXGcoZFw49RXu1swf02SUZcPzr4IFvhb6VOqfFzDtZD7qPRBquSmzjXSVcGO9WT71 sfJhTrBb7Guh1qPSJ7yEo6NEWchjCrajAe+/Nc8mQx3vUcwsfXVeUPNKtVzkp3r18Oa6 23F8iXJdLyueyzXXSKXXk+wddHgJm4JtP0RWarlPx3FnoQi8hByAlbKuFpAvfhfcIP01 MlRSt+gKUvYKtYBGEwNAUeT9vHuCyMU+anAso+bIqEcM1VVShDN5WJFIWvppKSXIxXe5 6C6A0LiOaADmX8TmKybPzRjBxvZmzxdvyuLFHmFQQKPMqEIIs/KnrITOhtdh+1y4PUzY dTGg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=mghipZ7KjYeZ0FTGp7Tk3ekEFHhrukqRx9uoxJv7lJY=; b=L2CY6Y8XdJAL+LwU5hyU6vNiDFAvj42cezoEiP5ahJjycKODRz4ha+Q0P+NOpyV5gO SUwjXX4CXvwdIKgumU2ZCwzRm155usaig3UFKfHycvJzURBXfu9vnM78RRe/ouXT3goB jdezw7YZVCnO6P+u+7V19QFhmGTfYtOcT+DB8dW9gmZuCte9XntSmVUgeenwrIa62V1W vNu2wslvtjljALyzT65Vpob1KQS8HfVuXfWQZmu2bgZcfFL+XrGSiQyQwdiGxt0PreNh d7t8JSBBYGBWFPypYtL5y6qMVlXi1RiFvkYaxMTUPhkfBaIW4UwWdNqQedTFl0UUO5vy Edng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=n50aFp0a; 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=tesarici.cz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b19-20020aa7d493000000b004c056644702si11249690edr.400.2023.04.04.22.01.09; Tue, 04 Apr 2023 22:02:10 -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=@tesarici.cz header.s=mail header.b=n50aFp0a; 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=tesarici.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236886AbjDEEkk (ORCPT + 99 others); Wed, 5 Apr 2023 00:40:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236714AbjDEEkj (ORCPT ); Wed, 5 Apr 2023 00:40:39 -0400 Received: from bee.tesarici.cz (bee.tesarici.cz [IPv6:2a03:3b40:fe:2d4::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D50732127 for ; Tue, 4 Apr 2023 21:40:37 -0700 (PDT) Received: from meshulam.tesarici.cz (unknown [213.235.133.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bee.tesarici.cz (Postfix) with ESMTPSA id 6D8B41476CB; Wed, 5 Apr 2023 06:40:25 +0200 (CEST) Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail; t=1680669629; bh=mghipZ7KjYeZ0FTGp7Tk3ekEFHhrukqRx9uoxJv7lJY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=n50aFp0ah0fQMPX/2Sf2WckMc09pbxAOz+P3m6LKnYxwdBq4381+4sVswaKJyA/j7 +4b+C/OJJXdKWyZYy0d4f3jO9P/eTWjtOppiVYH/HPOmrx551zsjyKSz8mmALo0daL 2+wjF6EKMPj3FvZ2/fStmwXiGayjo5pi1j1hjZ7lC9qpxJghFf9hCBseR0KKsplmUk zkzc+S1FZ4owdLbGYzPBH7uGIMSmZqrKQCDvWn5fi2kmdyk9M1NuEbckVJkuEsn0EL 5ST9lOSqLzklpEYV2G9txpH+gY7oveKHdaKca6ThPqvlY1bADcwqks9SqbLqSCAFJp E/aQsaT8YQPdg== Date: Wed, 5 Apr 2023 06:40:19 +0200 From: Petr =?UTF-8?B?VGVzYcWZw61r?= To: Dexuan Cui Cc: Dexuan-Linux Cui , Petr Tesarik , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Konrad Rzeszutek Wilk , Jianxiong Gao , David Stevens , Joerg Roedel , "open list:DMA MAPPING HELPERS" , open list , Roberto Sassu , "Michael Kelley (LINUX)" , Tianyu Lan , "linux-hyperv@vger.kernel.org" Subject: Re: [PATCH v1 2/2] swiotlb: Fix slot alignment checks Message-ID: <20230405064019.6258ebb3@meshulam.tesarici.cz> In-Reply-To: References: X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_SBL_CSS,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: *** 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 Hi Dexuan, On Tue, 4 Apr 2023 20:11:18 +0000 Dexuan Cui wrote: > > From: Dexuan-Linux Cui > > Sent: Tuesday, April 4, 2023 12:55 PM > >=20 > > On Tue, Mar 21, 2023 at 1:37=E2=80=AFAM Petr Tesarik > > wrote: > > ... > >=20 > > Hi Petr, this patch has gone into the mainline: > > 0eee5ae10256 ("swiotlb: fix slot alignment checks") > >=20 > > Somehow it breaks Linux VMs on Hyper-V: a regular VM with > > swiotlb=3Dforce or a confidential VM (which uses swiotlb) fails to boot. > > If I revert this patch, everything works fine. =20 >=20 > The log is pasted below. Looks like the SCSI driver hv_storvsc fails to > detect the disk capacity: The first thing I can imagine is that there are in fact no (free) slots in the SWIOTLB which match the alignment constraints, so the map operation fails. However, this would result in a "swiotlb buffer is full" message in the log, and I can see no such message in the log excerpt you have posted. Please, can you check if there are any "swiotlb" messages preceding the first error message? Petr T