Re: [PATCH v8 26/38] KVM: arm64: Handle SME host state when running guests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 25, 2022 at 11:59:02AM +0000, Marc Zyngier wrote:
> Mark Brown <broonie@xxxxxxxxxx> wrote:

> > +	if (has_vhe()) {
> > +		if (system_supports_sme()) {

> nit:	if (has_vhe() && system_supports_sme()) {

> saves you one level of indentation.

Yes, for now.  IIRC there was some other stuff there when I had some of
the code for doing the register switching properly.

> > +			/* Also restore EL0 state seen on entry */
> > +			if (vcpu->arch.flags & KVM_ARM64_HOST_SME_ENABLED)
> > +				sysreg_clear_set(CPACR_EL1, 0,
> > +						 CPACR_EL1_SMEN_EL0EN |
> > +						 CPACR_EL1_SMEN_EL1EN);
> > +			else
> > +				sysreg_clear_set(CPACR_EL1,
> > +						 CPACR_EL1_SMEN_EL0EN,
> > +						 CPACR_EL1_SMEN_EL1EN);

> I find the use of CPACR_EL1_SMEN in some cases and its individual bits
> in some others pretty confusing. I understand that you have modelled
> it after the SVE code, but maybe this is a mistake we don't need to
> repeat. I'd be in favour of directly exposing the individual bits in
> all cases.

OK, it is just the KVM code that uses the plain ZEN.  I'll add a cleanup
patch for that at the start of the series for ZEN I guess otherwise it
looks worse, though that will inflate the size of the series a bit.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux