From win-pv-devel-bounces@lists.xenproject.org Fri Oct 04 13:07:49 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 04 Oct 2024 13:07:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.810392.1223086 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1swi27-0008Ix-Ex; Fri, 04 Oct 2024 13:07:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 810392.1223086; Fri, 04 Oct 2024 13:07:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1swi27-0008Iq-CM; Fri, 04 Oct 2024 13:07:47 +0000
Received: by outflank-mailman (input) for mailman id 810392;
 Fri, 04 Oct 2024 13:07:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=v+dN=RA=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1swi26-0008If-5S
 for win-pv-devel@lists.xenproject.org; Fri, 04 Oct 2024 13:07:46 +0000
Received: from fhigh-a5-smtp.messagingengine.com
 (fhigh-a5-smtp.messagingengine.com [103.168.172.156])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a3118647-8251-11ef-a0bb-8be0dac302b0;
 Fri, 04 Oct 2024 15:07:44 +0200 (CEST)
Received: from phl-compute-12.internal (phl-compute-12.phl.internal
 [10.202.2.52])
 by mailfhigh.phl.internal (Postfix) with ESMTP id 8F40911401DA;
 Fri,  4 Oct 2024 09:07:40 -0400 (EDT)
Received: from phl-mailfrontend-01 ([10.202.2.162])
 by phl-compute-12.internal (MEProxy); Fri, 04 Oct 2024 09:07:40 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 4 Oct 2024 09:07:39 -0400 (EDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a3118647-8251-11ef-a0bb-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:message-id:mime-version:reply-to
	:subject:subject:to:to; s=fm2; t=1728047260; x=1728133660; bh=2N
	cX0jHSCgfN9L5WNlnDgOC4yrQEEz7nSps6JqoB5wM=; b=XKhxLBVgreU484AoVV
	+4grawtWitdURDKSFI4TKq4BM8KsHq2EerTWuhdjAqdxKqukJ8yd+IGHK3v14Wws
	oiyX/rrdyJx5SutcLclxxbawjtnBmb9GFzHMeJzbKnIDZhI0so7sf1zmJ2/RxF37
	UxM/6bIgVVrwhttq4XTvzVewmTkfWNK7l3pPPunfBX8qCzuaptSb60QSw3ikb6iZ
	WOmhSZlyW4CrzA4dnFKNCYidTeaLOOXAd3tSWZdt2pCFa2DKPSBk9p/y8bGj9CUi
	rL5mbOzH8wr3LKXTzsfpVGZDMikTDG9jdQn5i3eTF7+foz72nx7mY5N0BaPOP1Vz
	lb/g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:message-id
	:mime-version:reply-to:subject:subject:to:to:x-me-proxy
	:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1728047260; x=1728133660; bh=2NcX0jHSCgfN9L5WNlnDgOC4yrQEEz7nSps
	6JqoB5wM=; b=Wq271bZ5E+KJNPv859vGqmFT/oyz+WLzU7mrjoqdWx4wKvdhBQQ
	9D827EZeYJdLcLU7WpHdxVp4CFX7dTXwi+9+l5L3YYKt6HX5KE8/B92P2ZXuadNd
	AQIwoPniBLSs2YhzLefupR7vg1akHHrNgvko4w2nDzVOtG56nzSrBZnRHP0AtPNU
	ZJYDqOJDcervuL4QxxRPZWI5N3Eiq3JuDneqOWLIh45HXey85sTeUBxrcGL4pZo2
	tStuJBQBbP4qThTC7agHEmTuUuKknSVIb3T5CKunDNvcGoOCUsY2tYdVL7LgR8w0
	glZLjd0t+MYimN876pFkDV6YB0H+5ZW89Hg==
X-ME-Sender: <xms:nOj_Zvm55qxJPUcCQzq1FaUANE0JsCg0-Qax43aryIkhmKWeIPEa7g>
    <xme:nOj_Zi0B1ZAUAQlgFlytav-oG9zpb93mmhdpvhCGjUIo3yg_35_vk0urg4JnOhJEj
    LRWOKUuZyQ_IQ>
X-ME-Received: <xmr:nOj_ZlpGnBzEfVKZzKjq1F5g4ll5TvrRMBbvqy9uQL1qcH2t8p-EFZ-IAuOb71VM4Agrt37GWCEY2dtgiIxOF9hWkqfN0Qu3cg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvfedgiedtucetufdoteggodetrfdotf
    fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu
    rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvve
    fukfggtggusehgtderredttdejnecuhfhrohhmpeforghrvghkucforghrtgiihihkohif
    shhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinh
    hgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefhteeuhfeigfdttdelgffggfeg
    veehtddvfeffuefgieeiieehfeetfeeggfegjeenucffohhmrghinhepghhithhhuhgsrd
    gtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep
    mhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomhdpnhgspg
    hrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepfihinhdqphhv
    qdguvghvvghlsehlihhsthhsrdigvghnphhrohhjvggtthdrohhrghdprhgtphhtthhope
    igvghnqdguvghvvghlsehlihhsthhsrdigvghnphhrohhjvggtthdrohhrgh
X-ME-Proxy: <xmx:nOj_Znk8msFTmSN9K2zLBr7YBmHh0-rAyTup32WyNANEk5mPtZ_MLw>
    <xmx:nOj_Zt050OrRRa5MVn3HnR6t_VqR7hT8waZ9rPiWuVpqzr7C2d61tw>
    <xmx:nOj_ZmvNR426XrYQjInQD0e2VvPP4eW6E41vmpZsg7ZibebhDrzYwA>
    <xmx:nOj_ZhUqYkVv7wqLXIbxhHcytKOISYav3Rm4qkWfZfwFtlWfxPByJg>
    <xmx:nOj_Zu_9RMABc7wuoSSc0vm0Lm-aLk5qxKZDrLn-5y2J6U2Ui7zT2Bek>
Feedback-ID: i1568416f:Fastmail
Date: Fri, 4 Oct 2024 15:07:37 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: win-pv-devel@lists.xenproject.org
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: xenvbd driver modifies in-flight data?
Message-ID: <Zv_omQjCFbw8sQRb@mail-itl>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="1K61LwtFAmappi+0"
Content-Disposition: inline


--1K61LwtFAmappi+0
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Fri, 4 Oct 2024 15:07:37 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: win-pv-devel@lists.xenproject.org
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: xenvbd driver modifies in-flight data?

Hi,

I've got a bit worrying report[1], that using Windows PV block driver,
together with backing file opened with O_DIRECT on BTRFS results in
checksum errors. At this point it's unclear what exactly happens there,
it could be some BTRFS issue, some xen-blkback issue, but since
according to reports it happens only with Windows DomU, the most likely
culprit is PV driver inside Windows DomU. It was detected on BTRFS
because it does checksumming, but it isn't clear whether other file
systems are not affected too.=20

I guess using O_DIRECT is asking for troubles here, but nevertheless, it
looks like it might have uncovered some issue that would be silently
ignored otherwise.

[1] https://github.com/QubesOS/qubes-issues/issues/9488#issuecomment-238915=
2014

--=20
Best Regards,
Marek Marczykowski-G=C3=B3recki
Invisible Things Lab

--1K61LwtFAmappi+0
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmb/6JkACgkQ24/THMrX
1yzZ0Qf7B6Xl0cPD5MjF0AAuw6NLe7U9/6s9sypNh26znx1dLLgB230Q0firIM3Y
5BKOFOHqqw1nZ5t1h4QyArfe0y35Mrrx+0iqJUR/8p59J+hnxESNNIwuTax9y+ZC
OnYR/gSD8n82pSXj0LW7CwB600CRcanoX0A9RFZjiN3jGcch670dFtJ55uXFJF7M
QY98JiKsCoFQftkWYOmQANyez4AJDkxJiyinUKkMSqW7az3cTTWm6w/3lh4bnPKi
GJO5lZQS6ADqCvuXbgyu9TgcLqZ6cCIKi6EKvT2VoyTMULsoUdpOk+ahKKqL2OVg
DH/zEvSh1t+xjCK6W7sfC9mdvIe27w==
=3dN4
-----END PGP SIGNATURE-----

--1K61LwtFAmappi+0--


From win-pv-devel-bounces@lists.xenproject.org Fri Oct 04 14:24:29 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 04 Oct 2024 14:24:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.810458.1223175 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1swjEI-0007qY-Ow; Fri, 04 Oct 2024 14:24:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 810458.1223175; Fri, 04 Oct 2024 14:24:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1swjEI-0007qQ-M5; Fri, 04 Oct 2024 14:24:26 +0000
Received: by outflank-mailman (input) for mailman id 810458;
 Fri, 04 Oct 2024 14:24:24 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AGCP=RA=gmail.com=xadimgnik@srs-se1.protection.inumbo.net>)
 id 1swjEG-0007qK-PZ
 for win-pv-devel@lists.xenproject.org; Fri, 04 Oct 2024 14:24:24 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 58b82d4c-825c-11ef-99a2-01e77a169b0f;
 Fri, 04 Oct 2024 16:24:22 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5c8844f0ccaso2711132a12.0
 for <win-pv-devel@lists.xenproject.org>; Fri, 04 Oct 2024 07:24:21 -0700 (PDT)
Received: from [192.168.7.212] (54-240-197-239.amazon.com. [54.240.197.239])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a99100a37cdsm235240766b.3.2024.10.04.07.24.19
 for <win-pv-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 04 Oct 2024 07:24:19 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 58b82d4c-825c-11ef-99a2-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1728051860; x=1728656660; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:to:subject:reply-to:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=7qHXZ137v6GtE0hf6aCnnTfkww94TO5XEbA3AOHCfqE=;
        b=nCptJDF7doibDV8upJO5KtCqsiCpZLSSxkkKu0I2zjk6gUG6r5DbKn812AmNSPPG0Y
         yiE+6nOAt/Omi8HpbUSszYQGx0ej+0FYahHmuj6Ui0+cC6+tDrtADnrgvorcS3HugoZD
         xi5/59jq3FxRq5F5oKkHbLU/rzvqWXinD+CCWJKZBjaPITr2VBGik0XiR1JNypOuTYX1
         21UnjuYfHT/M+0D0eJ5DU4Jm7vIWwO1ad07+hp1R/wKkwdZJ2vfDojhVKf6FBniRZ9L3
         kaqM9PQZ6N2YdtPqP1yVX8OpSK/Lj4DapKs1yaaDlDK/OhZcf4MKVgzxCiaP1wWjY6KP
         Agmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1728051860; x=1728656660;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:to:subject:reply-to:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=7qHXZ137v6GtE0hf6aCnnTfkww94TO5XEbA3AOHCfqE=;
        b=NZ2YCCG657qe106rJluZik5NxNj2nckI7MZRQ65kTiWGZ3bFYN3smBPGn1xRVS79B1
         Q/NGtxeUH+ZGO7awjDBtfVurIyGcHHPbmjuIuyFFRTjIe8ygqMneECWtlsljjs8MkHBJ
         ZdfHH+vtlKG9wD/QPhS3OX3NlCh63OFubNizWSgVNBwIX70ONxNGFrgYrZWs3DGJejzk
         0hCRlURaQBAhEyY0krQ00iZDH0sgoBA9FPnqDOsa8tdCm8tyUO1xvGxdZ7hqcalJ106y
         ovdHd53BUnEctRVqwOYiFORA6OzQ0tFCal4jbnbg//0bS09rXJeZGwfWLDuQS8HyeUI1
         pwMg==
X-Gm-Message-State: AOJu0Yxx5+/1xIos3e+N791MnUvSpDxLci3NhWep1QQR8wY2VveXL9Mp
	ng+HA2sPFEUMcZd6vAm/LIerhUxbhvuMZTHg/frqwuFGItVEmAwTNhF7QqZO+wI=
X-Google-Smtp-Source: AGHT+IF0XMN9DyFNu2AOHEOdjK5FkJCLbrEhW+GwQaBpJmAb04HXODxuFG7JWk4c4VYaiOgQWPxZhg==
X-Received: by 2002:a17:907:26c1:b0:a86:7c5d:1856 with SMTP id a640c23a62f3a-a991c0314f3mr330302766b.46.1728051860254;
        Fri, 04 Oct 2024 07:24:20 -0700 (PDT)
Message-ID: <744b3c4e-6ef4-4ac0-98b4-a9023631a008@gmail.com>
Date: Fri, 4 Oct 2024 15:24:19 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Reply-To: paul@xen.org
Subject: Re: xenvbd driver modifies in-flight data?
To: win-pv-devel@lists.xenproject.org
References: <Zv_omQjCFbw8sQRb@mail-itl>
Content-Language: en-US
From: "Durrant, Paul" <xadimgnik@gmail.com>
In-Reply-To: <Zv_omQjCFbw8sQRb@mail-itl>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 04/10/2024 14:07, Marek Marczykowski-Górecki wrote:
> Hi,
> 
> I've got a bit worrying report[1], that using Windows PV block driver,
> together with backing file opened with O_DIRECT on BTRFS results in
> checksum errors. At this point it's unclear what exactly happens there,
> it could be some BTRFS issue, some xen-blkback issue, but since
> according to reports it happens only with Windows DomU, the most likely
> culprit is PV driver inside Windows DomU. It was detected on BTRFS
> because it does checksumming, but it isn't clear whether other file
> systems are not affected too.
> 
> I guess using O_DIRECT is asking for troubles here, but nevertheless, it
> looks like it might have uncovered some issue that would be silently
> ignored otherwise.
> 
> [1] https://github.com/QubesOS/qubes-issues/issues/9488#issuecomment-2389152014
> 

Using O_DIRECT is the norm for Xen block backends to avoid anything 
being cached. I've never heard of XENVBD ever causing corruption 
either... The only corruption cases I ever came across were because 
something had gone wrong with emulated unplug and so the IDE device was 
still present in the VM and was treated as a separate disk.

   Cheers,

     Paul


From win-pv-devel-bounces@lists.xenproject.org Mon Oct 21 11:47:19 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 21 Oct 2024 11:47:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.823404.1237395 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1t2qsX-0002Cn-5Q; Mon, 21 Oct 2024 11:47:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 823404.1237395; Mon, 21 Oct 2024 11:47:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1t2qsX-0002Cg-2s; Mon, 21 Oct 2024 11:47:17 +0000
Received: by outflank-mailman (input) for mailman id 823404;
 Mon, 21 Oct 2024 11:47:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Q77J=RR=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1t2qsV-0002Ca-GV
 for win-pv-devel@lists.xenproject.org; Mon, 21 Oct 2024 11:47:15 +0000
Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com
 [2a00:1450:4864:20::22e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3670de6d-8fa2-11ef-a0be-8be0dac302b0;
 Mon, 21 Oct 2024 13:47:14 +0200 (CEST)
Received: by mail-lj1-x22e.google.com with SMTP id
 38308e7fff4ca-2fb56cb61baso33877741fa.1
 for <win-pv-devel@lists.xenproject.org>; Mon, 21 Oct 2024 04:47:13 -0700 (PDT)
Received: from mewpvdipd1026.corp.cloud.com ([52.174.59.202])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5cb66a65529sm1859024a12.40.2024.10.21.04.47.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 21 Oct 2024 04:47:12 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3670de6d-8fa2-11ef-a0be-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1729511232; x=1730116032; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=UnyxUycu7ZT6oVuUaRDbRDGZ26hEDThlT42E5xVxHmk=;
        b=D0t+Ui8eddYZncU6i+G4vNcLTgpi+wWjkvL3rhfJwN/PIXFnz8PNdhTSCGrejAt5bJ
         BeeOw8OwtLsgs0UBPy+YQPur/vLb4HUJaJiBSTgJvZWUgnaAiJetO/j97uQMq718rvK2
         wnLKAma3DYd4KzXgIKulLXEFpFs8S16uBAZqs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1729511232; x=1730116032;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=UnyxUycu7ZT6oVuUaRDbRDGZ26hEDThlT42E5xVxHmk=;
        b=QmIPZhvGA251Dy1WJx3PwacNrRG4tsS980mq7qUkiSk/2C26yOWh9TfrXIhdHqyPI8
         uXNNZFMY2+miF30qsDAHLVf61iv0JGQcoRDX+u/hlSl8Z4Sm9I8onOXjJVTWoAzqjEjR
         xqqMuDfHuwHTHdayWUQvyIGW2NomSa+ujz6ZgI7tj3bp9EsEjCfP7+/MBh5wnf00D8am
         EHQnsqVvwlVsCXv9/rJ2lTfvPx1klfq22seA8As5DEQOU0Z758xfmrIsd+opxiFoo51L
         mVaSNaqGLPaAyhYE9S3Kuelk5xgoduAQb9leEROoPJGQ4234YHXnhf7dKAsjVybRldUS
         wKjw==
X-Gm-Message-State: AOJu0YzPxdyQQE5Ju78KJ5Q31+uRYUdlhENu3ApugmFoJipFXV1KPfJS
	ZUv3dpULkaLqHbCKu93HI/+WOg4T1W/JFDT8pXMoqmyEbaq26gLPOJFh3qpgbqIKEU0NY0oFQPw
	UEA==
X-Google-Smtp-Source: AGHT+IGPCjxJGuMc6KywapPCswptrrqeLzTI13zDD6bej733LjeYlcoXG7xEpswnPnIMbD0NshXvQA==
X-Received: by 2002:a2e:b8cc:0:b0:2fb:6229:c597 with SMTP id 38308e7fff4ca-2fb82e90c78mr53253961fa.4.1729511232488;
        Mon, 21 Oct 2024 04:47:12 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [PATCH] Allow BLKIF_OP_WRITE_BARRIER or BLKIF_OP_FLUSH_DISKCACHE...
Date: Mon, 21 Oct 2024 12:47:08 +0100
Message-ID: <20241021114708.453-1-owen.smith@cloud.com>
X-Mailer: git-send-email 2.46.0.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

... when a SCSIOP_SYNCHRONIZE_CACHE is issued, which should be the last
operation issued by the crash kernel.
Certain backends do not advertise WriteBarrier support, and use SyncDiskCache
instead. Add support for creating crashdumps on these backends.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 src/xencrsh/frontend.c | 13 ++++++++++++-
 src/xencrsh/frontend.h |  1 +
 src/xencrsh/pdo.c      | 27 ++++++++++++++++++++++++---
 3 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/src/xencrsh/frontend.c b/src/xencrsh/frontend.c
index d88f498..0b9e46b 100644
--- a/src/xencrsh/frontend.c
+++ b/src/xencrsh/frontend.c
@@ -268,6 +268,7 @@ FrontendInsertRequestOnRing(
         }
         break;
     case BLKIF_OP_WRITE_BARRIER:
+    case BLKIF_OP_FLUSH_DISKCACHE:
         RingReq->operation          = Request->Operation;
         RingReq->nr_segments        = 0;
         RingReq->handle             = (USHORT)Frontend->DeviceId;
@@ -470,6 +471,15 @@ __ReadFeatures(
         Frontend->FeatureBarrier = FALSE;
     }
 
+    Status = StoreRead(NULL, Frontend->BackendPath,
+                        "feature-flush-cache", &Buffer);
+    if (NT_SUCCESS(Status)) {
+        Frontend->FeatureFlush = (strtoul(Buffer, NULL, 10) == 1);
+        AustereFree(Buffer);
+    } else {
+        Frontend->FeatureFlush = FALSE;
+    }
+
     Status = StoreRead(NULL, Frontend->BackendPath,
                         "feature-discard", &Buffer);
     if (NT_SUCCESS(Status)) {
@@ -479,9 +489,10 @@ __ReadFeatures(
         Frontend->FeatureDiscard = FALSE;
     }
 
-    LogVerbose("Features: DomId=%d, RingOrder=0, %s %s\n",
+    LogVerbose("Features: DomId=%d, RingOrder=0, %s %s %s\n",
                 Frontend->BackendId,
                 Frontend->FeatureBarrier ? "BARRIER" : "NOT_BARRIER",
+                Frontend->FeatureFlush ? "FLUSH" : "NOT_FLUSH",
                 Frontend->FeatureDiscard ? "DISCARD" : "NOT_DISCARD");
 }
 static VOID
diff --git a/src/xencrsh/frontend.h b/src/xencrsh/frontend.h
index 174e4d7..2e2c305 100644
--- a/src/xencrsh/frontend.h
+++ b/src/xencrsh/frontend.h
@@ -62,6 +62,7 @@ typedef struct _XENVBD_FRONTEND {
     // Capabilities
     BOOLEAN                     Connected;
     BOOLEAN                     FeatureBarrier;
+    BOOLEAN                     FeatureFlush;
     BOOLEAN                     FeatureDiscard;
     BOOLEAN                     Paging;
     BOOLEAN                     Hibernation;
diff --git a/src/xencrsh/pdo.c b/src/xencrsh/pdo.c
index 9fe3c53..76c4d59 100644
--- a/src/xencrsh/pdo.c
+++ b/src/xencrsh/pdo.c
@@ -564,17 +564,31 @@ PrepareSyncCache(
 {
     PXENVBD_SRBEXT          SrbExt = GetSrbExt(Srb);
     PXENVBD_REQUEST         Request;
-    
+    UCHAR                   Operation;
+
+    if (Pdo->Frontend.FeatureBarrier) {
+        Operation = BLKIF_OP_WRITE_BARRIER;
+    } else if (Pdo->Frontend.FeatureFlush) {
+        Operation = BLKIF_OP_FLUSH_DISKCACHE;
+    } else {
+        // cannot submit this to backend, just complete the SRB
+        Srb->SrbStatus = SRB_STATUS_SUCCESS;
+        Srb->ScsiStatus = 0x00; // SCSI_GOOD
+
+        FdoCompleteSrb(Pdo->Fdo, Srb);
+        return;
+    }
+
     SrbExt->NumRequests = 1;
     Request = &SrbExt->Requests[0];
     Request->Srb = Srb;
 
-    Request->Operation      = BLKIF_OP_WRITE_BARRIER;
+    Request->Operation      = Operation;
     Request->NrSegments     = 0;
     Request->FirstSector    = Cdb_LogicalBlock(Srb);
     Request->NrSectors      = 0;
 
-    __UpdateStats(Pdo, BLKIF_OP_WRITE_BARRIER);
+    __UpdateStats(Pdo, Operation);
     QueueInsertTail(&Pdo->PreparedSrbs, Srb);
 }
 
@@ -692,6 +706,13 @@ PdoCompleteSubmittedRequest(
             Pdo->Frontend.FeatureBarrier = FALSE;
         }
         break;
+    case BLKIF_OP_FLUSH_DISKCACHE:
+        LogVerbose("FLUSH\n");
+        if (Status == BLKIF_RSP_EOPNOTSUPP) {
+            // remove supported feature
+            Pdo->Frontend.FeatureFlush = FALSE;
+        }
+        break;
     case BLKIF_OP_DISCARD:
         LogVerbose("DISCARD\n");
         if (Status == BLKIF_RSP_EOPNOTSUPP) {
-- 
2.46.0.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Oct 28 13:02:30 2024
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 28 Oct 2024 13:02:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.826516.1240794 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1t5PO8-0004xp-9e; Mon, 28 Oct 2024 13:02:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 826516.1240794; Mon, 28 Oct 2024 13:02:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1t5PO8-0004xi-74; Mon, 28 Oct 2024 13:02:28 +0000
Received: by outflank-mailman (input) for mailman id 826516;
 Mon, 28 Oct 2024 13:02:26 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HGLw=RY=cloud.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1t5PO6-0004xc-Lp
 for win-pv-devel@lists.xenproject.org; Mon, 28 Oct 2024 13:02:26 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id df189ec5-952c-11ef-99a3-01e77a169b0f;
 Mon, 28 Oct 2024 14:02:24 +0100 (CET)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a9a4031f69fso578911266b.0
 for <win-pv-devel@lists.xenproject.org>; Mon, 28 Oct 2024 06:02:22 -0700 (PDT)
Received: from mewpvdipd1026.corp.cloud.com ([52.174.59.202])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a9afcef10efsm376693966b.0.2024.10.28.06.02.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 28 Oct 2024 06:02:20 -0700 (PDT)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: df189ec5-952c-11ef-99a3-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1730120541; x=1730725341; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=4ptTcwJYDMBt9ujqCI9QCHk8+bWX2kXi4RbO5FxWFmY=;
        b=iDMoMGvG7sVsh2I5dz0qLfDb6W7EyYXwHi68GX1SauHouQrAz6qSYmCWHP7LZ1NP20
         +kG/icl2rRVh2xJn/YZ0UDgnQhzWWzbtnlKymDUF9i0XpYTlT6aQxtkgnSTP39CGOUnu
         Nm6nmg2AuBrehIveMp+szjsfbb6HjDyZ7bMr4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1730120541; x=1730725341;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=4ptTcwJYDMBt9ujqCI9QCHk8+bWX2kXi4RbO5FxWFmY=;
        b=Dc8ZObFl+p9UC2n8yUuNORrb4aiyQY+pCvxIGv4BKKIGuPTBe62hFldIb8Ph2NA0DR
         fbpBIwUO1eGEVR+KqUdbVZD4NjBaQtC26GgoDgSLHMNXqtBFRqaWyuSWBEvSIRGJWGKO
         jsFZpsQfETdEXx1ShQOFvba4bEZvyb9Ly7vhXRC21kWo8LifoloZ7+DSzTvBiP0v4ywE
         6EKdJTd3T0PZEDtw5ZW4ztn49TPmfe07AU7l3eYHKBOs+Rzh+LuvKx/51OUmEyxXPohM
         2APdBY4dj4aAeqFFGYywRIqcjPm0aRTllxfJ4MDWRCFLHiMwjySHo02C68MoKytn0oyL
         N78g==
X-Gm-Message-State: AOJu0YwiYQIDp//izdndGUOztyutaK6ZtKfDtmPhsFesXOu0TDZOWA7b
	HUbRQm43+egGVnaOFMl9pc6WgoksOnLnCQzEeanfHWl4KoNGQyjWrwsTZQUph4O6EUXz5d8WXV7
	cXQ==
X-Google-Smtp-Source: AGHT+IGn15HlysSPTMMAer40Bl+X/QPjAxq2vIgbmw91dxqGMJN5dgQO1jvGiUm3DS5QbxAnGvUjZg==
X-Received: by 2002:a17:907:6eac:b0:a9a:7f91:8c76 with SMTP id a640c23a62f3a-a9de5a3e0ebmr918528566b.0.1730120540654;
        Mon, 28 Oct 2024 06:02:20 -0700 (PDT)
From: Owen Smith <owen.smith@cloud.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [PATCH] Add DeviceID info to DisplayNames
Date: Mon, 28 Oct 2024 13:02:16 +0000
Message-ID: <20241028130217.816-1-owen.smith@cloud.com>
X-Mailer: git-send-email 2.46.0.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Append the DeviceID info to the strings used for the DisplayName strings.
Use the current genfiles.ps1 script, as part of the version project, to
populate the %XenBusName_VEND% value (or remove the lines) to match the
binding hardware ID.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 src/xenbus.inf | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/xenbus.inf b/src/xenbus.inf
index 73a2b11..7cc9ac2 100644
--- a/src/xenbus.inf
+++ b/src/xenbus.inf
@@ -69,9 +69,9 @@ xenbus_monitor_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.dl
 ; DisplayName		Section		DeviceID
 ; -----------		-------		--------
 
-%XenBusName%		=XenBus_Inst,	PCI\VEN_5853&DEV_@VENDOR_DEVICE_ID@&SUBSYS_@VENDOR_DEVICE_ID@5853&REV_01
-%XenBusName%		=XenBus_Inst,	PCI\VEN_5853&DEV_0002
-%XenBusName%		=XenBus_Inst,	PCI\VEN_5853&DEV_0001
+%XenBusName_VEND%	=XenBus_Inst,	PCI\VEN_5853&DEV_@VENDOR_DEVICE_ID@&SUBSYS_@VENDOR_DEVICE_ID@5853&REV_01
+%XenBusName_0002%	=XenBus_Inst,	PCI\VEN_5853&DEV_0002
+%XenBusName_0001%	=XenBus_Inst,	PCI\VEN_5853&DEV_0001
 
 [XenBus_Inst] 
 CopyFiles=XenBus_CopyFiles
@@ -149,6 +149,9 @@ HKR,,TypesSupported,0x00010001,7
 Vendor="@VENDOR_NAME@" 
 DiskDesc="@PRODUCT_NAME@ PV Bus Package" 
 XenBusName="@PRODUCT_NAME@ PV Bus"
+XenBusName_VEND="@PRODUCT_NAME@ PV Bus (@VENDOR_DEVICE_ID@)"
+XenBusName_0002="@PRODUCT_NAME@ PV Bus (0002)"
+XenBusName_0001="@PRODUCT_NAME@ PV Bus (0001)"
 XenFiltName="@PRODUCT_NAME@ Generic Bus Filter"
 MonitorName="@PRODUCT_NAME@ PV Driver Monitor"
 MonitorDesc="Provides support for @PRODUCT_NAME@ PV drivers"
-- 
2.46.0.windows.1



