lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
 <MW4PR12MB72133DAC9A35687D33DCCDC0B04B2@MW4PR12MB7213.namprd12.prod.outlook.com>
Date: Fri, 9 Feb 2024 14:12:01 +0000
From: Ankit Agrawal <ankita@...dia.com>
To: Will Deacon <will@...nel.org>
CC: Jason Gunthorpe <jgg@...dia.com>, "maz@...nel.org" <maz@...nel.org>,
	"oliver.upton@...ux.dev" <oliver.upton@...ux.dev>, "james.morse@....com"
	<james.morse@....com>, "suzuki.poulose@....com" <suzuki.poulose@....com>,
	"yuzenghui@...wei.com" <yuzenghui@...wei.com>, "reinette.chatre@...el.com"
	<reinette.chatre@...el.com>, "surenb@...gle.com" <surenb@...gle.com>,
	"stefanha@...hat.com" <stefanha@...hat.com>, "brauner@...nel.org"
	<brauner@...nel.org>, "catalin.marinas@....com" <catalin.marinas@....com>,
	"mark.rutland@....com" <mark.rutland@....com>, "alex.williamson@...hat.com"
	<alex.williamson@...hat.com>, "kevin.tian@...el.com" <kevin.tian@...el.com>,
	"yi.l.liu@...el.com" <yi.l.liu@...el.com>, "ardb@...nel.org"
	<ardb@...nel.org>, "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"andreyknvl@...il.com" <andreyknvl@...il.com>, "wangjinchao@...sion.com"
	<wangjinchao@...sion.com>, "gshan@...hat.com" <gshan@...hat.com>,
	"ricarkol@...gle.com" <ricarkol@...gle.com>, "linux-mm@...ck.org"
	<linux-mm@...ck.org>, "lpieralisi@...nel.org" <lpieralisi@...nel.org>,
	"rananta@...gle.com" <rananta@...gle.com>, "ryan.roberts@....com"
	<ryan.roberts@....com>, Aniket Agashe <aniketa@...dia.com>, Neo Jia
	<cjia@...dia.com>, Kirti Wankhede <kwankhede@...dia.com>, "Tarun Gupta
 (SW-GPU)" <targupta@...dia.com>, Vikram Sethi <vsethi@...dia.com>, Andy
 Currid <acurrid@...dia.com>, Alistair Popple <apopple@...dia.com>, John
 Hubbard <jhubbard@...dia.com>, Dan Williams <danw@...dia.com>,
	"kvmarm@...ts.linux.dev" <kvmarm@...ts.linux.dev>, Matt Ochs
	<mochs@...dia.com>, Zhi Wang <zhiw@...dia.com>, "kvm@...r.kernel.org"
	<kvm@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v6 1/4] kvm: arm64: introduce new flag for non-cacheable
 IO memory

>>
>> +     switch (prot & (KVM_PGTABLE_PROT_DEVICE |
>> +                     KVM_PGTABLE_PROT_NORMAL_NC)) {
>> +     case 0:
>> +             attr = KVM_S2_MEMATTR(pgt, NORMAL);
>> +             break;
>> +     case KVM_PGTABLE_PROT_DEVICE:
>> +             if (prot & KVM_PGTABLE_PROT_X)
>> +                     return -EINVAL;
>> +             attr = KVM_S2_MEMATTR(pgt, DEVICE_nGnRE);
>> +             break;
>> +     case KVM_PGTABLE_PROT_NORMAL_NC:
>> +             attr = KVM_S2_MEMATTR(pgt, NORMAL_NC);
>> +             break;
>> +     default:
>> +             WARN_ON_ONCE(1);
>> +     }
>
> Cosmetic nit, but I'd find this a little easier to read if the normal
> case was the default (i.e. drop 'case 0') and we returned an error for
> DEVICE | NC.

Makes sense, will update the logic accordingly.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ