Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8803040rwr; Thu, 11 May 2023 06:30:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5PuBq6PtIdcLRP8Z9CbNLuOHJLWXaibg6KZJbR6MaJnnTZYl3vAKqFIU7FiLhbgIFeRpeo X-Received: by 2002:a05:6a21:33a8:b0:103:ee82:dc92 with SMTP id yy40-20020a056a2133a800b00103ee82dc92mr2455014pzb.60.1683811834396; Thu, 11 May 2023 06:30:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683811834; cv=none; d=google.com; s=arc-20160816; b=XQ2slQ46WDYSP0K0XTBvJPIptQyiBBGtfTySIo8JJU5X17AK/TzgJqsZA/RXDdTb2Z +bqzp5G0vGW6NyMP/9AfojJP7UlOhqwIFt+KtZiMQHDFxkMDnDTuwz9oALrcpPY7Rdvo OaoHy0b06bmlnyxD9Fsb+iagLwcrbRnx8Oeo09OtY191QHGiq/FIh0VjjuQuIWaF8kBc QO6OyPayQlLeqouQnLvL3vIuaU6NviN8Nc/+jogEcwCi79yF4dEA/v1jFyHDLBn1BLoz FSR5FBcWkb4r9uUjNvUI7tNFAjXoYO9K0CRVw2bjWc60wX/lxuYJigcgLMRNV+AKT0DO bJhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=yXN1X+z5ambEAc+bzP74ebt1H+9gjSv5BYNzgZqPVgY=; b=XFS7L8wyiyH6+3QzYuznE6O2uiqo3GNh1XxU6fURND9KiAiFrm2eETTMOjADATKaRQ ufMh6dikvtVLfBS29ArtfmexHFZUQjf5tsMiRlapA4er4udBfan9UPf+EUPASloZwuYW 6eRnnCP5X2B7UVk91zZifml6zBPMwARCCPIsh32dyBCJ3Toas1G9uiLSnBbo2A7mFoec JpNgRQonH3Nmmlg4IdhUVaYlmgTh5wfPrKjdlHXPWoEn2bffT57sP0BBp0TkYqBcm5us 5aD4dAvP7eUQLAbVdxjLDue4BPktevWRFzZG4ujTdKwxSqNw73Q4bvHBFo7oLw9hQ6h/ nFVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=BkTFKGG5; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z11-20020a6552cb000000b005307ce6fd07si1079015pgp.850.2023.05.11.06.30.22; Thu, 11 May 2023 06:30:34 -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=@suse.com header.s=susede1 header.b=BkTFKGG5; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238130AbjEKNZe (ORCPT + 99 others); Thu, 11 May 2023 09:25:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238424AbjEKNZG (ORCPT ); Thu, 11 May 2023 09:25:06 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E33C0100E9; Thu, 11 May 2023 06:23:16 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8A0691FEC0; Thu, 11 May 2023 13:23:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1683811395; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yXN1X+z5ambEAc+bzP74ebt1H+9gjSv5BYNzgZqPVgY=; b=BkTFKGG5GivUO6HQEAQ6qq5PbLw5r5KEokIsQ/ZYvhPO6btOeYZXW21TPdn2h4jYfmZ2oo 8S51Xs5Tzl3oivc+wVI8+c90gWjc1EEaM3W++wEBDC9TpPKtFtE/lpcXTxjEU+mP+2T5Of v8yMXj4ZoeXxT8hX1tsVHF5S2uExeWc= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4F1E4138FA; Thu, 11 May 2023 13:23:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Y8IrEUPsXGSuIwAAMHmgww (envelope-from ); Thu, 11 May 2023 13:23:15 +0000 Message-ID: Subject: Re: [PATCH] scsi: Let scsi_execute_cmd() mark args->sshdr as invalid From: Martin Wilck To: Juergen Gross , linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Cc: "James E.J. Bottomley" , "Martin K. Petersen" , stable@vger.kernel.org Date: Thu, 11 May 2023 15:23:14 +0200 In-Reply-To: <85a7dc28-74ec-f4d6-b5c3-ca456ce9d380@suse.com> References: <20230511123432.5793-1-jgross@suse.com> <095a2264120ad51d0500c4ce8221be2f88a9537e.camel@suse.com> <85a7dc28-74ec-f4d6-b5c3-ca456ce9d380@suse.com> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Thu, 2023-05-11 at 15:17 +0200, Juergen Gross wrote: > >=20 > > We know for certain that sizeof(*sshdr) is 8 bytes, and will most > > probably remain so. Thus > >=20 > > =A0=A0=A0=A0 memset(sshdr, 0, sizeof(*sshdr)) > >=20 > > would result in more efficient code. >=20 > I fail to see why zeroing a single byte would be less efficient than > zeroing > a possibly unaligned 8-byte area. I don't think it can be unaligned. gcc seems to think the same. It compiles the memset(sshdr, ...) in scsi_normalize_sense() into a single instruction on x86_64. 0xffffffff8177e9d0 : nopl 0x0(%rax,%rax,1) [FT= RACE NOP] 0xffffffff8177e9d5 : test %rdi,%rdi 0xffffffff8177e9d8 : movq $0x0,(%rdx) Martin