From patchwork Mon Jan 18 15:33:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)\" via" X-Patchwork-Id: 12027547 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B08AC433DB for ; Mon, 18 Jan 2021 15:35:52 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B4E3206F7 for ; Mon, 18 Jan 2021 15:35:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B4E3206F7 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=nongnu.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1WZL-0003Em-1U for qemu-devel@archiver.kernel.org; Mon, 18 Jan 2021 10:35:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1WXK-0001pT-7P; Mon, 18 Jan 2021 10:33:46 -0500 Received: from esa4.hc3370-68.iphmx.com ([216.71.155.144]:6368) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1WXH-0001VU-7F; Mon, 18 Jan 2021 10:33:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1610984022; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=5IgWQMiytAxeLeEdXsmof0S9L2LFsUa5TMj2P3zL12k=; b=QmvoSmNGHyHKT9IYZCFatHOb9M0WeUFFTQRknLObJP26fLplTnH2ifFk nvEKREtH8u5bcUAbgXurWQZFLWZBDNkLoYh1jKJ/9CZnpnUeZWzpW3q2y 0RkQzYXiUVsepp4rIpWK5lR557SVVxuTJmBxbkaQ1qN/FkWuCv51tSbnZ c=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com IronPort-SDR: VGue1MCqGxbMfd6Neo4leRV//MEVur/8VqgbzCLedVS3x5ugx/22Jwv/scH/7MGUZVgdSDlZdR OhuQ38U4/1pUiyGW3KbPvfXJHAXmx/SD18Dg3loMfR3/OzghWKrnLLLhuwEsZ/JdEQ8YGc9xrr O/PF1NLaFDzmQusCWrJTvdlAVaSUmJuP4oRujJvKewDNFtggzWUHjUKX8zRD+Nt4u6YuRIl/Qu z2FqZh6PsRCl5PAmhnXpUVMyG1lYW5AabGoiUv7hqNmgUZxVfbKPtMzJWBThdMMXoUs/8RhT/o zQ0= X-SBRS: 5.2 X-MesageID: 36604199 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.79,356,1602561600"; d="scan'208";a="36604199" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MFK6eCmH6+D8WPgct5aBDEebF0wYe11xD+9uVv0hFopyviKeHFk0Pgx1ChSWMwElbHC19RkGxqd+DFXo3pCqTlzVId1L9AO61J0aAN9n+rqeaRtSybFj8YV3Y+qdRRLsfxJOqLVet0ltkP/XOKWD7xB5TOClQkog/CwooTLARNXQo2uBEpDsgKqHVGdFJOWWTD6NC4tJvI3mfD1zq08bRDynHJKbOwe5jFki6Dd1T3DwgJ40k7mJLIa5hk1Cz4hxuKWFTIVVr3LOwqRjpHMYDuCBfITpd2LorTst9euqzYEZvPqLw+zmqtq+J95lkeBofD4Ol66IvYIp/FoHgAZYkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=414HAnI51gzZNcMd8XEwXwGUTwqdX0TMfXgV5vrF0kQ=; b=jYkCA2+GhmvKAOD/X17EvmllYFsnj0Evgjgk0OBaELlrl51teyQh7cU/I4kqYyEuZv9bfCLWx+ZxzfzlwttCjWQtSS/WhAmxUX8xPJx740rclxbkptNEg9fbD1z+ajSH29SGzwM/G8VFriT1LHVcubKOlCR3USQFAWfJUtP1vpeZ6LweU9B7poW/Wo6cPsz//KbmQUahj6I4t9cXssHHV8fPmwzsObfzAZBNIlqizUTf8O/F5gNWGJSwNN1PQFIz41zcjrCKtmt/P5POMtloyH0uX3sxb7a94+IQRpjKRjs6/w2u+MDuUcBOT38IeR6iLLqVFBdrSTXQX3eW6TRqKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=414HAnI51gzZNcMd8XEwXwGUTwqdX0TMfXgV5vrF0kQ=; b=ShQh2PU/7T2/saAemMr1dhYCp5fE1gU1VkXDftxyDaWrxIZcgOsOSmBARW/Opw2bGIdXIcHD6gVtHNK7PtSaA5R+KMj9UDxNV3ViKlZ745uKfXmGmrqd+Ic520ok55yZ3lZ6Q8/4y9Imf7waDMK9IOMrbYaB2X+F/SheVMDB/WQ= To: Subject: [PATCH] xen-block: fix reporting of discard feature Date: Mon, 18 Jan 2021 16:33:30 +0100 Message-ID: <20210118153330.82324-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.29.2 X-ClientProxiedBy: MR2P264CA0073.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:32::13) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ef8352a-9fd1-4db0-ce06-08d8bbc66bf5 X-MS-TrafficTypeDiagnostic: DM6PR03MB4219: X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +BMT44CkRZPYVXWRPAN2hQn+Vd/lyny2bHlgcy3pAPiAD5irsSxLw3wjAMXWFqYTb1+HOIWkvSo5py+V7CykYy9mdwah3L6dtw0ARtcwDnA4Fpht8J3FmON7txRqthdhm/ibiR/cmj0NN792iFrA8ObdyukFFF5ZUEPgYRimimH7ooz6MVXqaVlsu/EmdT9WWLJc5lhqjTfyeKH+6Q92/JC55OygCaei07eK2/vGnKta1uka835DENSSDq9KBEpLufYpCk15axWUepV66RJ0a8MDAUHqvGmTsIQAD9oHYRmqPPqRhkBEKjf8itO9z3nXO3w3QcozQUKpc3HKPfmMrU2teCJG9EK2uyVrWTl1x4wbycNwahwPNFtyGjo229JLVf1BUl15sSf5eeICxBGSaIENI3ecGcp3xBZgQFhy4Rj7KpOlRwcud4OUjaIO8ksgTEcnlWfsFe0ujt40ujqQAw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS7PR03MB5608.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(366004)(186003)(54906003)(2616005)(26005)(6916009)(1076003)(956004)(966005)(16526019)(83380400001)(8676002)(478600001)(316002)(86362001)(66556008)(8936002)(66476007)(5660300002)(4326008)(66946007)(36756003)(2906002)(6496006)(6486002)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?WMP1L4EuJtN3WMq5uqNSQjWGNwSTEk?= =?utf-8?q?0yY2zLEqrxhKQNN6oCxmKOwrpLHA4b3+gENGifvxEwi9CyAiauHaUdnEgpRSUHO6x?= =?utf-8?q?wC2Dkrd/qMfLuqbGDzSWK8T2T+XWuAZuYeT4J3mKf401yN6sNa1vAGX5acrEm8K0R?= =?utf-8?q?Yrpnc2ik8uiD3OruMsbssUpRLbxRDbX2d39jwWUfXkvPuW2SMVRsVI/AJ3F9X3rM+?= =?utf-8?q?YJ9vpYpK+DoyJ+XZ1jKGL/8xX/PSbzqifCVIZF9tCwYyVh6fVFjGCHXZF2PaqUJn/?= =?utf-8?q?uJ9gNdMLY1adhcgKntP4qV2GmDT2d4Yy2VrTpKOlKEiBcc/x/7y9Pah1XfJfojf7P?= =?utf-8?q?Z8KbyHxrpHs4U0h3MsRCmlsP6BPGNxb8RCQQaCQOk4B8tsNafWhFNQiqLKBURSctH?= =?utf-8?q?4rYx6KhglsiidBvEZqt0NRdJkOgddftB3yf1+76jiwkNALw8/9iKYUNlYKYAMSHcW?= =?utf-8?q?BBPxqz1OCM3aZRTAGAhthlvTppfY0bCBFoa343BSPnW1z3S3eyklACCbCY5Ps3DNf?= =?utf-8?q?Rbs/pmiCMEC+lHHGTXVKzICEZCkUpgvGNE36xtllOko0Rt5kFnIBqRCSeZpjll56O?= =?utf-8?q?t03un+Q8Eh/IsqDx4lzxD3wtTu4MzvAyM2q3zwsc6mqoQ8dvZMuB7Vc6tYZS3/jwS?= =?utf-8?q?Q8KRaq4iHrwR0qrPh5Gwt2Mnv/6xsTvDL7uQ8H1Z4hw4hy3XfdzKhlZ5HaRzRfZDK?= =?utf-8?q?h5PokP9w3MYHgYL7JvMZzmnG1/7xqDFarYz6LAIFgQ0f1o0fM8dPcvh2sJeNkTEML?= =?utf-8?q?5TY5MN2mfFmxtv8DGT85L02yrQJoOiNrTWhVEKy7+3LRXZUocZH4VAl5aLBQvy3A5?= =?utf-8?q?OqGJhw38e0qkTvN2c6D1jSgyUsTmY8QTY/on25H78G87CWr34msInMXfJH7KiACIp?= =?utf-8?q?0MJrnbdD//x0GAvpbY+KXe64Us043wtAFI+ZAKsAtZNephjOcMsw2ZsN90ZFYSjee?= =?utf-8?q?RIrOrwQcDXHbqhdJIdB?= X-MS-Exchange-CrossTenant-Network-Message-Id: 2ef8352a-9fd1-4db0-ce06-08d8bbc66bf5 X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2021 15:33:36.3976 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: d3aXhdyBLrtGMthpneCxYJ12F5+mBUVlQrZziJGefV3ia56Z5ELRIXNyuiR+XmHd2l9QWOT/VeE3waVHY1oZXg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB4219 X-OriginatorOrg: citrix.com Received-SPF: pass client-ip=216.71.155.144; envelope-from=roger.pau@citrix.com; helo=esa4.hc3370-68.iphmx.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Stefano Stabellini , qemu-block@nongnu.org, Paul Durrant , Arthur Borsboom , Max Reitz , Anthony Perard , xen-devel@lists.xenproject.org, Roger Pau Monne Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reply-to: Roger Pau Monne X-Patchwork-Original-From: roger.pau--- via From: "Zhijian Li (Fujitsu)\" via" Linux blkfront expects both "discard-granularity" and "discard-alignment" present on xenbus in order to properly enable the feature, not exposing "discard-alignment" left some Linux blkfront versions with a broken discard setup. This has also been addressed in Linux with: https://lore.kernel.org/lkml/20210118151528.81668-1-roger.pau@citrix.com/T/#u Fix QEMU to report a "discard-alignment" of 0, in order for it to work with older Linux frontends. Reported-by: Arthur Borsboom Signed-off-by: Roger Pau Monné Reviewed-by: Paul Durrant --- Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: Kevin Wolf Cc: Max Reitz Cc: xen-devel@lists.xenproject.org Cc: qemu-block@nongnu.org --- hw/block/xen-block.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 718d886e5c..246d9c23a2 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -253,6 +253,7 @@ static void xen_block_realize(XenDevice *xendev, Error **errp) xen_device_backend_printf(xendev, "feature-discard", "%u", 1); xen_device_backend_printf(xendev, "discard-granularity", "%u", conf->discard_granularity); + xen_device_backend_printf(xendev, "discard-alignment", "%u", 0); } xen_device_backend_printf(xendev, "feature-flush-cache", "%u", 1);